mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Fix up Python tests for new structure of Import
This commit is contained in:
parent
9b3cc349d3
commit
ea5d7437d4
@ -169,9 +169,9 @@ expressionChoices =
|
||||
]
|
||||
|
||||
expressions :: Assignment
|
||||
expressions = mk <$> location <*> manyTerm expression
|
||||
where mk _ [child] = child
|
||||
mk location children = makeTerm location children
|
||||
expressions = makeTerm <$> location <*> manyTerm expression
|
||||
-- where mk _ [child] = child
|
||||
-- mk location children = makeTerm location children
|
||||
|
||||
expressionStatement :: Assignment
|
||||
expressionStatement = mk <$> symbol ExpressionStatement <*> children (someTerm expression)
|
||||
|
@ -1,22 +1,28 @@
|
||||
(Program
|
||||
(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+})
|
||||
(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+})
|
||||
(Import
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Empty)
|
||||
(
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Empty)
|
||||
(Identifier)))
|
||||
|
@ -1,22 +1,28 @@
|
||||
(Program
|
||||
(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+})
|
||||
(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-})
|
||||
(Import
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Empty)
|
||||
(
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Empty)
|
||||
(Identifier)))
|
||||
|
@ -2,16 +2,21 @@
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(Identifier)))
|
||||
|
@ -2,16 +2,21 @@
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(Identifier)))
|
||||
|
@ -1,22 +1,32 @@
|
||||
(Program
|
||||
(
|
||||
{+(Import
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+}
|
||||
{+(Empty)+})+}
|
||||
(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{-(Let
|
||||
{-(Identifier)-}
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))
|
||||
{-(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-})
|
||||
(Import
|
||||
(Let
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier))
|
||||
(Empty))
|
||||
{+(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+}
|
||||
{-(
|
||||
{-(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}))
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-}
|
||||
{-(Import
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-}
|
||||
{-(Empty)-})-})-})
|
||||
|
@ -1,22 +1,32 @@
|
||||
(Program
|
||||
(
|
||||
{-(Import
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-}
|
||||
{-(Empty)-})-}
|
||||
(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{+(Let
|
||||
{+(Identifier)+}
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))
|
||||
{+(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+})
|
||||
(Import
|
||||
(Let
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier))
|
||||
(Empty))
|
||||
{+(
|
||||
{+(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}))
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+}
|
||||
{+(Import
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+}
|
||||
{+(Empty)+})+})+}
|
||||
{-(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-})
|
||||
|
30
test/fixtures/python/import-statement.parseA.txt
vendored
30
test/fixtures/python/import-statement.parseA.txt
vendored
@ -1,18 +1,22 @@
|
||||
(Program
|
||||
(
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Let
|
||||
(Identifier)
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)))
|
||||
(Import
|
||||
(Let
|
||||
(Identifier)
|
||||
(ScopeResolution
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(Empty))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))))
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
(
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Empty))
|
||||
(Import
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))))
|
||||
|
17
test/fixtures/python/import-statement.parseB.txt
vendored
17
test/fixtures/python/import-statement.parseB.txt
vendored
@ -1,13 +1,16 @@
|
||||
(Program
|
||||
(
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Import
|
||||
(Let
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))
|
||||
(Import
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty)))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Empty))))
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
|
Loading…
Reference in New Issue
Block a user