You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error was risen by a multiline comments block I've added to the lang file using /* ... */. When I changed the comments to multiple single-line comments (// ...) the error was gone. So I worked to pin down the problem...
I've selectively removed comment lines until I isolated the culprit, but I can't make much sense from what I've found.
The following comment will raise the error:
/*
http://www.someurl.com/
*/
But if I remove the slash / at the end of the line the error dissapears:
/*
http://www.someurl.com
*/
The error also dissapears by adding another slash / at the end of the line:
/*
http://www.someurl.com//
*/
But a third slash bring the problem back again:
/*
http://www.someurl.com///
*/
And it doesn't matter is the slash is the last char on the line or if there are other characters following it — it's the presence of an ODD number of slashes on the line that raises the error!
It seems a problem relating to parsing multiline comments and the way slashes are interpreted — and the presence of two slashes in the URL is what sets into motion. A line with an odd number of slashes seems to raise the error, not so when their number is even. The 'Unmatched quote' error reported is a bit misleading, at the beginning I though it was due to the single quotes, but it wasn't.
The problem doesn't show up when using single line comments:
// http://www.someurl.com/
So we are not talking about an edge-case, similar URLs are common within comment blocks. The error blocks the building process, and doesn't provide much info on where the process failed, so users might need quite some time to isolate the specific line which is causing build failure.
The text was updated successfully, but these errors were encountered:
Our build pipeline has custom written code that doesn't properly understand /* */ comments. This is something we really should fix.
joshgoebel
changed the title
Error building when lang definition has block comments
replaceSkippingStrings does not properly understand /* style */ comments
Oct 7, 2019
If anyone doesn't understand this, ask me. The url issue is that because we don't understand /* comments we think the // in the URL is the start of a comment and that leads to all sorts of problems since really we have no idea what is and isn't commented after that. :)
joshgoebel
changed the title
replaceSkippingStrings does not properly understand /* style */ comments
replaceSkippingStrings does not properly understand /* style */ comments [auto-close new build system]
Oct 24, 2019
While working on a language definition file I stubmled upon the following error when building HLJS:
The error was risen by a multiline comments block I've added to the lang file using
/* ... */
. When I changed the comments to multiple single-line comments (// ...
) the error was gone. So I worked to pin down the problem...I've selectively removed comment lines until I isolated the culprit, but I can't make much sense from what I've found.
The following comment will raise the error:
But if I remove the slash
/
at the end of the line the error dissapears:The error also dissapears by adding another slash
/
at the end of the line:But a third slash bring the problem back again:
And it doesn't matter is the slash is the last char on the line or if there are other characters following it — it's the presence of an ODD number of slashes on the line that raises the error!
It seems a problem relating to parsing multiline comments and the way slashes are interpreted — and the presence of two slashes in the URL is what sets into motion. A line with an odd number of slashes seems to raise the error, not so when their number is even. The 'Unmatched quote' error reported is a bit misleading, at the beginning I though it was due to the single quotes, but it wasn't.
The problem doesn't show up when using single line comments:
So we are not talking about an edge-case, similar URLs are common within comment blocks. The error blocks the building process, and doesn't provide much info on where the process failed, so users might need quite some time to isolate the specific line which is causing build failure.
The text was updated successfully, but these errors were encountered: