diff --git a/language/tokens.ts b/language/tokens.ts index aeac06fd..fa75bda5 100644 --- a/language/tokens.ts +++ b/language/tokens.ts @@ -35,7 +35,7 @@ const commonMatchers: Matcher[] = [ { type: `divide` }, { type: `word`, - match: (word) => [`TITLE`, `EJECT`, `SPACE`, `COPY`, `INCLUDE`, `SET`, `RESTORE`, `OVERLOAD`, `DEFINE`, `UNDEFINED`, `IF`, `ELSE`, `ELSEIF`, `ENDIF`, `EOF`, `CHARCOUNT`].includes(word.toUpperCase()) + match: (word) => [`TITLE`, `EJECT`, `SPACE`, `COPY`, `INCLUDE`, `SET`, `RESTORE`, `OVERLOAD`, `DEFINE`, `UNDEFINE`, `IF`, `ELSE`, `ELSEIF`, `ENDIF`, `EOF`, `CHARCOUNT`].includes(word.toUpperCase()) }, ], becomes: { diff --git a/tests/suite/linter.test.ts b/tests/suite/linter.test.ts index ba2d475f..6aced4aa 100644 --- a/tests/suite/linter.test.ts +++ b/tests/suite/linter.test.ts @@ -3281,4 +3281,25 @@ test(`snd-msg casing #309`, async () => { }, cache); expect(errors.length).toBe(0); -}); \ No newline at end of file +}); + +test(`define and undefine directives #310`, async () => { + const lines = [ + `**free`, + `/define #stuff`, + `// do exciting things here`, + `/undefine #stuff`, + `dcl-ds gPSDS psds qualified;`, + ` pgmName *proc;`, + `end-ds;`, + `*inlr = *on;`, + `return;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); + const { indentErrors } = Linter.getErrors({ uri, content: lines }, { + indent: 2 + }, cache); + + expect(indentErrors.length).toBe(0); +});