Skip to content

Commit 6ae28eb

Browse files
committed
f u
1 parent e1aafdf commit 6ae28eb

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/preprocessor/preprocessor.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ import generate from './generator.js';
1111
import * as parser from './preprocessor-parser.js';
1212
import { formatError } from '../error.js';
1313

14-
// Register the constant_expression parser so preprocessor.ts can parse #if
15-
// expression strings after macro expansion.
16-
const expressionParser = (src: string): PreprocessorAstNode =>
17-
formatError(parser)(src, {
18-
grammarSource: 'expression',
19-
startRule: 'constant_expression',
20-
});
21-
2214
export type PreprocessorProgram = {
2315
type: string;
2416
program: PreprocessorSegmentNode[];
@@ -147,6 +139,12 @@ export type NodeEvaluators = Partial<
147139
}
148140
>;
149141

142+
const expressionParser = (src: string): PreprocessorAstNode =>
143+
formatError(parser)(src, {
144+
grammarSource: 'expression',
145+
startRule: 'constant_expression',
146+
});
147+
150148
const evaluate = (ast: PreprocessorAstNode, evaluators: NodeEvaluators) => {
151149
const visit = (node: PreprocessorAstNode) => {
152150
const evaluator = evaluators[node.type];

0 commit comments

Comments
 (0)