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 = {t => something(t)}
|
||||||
val f1 = {something(it)}
|
val f1 = {something(it)}
|
||||||
|
|
||||||
val f1 : {(T) : X} = ...
|
val f1 : {(T) : X} = {X()}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user