1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Assign pass statements

This commit is contained in:
Rick Winfrey 2017-06-07 13:01:24 -07:00
parent bf80b85637
commit 23ae8bfafb

View File

@ -53,6 +53,7 @@ type Syntax' =
, Literal.Tuple
, Redirect
, Statement.Assignment
, Statement.Continue
, Statement.If
, Statement.Return
, Statement.Throw
@ -98,6 +99,7 @@ statement = assertStatement
<|> identifier
<|> import'
<|> importFrom
<|> passStatement
<|> printStatement
<|> raiseStatement
<|> returnStatement
@ -292,6 +294,9 @@ ifStatement = makeTerm <$> symbol IfStatement <*> children (Statement.If <$> exp
optionalElse = fromMaybe <$> emptyTerm <*> optional elseClause
makeElif (loc, makeIf) rest = makeTerm loc (makeIf rest)
passStatement :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
passStatement = makeTerm <$> symbol PassStatement <*> (Statement.Continue <$> (makeTerm <$> location <*> (Syntax.Identifier <$> source)))
memberAccess :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
memberAccess = makeTerm <$> symbol Attribute <*> children (Expression.MemberAccess <$> expression <*> expression)