diff --git a/language/parser.js b/language/parser.js index 03a05e7c..22e86df7 100644 --- a/language/parser.js +++ b/language/parser.js @@ -129,6 +129,7 @@ export default class Parser { if (line.trim().startsWith(`//`)) return; // Likely comment const upperLine = line.toUpperCase(); + const firstComment = upperLine.indexOf(`//`); let comment = -1; let directivePosition = upperLine.indexOf(`/COPY `); @@ -143,6 +144,11 @@ export default class Parser { directiveLength = 9 }; + // If comment is before directive, then it's a comment + if (firstComment >= 0 && firstComment < directivePosition) { + return; + } + /** @type {string|undefined} */ let directiveValue;