Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upEditorial: instead of the [Tagged] parameter #966
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jmdyck commentedAug 3, 2017
The
[Tagged]grammatical parameter doesn't actually alter the grammar -- there are no right-hand-sides preceded by[+Tagged]or[~Tagged]. Its purpose appears to be: for a given TemplateLiteral, capture whether it belongs to a tagged template, and then convey that fact to the TemplateLiteral's literal components, so that they know whether or not to raise a Syntax Error on NotEscapeSequence.But if that's the case, then we don't need to use a grammatical parameter, we could just say things like:
Note that we use similar 'context-examining' formulations in the early error rules for 'break' and 'continue', for uninitialized constant-decls, and (kind of) whenever an EE rule says "if [something] is contained in strict mode code".
(You could do it in a single early error rule:
but that makes an assumption about the syntactic/lexical boundary that we may not want to make.)