1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Revert "Don't wrap a VarAssignment in a VarDecl"

This reverts commit 2b39a7cc0576675f0104f67a00df799b6f9ef970.
This commit is contained in:
joshvera 2017-01-09 18:07:02 -05:00
parent cbb31dd42a
commit 531524f29c

View File

@ -163,11 +163,8 @@ termConstructor source sourceSpan name range children _ = case name of
assignments' <- sequenceA $ zipWith (\id expr ->
withCategory VarAssignment $ S.VarAssignment id expr) (toList $ unwrap idList) (toList $ unwrap expressionList)
withDefaultInfo (S.Indexed assignments')
[idList] | category (extract idList) == VarAssignment -> do
withCategory ExpressionStatements (S.Indexed [idList])
[idList] -> do
varDecls <- mapM (withDefaultInfo . S.VarDecl) (toList $ unwrap idList)
withDefaultInfo (S.Indexed varDecls)
withDefaultInfo (S.Indexed [idList])
rest -> withCategory Error (S.Error rest)
withRanges originalRange category' terms syntax = do
@ -221,5 +218,4 @@ categoryForGoName = \case
"map_type" -> DictionaryTy
"array_type" -> ArrayTy
"implicit_length_array_type" -> ArrayTy
"const_declaration" -> VarDecl
s -> Other (toS s)