Add expressed Boolean methods. Add explicit object instantiation syntax
This commit is contained in:
parent
5f85679547
commit
40209417c5
3
grammar/declarations/object_instantiation.bnf
Normal file
3
grammar/declarations/object_instantiation.bnf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<object_instantiation> ::= "new" <type> "(" <argument_list>? ")"
|
||||
|
||||
<type> ::= <identifier> ["/" <identifier>]?
|
||||
|
|
@ -16,6 +16,7 @@ import "core/visibility.bnf"
|
|||
import "core/modules.bnf"
|
||||
import "declarations/type_declarations.bnf"
|
||||
import "declarations/function_declarations.bnf"
|
||||
import "declarations/object_instantiation.bnf"
|
||||
import "operations/expressions.bnf"
|
||||
import "operations/method_calls.bnf"
|
||||
import "operations/control_flow.bnf"
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
| <literal>
|
||||
| <object_method_call>
|
||||
| <constant_expression>
|
||||
| <object_instantiation>
|
||||
| "(" <expression> ")"
|
||||
| <lambda_expression>
|
||||
|
||||
<boolean_expression> ::= <boolean_literal>
|
||||
<boolean_expression> ::=
|
||||
<boolean_literal>
|
||||
| "(" <boolean_expression> ")"
|
||||
| <my_identifier>.eq(<expression>)
|
||||
| <my_identifier>.is(<expression>)
|
||||
|
|
@ -14,7 +16,16 @@
|
|||
| <my_identifier>.lt(<expression>)
|
||||
| <my_identifier>.gte(<expression>)
|
||||
| <my_identifier>.lte(<expression>)
|
||||
| Boolean.or(<boolean_expression>, <boolean_expression>)
|
||||
| <my_identifier>.and(<boolean_expression>)
|
||||
| <my_identifier>.or(<boolean_expression>)
|
||||
| Boolean.and(<boolean_expression>, <boolean_expression>)
|
||||
| Boolean.or(<boolean_expression>, <boolean_expression>)
|
||||
| Boolean.not(<boolean_expression>)
|
||||
| Boolean.eq(<boolean_expression>, <boolean_expression>)
|
||||
| Boolean.is(<boolean_expression>, <boolean_expression>)
|
||||
| Boolean.gt(<boolean_expression>, <boolean_expression>)
|
||||
| Boolean.lt(<boolean_expression>, <boolean_expression>)
|
||||
| Boolean.gte(<boolean_expression>, <boolean_expression>)
|
||||
| Boolean.lte(<boolean_expression>, <boolean_expression>)
|
||||
|
||||
<constant_expression> ::= <my_identifier> ".define(" <literal> ")"
|
||||
|
|
|
|||
Loading…
Reference in a new issue