Mercurial > hg > index.cgi
diff lwcc/tree.c @ 506:7e8298f7bc0a
Add basic syntax for typecasting
Add parser support for type casts. This current scheme handles only integer
types.
Also include parenthesis grouping in expressions.
author | William Astle <lost@l-w.ca> |
---|---|
date | Sun, 27 Oct 2019 12:06:01 -0600 |
parents | 14a40f8bb4eb |
children |
line wrap: on
line diff
--- a/lwcc/tree.c Sat Oct 26 22:01:55 2019 -0600 +++ b/lwcc/tree.c Sun Oct 27 12:06:01 2019 -0600 @@ -90,6 +90,7 @@ "OPER_BWXORASS", "OPER_BWORASS", "OPER_COMMA", + "TYPECAST", }; @@ -151,6 +152,10 @@ nargs = 2; break; + case NODE_TYPECAST: + nargs = 2; + break; + case NODE_OPER_POSTINC: case NODE_OPER_POSTDEC: nargs = 1;