Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bugs in metalanguage parser for this nonterminals #121

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

jhnaldo
Copy link
Contributor

@jhnaldo jhnaldo commented Dec 8, 2022

The following JS code throws a ReferenceError in ESMeta interpretation because of the wrong interpretation of HasCallInTailPosition for the function call f ( ).

function f ( ) { }
( x => f ( ) ( x ) ) ( ) ;

It happens because of the wrong metalanguage parser for this nonterminal literals.
In the SDO, the expression this |CallExpression| should be parsed into a ThisLiteral, but it was parsed into a NonterminalLiteral as same as the expression |CallExpression|.

Static Semantics: HasCallInTailPosition (
    _call_: unknown,
): a Boolean

<emu-grammar>CallExpression : CallExpression Arguments</emu-grammar>
<emu-alg>
    1. If this |CallExpression| is _call_, return *true*.
    1. Return *false*.
</emu-alg>

This PR resolved this problem.

@jhnaldo jhnaldo merged commit ff0c8a0 into dev Dec 8, 2022
@jhnaldo jhnaldo deleted the fix-lang-parser-for-this-nt branch December 8, 2022 15:03
@jhnaldo jhnaldo added bug Something isn't working area:lang Related to metalanguage labels Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:lang Related to metalanguage bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant