about summary refs log tree commit diff
path: root/src/comp/syntax
AgeCommit message (Collapse)AuthorLines
2011-12-18Only look for a matching method when normal field access failsMarijn Haverbeke-5/+3
We should probalby warn when defining a method foo on {foo: int} etc. This should reduce the amount of useless typevars that are allocated. Issue #1227
2011-12-16Reserve node_id 0 for the crate top-level moduleMarijn Haverbeke-0/+1
And define a const to refer to it.
2011-12-16Switch fmt extension to reference extfmt that's in core.Graydon Hoare-7/+2
2011-12-16reorder args to the various vec, option fns so blk comes lastNiko Matsakis-49/+49
2011-12-16Make polymorphic impl methods workMarijn Haverbeke-13/+15
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-20/+16
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 1.f parse as a field access on the integer 1Marijn Haverbeke-1/+1
A dot is only considered part of a number when not followed by a letter Closes #1306
2011-12-16Make uses of self in impls compileMarijn Haverbeke-25/+2
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-11/+58
Issue #1227
2011-12-15massive refactor of how closures workNiko Matsakis-0/+9
2011-12-15Iterate over an array when creating the parser's reserved word tableMarijn Haverbeke-38/+8
2011-12-14change syntax from lambda[send] to sendfnNiko Matsakis-81/+15
2011-12-14restructure, temporarily working around what looks like an LLVM bugNiko Matsakis-3/+37
2011-12-14remove extra trailing semicolonNiko Matsakis-1/+1
2011-12-14push changes through to get things compiling, if not running.Niko Matsakis-13/+39
2011-12-14first attempt, not happy with itNiko Matsakis-33/+37
2011-12-14define ty and update parser for sendable lambdasNiko Matsakis-7/+96
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-40/+49
2011-12-09Allow type annotations for blocksMarijn Haverbeke-10/+8
I.e. {|foo: int| -> int foo + 2} Issue #1275
2011-12-08Error when parsing the empty record typeMarijn Haverbeke-0/+1
Issue #1200
2011-12-08Allow binding of nested patternsMarijn Haverbeke-12/+23
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-08Consider variant constructors pure functions for the purpose of purity checkingMarijn Haverbeke-1/+0
Closes #1269
2011-12-07Inject the view_items for core in the right place, add comment documenting ↵Graydon Hoare-0/+7
why the wrong place was wrong.
2011-12-07Remove stmt_crate_directive, it's vestigial and confusing.Graydon Hoare-26/+2
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-225/+158
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-1/+9
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-02Stop lexing -1 as a single tokenMarijn Haverbeke-62/+3
And remove the hack that made 1-1 work given that other hack. Issue #954
2011-12-02Allow literal patterns to contain arbitrary literal expressionsMarijn Haverbeke-46/+85
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-60/+59
It seems inefficient to copy them around. Let's measure whether that's actually > the case
2011-11-24rustc: Fix a bug in cdir attribute parsingBrian Anderson-0/+2
The first attribute of the first mod was being applied to every mod.
2011-11-24rustc: Add a path attribute for crate directivesHaitao Li-23/+24
The path information was an optional "filename" component of crate directive AST. It is now replaced by an attribute with metadata named "path". With this commit, a directive mod foo = "foo.rs"; should be written as: #[path = "foo.rs"] mod foo; Closes issue #906.
2011-11-24rustc: Accepts `path` attributes for crate directivesHaitao Li-1/+3
Temporarily allow path specified in either as attribute or in AST, like: #[path = "mymod.rs"] mod mymod = "mymod.rs"; This is a transitional commit to avoid creating a stage1 snapshot.
2011-11-24rustc: Fix position of diagnostic highlight linesHaitao Li-1/+1
Diagnostic highlight lines are incorrect placed when the related line number is 10, 100, etc. The root cause is line number are treated as 0 based (should be 1 based) when calculating offset of line number digits.
2011-11-23Add some changes that *should* have been in e98286b594Marijn Haverbeke-0/+1
Forgot to amend the commit after fixing the failure.
2011-11-23Allow import directives in any blockMarijn Haverbeke-9/+11
Closes #49
2011-11-23Rollback return-by-referenceMarijn Haverbeke-55/+6
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-23Remove last traces of auth keywordMarijn Haverbeke-19/+0
The reference now has an empty hole where the auth keyword used to be. Changing the keyword table seems to require manually sorting the keywords and putting them back into some kind of arcane interleaved order. I'll open an issue to actually fix this. Closes #1211
2011-11-22rustc: Allow trailing comma in record fieldsHaitao Li-30/+50
2011-11-22comp: allowed the declaration of pure fn's in native modsStefan Plantikow-0/+3
This is especially useful for the native calls in std::math This commit does NOT yet point to new snapshots
2011-11-22Add hacks to extract and compile tutorial codeMarijn Haverbeke-10/+0
Not included in the build by default, since it's fragile and kludgy. Do something like this to run it: cd doc/tutorial RUSTC=../../build/stage2/bin/rustc bash test.sh Closes #1143
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
2011-11-22Make ast::visit only descend into types when necessaryMarijn Haverbeke-3/+12
If visit_ty is not overridden, it uses a stub function which does not descend into types. Closes #1204
2011-11-21rustc: Remove abi from ast::native_modHaitao Li-27/+5
2011-11-18Update stdlib, compiler, and tests to new kind systemMarijn Haverbeke-52/+44
This involved adding 'copy' to more generics than I hoped, but an experiment with making it implicit showed that that way lies madness -- unless enforced, you will not remember to mark functions that don't copy as not requiring copyable kind. Issue #1177
2011-11-18Add a pass-by-copy parameter passing conventionMarijn Haverbeke-3/+7
This is intended to solve the problem of how to pass arguments to constructor functions -- you want to move in rvalues, but not have to explicitly copy stuff that is not an rvalue. The by-copy passing convention will ensure the callee gets its own copy of the value. For rvalues, it'll just pass off the value. For lvalues, it'll make a copy. Issue #1177
2011-11-18Preparation for kind system overhaulMarijn Haverbeke-19/+23
This goes before a snapshot, so that subsequenct patches can make the transition without breaking the build. Disables kind checking pass, makes parser accept both new and old-style kind annotation. Issue #1177