More on binary operations

This commit is contained in:
Andrey Breslav
2010-11-16 14:24:56 +03:00
parent 807062a1f8
commit 0bd6020f5a
3 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -30,5 +30,5 @@ val f1 = {(T) : X => something(it)}
val f1 = {t => something(t)}
val f1 = {something(it)}
val f1 : {(T) : X} = ...
val f1 : {(T) : X} = {X()}
+3 -2
View File
@@ -22,6 +22,7 @@ class
classModifier
: accessModifier
: "abstract"
: "interface" // TODO: better name
: "sealed"
;
@@ -31,7 +32,7 @@ delegationSpecifier
;
explicitDelegation
: userType "by" expression // Syntax is questionable
: userType "by" expression // TODO: Syntax is questionable
;
typeParameter
@@ -40,7 +41,7 @@ typeParameter
typeConstraint
: userType ":" userType
// other constraints, maybe
// TODO: other constraints, maybe
;
defaultConstructorParameter
+8 -3
View File
@@ -6,11 +6,11 @@ expression
: tupleLiteral
: listLiteral
: mapLiteral
: typeLiteral
: "null"
: binOpExpression
: unOpExpression
: name functionParameters? // TODO: ambiguity here
: infixFunctionCall
: functionCall
: arrayAccess
: match
: FieldName
@@ -23,7 +23,7 @@ binaryOperation // Decreasing precedence
: "*" : "/" // No %
: "+" : "-"
// No << >> >>>
: "<" : ">" : ">=" : "<=" : "is" : "isnot" : "in" // TODO: Check the precedence for in carefully
: "<" : ">" : ">=" : "<=" : "is" : "isnot" : "in" : "as" // TODO: Check the precedence for in carefully
: "==" : "==="
// No | & ^ ~
: "&&"
@@ -45,6 +45,11 @@ postfixUnaryOperation
: "++" : "--"
;
functionCall
: completeFunctionCall
: onlyTypeParameters
: infixFunctionCall
jump
: "throw" expression
: "return" expression