Skip to content

Commit

Permalink
Fix bug mirah/mirah-parser#25 for DStrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixvf committed Jul 21, 2015
1 parent a13ebdf commit a900c10
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mirahparser/impl/MirahLexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,12 @@ public Tokens lex(MirahLexer l, Input i) {
return Tokens.tStrEvBegin;
}
i.backup(1);
break;
case '\n':
l.noteNewline();
break;
}
readRestOfString(i);
readRestOfString(l, i);
return Tokens.tStringContent;
}
public Tokens readEndOfString(Input i) {
Expand Down Expand Up @@ -290,7 +294,7 @@ private void readEscape(Input i) {
}
}

private void readRestOfString(Input i) {
private void readRestOfString(MirahLexer l, Input i) {
int c = 0;
for (c = i.read(); c != EOF; c = i.read()) {
if (isEndOfString(c)) {
Expand All @@ -307,6 +311,8 @@ private void readRestOfString(Input i) {
} else if (c == '\\') {
i.backup(1);
break;
} else if (c == '\n') {
l.noteNewline();
}
}
if ( c == EOF ){
Expand Down

0 comments on commit a900c10

Please sign in to comment.