-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FFI definitions for
json
along with a JSON parser
- Loading branch information
Showing
9 changed files
with
671 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package: | ||
name: json | ||
dependencies: | ||
- prelude | ||
- arrays | ||
- functions | ||
- integers | ||
- maybe | ||
- either | ||
- tuples | ||
- foldable-traversable | ||
- gen | ||
- strings | ||
- unfoldable | ||
test: | ||
main: Test.JSON.Main | ||
dependencies: | ||
- assert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(library (JSON foreign) | ||
(export _null | ||
fromBoolean | ||
fromInt | ||
fromString | ||
fromJArray | ||
fromJObject | ||
printIndented) | ||
(import (chezscheme) | ||
(only (JSON.Internal foreign) json-stringify)) | ||
|
||
(define (coerce x) x) | ||
|
||
(define _null 'null) | ||
|
||
(define fromBoolean coerce) | ||
|
||
(define fromInt inexact) | ||
|
||
(define fromString coerce) | ||
|
||
(define fromJArray coerce) | ||
|
||
(define fromJObject coerce) | ||
|
||
(define print json-stringify) | ||
|
||
(define printIndented json-stringify) | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(library (JSON.Array foreign) | ||
(export singleton) | ||
(import (chezscheme) | ||
(prefix (purs runtime srfi :214) srfi:214:)) | ||
|
||
(define (singleton x) (srfi:214:flexvector x)) | ||
|
||
) | ||
|
Oops, something went wrong.