1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 22:01:46 +03:00

Duplicate Symbol

This commit is contained in:
Timothy Clem 2017-07-06 09:44:31 -07:00
parent 0aa0c614b7
commit 83642f15e6

View File

@ -133,15 +133,12 @@ literal =
<|> makeTerm <$> symbol Grammar.False <*> (Literal.false <$ source)
<|> makeTerm <$> symbol Grammar.Integer <*> (Literal.Integer <$> source)
<|> makeTerm <$> symbol Grammar.Nil <*> (Literal.Null <$ source)
<|> makeTerm <$> symbol Symbol <*> (Literal.Symbol <$> source)
-- TODO: Do we want to represent the difference between .. and ...
<|> makeTerm <$> symbol Range <*> children (Literal.Range <$> statement <*> statement)
<|> makeTerm <$> symbol Array <*> children (Literal.Array <$> many statement)
<|> makeTerm <$> symbol Hash <*> children (Literal.Hash <$> many pairs)
-- TODO: Give subshell it's own literal and allow interpolation
<|> makeTerm <$> symbol Subshell <*> (Literal.TextElement <$> source)
-- TODO: Handle interpolation
<|> makeTerm <$> symbol Symbol <*> (Literal.Symbol <$> source)
<|> makeTerm <$> symbol Integer <*> (Literal.Integer <$> source)
<|> makeTerm <$> symbol Float <*> (Literal.Float <$> source)
-- TODO: Handle interpolation
@ -150,6 +147,8 @@ literal =
<|> makeTerm <$> symbol ChainedString <*> children (Literal.TextElement . mconcat <$> many (symbol String *> source))
-- TODO: Handle interpolation, dedicated literal?
<|> makeTerm <$> symbol Regex <*> (Literal.TextElement <$> source)
-- TODO: Handle interpolation
<|> makeTerm <$> symbol Symbol <*> (Literal.Symbol <$> source)
where
pairs = makeTerm <$> symbol Pair <*> children (Literal.KeyValue <$> statement <*> statement)