aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/src/c_lexer.flex
diff options
context:
space:
mode:
authorymherklotz <ymherklotz@gmail.com>2017-03-10 19:57:46 +0000
committerymherklotz <ymherklotz@gmail.com>2017-03-10 19:57:46 +0000
commita6fa6da5de8252a205e000dd7acc2589735aa55c (patch)
tree77a791e0877fc4925f8d0dba6eb746bb32eb88e9 /c_compiler/src/c_lexer.flex
parentfc4486443f1af75526306377437cb82c2c9f37ac (diff)
downloadCompiler-a6fa6da5de8252a205e000dd7acc2589735aa55c.tar.gz
Compiler-a6fa6da5de8252a205e000dd7acc2589735aa55c.zip
Can do simple add and subtract
Diffstat (limited to 'c_compiler/src/c_lexer.flex')
-rw-r--r--c_compiler/src/c_lexer.flex2
1 files changed, 1 insertions, 1 deletions
diff --git a/c_compiler/src/c_lexer.flex b/c_compiler/src/c_lexer.flex
index b225522..f6f2dd3 100644
--- a/c_compiler/src/c_lexer.flex
+++ b/c_compiler/src/c_lexer.flex
@@ -67,7 +67,7 @@ ALL .
[.] { return T_DOT; }
[-][>] { return T_ARROW; }
[+-][+-] { return T_INCDEC; }
-[+-] { return T_ADDSUB_OP; }
+[+-] { yylval.string = new std::string(yytext); return T_ADDSUB_OP; }
[=] { yylval.string = new std::string(yytext); return T_EQ; }
{ASSIGNMENT_OPERATOR} { yylval.string = new std::string(yytext); return T_ASSIGN_OPER; }