More on binary operations
This commit is contained in:
@@ -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()}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user