Preliminary list of keywords

This commit is contained in:
Andrey Breslav
2010-12-10 16:35:25 +03:00
parent b111cbbbbb
commit 274cf80336
4 changed files with 78 additions and 2 deletions
+2 -2
View File
@@ -73,7 +73,7 @@ function
;
functionRest
: SimpleName typeParameters? functionParameters (":" type)? functionBody?
: attributes SimpleName typeParameters? functionParameters (":" type)? functionBody?
;
functionBody
@@ -82,7 +82,7 @@ functionBody
;
property
: modifiers "lazy"? ("val" | "var") propertyRest
: modifiers ("val" | "var") propertyRest
;
propertyRest
+70
View File
@@ -10,3 +10,73 @@ CharacterLiteral : /*character as in Java*/;
StringWithTemplates : /*single-quoted string, $ can be escaped*/;
NoEscapeString : /* """-quoted string */;
/* Symbols:
[](){}<>
,
.
:
<= >= == != === !==
+ - * / %
=
+= -= *= /=
++ -- !
&& || -- may be just & and |
=>
..
?
*/
/* Keywords:
namespace
import
as
type
class
this
val
var
fun
decomposer -- may be soft
extension
for
null
typeof
new
true
false
is
isnot
in
throw
return
break
continue
object
if
else
while
do
match
extension
Soft:
wraps -- in a class header
where -- in class, function and type headers
by -- in a class header (Delegation specifier)
lazy -- in a property/parameter declaration
get, set -- in a property definition
abstract
virtual
enum
extendable -- or open
attribute
override
private
public
internal
protected
out
ref
*/
+1
View File
@@ -18,6 +18,7 @@ constantPattern
: literalConstant
;
tuplePattern
: "(" ((SimpleName "=")? pattern{","})? ")"
;
+5
View File
@@ -24,6 +24,7 @@ toplevelObject
: extension
: function
: property
: typedef
;
namespace
@@ -31,4 +32,8 @@ namespace
import*
toplevelObject*
"}"
;
typedef
: modifiers "type" SimpleName typeParameters? "=" type
;