Skip to content

Commit

Permalink
fix(tsl): parser fails to parse hexcode
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoodie committed Sep 13, 2020
1 parent 7cd2474 commit e6843fa
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -211,12 +211,13 @@ private String trimComments(String line) {

boolean escaping = false;
boolean inGroup = false;
boolean inJsonString = false;

for (char character : line.toCharArray()) {

// Comment character
if (character == COMMENT) {
if (!inGroup)
if (!inGroup && !inJsonString)
break;
}

Expand All @@ -226,6 +227,12 @@ private String trimComments(String line) {
inGroup = !inGroup;
}

// Json String
if (character == '"' || character == '\'') {
if (!escaping)
inJsonString = !inJsonString;
}

// Escape character
if (character == ESCAPE) {
escaping = !escaping;
Expand Down

0 comments on commit e6843fa

Please sign in to comment.