mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Subscripts
This commit is contained in:
parent
a4c0c93b2b
commit
06e0e07920
@ -36,6 +36,7 @@ type Syntax = '[
|
|||||||
, Expression.Comparison
|
, Expression.Comparison
|
||||||
, Expression.MemberAccess
|
, Expression.MemberAccess
|
||||||
, Expression.ScopeResolution
|
, Expression.ScopeResolution
|
||||||
|
, Expression.Subscript
|
||||||
, Literal.Array
|
, Literal.Array
|
||||||
, Literal.Boolean
|
, Literal.Boolean
|
||||||
, Literal.Float
|
, Literal.Float
|
||||||
@ -113,6 +114,7 @@ statement = handleError $
|
|||||||
<|> conditional
|
<|> conditional
|
||||||
<|> methodCall
|
<|> methodCall
|
||||||
<|> call
|
<|> call
|
||||||
|
<|> subscript
|
||||||
where mk s construct = makeTerm <$> symbol s <*> children ((construct .) . fromMaybe <$> emptyTerm <*> optional (symbol ArgumentList *> children statement))
|
where mk s construct = makeTerm <$> symbol s <*> children ((construct .) . fromMaybe <$> emptyTerm <*> optional (symbol ArgumentList *> children statement))
|
||||||
|
|
||||||
statements :: Assignment
|
statements :: Assignment
|
||||||
@ -242,6 +244,9 @@ until' =
|
|||||||
for :: Assignment
|
for :: Assignment
|
||||||
for = makeTerm <$> symbol For <*> children (Statement.ForEach <$> some identifier <*> statement <*> statements)
|
for = makeTerm <$> symbol For <*> children (Statement.ForEach <$> some identifier <*> statement <*> statements)
|
||||||
|
|
||||||
|
subscript :: Assignment
|
||||||
|
subscript = makeTerm <$> symbol ElementReference <*> children (Expression.Subscript <$> statement <*> many argument)
|
||||||
|
|
||||||
pair :: Assignment
|
pair :: Assignment
|
||||||
pair = makeTerm <$> symbol Pair <*> children (Literal.KeyValue <$> statement <*> statement)
|
pair = makeTerm <$> symbol Pair <*> children (Literal.KeyValue <$> statement <*> statement)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user