about summary refs log tree commit diff
path: root/src/comp/front
AgeCommit message (Collapse)AuthorLines
2011-07-05Support conditional compilation of native items. Closes #610Brian Anderson-5/+33
2011-07-05Error if the link attribute has duplicate items. Issue #614Brian Anderson-0/+16
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-5584/+8
src/comp/syntax is currently just a sub-module of rustc, but it will, in the near future, be its own crate. This includes: - The AST data structure - The parser - The pretty-printer - Visit, walk, and fold - The syntax extension system - Some utility stuff that should be in the stdlib* *) Stdlib extensions currently require a snapshot before they can be used, and the win build is very broken right now. This is temporary and will be cleaned up when one of those problems goes away. A lot of code was moved by this patch, mostly towards a more organized layout. Some package paths did get longer, and I guess the new layout will take some getting used to. Sorry about that! Please try not to re-introduce any dependencies in syntax/ on any of the other src/comp/ subdirs.
2011-07-04Move the ids of pat AST nodes into their structMarijn Haverbeke-18/+19
Just like it was done with items and exprs. Simplifies some code.
2011-07-03Handle fail as an argument; parse fail expressions unambiguouslyTim Chevalier-9/+8
An expression like: foo(1, fail, 2) was failing to parse, because the parser was interpreting the comma as the start of an expression that was an argument to fail, rather than recognizing that the fail here has no arguments Fixed this by using can_begin_expr to determine whether the next token after a fail token suggests that this is a nullary fail or a unary fail. In addition, when translating calls, check before translating each argument that the block still isn't terminated. This has the effect that if an argument list includes fail, the back-end won't keep trying to generate code for successive arguments and trip the !*terminated assertion.
2011-07-03Add a predicate that determines whether a token can begin an expressionTim Chevalier-0/+21
2011-07-02Fix assertion failure when syntax extension name is missing.Josh Matthews-0/+3
2011-07-02Allow any string expression to be used with fail.Josh Matthews-5/+8
2011-07-01rustc: Move path_to_str to front::astPatrick Walton-0/+13
2011-07-01Add some FIXMEs for issue #607Brian Anderson-1/+4
2011-07-01Add some logging to attr when reading crate link attributesBrian Anderson-2/+1
Only link attributes of the meta_list type are considered when matching crate attributes. Instead of doing nothing we can at least log that link attributes of other types were ignored.
2011-07-01Export only what's in use from front::eval. Issue #604Brian Anderson-0/+2
2011-07-01Remove unused imports from front::evalBrian Anderson-7/+0
2011-07-01Remove remaining unused eval methods. Issue #604Brian Anderson-46/+0
2011-07-01Remove the concept of crate directive let statements. Issue #604Brian Anderson-111/+0
2011-07-01Remove the concept of crate directive expressions. Issue #604Brian Anderson-66/+1
2011-07-01Remove the environment concept from front::evalBrian Anderson-59/+31
This is the old method of conditional compilation. It is going away. Issue #489
2011-07-01Cleanup attribute code. Issue #487Brian Anderson-2/+9
2011-07-01Add some helper functions to front::attrBrian Anderson-0/+20
2011-07-01Allow 'newtype' syntax for tagsMarijn Haverbeke-1/+16
Doing this: tag foo = mytype; is now equivalent to doing this: tag foo { foo(mytype); }
2011-06-30Preserve hard \n\n pairs from source when pretty-printing, as explicit ↵Graydon Hoare-4/+20
formatting control from users.
2011-06-30Use attributes for conditional compilation in std.rcBrian Anderson-2/+24
2011-06-30Conditionally compile items declared as statements. Issue #489Brian Anderson-1/+30
2011-06-30Kill unused variablesTim Chevalier-14/+3
2011-06-30Add a pass to fold out items that do not belong in the current configurationBrian Anderson-0/+68
The parser needs to parse unconfigured items into the AST so that they can make the round trip back through the pretty printer, but subsequent passes shouldn't care about items not being translated. Running a fold pass after parsing is the lowest-impact way to make this work. The performance seems fine. Issue #489
2011-06-30Add missing item variants to fold_item_underscoreBrian Anderson-0/+3
2011-06-30Add missing expression variants to fold_exprBrian Anderson-0/+15
2011-06-30Fold the crate-level module in front::foldBrian Anderson-1/+2
2011-06-30Move middle::attr to front::attrBrian Anderson-0/+167
2011-06-30Convert the eval::env to an ast::crate_cfgBrian Anderson-4/+19
crate_cfg will replace eval::env as the mechanism for conditional compilation. This is a transitional step so they can both exist together. Issue #489
2011-06-30Introduce a config property to the crate AST nodeBrian Anderson-4/+12
This represents the compilation environment, defined as AST meta_items, Used for driving conditional compilation and will eventually replace the environment used by the parser for the current conditional compilation scheme. Issue #489
2011-06-29More fixes to fast-check.Graydon Hoare-2/+10
2011-06-29Eliminate the --check-claims compiler flagTim Chevalier-6/+1
The option can only be toggled at runtime now.
2011-06-28Support attaching attributes to modules via the crate file. Issue #487Brian Anderson-37/+57
2011-06-28Implement "claim"Tim Chevalier-4/+18
Implement "claim" (issue #14), which is a version of "check" that doesn't really do the check at runtime. It's an unsafe feature. The new flag --check-claims turns claims into checks automatically -- but it's off by default, so by default, the assertion in a claim doesn't execute at runtime.
2011-06-28Teach the parser and typechecker to understand port[int](). Closes #588Eric Holk-4/+15
2011-06-28add a predicate that determines whether a binop is lazy (and and or are lazy)Tim Chevalier-0/+8
2011-06-28Write metadata for more meta_item types. Issue #487Brian Anderson-4/+4
2011-06-28Use 'resource' rather than 'res' as a keywordMarijn Haverbeke-2/+2
Resources are now defined like... resource fd(int n) { close(n); } Calling fd with an int will then produce a non-copyable value that, when dropped, will call close on the given int.
2011-06-28'#simplext' -> '#macro'Paul Stansifer-1/+1
2011-06-28Add simple syntax extension (#simplext)Paul Stansifer-40/+201
2011-06-28Add AST fold.Paul Stansifer-0/+689
2011-06-28Use "" in the native_name as an indication that no extra options have toRafael Ávila de Espíndola-1/+1
be passed to the "linker". Use that for libc.
2011-06-27Rename middle::metadata to metadata::cwriter. Move creader to metadataBrian Anderson-895/+0
Preparation for a lot more metadata refactoring
2011-06-27Record and link with used native libraries.Rafael Ávila de Espíndola-18/+42
2011-06-25Allow moving out of temporary valuesMarijn Haverbeke-0/+7
This will probably need more work, as moving doesn't appear to do quite the right thing yet in general, and we should also check somewhere that we're not, for example, moving out the content out of an immutable field (probably moving out of fields is not okay in general).
2011-06-25Partial implementation of resourcesMarijn Haverbeke-5/+34
Non-copyability is not enforced yet, and something is still flaky with dropping of the internal value, so don't actually use them yet. I'm merging this in so that I don't have to keep merging against new patches.
2011-06-24Fix inexhaustive match in parserTim Chevalier-0/+7
2011-06-24Invalidate constraints correctly after an assignment expressionTim Chevalier-0/+3
Modified typestate to throw away any constraints mentioning a variable on the LHS of an assignment, recv, assign_op, or on either side of a swap. Some code cleanup as well.
2011-06-24Modify the fn vistors in walk so that they can handle functions without ↵Michael Sullivan-0/+2
names. Update the typestate code to understand this.