about summary refs log tree commit diff
path: root/src/comp/syntax/ast_util.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-443/+0
2012-03-02restructure to better support method inliningNiko Matsakis-0/+23
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-1/+1
2012-02-28change def's that are always local to use node_id, add --inline optNiko Matsakis-3/+9
2012-02-24Encode/decode AST into metadata, re-instantiate inlined itemsNiko Matsakis-0/+8
2012-02-22rustc: Allow any integral types on rhs of shift opsBrian Anderson-0/+9
2012-02-22Make the various from_str functions return optionsMarijn Haverbeke-1/+1
So that they can be used with user input without causing task failures. Closes #1335
2012-02-17Refactor view_path to parse (but not yet process) export globs, unify code ↵Graydon Hoare-28/+35
paths.
2012-02-15make mut a keyword synonymous with mutableNiko Matsakis-2/+2
first step towards issue #1273
2012-02-10Remove a vestige of return-by-referenceMarijn Haverbeke-1/+1
2012-02-09Increase precedence of as operatorMarijn Haverbeke-3/+3
Closes #1717
2012-02-08A bit more WIP on classes, and some cleanup in resolveTim Chevalier-2/+9
2012-02-07Minor class-related tweaks to the ASTTim Chevalier-0/+1
2012-02-06Handle built-in typenames in the resolve pass, rather than in parserMarijn Haverbeke-0/+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-05Fix macro backtraces.Kevin Atkinson-1/+1
In addition add information about the macro doing the expansion, and move the printing of the expansion backtrace from codemap::span_to_str to the diagnostic code. The backtrace is now more verbose and includes information on the macro doing the expansion, in addition to the expansion site.
2012-02-01Remove support for native typesMarijn Haverbeke-2/+1
Issue #1673
2012-01-31Change option::t to optionTim Chevalier-2/+2
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/+31
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-30Remove ternary operatorPaul Woolcock-17/+0
`expr_ternary`, `ternary_to_if`, and all parses & lexer definitions have been removed.
2012-01-30Change all ternary ops to if/then/elsePaul Woolcock-4/+36
All the files below had at least one instance of the ternary operator present in the source. All have been changed to the equivalent if/then/else expression.
2012-01-26First stab at operator overloadingMarijn Haverbeke-0/+5
When no built-in interpretation is found for one of the operators mentioned below, the typechecker will try to turn it into a method call with the name written next to it. For binary operators, the method will be called on the LHS with the RHS as only parameter. Binary: + op_add - op_sub * op_mul / op_div % op_rem & op_and | op_or ^ op_xor << op_shift_left >> op_shift_right >>> op_ashift_right Unary: - op_neg ! op_not Overloading of the indexing ([]) operator isn't finished yet. Issue #1520
2012-01-26Remove ty_native_fnMarijn Haverbeke-1/+1
It was being used as a clumsy synonym of ty_fn.
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-11/+12
This should reduce confusion of people trying to read the code.
2012-01-25Add bit-shifting ops to ast_util::eval_const_exprMarijn Haverbeke-0/+4
Closes #1659
2012-01-23Export all enum variants by default; new syntax for selectively exporting ↵Tim Chevalier-2/+25
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-19rustc: ";" to "," in enumsPatrick Walton-4/+4
2012-01-19rustc: "tag" -> "enum"Patrick Walton-1/+1
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-58/+58
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-37/+8
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-2/+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-16Properly print u suffix for uint literalsMarijn Haverbeke-1/+1
Issue #1532
2012-01-13Obj system? What obj system?Marijn Haverbeke-5/+1
Removes the obj system from the compiler. Closes #1484
2012-01-12Cleanups to previous commits for issue #1393.Kevin Atkinson-0/+2
2012-01-05Switch to new param kind bound syntaxMarijn Haverbeke-2/+2
And remove support for the old syntax
2011-12-28Change representation of type params to handle interface boundsMarijn Haverbeke-18/+5
Issue #1227
2011-12-22Remove trivial cast checkerMarijn Haverbeke-17/+0
I consider the added complexity not justified at this point, and it interacts badly with the patches for issue #828. Feel free to discuss.
2011-12-16Parse and resolve implementations.Marijn Haverbeke-0/+1
Issue #1227
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-3/+4
2011-12-08Allow binding of nested patternsMarijn Haverbeke-2/+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-07Check for literals that are out of range for their typeMarijn Haverbeke-0/+18
2011-12-07Change literal representation to not truncateMarijn Haverbeke-19/+37
Also shuffles around the organization of numeric literals and types, separating by int/uint/float instead of machine-vs-non-machine types. This simplifies some code. Closes #974 Closes #1252
2011-12-07repair more hash functionsNiko Matsakis-1/+1
2011-12-06fix hash function: + binds tighter than <<Niko Matsakis-1/+4
2011-12-02parse: typeck: enabling trivial casts of tail-call return valuesStefan Plantikow-0/+8
introduces ctypes::m_* machine type aliases for int, uint, float depending on cfg(target_arch) that are used in tests
2011-12-02ty: trans: added support for dropping trivial castsStefan Plantikow-1/+8
2011-12-02Allow literal patterns to contain arbitrary literal expressionsMarijn Haverbeke-32/+69
This removes the need for the unary minus hacks, and allows some other neat things like matching on 1 >> 4. Issue #954
2011-11-30Box ast::path valuesMarijn Haverbeke-1/+1
It seems inefficient to copy them around. Let's measure whether that's actually > the case
2011-11-23Allow import directives in any blockMarijn Haverbeke-1/+1
Closes #49
2011-11-23Rollback return-by-referenceMarijn Haverbeke-7/+0
It's proving too inflexible, so I'm ripping out the extra complexity in the hope that regions will, at some point, provide something similar. Closes #918
2011-11-22Only warn about unreachable range patterns when appropriateMarijn Haverbeke-1/+41
Also simplifies the literal-munging, and moves it into ast_util Closes #1170