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

account for new compilation

This commit is contained in:
Patrick Thomson 2019-10-09 12:58:56 -04:00
parent ae1430c6a2
commit cc572947c2

View File

@ -198,19 +198,19 @@ instance Compile Py.BooleanOperator
instance Compile Py.BreakStatement instance Compile Py.BreakStatement
instance Compile Py.Call where instance Compile Py.Call where
compileCC it@Py.Call compile it@Py.Call
{ function { function
, arguments = L1 Py.ArgumentList { extraChildren = args } , arguments = L1 Py.ArgumentList { extraChildren = args }
} cc = do } cc = do
func <- compileCC function cc func <- compile function cc
let compileArg = \case let compileArg = \case
L1 expr -> compileCC expr cc Prj expr -> compile (expr :: Py.Expression Span) cc
other -> fail ("Can't compile non-expression function argument: " <> show other) other -> fail ("Can't compile non-expression function argument: " <> show other)
-- Python function arguments are defined to evaluate left to right. -- Python function arguments are defined to evaluate left to right.
args <- traverse compileArg args args <- traverse compileArg args
locate it (func $$* args) locate it (func $$* args)
compileCC it _cc = fail ("can't compile Call node with generator expression: " <> show it) compile it _cc = fail ("can't compile Call node with generator expression: " <> show it)
instance Compile Py.ClassDefinition instance Compile Py.ClassDefinition
instance Compile Py.ComparisonOperator instance Compile Py.ComparisonOperator
@ -315,8 +315,8 @@ instance Compile Py.NonlocalStatement
instance Compile Py.NotOperator instance Compile Py.NotOperator
instance Compile Py.ParenthesizedExpression where instance Compile Py.ParenthesizedExpression where
compileCC it@Py.ParenthesizedExpression { extraChildren } cc compile it@Py.ParenthesizedExpression { extraChildren } cc
= compileCC extraChildren cc >>= locate it = compile extraChildren cc >>= locate it
instance Compile Py.PassStatement where instance Compile Py.PassStatement where
compile it@Py.PassStatement {} _ = locate it $ Core.unit compile it@Py.PassStatement {} _ = locate it $ Core.unit