Fix inclusion of libc++ in wasm build

This commit is contained in:
Max Brunsfeld 2019-04-27 18:06:34 -07:00
parent 73e1512555
commit f3ecafe13b
3 changed files with 14 additions and 4 deletions

View file

@ -1,11 +1,11 @@
const {assert} = require('chai');
let Parser, JavaScript;
let Parser, JavaScript, Python;
describe("Parser", () => {
let parser;
before(async () =>
({Parser, JavaScript} = await require('./helper'))
({Parser, JavaScript, Python} = await require('./helper'))
);
beforeEach(() => {
@ -125,6 +125,15 @@ describe("Parser", () => {
assert.equal(tree.rootNode.firstChild.firstChild.namedChildCount, repeatCount);
});
it.only("can use languages with external scanners written in C++", () => {
parser.setLanguage(Python);
tree = parser.parse("def foo():\n bar()");
assert.equal(
tree.rootNode.toString(),
'(module (function_definition (identifier) (parameters) (expression_statement (call (identifier) (argument_list)))))'
);
});
it('parses only the text within the `includedRanges` if they are specified', () => {
const sourceCode = "<% foo() %> <% bar %>";