Skip to content

Commit

Permalink
String line coordinates should be stored properly again.
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyIsEvery4thYearAlwaysBad authored and WhyIsEvery4thYearAlwaysBad committed Apr 11, 2021
1 parent 58caf7b commit 406cc59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ namespace Lexer {
// strings
case '\"':
{
std::size_t tempcol=iLineColumn,templn=iLineNum;
// New lines or carriage returns cannot be in strings. (I don't mean the '\r' or '\n' character.)
for (i++, iLineColumn++; i < p_sInStr.length(); i++, iLineColumn++) {
if (p_sInStr.at(i)=='\r') {
Expand Down Expand Up @@ -179,7 +178,7 @@ namespace Lexer {
break;
}
else if (p_sInStr.at(i)=='\"') {
TokenContainer.push_back(Token(tempcol,templn,TokenType::STRING,t_sStrTemp));
TokenContainer.push_back(Token(iLineNum,iLineColumn,TokenType::STRING,t_sStrTemp));
t_sStrTemp="";
break;
}
Expand Down

0 comments on commit 406cc59

Please sign in to comment.