-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
181 additions
and
6 deletions.
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
sail_doc/ | ||
sail_config/ | ||
sail_schema/ | ||
lib_sail_doc/ | ||
module_sail_doc/ | ||
|
||
|
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
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
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,5 @@ | ||
{ | ||
"some" : { | ||
"integer" : 72 | ||
} | ||
} |
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 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
val example : unit -> unit | ||
|
||
function example() = { | ||
let n : {32, 64} = config some.integer; | ||
} |
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,11 @@ | ||
{ | ||
"some" : { | ||
"json_struct" : { | ||
"field1" : 3287589457, | ||
"field2" : "A string value" | ||
}, | ||
"json_union" : { | ||
"Constructor2" : "Another string value" | ||
} | ||
} | ||
} |
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,30 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
struct my_struct = { | ||
field1 : int, | ||
field2 : string, | ||
} | ||
|
||
val example1 : unit -> unit | ||
|
||
function example1() = { | ||
let v : my_struct = config some.json_struct; | ||
print_endline(v.field2); | ||
} | ||
|
||
union my_union = { | ||
Constructor1 : int, | ||
Constructor2 : string, | ||
} | ||
|
||
val example2 : unit -> unit | ||
|
||
function example2() = { | ||
let v : my_union = config some.json_union; | ||
match v { | ||
Constructor1(n) => print_int("Got integer ", n), | ||
Constructor2(message) => print_endline(message), | ||
} | ||
} |
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
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