about summary refs log tree commit diff
path: root/src/rt/rust_shape.cpp
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-01-14 16:05:07 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-01-17 10:08:16 -0800
commitc3bc8fada838c15e09e76a9d5d85438667c1636c (patch)
treee0ff1cb9ea73f7ee894e8ff3ab3180260f71aeac /src/rt/rust_shape.cpp
parenta7bd817017c247edb0680936c6cf34ec4d8e7fc0 (diff)
downloadrust-c3bc8fada838c15e09e76a9d5d85438667c1636c.tar.gz
rust-c3bc8fada838c15e09e76a9d5d85438667c1636c.zip
Allow omission of the '.' after nullary tag patterns
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 '.'.
Diffstat (limited to 'src/rt/rust_shape.cpp')
0 files changed, 0 insertions, 0 deletions