1
Fork 0

Implement slicing syntax.

`expr[]`, `expr[expr..]`, `expr[..expr]`,`expr[expr..expr]`

Uses the Slice and SliceMut traits.

Allows ... as well as .. in range patterns.
This commit is contained in:
Nick Cameron 2014-09-15 20:48:58 +12:00
commit 31a7e38759
27 changed files with 909 additions and 105 deletions

View file

@ -245,6 +245,7 @@ mod svh_visitor {
SawExprAssign,
SawExprAssignOp(ast::BinOp),
SawExprIndex,
SawExprSlice,
SawExprPath,
SawExprAddrOf(ast::Mutability),
SawExprRet,
@ -279,6 +280,7 @@ mod svh_visitor {
ExprField(_, id, _) => SawExprField(content(id.node)),
ExprTupField(_, id, _) => SawExprTupField(id.node),
ExprIndex(..) => SawExprIndex,
ExprSlice(..) => SawExprSlice,
ExprPath(..) => SawExprPath,
ExprAddrOf(m, _) => SawExprAddrOf(m),
ExprBreak(id) => SawExprBreak(id.map(content)),