diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-06 13:39:21 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-06 13:39:21 +0000 |
commit | da44edd3b1cea6d0a767f6871cf286c6d83ed01c (patch) | |
tree | 06795860351be139a64d6f789b5cee19d4e2a490 /src/main.cpp | |
parent | a96a4a8673d92c1fc82e40d9b9a48de017eeb827 (diff) | |
download | Compiler-da44edd3b1cea6d0a767f6871cf286c6d83ed01c.tar.gz Compiler-da44edd3b1cea6d0a767f6871cf286c6d83ed01c.zip |
Completely done
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index eac349e..8b20098 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,10 +11,10 @@ int main() { std::string sourceLine, streamLine, sourceCol, classType, text; while(1) { // get the token type and run the lexer - TokenType type = (TokenType)yylex(); - std::stringstream str_line, src_col, src_line; + TokenType type = (TokenType)yylex(); + str_line << lineCount; streamLine = str_line.str(); @@ -63,10 +63,9 @@ int main() { return 1; } - updateSpaceCount(text); - if(type == StringLiteral) - spaceCount += 2; printf("%s,\n", toJson(classType, text, streamLine, sourceCol, sourceLine, fileName).c_str()); + + spaceCount += yyleng; } printf("{}\n]\n"); |