25: Start adding Float Type

This commit is contained in:
Marvin Kaiser
2020-03-03 20:45:55 +01:00
parent db8146ed8a
commit 0316a7d4bf
14 changed files with 658 additions and 98 deletions

View File

@@ -87,6 +87,7 @@ expression
atom
: INTEGER_LITERAL #intAtom
| BOOLEAN_LITERAL #boolAtom
| FLOAT_LITERAL #floatAtom
| IDENT #variable
;
@@ -97,6 +98,7 @@ type_annotation
type
: INTEGER
| BOOLEAN
| FLOAT
;
functionCall
@@ -131,6 +133,7 @@ WHILE: 'while';
DO: 'do';
FOR: 'for';
PERIOD: '.';
COL: ':';
SCOL: ';';
OBRK: '{';
@@ -157,11 +160,16 @@ DIV: '/';
BOOLEAN: 'bool';
INTEGER: 'int';
FLOAT: 'float';
INTEGER_LITERAL
: [0-9]+
;
FLOAT_LITERAL
: INTEGER_LITERAL PERIOD INTEGER_LITERAL
;
BOOLEAN_LITERAL
: 'true'
| 'false'