about summary refs log tree commit diff
path: root/src/comp/syntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-553/+0
2012-03-02restructure to better support method inliningNiko Matsakis-0/+8
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-2/+3
2012-02-28change def's that are always local to use node_id, add --inline optNiko Matsakis-5/+7
2012-02-22Stop normalizing patternsMarijn Haverbeke-3/+0
The check for whether a pat_ident is a variant or a binding is simple and fast. Normalizing patterns again and again is slow and error-prone (several places were forgetting to do it).
2012-02-17Refactor view_path to parse (but not yet process) export globs, unify code ↵Graydon Hoare-11/+21
paths.
2012-02-15make mut a keyword synonymous with mutableNiko Matsakis-4/+4
first step towards issue #1273
2012-02-15Support 'alt check' syntaxMarijn Haverbeke-1/+3
It is only a way to flag an alt as intentionally non-exhaustive right now. Issue #1679
2012-02-14rustc: Add crust functions to the ASTBrian Anderson-0/+1
2012-02-10Remove a vestige of return-by-referenceMarijn Haverbeke-4/+2
2012-02-09Remove some pointless importsMarijn Haverbeke-1/+0
2012-02-07Restore a comment that got lost (comments only)Tim Chevalier-1/+1
2012-02-07Minor class-related tweaks to the ASTTim Chevalier-2/+12
2012-02-06Handle built-in typenames in the resolve pass, rather than in parserMarijn Haverbeke-10/+9
Closes #1728 Comments out a section of debuginfo.rs. This code was already broken (only being called when --xg was passed, and only working on trivial programs).
2012-02-05Remove support for $(...) form of quasi-quotes, use #ast{...} instead.Kevin Atkinson-1/+0
2012-02-05infer modes rather than overwriting with expected tyNiko Matsakis-1/+11
2012-02-03Beginnings of front-end support for classesTim Chevalier-0/+18
Added class support to the parser, prettyprinter, fold, and visit. (See Issue 1726.) This is WIP -- the test case is xfailed, and attempting to compile it will error out in resolve.
2012-02-03Allow anti-quotes to also be ast::ty rather than just ast::expr.Kevin Atkinson-1/+1
2012-02-03Make macro arg optional in syntax, again untested.Kevin Atkinson-1/+1
2012-02-03Add support for recognizing macro body, completely untested.Kevin Atkinson-2/+4
2012-02-03Change the type for the macro body to also store the span.Kevin Atkinson-1/+4
Note: the body is the part of the macro syntax between the {}.
2012-02-03Add support for parsing quasi-quotes, doesn't do anything useful yet.Kevin Atkinson-0/+4
2012-02-01Remove support for native typesMarijn Haverbeke-2/+0
Issue #1673
2012-01-31Change option::t to optionTim Chevalier-14/+14
Now that core exports "option" as a synonym for option::t, search-and- replace option::t with option. The only place that still refers to option::t are the modules in libcore that use option, because fixing this requires a new snapshot (forthcoming).
2012-01-31Require alts to be exhaustiveTim Chevalier-4/+0
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-30rustc: Allow attributes on methods. Closes #1709Brian Anderson-2/+4
2012-01-30Remove ternary operatorPaul Woolcock-1/+0
`expr_ternary`, `ternary_to_if`, and all parses & lexer definitions have been removed.
2012-01-26Remove ty_native_fnMarijn Haverbeke-1/+0
It was being used as a clumsy synonym of ty_fn.
2012-01-25rustc: Allow attributes on enum variants. Closes #1663Brian Anderson-2/+2
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-6/+6
This should reduce confusion of people trying to read the code.
2012-01-23Export all enum variants by default; new syntax for selectively exporting ↵Tim Chevalier-1/+1
variants See issue 1426 for details. Now, the semantics of "export t;" where t is a tag are to export all of t's variants as well. "export t{};" exports t but not its variants, while "export t{a, b, c};" exports only variants a, b, c of t. To do: - documentation - there's currently no checking that a, b, c are actually variants of t in the above example - there's also no checking that t is an enum type, in the second two examples above - change the modules listed in issue 1426 that should have the old export semantics to use the t{} syntax I deleted the test export-no-tag-variants since we're doing the opposite now, and other tests cover the same behavior.
2012-01-20WIP on issue 1426 (exporting all tags)Tim Chevalier-0/+4
Support Lenny222's proposed syntax for exporting a tag without its variants, or selected tags from a variant, in the AST and parser. No support further down the line yet. Tests are xfailed.
2012-01-19rustc: ";" to "," in enumsPatrick Walton-171/+171
2012-01-19rustc: Fix long linesPatrick Walton-2/+2
2012-01-19rustc: "tag" -> "enum"Patrick Walton-36/+36
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-2/+2
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-2/+12
This commit allows patterns like: alt x { some(_) { ... } none { } } without the '.' after none. The parser suspends judgment about whether a bare ident is a tag or a new bound variable; instead, the resolver disambiguates. This means that any code after resolution that pattern-matches on patterns needs to call pat_util::normalize_pat, which consults an environment to do this disambiguation. In addition, local variables are no longer allowed to shadow tag names, so this required changing some code (e.g. renaming variables named "mut", and renaming ast::sub to subtract). The parser currently accepts patterns with and without the '.'. Once the compiler and libraries are changed, it will no longer accept the '.'.
2012-01-16Don't evaluate discriminator value constants when parsing.Kevin Atkinson-1/+1
Remove disr_val from ast::variant_ and always use ty::variant_info when the value is needed. Move what was done during parsing into other passes, primary typeck.rs. This move also correctly type checks the disr. value expression; thus, fixing rustc --pretty=typed when disr. values are used.
2012-01-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-0/+7
2012-01-13make blocks fn& and fn stand for "any closure"Niko Matsakis-2/+3
2012-01-13Obj system? What obj system?Marijn Haverbeke-22/+2
Removes the obj system from the compiler. Closes #1484
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-1/+2
Addresses issue #1393. For now disallow disr. values unless all variants use nullary contractors (i.e. "enum-like"). Disr. values are now encoded in the crate metadata, but only when it will differ from the inferred value based on the order.
2012-01-10rename sendfn to fn~, lambda to fn@Niko Matsakis-4/+4
2012-01-09Remove proto_sugar and 'lambda' as keyword, commit to fn@.Graydon Hoare-6/+1
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-0/+5
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-4/+3
this will address the (crashing) new test added.
2011-12-28Move the kind datatype to middle::tyMarijn Haverbeke-30/+0
The AST no longer references it.
2011-12-28Change representation of type params to handle interface boundsMarijn Haverbeke-2/+8
Issue #1227
2011-12-23Check impls methods against the type of their iface.Marijn Haverbeke-1/+1
2011-12-23Parse `iface` items and interface references in `impl` items.Marijn Haverbeke-1/+3
The (temporary) syntax is iface seq<T> { fn len() -> uint; fn iter(f: block(T)); } // The 'blah<T>' can be left of to default the name of the // impl to seq<T>. The 'of seq<T>' can be left off when // not implementing a named interface. impl blah<T> of seq<T> for [T] { fn len() -> uint { vec::len(self) } fn iter(f: block(T)) { for x in self { f(x); } } }