Skip to content

Commit

Permalink
fix(getIncludeFromDirective): ignore the comment line
Browse files Browse the repository at this point in the history
  • Loading branch information
sebCIL committed Oct 22, 2024
1 parent b9a6072 commit c846072
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions language/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default class Parser {
*/
static getIncludeFromDirective(line) {
if (line.includes(`*`)) return; // Likely comment
if (line.includes(`//`)) return; // Likely comment
if (line.trim().startsWith(`//`)) return; // Likely comment

const upperLine = line.toUpperCase();
let comment = -1;
Expand Down Expand Up @@ -441,23 +441,23 @@ export default class Parser {
// End of parsing for this file
break;
} else
if (parts[0] === `/IF`) {
if (parts[0] === `/IF`) {
// Directive IF
directIfScope += 1;
continue;
} else
if (parts[0] === `/ENDIF`) {
// Directive ENDIF
directIfScope -= 1;
continue;
} else
if (directIfScope > 0) {
// Ignore lines inside the IF scope.
continue;
} else
if (line.startsWith(`/`)) {
continue;
}
directIfScope += 1;
continue;
} else
if (parts[0] === `/ENDIF`) {
// Directive ENDIF
directIfScope -= 1;
continue;
} else
if (directIfScope > 0) {
// Ignore lines inside the IF scope.
continue;
} else
if (line.startsWith(`/`)) {
continue;
}
}

if (pieces.length > 1 && pieces[1].includes(`//`)) line = pieces[0] + `;`;
Expand Down Expand Up @@ -671,9 +671,9 @@ export default class Parser {
if (dsScopes.length === 1) {
scope.structs.push(dsScopes.pop());
} else
if (dsScopes.length > 1) {
dsScopes[dsScopes.length - 2].subItems.push(dsScopes.pop());
}
if (dsScopes.length > 1) {
dsScopes[dsScopes.length - 2].subItems.push(dsScopes.pop());
}
break;

case `DCL-PR`:
Expand Down Expand Up @@ -915,7 +915,7 @@ export default class Parser {

if (currentSqlItem.name)

currentSqlItem.keywords = [];
currentSqlItem.keywords = [];
currentSqlItem.description = qualifiedObjectPath.schema || ``;

currentSqlItem.position = {
Expand Down

0 comments on commit c846072

Please sign in to comment.