With the new log system, I'm remaking the parser, because the old one is old and crapy and I want to change the grammar of the language so kill two birds with one stone.
TODO:
[x] new log / error system -> #55
[ ] allow errors on multiple lines
[x] improve note and help to be able to point to code
[x] in the parse_parenthesized_expr, add a note about the expected closing partenthesis to point to the opening one.
[x] package clause
[x] import declaration
[x] function top level declaration
[x] extern function tl. decl
[x] var & const-var top level declaration
[x] types
[x] Primitive Types
[x] Pointer & const pointer
[x] expression
[x] int literal
[x] char literal
[x] string literal
[x] boolean literal
[x] identifier expr
[x] call expr
[x] undefined expr -> see unresolved questions
[x] parenthesized expr
[x] member access
[x] binary a + b -> Operator precedence parser
[x] unary -a, !a, &a, and a.*
[x] if-else expr -> a if predicate else b
[ ] make Block stmt an expression
[x] statements
[x] var & const-var declaration
[x] if-else
[x] block stmt
[x] return
[x] while
[x] labeled stmts
[x] while
[x] block
[x] break
[x] continue
[x] expr stmt
[x] short var declaration ? -> $IdentifierList := $ExprList
[x] assignment
[x] post & pre -fix increment and decrement i++, i--, ++i and --i -> will potentialy be done later, the question hasn't yet been resolved
[x] move operators related stuff in zom_common::token in its own module
[x] add tests -> #6
[x] in the parser
[x] in the lexer
[x] in the log crate
Unresolved questions
Is it still relevant to make the undefined expression ? With the new path Zom is taking, the path of simplicity, should instead allow variable declaration with the expr optional : const test: u32?
-> We allow to define a variable without initializing its expression, and we remove the 'undefined' expression, and keyword.
Should we make := its own operator?
-> Will not be answered here / now.
If we make the postfix increment / decrement we couldn't make the array concatenation operator like in Zig, a ++ b, what do we do?
-> Will not be answered here / now.
With the new log system, I'm remaking the parser, because the old one is old and crapy and I want to change the grammar of the language so kill two birds with one stone.
TODO:
note
andhelp
to be able to point to codeparse_parenthesized_expr
, add a note about the expected closing partenthesis to point to the opening one.undefined expr-> see unresolved questionsa + b
-> Operator precedence parser-a
,!a
,&a
, anda.*
a if predicate else b
$IdentifierList := $ExprList
i++
,i--
,++i
and--i
-> will potentialy be done later, the question hasn't yet been resolvedzom_common::token
in its own moduleUnresolved questions
undefined
expression ? With the new path Zom is taking, the path of simplicity, should instead allow variable declaration with the expr optional :const test: u32
?-> We allow to define a variable without initializing its expression, and we remove the 'undefined' expression, and keyword.
:=
its own operator?-> Will not be answered here / now.
a ++ b
, what do we do?-> Will not be answered here / now.