1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

assign arrayAccess

This commit is contained in:
Ayman Nadeem 2018-06-05 12:15:13 -07:00
parent be050a7115
commit 8ca91b1fb3

View File

@ -41,6 +41,7 @@ type Syntax =
, Expression.Boolean
, Expression.InstanceOf
, Expression.MemberAccess
, Expression.Subscript
, Expression.Super
, Expression.This
, Java.Syntax.Annotation
@ -136,6 +137,7 @@ expressionChoices :: [Assignment.Assignment [] Grammar Term]
expressionChoices =
[
arrayInitializer
, arrayAccess
, assignment'
, block
, binary
@ -535,3 +537,6 @@ spreadParameter = makeTerm <$> symbol Grammar.SpreadParameter <*> children (Java
variableDeclarator = symbol VariableDeclarator *> children ((,) <$> variableDeclaratorId <*> optional expression)
makeSingleDecl modifiers type' (target, Nothing) = makeTerm1 (Java.Syntax.Variable modifiers type' target)
makeSingleDecl modifiers type' (target, Just value) = makeTerm1 (Statement.Assignment [] (makeTerm1 (Java.Syntax.Variable modifiers type' target)) value)
arrayAccess :: Assignment
arrayAccess = makeTerm <$> symbol ArrayAccess <*> children (Expression.Subscript <$> term expression <*> manyTerm expression)