-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
4 changed files
with
199 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
generators-tokdl = ./tokdl.nix; | ||
generators-toron = ./toron.nix; | ||
generators-toscfg-empty = ./toscfg-empty.nix; | ||
generators-toscfg-example = ./toscfg-example.nix; | ||
} |
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,71 @@ | ||
[ | ||
{ | ||
byte: b'0', | ||
float_exp: -1.0e-16, | ||
float_frac: .1, | ||
float_int: 1000, | ||
float_std: 1000.000000, | ||
float_suffix: -.1f64, | ||
integer: 0, | ||
integer_suffix: i8, | ||
unsigned_binary: 0b10, | ||
unsigned_decimal: 10, | ||
unsigned_hexadecimal: 0x10, | ||
unsigned_octal: 0o10 | ||
}, | ||
{ | ||
byte_string_raw: br##"Hello, World!"##, | ||
byte_string_std: b"Hello, World!", | ||
string_escape_ascii: "\'", | ||
string_escape_byte: "\x0A", | ||
string_escape_unicode: "\u{0A0A}", | ||
string_raw: r##"This is a "raw string". | ||
It can contain quotations or backslashes (\)!"##, | ||
string_std: "Hello, World!" | ||
}, | ||
{ | ||
char: 'a' | ||
}, | ||
{ | ||
boolean: true | ||
}, | ||
{ | ||
option_none: None, | ||
option_some: Some(10) | ||
}, | ||
{ | ||
list: [ | ||
1, | ||
2, | ||
3 | ||
] | ||
}, | ||
{ | ||
map: { | ||
a: 1, | ||
b: 2, | ||
c: 3 | ||
} | ||
}, | ||
{ | ||
tuple: ( | ||
1, | ||
2, | ||
3 | ||
) | ||
}, | ||
{ | ||
tuple_struct: ( | ||
1, | ||
2, | ||
3 | ||
), | ||
tuple_struct_ident: MyTupleStruct( | ||
1, | ||
2, | ||
3 | ||
), | ||
unit_struct: (), | ||
unit_struct_ident: MyUnitStruct | ||
} | ||
] |
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,77 @@ | ||
{ config, lib, ... }: | ||
|
||
{ | ||
home.file."toron-result.txt".text = lib.hm.generators.toRON { } [ | ||
# numbers | ||
{ | ||
byte = f: "b'0'"; | ||
# while nix supports scientific notation, it will convert -1.0e-16 to -0.000000 | ||
float_exp = f: "-1.0e-16"; | ||
# while nix supports fractional notation, nix fmt will complain about .1 | ||
float_frac = f: ".1"; | ||
float_int = 1000; | ||
float_std = 1000.0; | ||
float_suffix = f: "-.1f64"; | ||
integer = 0; | ||
integer_suffix = f: "i8"; | ||
unsigned_binary = f: "0b10"; | ||
unsigned_decimal = 10; | ||
unsigned_hexadecimal = f: "0x10"; | ||
unsigned_octal = f: "0o10"; | ||
} | ||
# strings | ||
{ | ||
byte_string_raw = f: ''br##"Hello, World!"##''; | ||
byte_string_std = f: ''b"Hello, World!"''; | ||
string_escape_ascii = "\\'"; | ||
string_escape_byte = "\\x0A"; | ||
string_escape_unicode = "\\u{0A0A}"; | ||
string_raw = f: '' | ||
r##"This is a "raw string". | ||
It can contain quotations or backslashes (\)!"##''; | ||
string_std = "Hello, World!"; | ||
} | ||
# char | ||
{ | ||
char = f: "'a'"; | ||
} | ||
# boolean | ||
{ | ||
boolean = true; | ||
} | ||
# option | ||
{ | ||
option_none = f: "None"; | ||
option_some = f: "Some(10)"; | ||
} | ||
# list | ||
{ | ||
list = [ 1 2 3 ]; | ||
} | ||
# map | ||
{ | ||
map = { | ||
a = 1; | ||
b = 2; | ||
c = 3; | ||
}; | ||
} | ||
# tuple | ||
{ | ||
tuple = f: [ 1 2 3 ]; | ||
} | ||
# struct | ||
{ | ||
tuple_struct = f: [ 1 2 3 ]; | ||
tuple_struct_ident = f: [ 1 2 3 ]; | ||
unit_struct = f: "()"; | ||
unit_struct_ident = f: "MyUnitStruct"; | ||
} | ||
]; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/toron-result.txt \ | ||
${./toron-result.txt} | ||
''; | ||
} |