Compare commits
13 commits
2111e20f33
...
e3d563e6a3
Author | SHA1 | Date | |
---|---|---|---|
e3d563e6a3 | |||
894b0bcbf9 | |||
06e9c09eab | |||
e74fe68e32 | |||
6be2b5372e | |||
2775429bf3 | |||
e871a91fb8 | |||
fbb5fc09be | |||
cd4d737434 | |||
03b06a6944 | |||
dd0c642cd0 | |||
c3a28d469e | |||
0f6da0b952 |
2 changed files with 0 additions and 29 deletions
|
@ -238,7 +238,6 @@ parseTheseChars cs = do
|
||||||
Attempt to parse an exact string
|
Attempt to parse an exact string
|
||||||
|
|
||||||
```idris
|
```idris
|
||||||
export
|
|
||||||
exactString : String -> Parser String
|
exactString : String -> Parser String
|
||||||
exactString str with (asList str)
|
exactString str with (asList str)
|
||||||
exactString "" | [] = pure ""
|
exactString "" | [] = pure ""
|
||||||
|
|
|
@ -209,31 +209,3 @@ string = do
|
||||||
_ <- parseExactChar '"'
|
_ <- parseExactChar '"'
|
||||||
pure $ VString contents
|
pure $ VString contents
|
||||||
```
|
```
|
||||||
|
|
||||||
```idris
|
|
||||||
number = do
|
|
||||||
d <- double
|
|
||||||
pure $ VNumber d
|
|
||||||
```
|
|
||||||
|
|
||||||
```idris
|
|
||||||
bool = do
|
|
||||||
oneOfE
|
|
||||||
(throwParseError "Expected Bool")
|
|
||||||
(the (List _) [true, false])
|
|
||||||
where
|
|
||||||
true : Parser (JSONValue TBool)
|
|
||||||
true = do
|
|
||||||
_ <- exactString "true"
|
|
||||||
pure $ VBool True
|
|
||||||
false : Parser (JSONValue TBool)
|
|
||||||
false = do
|
|
||||||
_ <- exactString "false"
|
|
||||||
pure $ VBool False
|
|
||||||
```
|
|
||||||
|
|
||||||
```idris
|
|
||||||
null = do
|
|
||||||
_ <- exactString "null"
|
|
||||||
pure VNull
|
|
||||||
```
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue