diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-09-26 18:46:01 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-09-26 18:46:01 +0300 |
commit | d067b8b70ad503f003a56193ec7d4bebfd3c0276 (patch) | |
tree | 6a700651f2e20d031c5b24f5b69ca2a99e9ffc37 /src/compiler/expr.lm | |
parent | 06c4761a3a2b129d221851391ced380e233c6ee1 (diff) |
remove type::name add endianess support
type::name is too agressive as it clashes with keywords
use reference::variable::type and reference::function::type instead
Diffstat (limited to 'src/compiler/expr.lm')
-rw-r--r-- | src/compiler/expr.lm | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/compiler/expr.lm b/src/compiler/expr.lm index 1bf6746..b763005 100644 --- a/src/compiler/expr.lm +++ b/src/compiler/expr.lm @@ -69,18 +69,34 @@ end context reference context function - literal `( `) `, + lex + # reserved + literal `struct `enum `select + literal `nul `dec `hex `str `be `le + token PRIMITIVE / [us][1-9][0-9]* / + literal `( `) `, + token NAME / [a-zA-Z_][a-zA-Z_0-9]* / + end def arg [expr::arg::type `, arg] | [expr::arg::type] def type - [name:name::type `( args:arg* `)] + [name:NAME WS* `( args:arg* `)] end context variable + lex + # reserved + literal `struct `enum `select + literal `until `sizeof + literal `nul `dec `hex `str `be `le + token PRIMITIVE / [us][1-9][0-9]* / + token NAME / [a-zA-Z_][a-zA-Z_0-9]* / + end + def type - [name:name::type] + [name:NAME] end def type @@ -101,7 +117,6 @@ context collapser values:str next_is_unary:bool - token WS / space / literal `+ `- literal `( `) `+# `-# `! `~ `* `/ `% `#+ `#- `<< `>> `< `> `<= `>= `== `!= `& `^ `| `&& `|| `? `: literal `. `[ `] |