1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 18:36:27 +03:00

Merge branch 'master' into alephd-improvements

This commit is contained in:
Timothy Clem 2019-03-01 15:18:58 -08:00 committed by GitHub
commit a558067129
3 changed files with 5 additions and 5 deletions
src/Language
vendor

View File

@ -110,7 +110,7 @@ binaryOperator = makeTerm' <$> symbol BinaryOperator <*> children (infixTerm exp
])
identifier :: Assignment Term
identifier = makeTerm <$> (symbol Identifier <|> symbol Identifier' <|> symbol DottedName) <*> (Syntax.Identifier . name <$> source)
identifier = makeTerm <$> (symbol Identifier <|> symbol DottedName) <*> (Syntax.Identifier . name <$> source)
integer :: Assignment Term
integer = makeTerm <$> symbol Integer <*> (Literal.Integer <$> source)

View File

@ -375,7 +375,7 @@ yield :: Assignment Term
yield = makeTerm <$> symbol Yield <*> (Statement.Yield <$> children (term ( expression <|> emptyTerm )))
identifier :: Assignment Term
identifier = makeTerm <$> (symbol Identifier <|> symbol Identifier' <|> symbol DottedName) <*> (Syntax.Identifier . name <$> source)
identifier = makeTerm <$> (symbol Identifier <|> symbol DottedName) <*> (Syntax.Identifier . name <$> source)
set :: Assignment Term
set = makeTerm <$> symbol Set <*> children (Literal.Set <$> manyTerm expression)
@ -414,7 +414,7 @@ import' = makeTerm'' <$> symbol ImportStatement <*> children (manyTerm (aliase
-- `import a`
plainImport = makeTerm <$> symbol DottedName <*> children (Python.Syntax.QualifiedImport <$> NonEmpty.some1 identifier)
-- `from a import foo `
importSymbol = makeNameAliasPair <$> (symbol Identifier <|> symbol Identifier' <|> symbol DottedName) <*> (mkIdentifier <$> location <*> source)
importSymbol = makeNameAliasPair <$> (symbol Identifier <|> symbol DottedName) <*> (mkIdentifier <$> location <*> source)
-- `from a import foo as bar`
aliasImportSymbol = makeTerm <$> symbol AliasedImport <*> children (Python.Syntax.Alias <$> identifier <*> identifier)
-- `from a import *`
@ -424,7 +424,7 @@ import' = makeTerm'' <$> symbol ImportStatement <*> children (manyTerm (aliase
importDottedName = symbol DottedName *> children (qualifiedName <$> NonEmpty.some1 identifierSource)
importRelative = symbol RelativeImport *> children (relativeQualifiedName <$> importPrefix <*> ((symbol DottedName *> children (many identifierSource)) <|> pure []))
importPrefix = symbol ImportPrefix *> source
identifierSource = (symbol Identifier <|> symbol Identifier') *> source
identifierSource = symbol Identifier *> source
makeNameAliasPair location alias = makeTerm location (Python.Syntax.Alias alias alias)
mkIdentifier location source = makeTerm location (Syntax.Identifier (name source))

@ -1 +1 @@
Subproject commit de469907a0fcd4d522a880c985e533e7849ff8b5
Subproject commit 53dbe815fd85726484294833dfaece544d5f423d