json: Janky string
This commit is contained in:
parent
38e259fd13
commit
3ad023ef6a
1 changed files with 11 additions and 0 deletions
|
@ -198,3 +198,14 @@ array = do
|
||||||
let (types ** xs) = DList.fromList (first :: rest)
|
let (types ** xs) = DList.fromList (first :: rest)
|
||||||
pure $ VArray xs
|
pure $ VArray xs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```idris
|
||||||
|
string = do
|
||||||
|
_ <- parseExactChar '"'
|
||||||
|
-- TODO: Handle control characters properly
|
||||||
|
e1 <- parseError "Expected non-quote, got quote"
|
||||||
|
e2 <- parseError "End of input"
|
||||||
|
contents <- parseString . many $ parseCharE (not . (== '"')) (\_ => e1) e2
|
||||||
|
_ <- parseExactChar '"'
|
||||||
|
pure $ VString contents
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue