Skip to content

Grammars which extend Javascript fail to parse template literals, despite the Javascript grammar doing so itself #364

@enquora

Description

@enquora

The following Javascript code is correctly parsed by the grammar:

// test.js
function fact(n) {
    let res = 1;
    for (let i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

let test_value = "hello";
let test_templated_string = `${test_value} world!`;

Any grammar which extends the Javascript generates an error when encountering template literals, despite the canonical Javascript grammar parsing all constructs properly.
Other javascript constructs are parsed properly by the extended grammar, whether any rules are present or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions