Add location information to list values
This commit is contained in:
@ -263,7 +263,7 @@ data Value
|
||||
| Boolean Bool
|
||||
| Null
|
||||
| Enum Name
|
||||
| List [Value]
|
||||
| List [Node Value]
|
||||
| Object [ObjectField Value]
|
||||
deriving Eq
|
||||
|
||||
@ -287,7 +287,7 @@ data ConstValue
|
||||
| ConstBoolean Bool
|
||||
| ConstNull
|
||||
| ConstEnum Name
|
||||
| ConstList [ConstValue]
|
||||
| ConstList [Node ConstValue]
|
||||
| ConstObject [ObjectField ConstValue]
|
||||
deriving Eq
|
||||
|
||||
|
@ -219,7 +219,7 @@ fromConstValue (Full.ConstBoolean x) = Full.Boolean x
|
||||
fromConstValue Full.ConstNull = Full.Null
|
||||
fromConstValue (Full.ConstString string) = Full.String string
|
||||
fromConstValue (Full.ConstEnum x) = Full.Enum x
|
||||
fromConstValue (Full.ConstList x) = Full.List $ fromConstValue <$> x
|
||||
fromConstValue (Full.ConstList x) = Full.List $ fmap fromConstValue <$> x
|
||||
fromConstValue (Full.ConstObject x) = Full.Object $ fromConstObjectField <$> x
|
||||
where
|
||||
fromConstObjectField Full.ObjectField{value = value', ..} =
|
||||
@ -266,8 +266,8 @@ stringValue (Pretty indentation) string =
|
||||
= Builder.fromLazyText (indent (indentation + 1))
|
||||
<> line' <> newline <> acc
|
||||
|
||||
listValue :: Formatter -> [Full.Value] -> Lazy.Text
|
||||
listValue formatter = bracketsCommas formatter $ value formatter
|
||||
listValue :: Formatter -> [Full.Node Full.Value] -> Lazy.Text
|
||||
listValue formatter = bracketsCommas formatter $ value formatter . Full.node
|
||||
|
||||
objectValue :: Formatter -> [Full.ObjectField Full.Value] -> Lazy.Text
|
||||
objectValue formatter = intercalate $ objectField formatter
|
||||
|
@ -450,7 +450,7 @@ value = Full.Variable <$> variable
|
||||
<|> Full.Null <$ nullValue
|
||||
<|> Full.String <$> stringValue
|
||||
<|> Full.Enum <$> try enumValue
|
||||
<|> Full.List <$> brackets (some value)
|
||||
<|> Full.List <$> brackets (some $ valueNode value)
|
||||
<|> Full.Object <$> braces (some $ objectField $ valueNode value)
|
||||
<?> "Value"
|
||||
|
||||
@ -461,7 +461,7 @@ constValue = Full.ConstFloat <$> try float
|
||||
<|> Full.ConstNull <$ nullValue
|
||||
<|> Full.ConstString <$> stringValue
|
||||
<|> Full.ConstEnum <$> try enumValue
|
||||
<|> Full.ConstList <$> brackets (many constValue)
|
||||
<|> Full.ConstList <$> brackets (many $ valueNode constValue)
|
||||
<|> Full.ConstObject <$> braces (many $ objectField $ valueNode constValue)
|
||||
<?> "Value"
|
||||
|
||||
|
Reference in New Issue
Block a user