Skip to content

Commit

Permalink
Handle comments and commas in skipDotExprBackwards
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowAfterlife committed Oct 17, 2020
1 parent 5ffc50a commit 654a7fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tools/StringToolsEx.hx
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,14 @@ class StringToolsEx {
}
}
};
case VitGML.commentEOL: {
if (depth <= 0) return till;
while (--pos >= 0) {
if (src.fastCodeAt(pos) == "/".code
&& src.fastCodeAt(pos - 1) == "/".code
) pos--;
}
};
case "(".code, "[".code, "{".code: depth++;
case ")".code, "]".code, "}".code: depth--;
case _ if (inline isIdent1(c)): {
Expand Down Expand Up @@ -440,6 +448,10 @@ class StringToolsEx {
// keep going
} else return false;
};
case ",".code: {
// it could be a variable declaration, but we don't usually remap those
return false;
};
case "/".code: {
if (src.fastCodeAt(--pos) == "*".code) { // comment
pos--;
Expand Down

0 comments on commit 654a7fb

Please sign in to comment.