diff --git a/src/core/context/index.ts b/src/core/context/index.ts index 2c438e4..64e155f 100644 --- a/src/core/context/index.ts +++ b/src/core/context/index.ts @@ -78,6 +78,9 @@ export class Context { transform(code: string, _id: string) { const tokens = Lexer.lex(code, this.lexers) + const hasDirective = tokens.some(token => token.type !== 'code') + if (!hasDirective) + return const ast = Parser.parse(tokens, this.parsers) const transformed = Transformer.transform(ast, this.transforms)