-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config: Fix issue with boolean values in configuration
Improve support for large integers and ranges
- Loading branch information
Showing
14 changed files
with
115 additions
and
24 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
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
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 @@ | ||
Hello, World! |
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" : { | ||
"boolean" : true | ||
} | ||
} |
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 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
$iftarget c | ||
$c_in_main sail_config_set_file("config_bool.json"); | ||
$c_in_main_post sail_config_cleanup(); | ||
$else | ||
$option --config ../c/config_bool.json | ||
$endif | ||
|
||
val main : unit -> unit | ||
|
||
function main() = { | ||
if config some.boolean then { | ||
print_endline("Hello, World!") | ||
} | ||
} |
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,4 @@ | ||
x = 64 | ||
y = 0 | ||
z = 8392413984723472389546328576138756413875644375 | ||
w = 9999999999999999999999999999999999999999999999999999999 |
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,6 @@ | ||
{ | ||
"c1" : 64, | ||
"c2" : 0, | ||
"c3" : 8392413984723472389546328576138756413875644375, | ||
"c4" : 9999999999999999999999999999999999999999999999999999999 | ||
} |
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,23 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
$iftarget c | ||
$c_in_main sail_config_set_file("config_int.json"); | ||
$c_in_main_post sail_config_cleanup(); | ||
$else | ||
$option --config ../c/config_int.json | ||
$endif | ||
|
||
val main : unit -> unit | ||
|
||
function main() = { | ||
let x : range(0, 64) = config c1; | ||
print_int("x = ", x); | ||
let y : range(0, 1) = config c2; | ||
print_int("y = ", y); | ||
let z : int = config c3; | ||
print_int("z = ", z); | ||
let w : {'n, 'n >= 0. int('n)} = config c4; | ||
print_int("w = ", w); | ||
} |
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,7 +1,7 @@ | ||
{ | ||
"hello": { | ||
"world": "Hello, World!", | ||
"number": "13438537428731902344561435823034520154709854735643", | ||
"number": 13438537428731902344561435823034520154709854735643, | ||
"bits" : [true, false, false, false, false] | ||
} | ||
} |
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 @@ | ||
ok |
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,3 @@ | ||
{ | ||
"c1" : null | ||
} |
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,17 @@ | ||
default Order dec | ||
|
||
$include <prelude.sail> | ||
|
||
$iftarget c | ||
$c_in_main sail_config_set_file("config_unit.json"); | ||
$c_in_main_post sail_config_cleanup(); | ||
$else | ||
$option --config ../c/config_unit.json | ||
$endif | ||
|
||
val main : unit -> unit | ||
|
||
function main() = { | ||
let x : unit = config c1; | ||
print_endline("ok") | ||
} |