about summary refs log tree commit diff
path: root/src/comp/front
AgeCommit message (Collapse)AuthorLines
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.
2011-06-24Remove uses of variable name 'res' from rustcMarijn Haverbeke-22/+21
This in preparation of making 'res' a keyword for defining resources. Please don't introduce too many new ones in the meantime...
2011-06-24Remove def_objMarijn Haverbeke-10/+2
Since obj constructors and types have different def_ids now, their def can simply be a def_fn and a def_ty.
2011-06-23rustc: Pretty-print ternary operatorBrian Anderson-0/+2
2011-06-23rustc: Add ternary operator. Closes #565Brian Anderson-1/+42
The implementation is so simple it might be considered cheating: at almost every step the expr_ternary is just converted to expr_if.
2011-06-23Remove parse_str_lit_or_env_ident.Rafael Ávila de Espíndola-29/+13
We decided to use metadata for the more complex cases, and a simple string is enough for rustc right now.
2011-06-22rustc: Limit creader exportsBrian Anderson-0/+7
2011-06-22rustc: Handle valueless ret expressions as block results. Closes #521Brian Anderson-0/+2
2011-06-22rustc: Introduce and parse additional meta_item formsBrian Anderson-21/+62
Examples: #[test], #[link(name = "vers")] Issue #487
2011-06-22rustc: Rename parser.err to parser.fatalBrian Anderson-29/+29
2011-06-23Remove a simidgeon of dead code.Paul Stansifer-8/+1
2011-06-21Serialize constraints in types (literal arguments still not supported)Tim Chevalier-26/+57
This involved, in part, changing the ast::def type so that a def_fn has a "purity" field. This lets the typechecker determine whether functions defined in other crates are pure. It also required updating some error messages in tests. As a test for cross-crate constrained functions, I added a safe_slice function to std::str (slice(), with one of the asserts replaced with a function precondition) and some test cases (various versions of fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for some of the boolean functions in std::uint.
2011-06-21Move names and ids of native items into their recs, rather than their tagsMarijn Haverbeke-12/+14
2011-06-21Puts out burning tinderbox (oops, AST nodes don't have def_ids/anns).Lindsey Kuper-2/+1
2011-06-21Some progress on support for extending objects with new fields (issueLindsey Kuper-6/+16
into four separate issues (#538, #539, #540, #543) with corresponding tests.
2011-06-21Move expr ids into the expr record typeMarijn Haverbeke-202/+184
This simplifies the tag variants a bit and makes expr_node_id obsolete.
2011-06-21rustc: Remove unused slice call from extfmt. Closes #532Brian Anderson-2/+0
2011-06-20Get rid of def_ids and anns in AST nodes, use single node_idMarijn Haverbeke-227/+207
This reduces some redundancy in the AST data structures and cruft in the code that works with them. To get a def_id from a node_id, apply ast::local_def, which adds the local crate_num to the given node_id. Most code only deals with crate-local node_ids, and won't have to create def_ids at all.
2011-06-20Remember the library files we used in rustc and pass them to the "linker".Rafael Ávila de Espíndola-1/+2
This avoid the hardcoded -lstd, allows programs to use other crates and avoids any differences that may exist in the rustc and ld search logic.
2011-06-19Remove various rustboot workaroundsBrian Anderson-7/+3
2011-06-19rustc: Rename session.span_err -> span_fatal, err -> fatalBrian Anderson-39/+44
Issue #440
2011-06-19Revert previous 6 commits. Hopefully put out Windows fire.Brian Anderson-44/+39
Revert "rustc: Export only what's needed from middle::ty" This reverts commit 4255d58aa5db2a05362c4435a0e807205e1b8ed7. Revert "rustc: Make name resolution errors less fatal" This reverts commit b8ab9ea89c16c60237e7660804f4321f59ae0435. Revert "rustc: Make import resolution errors less fatal" This reverts commit 92a8ae94b971206bf0502da3dc5f416fcb24cc36. Revert "rustc: Export only what's used from middle::resolve" This reverts commit 4539a2cf7ad99851a165c98ed2f4e4a475cffd7d. Revert "rustc: Re-introduce session.span_err, session.err" This reverts commit 7fe9a88e31ae07f2fd89f6715efedd7e3edf49e6. Revert "rustc: Rename session.span_err -> span_fatal, err -> fatal" This reverts commit c394a7f49ac29a099994e243017065de2ff97f2a.