Add attachComment parser option to disable comment attachment (#13229)

This commit is contained in:
Huáng Jùnliàng
2021-08-04 11:04:22 -04:00
committed by GitHub
parent fc3b09e533
commit d5b0d9e33d
11 changed files with 274 additions and 18 deletions

View File

@@ -0,0 +1,12 @@
import path from "path";
import { runFixtureTestsWithoutExactASTMatch } from "./helpers/runFixtureTests";
import { parseExpression } from "../lib";
import { fileURLToPath } from "url";
runFixtureTestsWithoutExactASTMatch(
path.join(path.dirname(fileURLToPath(import.meta.url)), "expressions"),
(input, options = {}) => {
options.attachComment = false;
return parseExpression(input, options);
},
);