summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/parser.l4
-rw-r--r--src/parser.y2
-rw-r--r--src/variable.h20
3 files changed, 13 insertions, 13 deletions
diff --git a/src/parser.l b/src/parser.l
index 70704b8..950c209 100644
--- a/src/parser.l
+++ b/src/parser.l
@@ -72,7 +72,7 @@ null { return tokNull; }
72 72
73[a-zA-Z_][a-zA-Z0-9_]* { yylval->sValue = new Bu::String( yytext ); return tokIdent; } 73[a-zA-Z_][a-zA-Z0-9_]* { yylval->sValue = new Bu::String( yytext ); return tokIdent; }
74 74
75-?[1-9][0-9]* { 75[1-9][0-9]* {
76 yylval->iValue = strtoll( yytext, NULL, 10 ); 76 yylval->iValue = strtoll( yytext, NULL, 10 );
77 return tokInt; 77 return tokInt;
78} 78}
@@ -81,7 +81,7 @@ null { return tokNull; }
81 return tokInt; 81 return tokInt;
82} 82}
83 83
84-?([1-9][0-9]*|0)?\.[0-9]* { 84([1-9][0-9]*|0)?\.[0-9]* {
85// printf("Parsing float: %s\n", yytext ); 85// printf("Parsing float: %s\n", yytext );
86 yylval->dValue = strtod( yytext, NULL ); 86 yylval->dValue = strtod( yytext, NULL );
87// printf("Final float: %f\n", yylval->dValue ); 87// printf("Final float: %f\n", yylval->dValue );
diff --git a/src/parser.y b/src/parser.y
index 47c0159..0358e48 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -87,9 +87,9 @@ void yyerror( YYLTYPE *llocp, yyscan_t yyscanner, GameBuilder &, const char *err
87%left NOT 87%left NOT
88%right '=' tokPlusAssign tokMinusAssign tokTimesAssign tokDivideAssign 88%right '=' tokPlusAssign tokMinusAssign tokTimesAssign tokDivideAssign
89%left tokIn tokAnd tokOr 89%left tokIn tokAnd tokOr
90%right '<' '>' tokLtEq tokGtEq tokCmp
90%left '-' '+' 91%left '-' '+'
91%left '*' '/' 92%left '*' '/'
92%right '<' '>' tokLtEq tokGtEq tokCmp
93%left '(' ')' '[' ']' 93%left '(' ')' '[' ']'
94%left NEG 94%left NEG
95 95
diff --git a/src/variable.h b/src/variable.h
index 2e84ae1..83b6d44 100644
--- a/src/variable.h
+++ b/src/variable.h
@@ -25,16 +25,16 @@ friend Bu::Formatter &operator<<( Bu::Formatter &f, const Variable &v );
25public: 25public:
26 enum Type 26 enum Type
27 { 27 {
28 tNull, 28 tNull = 0,
29 tBool, 29 tBool = 1,
30 tInt, 30 tInt = 2,
31 tFloat, 31 tFloat = 3,
32 tSituation, 32 tSituation = 4,
33 tVariable, 33 tVariable = 5,
34 tVarPtr, 34 tVarPtr = 6,
35 tList, 35 tList = 7,
36 tDictionary, 36 tDictionary = 8,
37 tString, 37 tString = 9,
38 }; 38 };
39 39
40public: 40public: