Modified the syntax of writing real-valued literals with the DSL. Casts are not needed any more: f.ex. 1.0 is implicitly cast to AcReal. The syntax is now more consistent: reals must be explicitly written as a.b, where a and b are some integers. IMPORTANT: Previously the shorthands a. and .b were allowed, not anymore. Using those shorthands will result in a compilation error

This commit is contained in:
jpekkila
2019-10-01 21:14:33 +03:00
parent b4a6ddb074
commit a0037d1a44
4 changed files with 43 additions and 30 deletions

View File

@@ -37,8 +37,9 @@ L [a-zA-Z_]
"return" { return RETURN; }
{D}+"."?{D}*[flud]? { return NUMBER; } /* Literals */
"."{D}+[flud]? { return NUMBER; }
{D}+"."{D}+ { return REAL_NUMBER; } /* Literals */
{D}+"."{D}+[fd]+ { return NUMBER; }
{D}+[lu]* { return NUMBER; }
{L}({L}|{D})* { return IDENTIFIER; }
\"(.)*\" { return IDENTIFIER; } /* String */