fixed space skipping and decimal literals in Lexer
This commit is contained in:
parent
5907457907
commit
8fe03105b7
@ -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:
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user