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 = {t => something(t)}
val f1 = {something(it)} val f1 = {something(it)}
val f1 : {(T) : X} = ... val f1 : {(T) : X} = {X()}
+3 -2
View File
@@ -22,6 +22,7 @@ class
classModifier classModifier
: accessModifier : accessModifier
: "abstract" : "abstract"
: "interface" // TODO: better name
: "sealed" : "sealed"
; ;
@@ -31,7 +32,7 @@ delegationSpecifier
; ;
explicitDelegation explicitDelegation
: userType "by" expression // Syntax is questionable : userType "by" expression // TODO: Syntax is questionable
; ;
typeParameter typeParameter
@@ -40,7 +41,7 @@ typeParameter
typeConstraint typeConstraint
: userType ":" userType : userType ":" userType
// other constraints, maybe // TODO: other constraints, maybe
; ;
defaultConstructorParameter defaultConstructorParameter
+8 -3
View File
@@ -6,11 +6,11 @@ expression
: tupleLiteral : tupleLiteral
: listLiteral : listLiteral
: mapLiteral : mapLiteral
: typeLiteral
: "null" : "null"
: binOpExpression : binOpExpression
: unOpExpression : unOpExpression
: name functionParameters? // TODO: ambiguity here : functionCall
: infixFunctionCall
: arrayAccess : arrayAccess
: match : match
: FieldName : FieldName
@@ -23,7 +23,7 @@ binaryOperation // Decreasing precedence
: "*" : "/" // No % : "*" : "/" // No %
: "+" : "-" : "+" : "-"
// No << >> >>> // No << >> >>>
: "<" : ">" : ">=" : "<=" : "is" : "isnot" : "in" // TODO: Check the precedence for in carefully : "<" : ">" : ">=" : "<=" : "is" : "isnot" : "in" : "as" // TODO: Check the precedence for in carefully
: "==" : "===" : "==" : "==="
// No | & ^ ~ // No | & ^ ~
: "&&" : "&&"
@@ -45,6 +45,11 @@ postfixUnaryOperation
: "++" : "--" : "++" : "--"
; ;
functionCall
: completeFunctionCall
: onlyTypeParameters
: infixFunctionCall
jump jump
: "throw" expression : "throw" expression
: "return" expression : "return" expression