mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-11 04:49:15 +03:00
add a way to define static members to circuits to accesses rfc
This commit is contained in:
parent
2a7298b873
commit
5654e8a7a6
@ -45,6 +45,15 @@ postfix-expression = primary-expression
|
||||
/ named-type "::" identifier ; this is new to allow member constants
|
||||
/ postfix-expression "[" expression "]"
|
||||
/ postfix-expression "[" [expression] ".." [expression] "]"
|
||||
|
||||
; Also need to add a new static member variable declaration rule to allow for static constant members.
|
||||
static-member-variable-declarations = static identifier ":" type = literal ";"
|
||||
|
||||
; We then need to modify the circuit declartion rule.
|
||||
circuit-declaration = %s"circuit" identifier
|
||||
"{" [ static-member-variable-declarations ]
|
||||
[ member-variable-declarations ]
|
||||
*member-function-declaration "}"
|
||||
```
|
||||
|
||||
Now methods and static members would be first-class citizens of scalar types and their values. For example, the following could be done:
|
||||
|
Loading…
Reference in New Issue
Block a user