mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +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))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(Identifier)))
|
||||
|
@ -2,16 +2,21 @@
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Empty)
|
||||
(
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier))))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)
|
||||
(Identifier)))
|
||||
|
@ -1,22 +1,32 @@
|
||||
(Program
|
||||
(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{-(Let
|
||||
{-(Identifier)-}
|
||||
(
|
||||
{+(Import
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+}
|
||||
{+(Empty)+})+}
|
||||
(Import
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))
|
||||
{-(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-})
|
||||
(Import
|
||||
(Let
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier))
|
||||
(Empty))
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}))
|
||||
{+(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+}
|
||||
{-(
|
||||
{-(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-}
|
||||
{-(Import
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-}
|
||||
{-(Empty)-})-})-})
|
||||
|
@ -1,22 +1,32 @@
|
||||
(Program
|
||||
(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-})-}
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
{+(Let
|
||||
{+(Identifier)+}
|
||||
(
|
||||
{-(Import
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-}
|
||||
{-(Empty)-})-}
|
||||
(Import
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))
|
||||
{+(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+})
|
||||
(Import
|
||||
(Let
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ScopeResolution
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier))
|
||||
(Empty))
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+})+}))
|
||||
{+(
|
||||
{+(Import
|
||||
{+(ScopeResolution
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+})+}
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+})+}
|
||||
{+(Import
|
||||
{+(Identifier)+}
|
||||
{+(Empty)+}
|
||||
{+(Empty)+})+})+}
|
||||
{-(Import
|
||||
{-(ScopeResolution
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-})-}
|
||||
{-(Identifier)-}
|
||||
{-(Empty)-})-})
|
||||
|
22
test/fixtures/python/import-statement.parseA.txt
vendored
22
test/fixtures/python/import-statement.parseA.txt
vendored
@ -1,18 +1,22 @@
|
||||
(Program
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Let
|
||||
(
|
||||
(Import
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(Empty)))
|
||||
(Import
|
||||
(Let
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
(
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Empty))
|
||||
(ScopeResolution
|
||||
(Identifier))))
|
||||
(Import
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty))))
|
||||
|
25
test/fixtures/python/import-statement.parseB.txt
vendored
25
test/fixtures/python/import-statement.parseB.txt
vendored
@ -1,13 +1,16 @@
|
||||
(Program
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier))
|
||||
(ScopeResolution
|
||||
(Identifier)))
|
||||
(Import
|
||||
(Let
|
||||
(
|
||||
(Import
|
||||
(Identifier)
|
||||
(ScopeResolution
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Empty))))
|
||||
(Empty)
|
||||
(Empty))
|
||||
(Import
|
||||
(Identifier)
|
||||
(Empty)
|
||||
(Empty)))
|
||||
(Import
|
||||
(ScopeResolution
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Empty)))
|
||||
|
Loading…
Reference in New Issue
Block a user