fixed space skipping and decimal literals in Lexer

This commit is contained in:
Timerix22 2023-12-23 13:54:35 +06:00
parent 5907457907
commit 8fe03105b7
2 changed files with 3 additions and 1 deletions

View File

@ -55,10 +55,12 @@ class Lexer {
// try end token and skip current char // try end token and skip current char
case ' ': case '\t': case '\n': case '\r': case ' ': case '\t': case '\n': case '\r':
TryEndToken(); TryEndToken();
tokBegin++;
break; break;
// move next // move next
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '5': case '6': case '7': case '8': case '9':
case '.':
break; break;
// set type from Numeric to Literal // set type from Numeric to Literal
default: default:

View File

@ -7,7 +7,7 @@ public static class MainClass {
#endif #endif
string() joined = ""; string() joined = "";
foreach(string arg in args){ foreach(string arg in args){
joined += arg; joined += arg + " ";
} }
double rezult = Calculator.Calculate(joined); double rezult = Calculator.Calculate(joined);
Console.WriteLine(rezult); Console.WriteLine(rezult);