diff options
| author | mirenn <me@mirenn.dev> | 2026-03-12 16:36:27 +0100 |
|---|---|---|
| committer | mirenn <me@mirenn.dev> | 2026-04-14 09:44:28 +0200 |
| commit | 6bb1a9b95b09663436c2fe30a8e2185a3f741af1 (patch) | |
| tree | 5546f4c44b3e9ca09776dae0078db25af229247b /src/lex.l | |
| parent | a8d572933d3a29e73bbbe20bc49e1fe988e55cfa (diff) | |
| download | inpla-6bb1a9b95b09663436c2fe30a8e2185a3f741af1.tar.gz inpla-6bb1a9b95b09663436c2fe30a8e2185a3f741af1.zip | |
float support
Diffstat (limited to '')
| -rw-r--r-- | src/lex.l | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -100,7 +100,7 @@ int yycolumn = 1; <INITIAL>"<=" return(LE); <INITIAL>"<<" return (ABR); -<INITIAL>"int" return(INT); +<INITIAL>"float" return(FLOAT); <INITIAL>"let" return(LET); <INITIAL>"in" return(IN); @@ -132,7 +132,7 @@ int yycolumn = 1; return (NAME);} <INITIAL>[A-Z][a-zA-Z0-9_'\.]* { yylval.chval = strdup(yytext); return (AGENT);} -<INITIAL>[0-9]+ { yylval.longval = atol(yytext); +<INITIAL>[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)? { yylval.doubleval = atof(yytext); return (NUMERAL_LITERAL);} <INITIAL>"//"[^\n]* ; //comment |
