about summary refs log tree commit diff
path: root/src/comp/syntax/fold.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-761/+0
2012-03-02restructure to better support method inliningNiko Matsakis-1/+0
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-1/+2
2012-02-24Encode/decode AST into metadata, re-instantiate inlined itemsNiko Matsakis-25/+54
2012-02-15make mut a keyword synonymous with mutableNiko Matsakis-2/+2
first step towards issue #1273
2012-02-15Support 'alt check' syntaxMarijn Haverbeke-2/+2
It is only a way to flag an alt as intentionally non-exhaustive right now. Issue #1679
2012-02-10Remove a vestige of return-by-referenceMarijn Haverbeke-7/+4
2012-02-09Remove some pointless importsMarijn Haverbeke-2/+0
2012-02-08A bit more WIP on classes, and some cleanup in resolveTim Chevalier-1/+1
2012-02-07Minor class-related tweaks to the ASTTim Chevalier-3/+4
2012-02-06Handle built-in typenames in the resolve pass, rather than in parserMarijn Haverbeke-2/+1
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-06Self types for ifacesMarijn Haverbeke-3/+1
This allows a 'Name:' to appear in front of an iface declaration's name, which will cause 'Name' to refer to the self type (with the same number of type parameters as the iface has) in the method signatures of the iface. For example: iface F: functor<A> { fn fmap<B>(f: fn(A) -> B) -> F<B>; } Issue #1718
2012-02-05Remove support for $(...) form of quasi-quotes, use #ast{...} instead.Kevin Atkinson-1/+0
2012-02-03Beginnings of front-end support for classesTim Chevalier-0/+41
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-03Fix various drift issues in the qq branch.Graydon Hoare-4/+0
2012-02-03Implement folding of ast::ty.Kevin Atkinson-3/+30
2012-02-03Make macro arg optional in syntax, again untested.Kevin Atkinson-1/+4
2012-02-03Add support for parsing quasi-quotes, doesn't do anything useful yet.Kevin Atkinson-0/+3
2012-02-01Remove support for native typesMarijn Haverbeke-1/+0
Issue #1673
2012-01-30Remove ternary operatorPaul Woolcock-4/+0
`expr_ternary`, `ternary_to_if`, and all parses & lexer definitions have been removed.
2012-01-27Stop passing spans to middle::trans functions that don't need themMarijn Haverbeke-4/+3
Removes a bunch of (eventually) unused arguments. Makes span passing to debuginfo explicit, instead of relying on the (usually incorrect) spans held in the contexts. Closes #1439
2012-01-25rustc: Allow attributes on enum variants. Closes #1663Brian Anderson-1/+8
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-4/+4
This should reduce confusion of people trying to read the code.
2012-01-23Allow ast_fold_precursor to change the span.Kevin Atkinson-40/+61
This involved changing the prototype for the callbacks to thread the span though. A wrapper function, fold::wrap, can be used to wrap the old style callbacks.
2012-01-19Remove support for the '.' after a nullary tag in a patternTim Chevalier-1/+1
(Commit also includes lots of changes to remove '.'s that a git merge messed up, or else it was monkeys.)
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-5/+5
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-6/+6
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-13/+4
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-13Obj system? What obj system?Marijn Haverbeke-38/+0
Removes the obj system from the compiler. Closes #1484
2012-01-12Cleanups to previous commits for issue #1393.Kevin Atkinson-1/+1
2012-01-10Fold and re-evaluate expr in tag discriminant.Graydon Hoare-3/+16
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-1/+3
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-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-2/+3
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-6/+5
this will address the (crashing) new test added.
2011-12-23Parse `iface` items and interface references in `impl` items.Marijn Haverbeke-6/+9
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); } } }
2011-12-22Work around unwinding bugMarijn Haverbeke-1/+2
See issue #1374
2011-12-22Unify some data structures in syntax::ast that were doing the same thingMarijn Haverbeke-30/+20
As a preparation to removing some duplication in typeck.
2011-12-21Switch log_expr to carrying a full expr:u32 for level. Add log_full variant ↵Graydon Hoare-1/+2
that parses that expr, prepare for snapshot.
2011-12-21Make { || ... } sugar for any type of closure, inferredNiko Matsakis-10/+12
2011-12-19Add type argument field to expr_pathMarijn Haverbeke-2/+3
This way, you can explicitly provide type parameters when calling a generic method. Issue #1227
2011-12-16reorder args to the various vec, option fns so blk comes lastNiko Matsakis-47/+47
2011-12-16Make polymorphic impl methods workMarijn Haverbeke-1/+2
Something will still have to be done to the AST to make it possible to say `x.foo::<int>()`, since currently field access never allows type parameters. Issue #1227
2011-12-16Change syntax for implMarijn Haverbeke-2/+2
Move the name of the bundle to the front, allow type parameters (not handled yet), and add a 'for' keyword: impl utils for int { fn str() -> str { int::str(self) } fn times(f: block()) { ... } }
2011-12-16Make uses of self in impls compileMarijn Haverbeke-1/+0
Get rid of expr_self_call, introduces def_self. `self` is now, syntactically, simply a variable. A method implicitly brings a `self` binding into scope. Issue #1227
2011-12-16Parse and resolve implementations.Marijn Haverbeke-0/+4
Issue #1227
2011-12-14first attempt, not happy with itNiko Matsakis-1/+2
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-1/+1
2011-12-08Allow binding of nested patternsMarijn Haverbeke-1/+3
See src/test/run-pass/nested-patterns.rs for some examples. The syntax is boundvar@subpattern Which will match the subpattern as usual, but also bind boundvar to the whole matched value. Closes #838
2011-12-07Remove stmt_crate_directive, it's vestigial and confusing.Graydon Hoare-4/+1
2011-11-30Box ast::path valuesMarijn Haverbeke-4/+4
It seems inefficient to copy them around. Let's measure whether that's actually > the case