* Visitors are now defined on a per-type level, allowing for greater
flexibility in combining and re-using behavior
* NameId is used for namespaces, which are used to index locally scoped
variables. Syms are used for free namespaces, specifically in objects.
All NameIDs are symbols, while not all symbols are NameIDs.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Single-quoted strings were accidentally expecting a double quote for
termination, instead of a single quote.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* compile::sym is now compile::name
* add basic block structure
* add visitor pattern
* some other minor things (e.g. syn::ast::prelude)
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* mem and obj modules are roughly divided between doing memory-specific
things and object-specific things
* Box::new_uninit() is a nightly feature and it's quite useful, so I'm
enabling that for now
* Check out src/obj/attrs.rs for possible undefined behavior in the
Attrs::new() function. I'm sure it'll be just fine.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Comment and whitespace skipping is now handed by a regex
* Remove skip_whitespace and adv_char since they aren't used anymore
* Fix pos_text() to return a reference with the correct lifetime
* Add comment skipping tests
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Assign statements and standalone expression statements are added, plus
some tests.
Additionally, starting tokens are implemented using lazy_static!{} so
that they can be mixed and matched.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
To distinguish between objects and code bodies, an object is delimited
by curly braces, prefixed with a percent sign. Ex:
obj = %{
key = value
}
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Lexer recognizes semicolons as EOL tokens, and newline tokens
* Parser can be configured to ignore newlines (which is also used
internally)
* Newlines are allowed in lists, tuples, and parenthesized expressions
* Add a bunch of tests for the new stuff
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>