Skip to content

Commit 57c2709

Browse files
committed
replace Math. with GPU_Math_ in lexing stage
1 parent b48a0bb commit 57c2709

2 files changed

Lines changed: 66 additions & 55 deletions

File tree

src/grammar.jison

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ RegularExpressionLiteral {RegularExpressionBody}\/{RegularExpressionFlags}
117117
"extends" return "EXTENDS";
118118
"import" return "IMPORT";
119119
"super" return "SUPER";
120+
"Math." return "GPU_Math_"
120121
{Identifier} parser.restricted = false; return "IDENTIFIER";
121122
{DecimalLiteral} parser.restricted = false; return "NUMERIC_LITERAL";
122123
{HexIntegerLiteral} parser.restricted = false; return "NUMERIC_LITERAL";
@@ -765,6 +766,10 @@ PropertySetParameterList
765766
MemberExpression
766767
: PrimaryExpression
767768
| FunctionExpression
769+
| MemberExpression "[" Expression "]"
770+
{
771+
$$ = new MemberExpressionNode($1, $3, true, createSourceLocation(null, @1, @4));
772+
}
768773
| MemberExpression "." IdentifierName
769774
{
770775
$$ = new MemberExpressionNode($1, $3, false, createSourceLocation(null, @1, @3));
@@ -777,6 +782,10 @@ MemberExpression
777782

778783
MemberExpressionNoBF
779784
: PrimaryExpressionNoBrace
785+
| MemberExpressionNoBF "[" Expression "]"
786+
{
787+
$$ = new MemberExpressionNode($1, $3, true, createSourceLocation(null, @1, @4));
788+
}
780789
| MemberExpressionNoBF "." IdentifierName
781790
{
782791
$$ = new MemberExpressionNode($1, $3, false, createSourceLocation(null, @1, @3));

0 commit comments

Comments
 (0)