A few basic expressions, no tests

This commit is contained in:
Andrey Breslav
2010-12-27 19:12:21 +03:00
parent 3d23350629
commit ef9a963ebd
14 changed files with 333 additions and 103 deletions
+12
View File
@@ -2,6 +2,18 @@ if
: "if" "(" expression ")" expression ("else" expression)?
;
try
: "try" block catchBlock* finallyBlock?
;
catchBlock
: "catch" valueParameters block
;
finallyBlock
: "finally" block
;
loop
: for
: while
+4 -3
View File
@@ -11,7 +11,8 @@ expression
: expressionWithPrecedences
: match
: if
: "typeof" // TODO: another keyword
: try
: "typeof" "(" expression ")"
: "new" constructorInvocation // TODO: Do we need "new"?, see factory methods
: objectLiteral
: declaration
@@ -165,11 +166,11 @@ listLiteral
;
mapLiteral
: "[" mapEntryLiteral{","} "]"
: "[" mapLiteralEntry{","} "]"
: "[" ":" "]"
;
mapEntryLiteral
mapLiteralEntry
: expression ":" expression
;
+3
View File
@@ -61,6 +61,7 @@ do
match
out
ref
try
Soft:
wraps -- in a class header
@@ -79,4 +80,6 @@ private
public
internal
protected
catch
finally
*/