mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Merge remote-tracking branch 'origin/main' into walk-with-index
This commit is contained in:
commit
b54a37e4b0
40 changed files with 1088 additions and 215 deletions
|
@ -309,7 +309,7 @@ mod cli_run {
|
|||
|
||||
if !actual.ends_with(expected_ending) {
|
||||
panic!(
|
||||
"expected output to end with:\n{}\nbut instead got:\n{}\n stderr was:\n{}",
|
||||
"> expected output to end with:\n{}\n> but instead got:\n{}\n> stderr was:\n{}",
|
||||
expected_ending, actual, out.stderr
|
||||
);
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ mod cli_run {
|
|||
let mut custom_flags: Vec<&str> = Vec::new();
|
||||
|
||||
match executable_filename {
|
||||
"form" | "hello-gui" | "breakout" | "libhello" => {
|
||||
"form" | "hello-gui" | "breakout" | "libhello" | "inspect-gui" => {
|
||||
// Since these require things the build system often doesn't have
|
||||
// (e.g. GUIs open a window, Ruby needs ruby installed, WASM needs a browser)
|
||||
// we do `roc build` on them but don't run them.
|
||||
|
@ -938,6 +938,29 @@ mod cli_run {
|
|||
test_roc_expect("examples/parser/package", "ParserHttp.roc")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inspect_logging() {
|
||||
test_roc_app_slim(
|
||||
"examples",
|
||||
"inspect-logging.roc",
|
||||
"inspect-logging",
|
||||
r#"{people: [{firstName: "John", lastName: "Smith", age: 27, hasBeard: true, favoriteColor: Blue}, {firstName: "Debby", lastName: "Johnson", age: 47, hasBeard: false, favoriteColor: Green}, {firstName: "Jane", lastName: "Doe", age: 33, hasBeard: false, favoriteColor: (RGB (255, 255, 0))}], friends: [{2}, {2}, {0, 1}]}
|
||||
"#,
|
||||
UseValgrind::Yes,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inspect_gui() {
|
||||
test_roc_app_slim(
|
||||
"examples",
|
||||
"inspect-gui.roc",
|
||||
"inspect-gui",
|
||||
"",
|
||||
UseValgrind::No,
|
||||
)
|
||||
}
|
||||
|
||||
// TODO not sure if this cfg should still be here: #[cfg(not(debug_assertions))]
|
||||
// this is for testing the benchmarks, to perform proper benchmarks see crates/cli/benches/README.md
|
||||
mod test_benchmarks {
|
||||
|
|
94
crates/compiler/builtins/roc/Inspect.roc
Normal file
94
crates/compiler/builtins/roc/Inspect.roc
Normal file
|
@ -0,0 +1,94 @@
|
|||
interface Inspect
|
||||
exposes [
|
||||
Inspect,
|
||||
Inspector,
|
||||
InspectFormatter,
|
||||
ElemWalker,
|
||||
KeyValWalker,
|
||||
inspect,
|
||||
init,
|
||||
list,
|
||||
set,
|
||||
dict,
|
||||
tag,
|
||||
tuple,
|
||||
record,
|
||||
bool,
|
||||
str,
|
||||
opaque,
|
||||
u8,
|
||||
i8,
|
||||
u16,
|
||||
i16,
|
||||
u32,
|
||||
i32,
|
||||
u64,
|
||||
i64,
|
||||
u128,
|
||||
i128,
|
||||
f32,
|
||||
f64,
|
||||
dec,
|
||||
custom,
|
||||
apply,
|
||||
toInspector,
|
||||
]
|
||||
imports [
|
||||
Bool.{ Bool },
|
||||
Num.{ U8, U16, U32, U64, U128, I8, I16, I32, I64, I128, F32, F64, Dec },
|
||||
List,
|
||||
Str,
|
||||
]
|
||||
|
||||
KeyValWalker state collection key val : collection, state, (state, key, val -> state) -> state
|
||||
ElemWalker state collection elem : collection, state, (state, elem -> state) -> state
|
||||
|
||||
InspectFormatter implements
|
||||
init : {} -> f where f implements InspectFormatter
|
||||
|
||||
tag : Str, List (Inspector f) -> Inspector f where f implements InspectFormatter
|
||||
tuple : List (Inspector f) -> Inspector f where f implements InspectFormatter
|
||||
record : List { key : Str, value : Inspector f } -> Inspector f where f implements InspectFormatter
|
||||
bool : Bool -> Inspector f where f implements InspectFormatter
|
||||
str : Str -> Inspector f where f implements InspectFormatter
|
||||
|
||||
list : list, ElemWalker state list elem, (elem -> Inspector f) -> Inspector f where f implements InspectFormatter
|
||||
set : set, ElemWalker state set elem, (elem -> Inspector f) -> Inspector f where f implements InspectFormatter
|
||||
dict : dict, KeyValWalker state dict key value, (key -> Inspector f), (value -> Inspector f) -> Inspector f where f implements InspectFormatter
|
||||
|
||||
# Note opaque is used for both opaque types and functions.
|
||||
# The auto deriver for functions probably could put the function type.
|
||||
# For regular opaque types, I think we can use the type name, though that may lead to some reflection related issues that still need to be discussed.
|
||||
# As a simple baseline, it can just use the exact words `opaque` and `function` for now.
|
||||
# In text, this would render as `<opaque>`, `<function>`, etc
|
||||
opaque : Str -> Inspector f where f implements InspectFormatter
|
||||
|
||||
u8 : U8 -> Inspector f where f implements InspectFormatter
|
||||
i8 : I8 -> Inspector f where f implements InspectFormatter
|
||||
u16 : U16 -> Inspector f where f implements InspectFormatter
|
||||
i16 : I16 -> Inspector f where f implements InspectFormatter
|
||||
u32 : U32 -> Inspector f where f implements InspectFormatter
|
||||
i32 : I32 -> Inspector f where f implements InspectFormatter
|
||||
u64 : U64 -> Inspector f where f implements InspectFormatter
|
||||
i64 : I64 -> Inspector f where f implements InspectFormatter
|
||||
u128 : U128 -> Inspector f where f implements InspectFormatter
|
||||
i128 : I128 -> Inspector f where f implements InspectFormatter
|
||||
f32 : F32 -> Inspector f where f implements InspectFormatter
|
||||
f64 : F64 -> Inspector f where f implements InspectFormatter
|
||||
dec : Dec -> Inspector f where f implements InspectFormatter
|
||||
|
||||
Inspector f := f -> f where f implements InspectFormatter
|
||||
|
||||
custom : (f -> f) -> Inspector f where f implements InspectFormatter
|
||||
custom = @Inspector
|
||||
|
||||
apply : Inspector f, f -> f where f implements InspectFormatter
|
||||
apply = \@Inspector fn, fmt -> fn fmt
|
||||
|
||||
Inspect implements
|
||||
toInspector : val -> Inspector f where val implements Inspect, f implements InspectFormatter
|
||||
|
||||
inspect : val -> f where val implements Inspect, f implements InspectFormatter
|
||||
inspect = \val ->
|
||||
(@Inspector valFn) = toInspector val
|
||||
valFn (init {})
|
|
@ -15,6 +15,7 @@ pub fn module_source(module_id: ModuleId) -> &'static str {
|
|||
ModuleId::ENCODE => ENCODE,
|
||||
ModuleId::DECODE => DECODE,
|
||||
ModuleId::HASH => HASH,
|
||||
ModuleId::INSPECT => INSPECT,
|
||||
ModuleId::JSON => JSON,
|
||||
_ => internal_error!(
|
||||
"ModuleId {:?} is not part of the standard library",
|
||||
|
@ -34,4 +35,5 @@ const BOOL: &str = include_str!("../roc/Bool.roc");
|
|||
const ENCODE: &str = include_str!("../roc/Encode.roc");
|
||||
const DECODE: &str = include_str!("../roc/Decode.roc");
|
||||
const HASH: &str = include_str!("../roc/Hash.roc");
|
||||
const INSPECT: &str = include_str!("../roc/Inspect.roc");
|
||||
const JSON: &str = include_str!("../roc/TotallyNotJson.roc");
|
||||
|
|
|
@ -25,6 +25,7 @@ const MODULES: &[(ModuleId, &str)] = &[
|
|||
(ModuleId::ENCODE, "Encode.roc"),
|
||||
(ModuleId::DECODE, "Decode.roc"),
|
||||
(ModuleId::HASH, "Hash.roc"),
|
||||
(ModuleId::INSPECT, "Inspect.roc"),
|
||||
(ModuleId::JSON, "TotallyNotJson.roc"),
|
||||
];
|
||||
|
||||
|
|
|
@ -212,6 +212,7 @@ const BOX: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Box.dat")) as &[_];
|
|||
const ENCODE: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Encode.dat")) as &[_];
|
||||
const DECODE: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Decode.dat")) as &[_];
|
||||
const HASH: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Hash.dat")) as &[_];
|
||||
const INSPECT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Inspect.dat")) as &[_];
|
||||
|
||||
fn deserialize_help(bytes: &[u8]) -> TypeState {
|
||||
let (state, _offset) = TypeState::deserialize(bytes);
|
||||
|
@ -242,6 +243,7 @@ fn read_cached_types() -> MutMap<ModuleId, TypeState> {
|
|||
output.insert(ModuleId::DECODE, deserialize_help(DECODE));
|
||||
|
||||
output.insert(ModuleId::HASH, deserialize_help(HASH));
|
||||
output.insert(ModuleId::INSPECT, deserialize_help(INSPECT));
|
||||
}
|
||||
|
||||
output
|
||||
|
|
|
@ -2290,6 +2290,7 @@ fn update<'a>(
|
|||
extend_header_with_builtin(header, ModuleId::ENCODE);
|
||||
extend_header_with_builtin(header, ModuleId::DECODE);
|
||||
extend_header_with_builtin(header, ModuleId::HASH);
|
||||
extend_header_with_builtin(header, ModuleId::INSPECT);
|
||||
}
|
||||
|
||||
state
|
||||
|
@ -3494,6 +3495,7 @@ fn load_module<'a>(
|
|||
"Encode", ModuleId::ENCODE
|
||||
"Decode", ModuleId::DECODE
|
||||
"Hash", ModuleId::HASH
|
||||
"Inspect", ModuleId::INSPECT
|
||||
"TotallyNotJson", ModuleId::JSON
|
||||
}
|
||||
|
||||
|
@ -5257,6 +5259,7 @@ fn canonicalize_and_constrain<'a>(
|
|||
| ModuleId::DICT
|
||||
| ModuleId::SET
|
||||
| ModuleId::HASH
|
||||
| ModuleId::INSPECT
|
||||
);
|
||||
|
||||
if !name.is_builtin() || should_include_builtin {
|
||||
|
|
|
@ -25,5 +25,6 @@ pub const BUILTIN_MODULES: &[(ModuleId, &str)] = &[
|
|||
(ModuleId::ENCODE, "Encode"),
|
||||
(ModuleId::DECODE, "Decode"),
|
||||
(ModuleId::HASH, "Hash"),
|
||||
(ModuleId::INSPECT, "Inspect"),
|
||||
(ModuleId::JSON, "TotallyNotJson"),
|
||||
];
|
||||
|
|
|
@ -85,6 +85,7 @@ impl Default for ModuleCache<'_> {
|
|||
ENCODE,
|
||||
DECODE,
|
||||
HASH,
|
||||
INSPECT,
|
||||
JSON,
|
||||
}
|
||||
|
||||
|
|
|
@ -940,8 +940,8 @@ fn issue_2863_module_type_does_not_exist() {
|
|||
Did you mean one of these?
|
||||
|
||||
Decoding
|
||||
Result
|
||||
Dict
|
||||
Result
|
||||
DecodeError
|
||||
"
|
||||
)
|
||||
|
|
|
@ -113,6 +113,7 @@ impl ModuleName {
|
|||
pub const ENCODE: &'static str = "Encode";
|
||||
pub const DECODE: &'static str = "Decode";
|
||||
pub const HASH: &'static str = "Hash";
|
||||
pub const INSPECT: &'static str = "Inspect";
|
||||
pub const JSON: &'static str = "TotallyNotJson";
|
||||
|
||||
pub fn as_str(&self) -> &str {
|
||||
|
|
|
@ -1589,9 +1589,49 @@ define_builtins! {
|
|||
20 HASH_HASH_LIST: "hashList"
|
||||
21 HASH_HASH_UNORDERED: "hashUnordered"
|
||||
}
|
||||
14 JSON: "TotallyNotJson" => {
|
||||
14 INSPECT: "Inspect" => {
|
||||
0 INSPECT_INSPECT_ABILITY: "Inspect" exposed_type=true
|
||||
1 INSPECT_INSPECTOR: "Inspector" exposed_type=true
|
||||
2 INSPECT_INSPECT_FORMATTER: "InspectFormatter" exposed_type=true
|
||||
3 INSPECT_ELEM_WALKER: "ElemWalker" exposed_type=true
|
||||
4 INSPECT_KEY_VAL_WALKER: "KeyValWalker" exposed_type=true
|
||||
5 INSPECT_INSPECT: "inspect"
|
||||
6 INSPECT_INIT: "init"
|
||||
7 INSPECT_LIST: "list"
|
||||
8 INSPECT_SET: "set"
|
||||
9 INSPECT_DICT: "dict"
|
||||
10 INSPECT_TAG: "tag"
|
||||
11 INSPECT_TUPLE: "tuple"
|
||||
12 INSPECT_RECORD: "record"
|
||||
13 INSPECT_BOOL: "bool"
|
||||
14 INSPECT_STR: "str"
|
||||
15 INSPECT_OPAQUE: "opaque"
|
||||
16 INSPECT_U8: "u8"
|
||||
17 INSPECT_I8: "i8"
|
||||
18 INSPECT_U16: "u16"
|
||||
19 INSPECT_I16: "i16"
|
||||
20 INSPECT_U32: "u32"
|
||||
21 INSPECT_I32: "i32"
|
||||
22 INSPECT_U64: "u64"
|
||||
23 INSPECT_I64: "i64"
|
||||
24 INSPECT_U128: "u128"
|
||||
25 INSPECT_I128: "i128"
|
||||
26 INSPECT_F32: "f32"
|
||||
27 INSPECT_F64: "f64"
|
||||
28 INSPECT_DEC: "dec"
|
||||
29 INSPECT_CUSTOM: "custom"
|
||||
30 INSPECT_APPLY: "apply"
|
||||
31 INSPECT_TO_INSPECTOR: "toInspector"
|
||||
}
|
||||
15 JSON: "TotallyNotJson" => {
|
||||
0 JSON_JSON: "TotallyNotJson"
|
||||
1 JSON_FIELD_NAME_MAPPING: "FieldNameMapping"
|
||||
2 JSON_NUMBER_STATE: "NumberState"
|
||||
3 JSON_STRING_STATE: "StringState"
|
||||
4 JSON_ARRAY_OPENING_STATE: "ArrayOpeningState"
|
||||
5 JSON_ARRAY_CLOSING_STATE: "ArrayClosingState"
|
||||
6 JSON_OBJECT_STATE: "ObjectState"
|
||||
}
|
||||
|
||||
num_modules: 15 // Keep this count up to date by hand! (TODO: see the mut_map! macro for how we could determine this count correctly in the macro)
|
||||
num_modules: 16 // Keep this count up to date by hand! (TODO: see the mut_map! macro for how we could determine this count correctly in the macro)
|
||||
}
|
||||
|
|
|
@ -3965,7 +3965,7 @@ fn build_specialized_proc<'a>(
|
|||
}
|
||||
}
|
||||
Ordering::Less => panic!(
|
||||
"more argument symbols than arguments (according to the layout) for {proc_name:?}"
|
||||
"more argument symbols than arguments (according to the layout) for {proc_name:?}. Pattern symbols: {:?}\n\nPattern layouts: {:?}", pattern_symbols, pattern_layouts_len,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -580,7 +580,9 @@ impl<'a> RawFunctionLayout<'a> {
|
|||
cacheable(Ok(Self::ZeroArgumentThunk(Layout::usize(env.target_info))))
|
||||
}
|
||||
|
||||
Alias(symbol, _, _, _) if symbol.is_builtin() => {
|
||||
Alias(Symbol::INSPECT_ELEM_WALKER | Symbol::INSPECT_KEY_VAL_WALKER, _, var, _) => Self::from_var(env, var),
|
||||
|
||||
Alias(symbol, _, var, _) if symbol.is_builtin() => {
|
||||
Layout::new_help(env, var, content).then(Self::ZeroArgumentThunk)
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ procedure List.66 (#Attr.2, #Attr.3):
|
|||
let List.545 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
ret List.545;
|
||||
|
||||
procedure List.86 (#Derived_gen.11, #Derived_gen.12, #Derived_gen.13, #Derived_gen.14, #Derived_gen.15):
|
||||
procedure List.86 (#Derived_gen.13, #Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17):
|
||||
joinpoint List.538 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.540 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.540 then
|
||||
|
@ -25,7 +25,7 @@ procedure List.86 (#Derived_gen.11, #Derived_gen.12, #Derived_gen.13, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.538 #Derived_gen.11 #Derived_gen.12 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15;
|
||||
jump List.538 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17;
|
||||
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Num.293 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
|
||||
|
@ -37,8 +37,8 @@ procedure Num.51 (#Attr.2, #Attr.3):
|
|||
|
||||
procedure Test.10 (Test.66, #Attr.12):
|
||||
let Test.9 : {} = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
let #Derived_gen.18 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.18 then
|
||||
let #Derived_gen.20 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.20 then
|
||||
free #Attr.12;
|
||||
ret Test.9;
|
||||
else
|
||||
|
@ -52,7 +52,7 @@ procedure Test.10 (Test.66, #Attr.12):
|
|||
procedure Test.14 (Test.45, #Attr.12):
|
||||
let Test.13 : {{}, []} = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
||||
let Test.12 : [<r>C {}, C *self {{}, []}] = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
joinpoint #Derived_gen.19:
|
||||
joinpoint #Derived_gen.18:
|
||||
let Test.50 : {} = Struct {};
|
||||
let Test.51 : U8 = GetTagId Test.12;
|
||||
joinpoint Test.52 Test.15:
|
||||
|
@ -79,14 +79,14 @@ procedure Test.14 (Test.45, #Attr.12):
|
|||
jump Test.52 Test.53;
|
||||
|
||||
in
|
||||
let #Derived_gen.20 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.20 then
|
||||
let #Derived_gen.19 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.19 then
|
||||
free #Attr.12;
|
||||
jump #Derived_gen.19;
|
||||
jump #Derived_gen.18;
|
||||
else
|
||||
inc Test.12;
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.19;
|
||||
jump #Derived_gen.18;
|
||||
|
||||
procedure Test.20 (Test.21, Test.18):
|
||||
let Test.23 : [C {}, C []] = CallByName Test.32 Test.21 Test.18;
|
||||
|
|
|
@ -16,7 +16,7 @@ procedure List.66 (#Attr.2, #Attr.3):
|
|||
let List.545 : Int1 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
ret List.545;
|
||||
|
||||
procedure List.86 (#Derived_gen.5, #Derived_gen.6, #Derived_gen.7, #Derived_gen.8, #Derived_gen.9):
|
||||
procedure List.86 (#Derived_gen.3, #Derived_gen.4, #Derived_gen.5, #Derived_gen.6, #Derived_gen.7):
|
||||
joinpoint List.538 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.540 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.540 then
|
||||
|
@ -29,7 +29,7 @@ procedure List.86 (#Derived_gen.5, #Derived_gen.6, #Derived_gen.7, #Derived_gen.
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.538 #Derived_gen.5 #Derived_gen.6 #Derived_gen.7 #Derived_gen.8 #Derived_gen.9;
|
||||
jump List.538 #Derived_gen.3 #Derived_gen.4 #Derived_gen.5 #Derived_gen.6 #Derived_gen.7;
|
||||
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Num.293 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
|
||||
|
@ -46,11 +46,11 @@ procedure Str.3 (#Attr.2, #Attr.3):
|
|||
procedure Test.1 (Test.5):
|
||||
ret Test.5;
|
||||
|
||||
procedure Test.11 (#Derived_gen.10, #Derived_gen.11):
|
||||
procedure Test.11 (#Derived_gen.8, #Derived_gen.9):
|
||||
joinpoint Test.27 Test.12 #Attr.12:
|
||||
let Test.8 : Int1 = UnionAtIndex (Id 2) (Index 1) #Attr.12;
|
||||
let Test.7 : [<rnw><null>, C *self Int1, C *self Int1] = UnionAtIndex (Id 2) (Index 0) #Attr.12;
|
||||
joinpoint #Derived_gen.14:
|
||||
joinpoint #Derived_gen.12:
|
||||
joinpoint Test.31 Test.29:
|
||||
let Test.30 : U8 = GetTagId Test.7;
|
||||
switch Test.30:
|
||||
|
@ -77,16 +77,16 @@ procedure Test.11 (#Derived_gen.10, #Derived_gen.11):
|
|||
jump Test.31 Test.32;
|
||||
|
||||
in
|
||||
let #Derived_gen.15 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.15 then
|
||||
let #Derived_gen.13 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.13 then
|
||||
free #Attr.12;
|
||||
jump #Derived_gen.14;
|
||||
jump #Derived_gen.12;
|
||||
else
|
||||
inc Test.7;
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.14;
|
||||
jump #Derived_gen.12;
|
||||
in
|
||||
jump Test.27 #Derived_gen.10 #Derived_gen.11;
|
||||
jump Test.27 #Derived_gen.8 #Derived_gen.9;
|
||||
|
||||
procedure Test.2 (Test.13):
|
||||
ret Test.13;
|
||||
|
@ -117,7 +117,7 @@ procedure Test.6 (Test.7, Test.8, Test.5):
|
|||
procedure Test.9 (Test.10, #Attr.12):
|
||||
let Test.8 : Int1 = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
||||
let Test.7 : [<rnw><null>, C *self Int1, C *self Int1] = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
joinpoint #Derived_gen.12:
|
||||
joinpoint #Derived_gen.14:
|
||||
let Test.37 : U8 = GetTagId Test.7;
|
||||
joinpoint Test.38 Test.36:
|
||||
switch Test.8:
|
||||
|
@ -145,14 +145,14 @@ procedure Test.9 (Test.10, #Attr.12):
|
|||
jump Test.38 Test.39;
|
||||
|
||||
in
|
||||
let #Derived_gen.13 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.13 then
|
||||
let #Derived_gen.15 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.15 then
|
||||
free #Attr.12;
|
||||
jump #Derived_gen.12;
|
||||
jump #Derived_gen.14;
|
||||
else
|
||||
inc Test.7;
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.12;
|
||||
jump #Derived_gen.14;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.41 : Int1 = false;
|
||||
|
|
|
@ -229,7 +229,7 @@ procedure List.8 (#Attr.2, #Attr.3):
|
|||
let List.658 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
|
||||
ret List.658;
|
||||
|
||||
procedure List.80 (#Derived_gen.25, #Derived_gen.26, #Derived_gen.27, #Derived_gen.28, #Derived_gen.29):
|
||||
procedure List.80 (#Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34):
|
||||
joinpoint List.705 List.453 List.454 List.455 List.456 List.457:
|
||||
let List.707 : Int1 = CallByName Num.22 List.456 List.457;
|
||||
if List.707 then
|
||||
|
@ -253,9 +253,9 @@ procedure List.80 (#Derived_gen.25, #Derived_gen.26, #Derived_gen.27, #Derived_g
|
|||
let List.706 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.454;
|
||||
ret List.706;
|
||||
in
|
||||
jump List.705 #Derived_gen.25 #Derived_gen.26 #Derived_gen.27 #Derived_gen.28 #Derived_gen.29;
|
||||
jump List.705 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34;
|
||||
|
||||
procedure List.86 (#Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34):
|
||||
procedure List.86 (#Derived_gen.35, #Derived_gen.36, #Derived_gen.37, #Derived_gen.38, #Derived_gen.39):
|
||||
joinpoint List.567 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.569 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.569 then
|
||||
|
@ -269,9 +269,9 @@ procedure List.86 (#Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.567 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34;
|
||||
jump List.567 #Derived_gen.35 #Derived_gen.36 #Derived_gen.37 #Derived_gen.38 #Derived_gen.39;
|
||||
|
||||
procedure List.86 (#Derived_gen.44, #Derived_gen.45, #Derived_gen.46, #Derived_gen.47, #Derived_gen.48):
|
||||
procedure List.86 (#Derived_gen.46, #Derived_gen.47, #Derived_gen.48, #Derived_gen.49, #Derived_gen.50):
|
||||
joinpoint List.639 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.641 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.641 then
|
||||
|
@ -284,9 +284,9 @@ procedure List.86 (#Derived_gen.44, #Derived_gen.45, #Derived_gen.46, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.639 #Derived_gen.44 #Derived_gen.45 #Derived_gen.46 #Derived_gen.47 #Derived_gen.48;
|
||||
jump List.639 #Derived_gen.46 #Derived_gen.47 #Derived_gen.48 #Derived_gen.49 #Derived_gen.50;
|
||||
|
||||
procedure List.86 (#Derived_gen.49, #Derived_gen.50, #Derived_gen.51, #Derived_gen.52, #Derived_gen.53):
|
||||
procedure List.86 (#Derived_gen.52, #Derived_gen.53, #Derived_gen.54, #Derived_gen.55, #Derived_gen.56):
|
||||
joinpoint List.627 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.629 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.629 then
|
||||
|
@ -300,7 +300,7 @@ procedure List.86 (#Derived_gen.49, #Derived_gen.50, #Derived_gen.51, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.627 #Derived_gen.49 #Derived_gen.50 #Derived_gen.51 #Derived_gen.52 #Derived_gen.53;
|
||||
jump List.627 #Derived_gen.52 #Derived_gen.53 #Derived_gen.54 #Derived_gen.55 #Derived_gen.56;
|
||||
|
||||
procedure List.96 (List.450, List.451, List.452):
|
||||
let List.703 : U64 = 0i64;
|
||||
|
@ -372,8 +372,8 @@ procedure Str.9 (Str.79):
|
|||
else
|
||||
let Str.291 : U8 = StructAtIndex 3 Str.80;
|
||||
let Str.292 : U64 = StructAtIndex 0 Str.80;
|
||||
let #Derived_gen.57 : Str = StructAtIndex 1 Str.80;
|
||||
dec #Derived_gen.57;
|
||||
let #Derived_gen.58 : Str = StructAtIndex 1 Str.80;
|
||||
dec #Derived_gen.58;
|
||||
let Str.290 : {U64, U8} = Struct {Str.292, Str.291};
|
||||
let Str.289 : [C {U64, U8}, C Str] = TagId(0) Str.290;
|
||||
ret Str.289;
|
||||
|
@ -1003,8 +1003,8 @@ procedure TotallyNotJson.102 (TotallyNotJson.852):
|
|||
else
|
||||
let TotallyNotJson.1691 : Str = "Z";
|
||||
let TotallyNotJson.1692 : Int1 = lowlevel Eq TotallyNotJson.1691 TotallyNotJson.852;
|
||||
dec TotallyNotJson.852;
|
||||
dec TotallyNotJson.1691;
|
||||
dec TotallyNotJson.852;
|
||||
if TotallyNotJson.1692 then
|
||||
let TotallyNotJson.1689 : Int1 = CallByName Bool.2;
|
||||
ret TotallyNotJson.1689;
|
||||
|
@ -1077,10 +1077,6 @@ procedure TotallyNotJson.189 (TotallyNotJson.1930, TotallyNotJson.192):
|
|||
ret TotallyNotJson.1955;
|
||||
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.215 (TotallyNotJson.216, TotallyNotJson.217):
|
||||
let TotallyNotJson.1901 : List U8 = CallByName TotallyNotJson.27 TotallyNotJson.217;
|
||||
let TotallyNotJson.1900 : List U8 = CallByName List.8 TotallyNotJson.216 TotallyNotJson.1901;
|
||||
|
@ -1284,6 +1280,10 @@ procedure TotallyNotJson.29 (TotallyNotJson.233):
|
|||
let TotallyNotJson.1526 : List {Str, Str} = CallByName Encode.23 TotallyNotJson.233;
|
||||
ret TotallyNotJson.1526;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.82 (TotallyNotJson.802, TotallyNotJson.803):
|
||||
let TotallyNotJson.1873 : U8 = GetTagId TotallyNotJson.803;
|
||||
switch TotallyNotJson.1873:
|
||||
|
@ -1315,14 +1315,14 @@ procedure TotallyNotJson.82 (TotallyNotJson.802, TotallyNotJson.803):
|
|||
|
||||
procedure TotallyNotJson.832 (TotallyNotJson.1493):
|
||||
let TotallyNotJson.1845 : List Str = StructAtIndex 1 TotallyNotJson.1493;
|
||||
let #Derived_gen.58 : List Str = StructAtIndex 0 TotallyNotJson.1493;
|
||||
dec #Derived_gen.58;
|
||||
let #Derived_gen.59 : List Str = StructAtIndex 0 TotallyNotJson.1493;
|
||||
dec #Derived_gen.59;
|
||||
ret TotallyNotJson.1845;
|
||||
|
||||
procedure TotallyNotJson.840 (TotallyNotJson.1214):
|
||||
let TotallyNotJson.1566 : List Str = StructAtIndex 1 TotallyNotJson.1214;
|
||||
let #Derived_gen.59 : List Str = StructAtIndex 0 TotallyNotJson.1214;
|
||||
dec #Derived_gen.59;
|
||||
let #Derived_gen.57 : List Str = StructAtIndex 0 TotallyNotJson.1214;
|
||||
dec #Derived_gen.57;
|
||||
ret TotallyNotJson.1566;
|
||||
|
||||
procedure TotallyNotJson.87 (TotallyNotJson.809):
|
||||
|
@ -1373,11 +1373,11 @@ procedure TotallyNotJson.95 (TotallyNotJson.829):
|
|||
let TotallyNotJson.1840 : List Str = CallByName TotallyNotJson.832 TotallyNotJson.1842;
|
||||
let TotallyNotJson.1841 : Str = "";
|
||||
let TotallyNotJson.1839 : Str = CallByName Str.4 TotallyNotJson.1840 TotallyNotJson.1841;
|
||||
dec TotallyNotJson.1840;
|
||||
dec TotallyNotJson.1841;
|
||||
dec TotallyNotJson.1840;
|
||||
ret TotallyNotJson.1839;
|
||||
|
||||
procedure TotallyNotJson.96 (#Derived_gen.23):
|
||||
procedure TotallyNotJson.96 (#Derived_gen.51):
|
||||
joinpoint TotallyNotJson.1847 TotallyNotJson.1168:
|
||||
let TotallyNotJson.834 : List Str = StructAtIndex 0 TotallyNotJson.1168;
|
||||
let TotallyNotJson.833 : List Str = StructAtIndex 1 TotallyNotJson.1168;
|
||||
|
@ -1413,7 +1413,7 @@ procedure TotallyNotJson.96 (#Derived_gen.23):
|
|||
let TotallyNotJson.1848 : {List Str, List Str} = Struct {TotallyNotJson.834, TotallyNotJson.833};
|
||||
ret TotallyNotJson.1848;
|
||||
in
|
||||
jump TotallyNotJson.1847 #Derived_gen.23;
|
||||
jump TotallyNotJson.1847 #Derived_gen.51;
|
||||
|
||||
procedure TotallyNotJson.97 (TotallyNotJson.837):
|
||||
let TotallyNotJson.838 : List Str = CallByName Str.55 TotallyNotJson.837;
|
||||
|
@ -1430,7 +1430,7 @@ procedure TotallyNotJson.97 (TotallyNotJson.837):
|
|||
dec TotallyNotJson.1562;
|
||||
ret TotallyNotJson.1560;
|
||||
|
||||
procedure TotallyNotJson.98 (#Derived_gen.24):
|
||||
procedure TotallyNotJson.98 (#Derived_gen.29):
|
||||
joinpoint TotallyNotJson.1568 TotallyNotJson.1169:
|
||||
let TotallyNotJson.842 : List Str = StructAtIndex 0 TotallyNotJson.1169;
|
||||
let TotallyNotJson.841 : List Str = StructAtIndex 1 TotallyNotJson.1169;
|
||||
|
@ -1466,11 +1466,11 @@ procedure TotallyNotJson.98 (#Derived_gen.24):
|
|||
let TotallyNotJson.1569 : {List Str, List Str} = Struct {TotallyNotJson.842, TotallyNotJson.841};
|
||||
ret TotallyNotJson.1569;
|
||||
in
|
||||
jump TotallyNotJson.1568 #Derived_gen.24;
|
||||
jump TotallyNotJson.1568 #Derived_gen.29;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.12 : Str = "bar";
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.8 : List U8 = CallByName Encode.26 Test.12 Test.10;
|
||||
let Test.1 : [C {U64, U8}, C Str] = CallByName Str.9 Test.8;
|
||||
let Test.5 : U8 = 1i64;
|
||||
|
|
|
@ -188,7 +188,7 @@ procedure List.8 (#Attr.2, #Attr.3):
|
|||
let List.598 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
|
||||
ret List.598;
|
||||
|
||||
procedure List.80 (#Derived_gen.10, #Derived_gen.11, #Derived_gen.12, #Derived_gen.13, #Derived_gen.14):
|
||||
procedure List.80 (#Derived_gen.11, #Derived_gen.12, #Derived_gen.13, #Derived_gen.14, #Derived_gen.15):
|
||||
joinpoint List.645 List.453 List.454 List.455 List.456 List.457:
|
||||
let List.647 : Int1 = CallByName Num.22 List.456 List.457;
|
||||
if List.647 then
|
||||
|
@ -212,9 +212,24 @@ procedure List.80 (#Derived_gen.10, #Derived_gen.11, #Derived_gen.12, #Derived_g
|
|||
let List.646 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.454;
|
||||
ret List.646;
|
||||
in
|
||||
jump List.645 #Derived_gen.10 #Derived_gen.11 #Derived_gen.12 #Derived_gen.13 #Derived_gen.14;
|
||||
jump List.645 #Derived_gen.11 #Derived_gen.12 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15;
|
||||
|
||||
procedure List.86 (#Derived_gen.15, #Derived_gen.16, #Derived_gen.17, #Derived_gen.18, #Derived_gen.19):
|
||||
procedure List.86 (#Derived_gen.26, #Derived_gen.27, #Derived_gen.28, #Derived_gen.29, #Derived_gen.30):
|
||||
joinpoint List.579 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.581 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.581 then
|
||||
let List.585 : U8 = CallByName List.66 List.148 List.151;
|
||||
let List.153 : List U8 = CallByName TotallyNotJson.215 List.149 List.585;
|
||||
let List.584 : U64 = 1i64;
|
||||
let List.583 : U64 = CallByName Num.51 List.151 List.584;
|
||||
jump List.579 List.148 List.153 List.150 List.583 List.152;
|
||||
else
|
||||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.579 #Derived_gen.26 #Derived_gen.27 #Derived_gen.28 #Derived_gen.29 #Derived_gen.30;
|
||||
|
||||
procedure List.86 (#Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34, #Derived_gen.35):
|
||||
joinpoint List.567 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.569 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.569 then
|
||||
|
@ -228,22 +243,7 @@ procedure List.86 (#Derived_gen.15, #Derived_gen.16, #Derived_gen.17, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.567 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18 #Derived_gen.19;
|
||||
|
||||
procedure List.86 (#Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34, #Derived_gen.35):
|
||||
joinpoint List.579 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.581 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.581 then
|
||||
let List.585 : U8 = CallByName List.66 List.148 List.151;
|
||||
let List.153 : List U8 = CallByName TotallyNotJson.215 List.149 List.585;
|
||||
let List.584 : U64 = 1i64;
|
||||
let List.583 : U64 = CallByName Num.51 List.151 List.584;
|
||||
jump List.579 List.148 List.153 List.150 List.583 List.152;
|
||||
else
|
||||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.579 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34 #Derived_gen.35;
|
||||
jump List.567 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34 #Derived_gen.35;
|
||||
|
||||
procedure List.96 (List.450, List.451, List.452):
|
||||
let List.643 : U64 = 0i64;
|
||||
|
@ -1020,10 +1020,6 @@ procedure TotallyNotJson.189 (TotallyNotJson.1579, TotallyNotJson.192):
|
|||
ret TotallyNotJson.1604;
|
||||
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.215 (TotallyNotJson.216, TotallyNotJson.217):
|
||||
let TotallyNotJson.1550 : List U8 = CallByName TotallyNotJson.27 TotallyNotJson.217;
|
||||
let TotallyNotJson.1549 : List U8 = CallByName List.8 TotallyNotJson.216 TotallyNotJson.1550;
|
||||
|
@ -1176,6 +1172,10 @@ procedure TotallyNotJson.29 (TotallyNotJson.233):
|
|||
let TotallyNotJson.1173 : List {Str, Str} = CallByName Encode.23 TotallyNotJson.233;
|
||||
ret TotallyNotJson.1173;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.82 (TotallyNotJson.802, TotallyNotJson.803):
|
||||
let TotallyNotJson.1522 : U8 = GetTagId TotallyNotJson.803;
|
||||
switch TotallyNotJson.1522:
|
||||
|
@ -1207,14 +1207,14 @@ procedure TotallyNotJson.82 (TotallyNotJson.802, TotallyNotJson.803):
|
|||
|
||||
procedure TotallyNotJson.832 (TotallyNotJson.1493):
|
||||
let TotallyNotJson.1494 : List Str = StructAtIndex 1 TotallyNotJson.1493;
|
||||
let #Derived_gen.38 : List Str = StructAtIndex 0 TotallyNotJson.1493;
|
||||
dec #Derived_gen.38;
|
||||
let #Derived_gen.37 : List Str = StructAtIndex 0 TotallyNotJson.1493;
|
||||
dec #Derived_gen.37;
|
||||
ret TotallyNotJson.1494;
|
||||
|
||||
procedure TotallyNotJson.840 (TotallyNotJson.1214):
|
||||
let TotallyNotJson.1215 : List Str = StructAtIndex 1 TotallyNotJson.1214;
|
||||
let #Derived_gen.37 : List Str = StructAtIndex 0 TotallyNotJson.1214;
|
||||
dec #Derived_gen.37;
|
||||
let #Derived_gen.38 : List Str = StructAtIndex 0 TotallyNotJson.1214;
|
||||
dec #Derived_gen.38;
|
||||
ret TotallyNotJson.1215;
|
||||
|
||||
procedure TotallyNotJson.87 (TotallyNotJson.809):
|
||||
|
@ -1247,8 +1247,8 @@ procedure TotallyNotJson.94 (TotallyNotJson.824):
|
|||
let TotallyNotJson.1400 : List Str = CallByName List.13 TotallyNotJson.828 TotallyNotJson.827;
|
||||
let TotallyNotJson.1401 : Str = "";
|
||||
let TotallyNotJson.1399 : Str = CallByName Str.4 TotallyNotJson.1400 TotallyNotJson.1401;
|
||||
dec TotallyNotJson.1400;
|
||||
dec TotallyNotJson.1401;
|
||||
dec TotallyNotJson.1400;
|
||||
ret TotallyNotJson.1399;
|
||||
else
|
||||
dec TotallyNotJson.825;
|
||||
|
@ -1269,7 +1269,7 @@ procedure TotallyNotJson.95 (TotallyNotJson.829):
|
|||
dec TotallyNotJson.1489;
|
||||
ret TotallyNotJson.1488;
|
||||
|
||||
procedure TotallyNotJson.96 (#Derived_gen.26):
|
||||
procedure TotallyNotJson.96 (#Derived_gen.25):
|
||||
joinpoint TotallyNotJson.1496 TotallyNotJson.1168:
|
||||
let TotallyNotJson.834 : List Str = StructAtIndex 0 TotallyNotJson.1168;
|
||||
let TotallyNotJson.833 : List Str = StructAtIndex 1 TotallyNotJson.1168;
|
||||
|
@ -1305,7 +1305,7 @@ procedure TotallyNotJson.96 (#Derived_gen.26):
|
|||
let TotallyNotJson.1497 : {List Str, List Str} = Struct {TotallyNotJson.834, TotallyNotJson.833};
|
||||
ret TotallyNotJson.1497;
|
||||
in
|
||||
jump TotallyNotJson.1496 #Derived_gen.26;
|
||||
jump TotallyNotJson.1496 #Derived_gen.25;
|
||||
|
||||
procedure TotallyNotJson.97 (TotallyNotJson.837):
|
||||
let TotallyNotJson.838 : List Str = CallByName Str.55 TotallyNotJson.837;
|
||||
|
@ -1322,7 +1322,7 @@ procedure TotallyNotJson.97 (TotallyNotJson.837):
|
|||
dec TotallyNotJson.1210;
|
||||
ret TotallyNotJson.1209;
|
||||
|
||||
procedure TotallyNotJson.98 (#Derived_gen.30):
|
||||
procedure TotallyNotJson.98 (#Derived_gen.10):
|
||||
joinpoint TotallyNotJson.1217 TotallyNotJson.1169:
|
||||
let TotallyNotJson.842 : List Str = StructAtIndex 0 TotallyNotJson.1169;
|
||||
let TotallyNotJson.841 : List Str = StructAtIndex 1 TotallyNotJson.1169;
|
||||
|
@ -1358,11 +1358,11 @@ procedure TotallyNotJson.98 (#Derived_gen.30):
|
|||
let TotallyNotJson.1218 : {List Str, List Str} = Struct {TotallyNotJson.842, TotallyNotJson.841};
|
||||
ret TotallyNotJson.1218;
|
||||
in
|
||||
jump TotallyNotJson.1217 #Derived_gen.30;
|
||||
jump TotallyNotJson.1217 #Derived_gen.10;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.11 : Str = "foo";
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.8 : List U8 = CallByName Encode.26 Test.11 Test.10;
|
||||
let Test.1 : [C {U64, U8}, C Str] = CallByName Str.9 Test.8;
|
||||
let Test.5 : U8 = 1i64;
|
||||
|
|
|
@ -195,7 +195,7 @@ procedure List.8 (#Attr.2, #Attr.3):
|
|||
let List.598 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
|
||||
ret List.598;
|
||||
|
||||
procedure List.80 (#Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17, #Derived_gen.18):
|
||||
procedure List.80 (#Derived_gen.15, #Derived_gen.16, #Derived_gen.17, #Derived_gen.18, #Derived_gen.19):
|
||||
joinpoint List.645 List.453 List.454 List.455 List.456 List.457:
|
||||
let List.647 : Int1 = CallByName Num.22 List.456 List.457;
|
||||
if List.647 then
|
||||
|
@ -219,9 +219,24 @@ procedure List.80 (#Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_g
|
|||
let List.646 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.454;
|
||||
ret List.646;
|
||||
in
|
||||
jump List.645 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18;
|
||||
jump List.645 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18 #Derived_gen.19;
|
||||
|
||||
procedure List.86 (#Derived_gen.19, #Derived_gen.20, #Derived_gen.21, #Derived_gen.22, #Derived_gen.23):
|
||||
procedure List.86 (#Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34):
|
||||
joinpoint List.579 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.581 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.581 then
|
||||
let List.585 : U8 = CallByName List.66 List.148 List.151;
|
||||
let List.153 : List U8 = CallByName TotallyNotJson.215 List.149 List.585;
|
||||
let List.584 : U64 = 1i64;
|
||||
let List.583 : U64 = CallByName Num.51 List.151 List.584;
|
||||
jump List.579 List.148 List.153 List.150 List.583 List.152;
|
||||
else
|
||||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.579 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34;
|
||||
|
||||
procedure List.86 (#Derived_gen.35, #Derived_gen.36, #Derived_gen.37, #Derived_gen.38, #Derived_gen.39):
|
||||
joinpoint List.567 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.569 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.569 then
|
||||
|
@ -235,22 +250,7 @@ procedure List.86 (#Derived_gen.19, #Derived_gen.20, #Derived_gen.21, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.567 #Derived_gen.19 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23;
|
||||
|
||||
procedure List.86 (#Derived_gen.35, #Derived_gen.36, #Derived_gen.37, #Derived_gen.38, #Derived_gen.39):
|
||||
joinpoint List.579 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.581 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.581 then
|
||||
let List.585 : U8 = CallByName List.66 List.148 List.151;
|
||||
let List.153 : List U8 = CallByName TotallyNotJson.215 List.149 List.585;
|
||||
let List.584 : U64 = 1i64;
|
||||
let List.583 : U64 = CallByName Num.51 List.151 List.584;
|
||||
jump List.579 List.148 List.153 List.150 List.583 List.152;
|
||||
else
|
||||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.579 #Derived_gen.35 #Derived_gen.36 #Derived_gen.37 #Derived_gen.38 #Derived_gen.39;
|
||||
jump List.567 #Derived_gen.35 #Derived_gen.36 #Derived_gen.37 #Derived_gen.38 #Derived_gen.39;
|
||||
|
||||
procedure List.96 (List.450, List.451, List.452):
|
||||
let List.643 : U64 = 0i64;
|
||||
|
@ -1027,10 +1027,6 @@ procedure TotallyNotJson.189 (TotallyNotJson.1579, TotallyNotJson.192):
|
|||
ret TotallyNotJson.1604;
|
||||
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.215 (TotallyNotJson.216, TotallyNotJson.217):
|
||||
let TotallyNotJson.1550 : List U8 = CallByName TotallyNotJson.27 TotallyNotJson.217;
|
||||
let TotallyNotJson.1549 : List U8 = CallByName List.8 TotallyNotJson.216 TotallyNotJson.1550;
|
||||
|
@ -1183,6 +1179,10 @@ procedure TotallyNotJson.29 (TotallyNotJson.233):
|
|||
let TotallyNotJson.1173 : List {Str, Str} = CallByName Encode.23 TotallyNotJson.233;
|
||||
ret TotallyNotJson.1173;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.82 (TotallyNotJson.802, TotallyNotJson.803):
|
||||
let TotallyNotJson.1522 : U8 = GetTagId TotallyNotJson.803;
|
||||
switch TotallyNotJson.1522:
|
||||
|
@ -1214,14 +1214,14 @@ procedure TotallyNotJson.82 (TotallyNotJson.802, TotallyNotJson.803):
|
|||
|
||||
procedure TotallyNotJson.832 (TotallyNotJson.1493):
|
||||
let TotallyNotJson.1494 : List Str = StructAtIndex 1 TotallyNotJson.1493;
|
||||
let #Derived_gen.42 : List Str = StructAtIndex 0 TotallyNotJson.1493;
|
||||
dec #Derived_gen.42;
|
||||
let #Derived_gen.41 : List Str = StructAtIndex 0 TotallyNotJson.1493;
|
||||
dec #Derived_gen.41;
|
||||
ret TotallyNotJson.1494;
|
||||
|
||||
procedure TotallyNotJson.840 (TotallyNotJson.1214):
|
||||
let TotallyNotJson.1215 : List Str = StructAtIndex 1 TotallyNotJson.1214;
|
||||
let #Derived_gen.41 : List Str = StructAtIndex 0 TotallyNotJson.1214;
|
||||
dec #Derived_gen.41;
|
||||
let #Derived_gen.42 : List Str = StructAtIndex 0 TotallyNotJson.1214;
|
||||
dec #Derived_gen.42;
|
||||
ret TotallyNotJson.1215;
|
||||
|
||||
procedure TotallyNotJson.87 (TotallyNotJson.809):
|
||||
|
@ -1254,8 +1254,8 @@ procedure TotallyNotJson.94 (TotallyNotJson.824):
|
|||
let TotallyNotJson.1400 : List Str = CallByName List.13 TotallyNotJson.828 TotallyNotJson.827;
|
||||
let TotallyNotJson.1401 : Str = "";
|
||||
let TotallyNotJson.1399 : Str = CallByName Str.4 TotallyNotJson.1400 TotallyNotJson.1401;
|
||||
dec TotallyNotJson.1400;
|
||||
dec TotallyNotJson.1401;
|
||||
dec TotallyNotJson.1400;
|
||||
ret TotallyNotJson.1399;
|
||||
else
|
||||
dec TotallyNotJson.825;
|
||||
|
@ -1276,7 +1276,7 @@ procedure TotallyNotJson.95 (TotallyNotJson.829):
|
|||
dec TotallyNotJson.1489;
|
||||
ret TotallyNotJson.1488;
|
||||
|
||||
procedure TotallyNotJson.96 (#Derived_gen.30):
|
||||
procedure TotallyNotJson.96 (#Derived_gen.29):
|
||||
joinpoint TotallyNotJson.1496 TotallyNotJson.1168:
|
||||
let TotallyNotJson.834 : List Str = StructAtIndex 0 TotallyNotJson.1168;
|
||||
let TotallyNotJson.833 : List Str = StructAtIndex 1 TotallyNotJson.1168;
|
||||
|
@ -1312,7 +1312,7 @@ procedure TotallyNotJson.96 (#Derived_gen.30):
|
|||
let TotallyNotJson.1497 : {List Str, List Str} = Struct {TotallyNotJson.834, TotallyNotJson.833};
|
||||
ret TotallyNotJson.1497;
|
||||
in
|
||||
jump TotallyNotJson.1496 #Derived_gen.30;
|
||||
jump TotallyNotJson.1496 #Derived_gen.29;
|
||||
|
||||
procedure TotallyNotJson.97 (TotallyNotJson.837):
|
||||
let TotallyNotJson.838 : List Str = CallByName Str.55 TotallyNotJson.837;
|
||||
|
@ -1329,7 +1329,7 @@ procedure TotallyNotJson.97 (TotallyNotJson.837):
|
|||
dec TotallyNotJson.1210;
|
||||
ret TotallyNotJson.1209;
|
||||
|
||||
procedure TotallyNotJson.98 (#Derived_gen.34):
|
||||
procedure TotallyNotJson.98 (#Derived_gen.14):
|
||||
joinpoint TotallyNotJson.1217 TotallyNotJson.1169:
|
||||
let TotallyNotJson.842 : List Str = StructAtIndex 0 TotallyNotJson.1169;
|
||||
let TotallyNotJson.841 : List Str = StructAtIndex 1 TotallyNotJson.1169;
|
||||
|
@ -1365,13 +1365,13 @@ procedure TotallyNotJson.98 (#Derived_gen.34):
|
|||
let TotallyNotJson.1218 : {List Str, List Str} = Struct {TotallyNotJson.842, TotallyNotJson.841};
|
||||
ret TotallyNotJson.1218;
|
||||
in
|
||||
jump TotallyNotJson.1217 #Derived_gen.34;
|
||||
jump TotallyNotJson.1217 #Derived_gen.14;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.11 : Str = "foo";
|
||||
let Test.12 : Str = "bar";
|
||||
let Test.9 : {Str, Str} = Struct {Test.11, Test.12};
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.8 : List U8 = CallByName Encode.26 Test.9 Test.10;
|
||||
let Test.1 : [C {U64, U8}, C Str] = CallByName Str.9 Test.8;
|
||||
let Test.5 : U8 = 1i64;
|
||||
|
|
|
@ -252,10 +252,6 @@ procedure TotallyNotJson.189 (TotallyNotJson.1226, TotallyNotJson.192):
|
|||
ret TotallyNotJson.1251;
|
||||
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.215 (TotallyNotJson.216, TotallyNotJson.217):
|
||||
let TotallyNotJson.1197 : List U8 = CallByName TotallyNotJson.27 TotallyNotJson.217;
|
||||
let TotallyNotJson.1196 : List U8 = CallByName List.8 TotallyNotJson.216 TotallyNotJson.1197;
|
||||
|
@ -357,9 +353,13 @@ procedure TotallyNotJson.27 (TotallyNotJson.218):
|
|||
ret TotallyNotJson.1211;
|
||||
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Str = "abc";
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.10 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.8 : List U8 = CallByName Encode.26 Test.9 Test.10;
|
||||
let Test.1 : [C {U64, U8}, C Str] = CallByName Str.9 Test.8;
|
||||
let Test.5 : U8 = 1i64;
|
||||
|
|
|
@ -184,7 +184,7 @@ procedure List.86 (#Derived_gen.21, #Derived_gen.22, #Derived_gen.23, #Derived_g
|
|||
in
|
||||
jump List.577 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23 #Derived_gen.24 #Derived_gen.25;
|
||||
|
||||
procedure List.86 (#Derived_gen.29, #Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33):
|
||||
procedure List.86 (#Derived_gen.26, #Derived_gen.27, #Derived_gen.28, #Derived_gen.29, #Derived_gen.30):
|
||||
joinpoint List.565 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.567 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.567 then
|
||||
|
@ -198,7 +198,7 @@ procedure List.86 (#Derived_gen.29, #Derived_gen.30, #Derived_gen.31, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.565 #Derived_gen.29 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33;
|
||||
jump List.565 #Derived_gen.26 #Derived_gen.27 #Derived_gen.28 #Derived_gen.29 #Derived_gen.30;
|
||||
|
||||
procedure List.96 (List.450, List.451, List.452):
|
||||
let List.623 : U64 = 0i64;
|
||||
|
@ -333,10 +333,6 @@ procedure TotallyNotJson.189 (TotallyNotJson.1267, TotallyNotJson.192):
|
|||
ret TotallyNotJson.1292;
|
||||
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.215 (TotallyNotJson.216, TotallyNotJson.217):
|
||||
let TotallyNotJson.1238 : List U8 = CallByName TotallyNotJson.27 TotallyNotJson.217;
|
||||
let TotallyNotJson.1237 : List U8 = CallByName List.8 TotallyNotJson.216 TotallyNotJson.1238;
|
||||
|
@ -495,9 +491,13 @@ procedure TotallyNotJson.32 (TotallyNotJson.262, TotallyNotJson.263):
|
|||
let TotallyNotJson.1173 : {Str, List Str} = CallByName Encode.23 TotallyNotJson.1174;
|
||||
ret TotallyNotJson.1173;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.12 : Str = "foo";
|
||||
let Test.11 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.11 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.10 : List U8 = CallByName Encode.26 Test.12 Test.11;
|
||||
let Test.2 : [C {U64, U8}, C Str] = CallByName Str.9 Test.10;
|
||||
let Test.7 : U8 = 1i64;
|
||||
|
|
|
@ -146,7 +146,7 @@ procedure List.8 (#Attr.2, #Attr.3):
|
|||
let List.597 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
|
||||
ret List.597;
|
||||
|
||||
procedure List.80 (#Derived_gen.11, #Derived_gen.12, #Derived_gen.13, #Derived_gen.14, #Derived_gen.15):
|
||||
procedure List.80 (#Derived_gen.14, #Derived_gen.15, #Derived_gen.16, #Derived_gen.17, #Derived_gen.18):
|
||||
joinpoint List.625 List.453 List.454 List.455 List.456 List.457:
|
||||
let List.627 : Int1 = CallByName Num.22 List.456 List.457;
|
||||
if List.627 then
|
||||
|
@ -170,7 +170,7 @@ procedure List.80 (#Derived_gen.11, #Derived_gen.12, #Derived_gen.13, #Derived_g
|
|||
let List.626 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.454;
|
||||
ret List.626;
|
||||
in
|
||||
jump List.625 #Derived_gen.11 #Derived_gen.12 #Derived_gen.13 #Derived_gen.14 #Derived_gen.15;
|
||||
jump List.625 #Derived_gen.14 #Derived_gen.15 #Derived_gen.16 #Derived_gen.17 #Derived_gen.18;
|
||||
|
||||
procedure List.86 (#Derived_gen.19, #Derived_gen.20, #Derived_gen.21, #Derived_gen.22, #Derived_gen.23):
|
||||
joinpoint List.565 List.148 List.149 List.150 List.151 List.152:
|
||||
|
@ -188,7 +188,7 @@ procedure List.86 (#Derived_gen.19, #Derived_gen.20, #Derived_gen.21, #Derived_g
|
|||
in
|
||||
jump List.565 #Derived_gen.19 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22 #Derived_gen.23;
|
||||
|
||||
procedure List.86 (#Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33, #Derived_gen.34):
|
||||
procedure List.86 (#Derived_gen.27, #Derived_gen.28, #Derived_gen.29, #Derived_gen.30, #Derived_gen.31):
|
||||
joinpoint List.577 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.579 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.579 then
|
||||
|
@ -201,7 +201,7 @@ procedure List.86 (#Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.577 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34;
|
||||
jump List.577 #Derived_gen.27 #Derived_gen.28 #Derived_gen.29 #Derived_gen.30 #Derived_gen.31;
|
||||
|
||||
procedure List.96 (List.450, List.451, List.452):
|
||||
let List.623 : U64 = 0i64;
|
||||
|
@ -336,10 +336,6 @@ procedure TotallyNotJson.189 (TotallyNotJson.1267, TotallyNotJson.192):
|
|||
ret TotallyNotJson.1292;
|
||||
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.215 (TotallyNotJson.216, TotallyNotJson.217):
|
||||
let TotallyNotJson.1238 : List U8 = CallByName TotallyNotJson.27 TotallyNotJson.217;
|
||||
let TotallyNotJson.1237 : List U8 = CallByName List.8 TotallyNotJson.216 TotallyNotJson.1238;
|
||||
|
@ -498,11 +494,15 @@ procedure TotallyNotJson.32 (TotallyNotJson.262, TotallyNotJson.263):
|
|||
let TotallyNotJson.1173 : {Str, List Str} = CallByName Encode.23 TotallyNotJson.1174;
|
||||
ret TotallyNotJson.1173;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.13 : Str = "foo";
|
||||
let Test.12 : Str = "foo";
|
||||
let Test.1 : {Str, Str} = Struct {Test.12, Test.13};
|
||||
let Test.11 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.11 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.10 : List U8 = CallByName Encode.26 Test.1 Test.11;
|
||||
let Test.2 : [C {U64, U8}, C Str] = CallByName Str.9 Test.10;
|
||||
let Test.7 : U8 = 1i64;
|
||||
|
|
|
@ -17,7 +17,7 @@ procedure Test.4 (Test.5, #Attr.12):
|
|||
let Test.16 : I64 = CallByName Num.19 Test.5 Test.1;
|
||||
ret Test.16;
|
||||
|
||||
procedure Test.0 (#Derived_gen.0):
|
||||
procedure Test.0 (#Derived_gen.2):
|
||||
joinpoint Test.7 Test.1:
|
||||
let Test.20 : I64 = 1i64;
|
||||
let Test.9 : I64 = CallByName Num.19 Test.1 Test.20;
|
||||
|
@ -33,4 +33,4 @@ procedure Test.0 (#Derived_gen.0):
|
|||
ret Test.8;
|
||||
|
||||
in
|
||||
jump Test.7 #Derived_gen.0;
|
||||
jump Test.7 #Derived_gen.2;
|
||||
|
|
|
@ -259,7 +259,7 @@ procedure Str.9 (Str.79):
|
|||
|
||||
procedure Test.3 ():
|
||||
let Test.0 : List U8 = Array [82i64, 111i64, 99i64];
|
||||
let Test.8 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.8 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
inc Test.0;
|
||||
let Test.1 : [C [C List U8, C ], C Str] = CallByName Decode.27 Test.0 Test.8;
|
||||
let Test.7 : Str = "Roc";
|
||||
|
@ -267,15 +267,11 @@ procedure Test.3 ():
|
|||
let Test.5 : Int1 = CallByName Bool.11 Test.1 Test.6;
|
||||
dec Test.7;
|
||||
expect Test.5;
|
||||
dec Test.0;
|
||||
dec Test.1;
|
||||
dec Test.0;
|
||||
let Test.4 : {} = Struct {};
|
||||
ret Test.4;
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.525 (TotallyNotJson.526, TotallyNotJson.1175):
|
||||
joinpoint TotallyNotJson.1458:
|
||||
inc TotallyNotJson.526;
|
||||
|
@ -285,8 +281,8 @@ procedure TotallyNotJson.525 (TotallyNotJson.526, TotallyNotJson.1175):
|
|||
inc TotallyNotJson.529;
|
||||
let TotallyNotJson.1323 : Int1 = CallByName List.1 TotallyNotJson.529;
|
||||
if TotallyNotJson.1323 then
|
||||
dec TotallyNotJson.529;
|
||||
dec TotallyNotJson.530;
|
||||
dec TotallyNotJson.529;
|
||||
let TotallyNotJson.1326 : {} = Struct {};
|
||||
let TotallyNotJson.1325 : [C {}, C Str] = TagId(0) TotallyNotJson.1326;
|
||||
let TotallyNotJson.1324 : {List U8, [C {}, C Str]} = Struct {TotallyNotJson.526, TotallyNotJson.1325};
|
||||
|
@ -313,8 +309,8 @@ procedure TotallyNotJson.525 (TotallyNotJson.526, TotallyNotJson.1175):
|
|||
let TotallyNotJson.1181 : {List U8, [C {}, C Str]} = Struct {TotallyNotJson.530, TotallyNotJson.1182};
|
||||
ret TotallyNotJson.1181;
|
||||
else
|
||||
dec TotallyNotJson.533;
|
||||
dec TotallyNotJson.530;
|
||||
dec TotallyNotJson.533;
|
||||
let TotallyNotJson.1185 : {} = Struct {};
|
||||
let TotallyNotJson.1184 : [C {}, C Str] = TagId(0) TotallyNotJson.1185;
|
||||
let TotallyNotJson.1183 : {List U8, [C {}, C Str]} = Struct {TotallyNotJson.526, TotallyNotJson.1184};
|
||||
|
@ -839,3 +835,7 @@ procedure TotallyNotJson.70 (#Derived_gen.5):
|
|||
ret TotallyNotJson.1276;
|
||||
in
|
||||
jump TotallyNotJson.1198 #Derived_gen.5;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
|
|
@ -252,8 +252,8 @@ procedure Str.9 (Str.79):
|
|||
else
|
||||
let Str.301 : U8 = StructAtIndex 3 Str.80;
|
||||
let Str.302 : U64 = StructAtIndex 0 Str.80;
|
||||
let #Derived_gen.7 : Str = StructAtIndex 1 Str.80;
|
||||
dec #Derived_gen.7;
|
||||
let #Derived_gen.6 : Str = StructAtIndex 1 Str.80;
|
||||
dec #Derived_gen.6;
|
||||
let Str.300 : {U64, U8} = Struct {Str.302, Str.301};
|
||||
let Str.299 : [C {U64, U8}, C Str] = TagId(0) Str.300;
|
||||
ret Str.299;
|
||||
|
@ -261,7 +261,7 @@ procedure Str.9 (Str.79):
|
|||
procedure Test.0 ():
|
||||
let Test.37 : Str = "-1234";
|
||||
let Test.35 : List U8 = CallByName Str.12 Test.37;
|
||||
let Test.36 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.36 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.34 : {List U8, [C {}, C Str]} = CallByName Decode.26 Test.35 Test.36;
|
||||
let Test.2 : List U8 = StructAtIndex 0 Test.34;
|
||||
let Test.1 : [C {}, C Str] = StructAtIndex 1 Test.34;
|
||||
|
@ -285,8 +285,8 @@ procedure Test.0 ():
|
|||
let Test.22 : [C Str, C {List U8, I64}] = TagId(0) Test.24;
|
||||
ret Test.22;
|
||||
else
|
||||
dec Test.1;
|
||||
dec Test.2;
|
||||
dec Test.1;
|
||||
let Test.30 : Str = "not a number";
|
||||
let Test.28 : [C Str, C {List U8, I64}] = TagId(0) Test.30;
|
||||
ret Test.28;
|
||||
|
@ -304,10 +304,6 @@ procedure Test.12 ():
|
|||
let Test.13 : {} = Struct {};
|
||||
ret Test.13;
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.525 (TotallyNotJson.526, TotallyNotJson.1175):
|
||||
joinpoint TotallyNotJson.1458:
|
||||
inc TotallyNotJson.526;
|
||||
|
@ -317,8 +313,8 @@ procedure TotallyNotJson.525 (TotallyNotJson.526, TotallyNotJson.1175):
|
|||
inc TotallyNotJson.529;
|
||||
let TotallyNotJson.1323 : Int1 = CallByName List.1 TotallyNotJson.529;
|
||||
if TotallyNotJson.1323 then
|
||||
dec TotallyNotJson.529;
|
||||
dec TotallyNotJson.530;
|
||||
dec TotallyNotJson.529;
|
||||
let TotallyNotJson.1326 : {} = Struct {};
|
||||
let TotallyNotJson.1325 : [C {}, C Str] = TagId(0) TotallyNotJson.1326;
|
||||
let TotallyNotJson.1324 : {List U8, [C {}, C Str]} = Struct {TotallyNotJson.526, TotallyNotJson.1325};
|
||||
|
@ -345,8 +341,8 @@ procedure TotallyNotJson.525 (TotallyNotJson.526, TotallyNotJson.1175):
|
|||
let TotallyNotJson.1181 : {List U8, [C {}, C Str]} = Struct {TotallyNotJson.530, TotallyNotJson.1182};
|
||||
ret TotallyNotJson.1181;
|
||||
else
|
||||
dec TotallyNotJson.533;
|
||||
dec TotallyNotJson.530;
|
||||
dec TotallyNotJson.533;
|
||||
let TotallyNotJson.1185 : {} = Struct {};
|
||||
let TotallyNotJson.1184 : [C {}, C Str] = TagId(0) TotallyNotJson.1185;
|
||||
let TotallyNotJson.1183 : {List U8, [C {}, C Str]} = Struct {TotallyNotJson.526, TotallyNotJson.1184};
|
||||
|
@ -401,8 +397,8 @@ procedure TotallyNotJson.534 (TotallyNotJson.535):
|
|||
|
||||
procedure TotallyNotJson.536 (TotallyNotJson.1192):
|
||||
let TotallyNotJson.1193 : List U8 = StructAtIndex 1 TotallyNotJson.1192;
|
||||
let #Derived_gen.6 : List U8 = StructAtIndex 0 TotallyNotJson.1192;
|
||||
dec #Derived_gen.6;
|
||||
let #Derived_gen.7 : List U8 = StructAtIndex 0 TotallyNotJson.1192;
|
||||
dec #Derived_gen.7;
|
||||
ret TotallyNotJson.1193;
|
||||
|
||||
procedure TotallyNotJson.60 ():
|
||||
|
@ -871,3 +867,7 @@ procedure TotallyNotJson.70 (#Derived_gen.5):
|
|||
ret TotallyNotJson.1276;
|
||||
in
|
||||
jump TotallyNotJson.1198 #Derived_gen.5;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
|
|
@ -57,8 +57,8 @@ procedure Test.0 ():
|
|||
else
|
||||
let Test.20 : Str = "B";
|
||||
let Test.21 : Int1 = lowlevel Eq Test.20 Test.12;
|
||||
dec Test.20;
|
||||
dec Test.12;
|
||||
dec Test.20;
|
||||
if Test.21 then
|
||||
let Test.16 : [C U8, C U8, C ] = TagId(1) Test.2;
|
||||
jump Test.13 Test.16;
|
||||
|
|
|
@ -20,9 +20,9 @@ procedure Test.0 ():
|
|||
if Test.13 then
|
||||
let Test.6 : {I64, Str} = CallByName Test.1;
|
||||
let Test.5 : Int1 = CallByName Bool.11 Test.6 Test.4;
|
||||
dec Test.6;
|
||||
let #Derived_gen.0 : Str = StructAtIndex 1 Test.4;
|
||||
dec #Derived_gen.0;
|
||||
dec Test.6;
|
||||
ret Test.5;
|
||||
else
|
||||
let #Derived_gen.1 : Str = StructAtIndex 1 Test.4;
|
||||
|
|
|
@ -6,10 +6,10 @@ procedure List.5 (#Attr.2, #Attr.3):
|
|||
procedure Test.2 (Test.5):
|
||||
let Test.6 : List [<rnnu>C List *self] = UnionAtIndex (Id 0) (Index 0) Test.5;
|
||||
inc Test.6;
|
||||
let #Derived_gen.2 : [<rnnu>C List *self] = Reset { symbol: Test.5, id: UpdateModeId { id: 1 } };
|
||||
let #Derived_gen.1 : [<rnnu>C List *self] = Reset { symbol: Test.5, id: UpdateModeId { id: 0 } };
|
||||
let Test.15 : {} = Struct {};
|
||||
let Test.7 : List [<rnnu>C List *self] = CallByName List.5 Test.6 Test.15;
|
||||
let Test.14 : [<rnnu>C List *self] = Reuse #Derived_gen.2 UpdateModeId { id: 1 } TagId(0) Test.7;
|
||||
let Test.14 : [<rnnu>C List *self] = Reuse #Derived_gen.1 UpdateModeId { id: 0 } TagId(0) Test.7;
|
||||
ret Test.14;
|
||||
|
||||
procedure Test.0 ():
|
||||
|
|
|
@ -10,7 +10,7 @@ procedure Num.21 (#Attr.2, #Attr.3):
|
|||
let Num.292 : U8 = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
ret Num.292;
|
||||
|
||||
procedure Test.1 (#Derived_gen.0, #Derived_gen.1):
|
||||
procedure Test.1 (#Derived_gen.2, #Derived_gen.3):
|
||||
joinpoint Test.11 Test.2 Test.3:
|
||||
let Test.24 : U8 = 0i64;
|
||||
let Test.20 : Int1 = CallByName Bool.11 Test.2 Test.24;
|
||||
|
@ -33,9 +33,9 @@ procedure Test.1 (#Derived_gen.0, #Derived_gen.1):
|
|||
let Test.14 : [<rnu><null>, C *self U8] = TagId(0) Test.3 Test.2;
|
||||
jump Test.11 Test.13 Test.14;
|
||||
in
|
||||
jump Test.11 #Derived_gen.0 #Derived_gen.1;
|
||||
jump Test.11 #Derived_gen.2 #Derived_gen.3;
|
||||
|
||||
procedure Test.4 (#Derived_gen.2, #Derived_gen.3):
|
||||
procedure Test.4 (#Derived_gen.0, #Derived_gen.1):
|
||||
joinpoint Test.15 Test.5 #Attr.12:
|
||||
let Test.2 : U8 = UnionAtIndex (Id 0) (Index 1) #Attr.12;
|
||||
let Test.3 : [<rnu><null>, C *self U8] = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
|
@ -61,7 +61,7 @@ procedure Test.4 (#Derived_gen.2, #Derived_gen.3):
|
|||
decref #Attr.12;
|
||||
jump #Derived_gen.4;
|
||||
in
|
||||
jump Test.15 #Derived_gen.2 #Derived_gen.3;
|
||||
jump Test.15 #Derived_gen.0 #Derived_gen.1;
|
||||
|
||||
procedure Test.6 (Test.7):
|
||||
ret Test.7;
|
||||
|
|
|
@ -8,8 +8,8 @@ procedure Str.3 (#Attr.2, #Attr.3):
|
|||
|
||||
procedure Test.11 (Test.29, #Attr.12):
|
||||
let Test.10 : {} = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
let #Derived_gen.9 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.9 then
|
||||
let #Derived_gen.11 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.11 then
|
||||
free #Attr.12;
|
||||
ret Test.10;
|
||||
else
|
||||
|
@ -19,11 +19,11 @@ procedure Test.11 (Test.29, #Attr.12):
|
|||
procedure Test.11 (Test.29, Test.10):
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.14 (#Derived_gen.7, #Derived_gen.8):
|
||||
procedure Test.14 (#Derived_gen.0, #Derived_gen.1):
|
||||
joinpoint Test.37 Test.36 #Attr.12:
|
||||
let Test.12 : {} = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
||||
let Test.13 : I64 = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
joinpoint #Derived_gen.10:
|
||||
joinpoint #Derived_gen.9:
|
||||
let Test.43 : {} = Struct {};
|
||||
let Test.42 : {} = CallByName Test.11 Test.43 Test.12;
|
||||
let Test.38 : [<r>C {}, C I64 {}] = CallByName Test.9 Test.42 Test.13;
|
||||
|
@ -38,15 +38,15 @@ procedure Test.14 (#Derived_gen.7, #Derived_gen.8):
|
|||
jump Test.37 Test.40 Test.38;
|
||||
|
||||
in
|
||||
let #Derived_gen.11 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.11 then
|
||||
let #Derived_gen.10 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.10 then
|
||||
free #Attr.12;
|
||||
jump #Derived_gen.10;
|
||||
jump #Derived_gen.9;
|
||||
else
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.10;
|
||||
jump #Derived_gen.9;
|
||||
in
|
||||
jump Test.37 #Derived_gen.7 #Derived_gen.8;
|
||||
jump Test.37 #Derived_gen.0 #Derived_gen.1;
|
||||
|
||||
procedure Test.2 ():
|
||||
let Test.6 : Str = "Hello";
|
||||
|
|
|
@ -23,7 +23,7 @@ procedure Test.2 (Test.9, Test.10):
|
|||
let Test.29 : U64 = CallByName Test.3 Test.9;
|
||||
ret Test.29;
|
||||
else
|
||||
joinpoint #Derived_gen.4:
|
||||
joinpoint #Derived_gen.1:
|
||||
let Test.13 : Str = UnionAtIndex (Id 0) (Index 0) Test.10;
|
||||
let Test.14 : [<rnu><null>, C Str *self] = UnionAtIndex (Id 0) (Index 1) Test.10;
|
||||
let Test.33 : U64 = CallByName Test.3 Test.12;
|
||||
|
@ -36,15 +36,15 @@ procedure Test.2 (Test.9, Test.10):
|
|||
else
|
||||
ret Test.16;
|
||||
in
|
||||
let #Derived_gen.5 : Int1 = lowlevel RefCountIsUnique Test.9;
|
||||
if #Derived_gen.5 then
|
||||
let #Derived_gen.2 : Int1 = lowlevel RefCountIsUnique Test.9;
|
||||
if #Derived_gen.2 then
|
||||
dec Test.11;
|
||||
free Test.9;
|
||||
jump #Derived_gen.4;
|
||||
jump #Derived_gen.1;
|
||||
else
|
||||
inc Test.12;
|
||||
decref Test.9;
|
||||
jump #Derived_gen.4;
|
||||
jump #Derived_gen.1;
|
||||
|
||||
procedure Test.3 (Test.17):
|
||||
let Test.26 : U8 = 1i64;
|
||||
|
@ -55,22 +55,22 @@ procedure Test.3 (Test.17):
|
|||
ret Test.22;
|
||||
else
|
||||
let Test.18 : [<rnu><null>, C Str *self] = UnionAtIndex (Id 0) (Index 1) Test.17;
|
||||
joinpoint #Derived_gen.1:
|
||||
joinpoint #Derived_gen.3:
|
||||
let Test.24 : U64 = 1i64;
|
||||
let Test.25 : U64 = CallByName Test.3 Test.18;
|
||||
let Test.23 : U64 = CallByName Num.19 Test.24 Test.25;
|
||||
ret Test.23;
|
||||
in
|
||||
let #Derived_gen.3 : Int1 = lowlevel RefCountIsUnique Test.17;
|
||||
if #Derived_gen.3 then
|
||||
let #Derived_gen.2 : Str = UnionAtIndex (Id 0) (Index 0) Test.17;
|
||||
dec #Derived_gen.2;
|
||||
let #Derived_gen.5 : Int1 = lowlevel RefCountIsUnique Test.17;
|
||||
if #Derived_gen.5 then
|
||||
let #Derived_gen.4 : Str = UnionAtIndex (Id 0) (Index 0) Test.17;
|
||||
dec #Derived_gen.4;
|
||||
free Test.17;
|
||||
jump #Derived_gen.1;
|
||||
jump #Derived_gen.3;
|
||||
else
|
||||
inc Test.18;
|
||||
decref Test.17;
|
||||
jump #Derived_gen.1;
|
||||
jump #Derived_gen.3;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.5 : [<rnu><null>, C Str *self] = TagId(1) ;
|
||||
|
|
|
@ -335,10 +335,6 @@ procedure TotallyNotJson.189 (TotallyNotJson.1270, TotallyNotJson.192):
|
|||
ret TotallyNotJson.1295;
|
||||
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.215 (TotallyNotJson.216, TotallyNotJson.217):
|
||||
let TotallyNotJson.1241 : List U8 = CallByName TotallyNotJson.27 TotallyNotJson.217;
|
||||
let TotallyNotJson.1240 : List U8 = CallByName List.8 TotallyNotJson.216 TotallyNotJson.1241;
|
||||
|
@ -497,8 +493,12 @@ procedure TotallyNotJson.32 (TotallyNotJson.262, TotallyNotJson.263):
|
|||
let TotallyNotJson.1214 : {Str, List Str} = CallByName Encode.23 TotallyNotJson.1215;
|
||||
ret TotallyNotJson.1214;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.12 : {Str, Str} = CallByName Test.3;
|
||||
let Test.13 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.13 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.11 : List U8 = CallByName Encode.26 Test.12 Test.13;
|
||||
ret Test.11;
|
||||
|
|
|
@ -142,7 +142,7 @@ procedure List.86 (#Derived_gen.18, #Derived_gen.19, #Derived_gen.20, #Derived_g
|
|||
in
|
||||
jump List.564 #Derived_gen.18 #Derived_gen.19 #Derived_gen.20 #Derived_gen.21 #Derived_gen.22;
|
||||
|
||||
procedure List.86 (#Derived_gen.29, #Derived_gen.30, #Derived_gen.31, #Derived_gen.32, #Derived_gen.33):
|
||||
procedure List.86 (#Derived_gen.32, #Derived_gen.33, #Derived_gen.34, #Derived_gen.35, #Derived_gen.36):
|
||||
joinpoint List.604 List.148 List.149 List.150 List.151 List.152:
|
||||
let List.606 : Int1 = CallByName Num.22 List.151 List.152;
|
||||
if List.606 then
|
||||
|
@ -155,7 +155,7 @@ procedure List.86 (#Derived_gen.29, #Derived_gen.30, #Derived_gen.31, #Derived_g
|
|||
dec List.148;
|
||||
ret List.149;
|
||||
in
|
||||
jump List.604 #Derived_gen.29 #Derived_gen.30 #Derived_gen.31 #Derived_gen.32 #Derived_gen.33;
|
||||
jump List.604 #Derived_gen.32 #Derived_gen.33 #Derived_gen.34 #Derived_gen.35 #Derived_gen.36;
|
||||
|
||||
procedure Num.127 (#Attr.2):
|
||||
let Num.311 : U8 = lowlevel NumIntCast #Attr.2;
|
||||
|
@ -212,10 +212,6 @@ procedure Test.5 (Test.6, Test.7, Test.4):
|
|||
let Test.22 : {Str, List [C {}, C {}]} = CallByName TotallyNotJson.32 Test.24 Test.25;
|
||||
jump Test.23 Test.22;
|
||||
|
||||
procedure TotallyNotJson.2 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure TotallyNotJson.264 (TotallyNotJson.265, TotallyNotJson.1175, #Attr.12):
|
||||
let TotallyNotJson.263 : List [C {}, C {}] = StructAtIndex 1 #Attr.12;
|
||||
let TotallyNotJson.262 : Str = StructAtIndex 0 #Attr.12;
|
||||
|
@ -330,8 +326,12 @@ procedure TotallyNotJson.32 (TotallyNotJson.262, TotallyNotJson.263):
|
|||
let TotallyNotJson.1257 : {Str, List []} = CallByName Encode.23 TotallyNotJson.1258;
|
||||
ret TotallyNotJson.1257;
|
||||
|
||||
procedure TotallyNotJson.8 ():
|
||||
let TotallyNotJson.1172 : [C , C [], C , C , C , C ] = TagId(2) ;
|
||||
ret TotallyNotJson.1172;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.13 : {{}, {}} = CallByName Test.3;
|
||||
let Test.14 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.2;
|
||||
let Test.14 : [C , C [], C , C , C , C ] = CallByName TotallyNotJson.8;
|
||||
let Test.12 : List U8 = CallByName Encode.26 Test.13 Test.14;
|
||||
ret Test.12;
|
||||
|
|
|
@ -3,22 +3,22 @@
|
|||
app "test" provides [main] to "./platform"
|
||||
|
||||
f = \{} ->
|
||||
#^{-1} <1600><117>{} -<120>[[f(1)]]-> <116>[Ok <1608>{}]<80>*
|
||||
#^{-1} <1874><117>{} -<120>[[f(1)]]-> <116>[Ok <1882>{}]<80>*
|
||||
when g {} is
|
||||
# ^ <1590><1608>{} -<1598>[[g(2)]]-> <72>[Ok <1608>{}]<102>*
|
||||
# ^ <1864><1882>{} -<1872>[[g(2)]]-> <72>[Ok <1882>{}]<102>*
|
||||
_ -> Ok {}
|
||||
|
||||
g = \{} ->
|
||||
#^{-1} <1590><1608>{} -<1598>[[g(2)]]-> <72>[Ok <1608>{}]<102>*
|
||||
#^{-1} <1864><1882>{} -<1872>[[g(2)]]-> <72>[Ok <1882>{}]<102>*
|
||||
when h {} is
|
||||
# ^ <1595><1608>{} -<1603>[[h(3)]]-> <94>[Ok <1608>{}]<124>*
|
||||
# ^ <1869><1882>{} -<1877>[[h(3)]]-> <94>[Ok <1882>{}]<124>*
|
||||
_ -> Ok {}
|
||||
|
||||
h = \{} ->
|
||||
#^{-1} <1595><1608>{} -<1603>[[h(3)]]-> <94>[Ok <1608>{}]<124>*
|
||||
#^{-1} <1869><1882>{} -<1877>[[h(3)]]-> <94>[Ok <1882>{}]<124>*
|
||||
when f {} is
|
||||
# ^ <1600><117>{} -<120>[[f(1)]]-> <116>[Ok <1608>{}]<80>*
|
||||
# ^ <1874><117>{} -<120>[[f(1)]]-> <116>[Ok <1882>{}]<80>*
|
||||
_ -> Ok {}
|
||||
|
||||
main = f {}
|
||||
# ^ <1610><133>{} -<136>[[f(1)]]-> <138>[Ok <1608>{}]<1609>w_a
|
||||
# ^ <1884><133>{} -<136>[[f(1)]]-> <138>[Ok <1882>{}]<1883>w_a
|
||||
|
|
|
@ -658,9 +658,9 @@ mod test_reporting {
|
|||
|
||||
Did you mean one of these?
|
||||
|
||||
Str
|
||||
Frac
|
||||
Num
|
||||
Str
|
||||
Err
|
||||
"###
|
||||
);
|
||||
|
@ -8201,8 +8201,8 @@ In roc, functions are always written as a lambda, like{}
|
|||
|
||||
Type
|
||||
Unsigned8
|
||||
Unsigned32
|
||||
Unsigned16
|
||||
Unsigned64
|
||||
|
||||
── UNRECOGNIZED NAME ───────────────────────────────────── /code/proj/Main.roc ─
|
||||
|
||||
|
@ -8215,8 +8215,8 @@ In roc, functions are always written as a lambda, like{}
|
|||
|
||||
Type
|
||||
Unsigned8
|
||||
Unsigned32
|
||||
Unsigned16
|
||||
Unsigned64
|
||||
"###
|
||||
);
|
||||
|
||||
|
|
2
examples/.gitignore
vendored
2
examples/.gitignore
vendored
|
@ -6,3 +6,5 @@ dynhost
|
|||
*.rh
|
||||
|
||||
helloWorld
|
||||
inspect-gui
|
||||
inspect-logging
|
||||
|
|
150
examples/Community.roc
Normal file
150
examples/Community.roc
Normal file
|
@ -0,0 +1,150 @@
|
|||
interface Community
|
||||
exposes [
|
||||
Community,
|
||||
empty,
|
||||
addPerson,
|
||||
addFriend,
|
||||
Person,
|
||||
walkFriendNames,
|
||||
]
|
||||
imports []
|
||||
|
||||
## Datatype representing a community for demonstration purposes in inspect-gui.roc and inspect-logging.roc
|
||||
|
||||
Community := {
|
||||
people : List Person,
|
||||
friends : List (Set Nat),
|
||||
}
|
||||
implements [
|
||||
Inspect {
|
||||
toInspector: inspectCommunity,
|
||||
},
|
||||
]
|
||||
|
||||
Person := {
|
||||
firstName : Str,
|
||||
lastName : Str,
|
||||
age : U8,
|
||||
hasBeard : Bool,
|
||||
favoriteColor : Color,
|
||||
}
|
||||
implements [
|
||||
Inspect {
|
||||
toInspector: inspectPerson,
|
||||
},
|
||||
]
|
||||
|
||||
Color : [
|
||||
Red,
|
||||
Green,
|
||||
Blue,
|
||||
RGB (U8, U8, U8),
|
||||
]
|
||||
|
||||
empty = @Community { people: [], friends: [] }
|
||||
|
||||
addPerson = \@Community { people, friends }, person ->
|
||||
@Community {
|
||||
people: List.append people (@Person person),
|
||||
friends: List.append friends (Set.empty {}),
|
||||
}
|
||||
|
||||
addFriend = \@Community { people, friends }, from, to ->
|
||||
when (List.get friends from, List.get friends to) is
|
||||
(Ok fromSet, Ok toSet) ->
|
||||
@Community {
|
||||
people,
|
||||
friends: friends
|
||||
|> List.set from (Set.insert fromSet to)
|
||||
|> List.set to (Set.insert toSet from),
|
||||
}
|
||||
|
||||
_ ->
|
||||
@Community { people, friends }
|
||||
|
||||
walkFriendNames : Community, state, (state, Str, Set Str -> state) -> state
|
||||
walkFriendNames = \@Community { people, friends }, s0, nextFn ->
|
||||
(out, _) =
|
||||
(s1, id), friendSet <- List.walk friends (s0, 0)
|
||||
(@Person person) =
|
||||
when List.get people id is
|
||||
Ok v -> v
|
||||
Err _ -> crash "Unknown Person"
|
||||
personName =
|
||||
person.firstName
|
||||
|> Str.concat " "
|
||||
|> Str.concat person.lastName
|
||||
|
||||
friendNames =
|
||||
friendsSet, friendId <- Set.walk friendSet (Set.empty {})
|
||||
(@Person friend) =
|
||||
when List.get people friendId is
|
||||
Ok v -> v
|
||||
Err _ -> crash "Unknown Person"
|
||||
friendName =
|
||||
friend.firstName
|
||||
|> Str.concat " "
|
||||
|> Str.concat friend.lastName
|
||||
Set.insert friendsSet friendName
|
||||
|
||||
(nextFn s1 personName friendNames, id + 1)
|
||||
out
|
||||
|
||||
# The functions below will be auto-generated in the future
|
||||
inspectCommunity : Community -> Inspector f where f implements InspectFormatter
|
||||
inspectCommunity = \@Community { people, friends } ->
|
||||
f0 <- Inspect.custom
|
||||
[
|
||||
{ key: "people", value: Inspect.list people List.walk Inspect.toInspector },
|
||||
{
|
||||
key: "friends",
|
||||
value: Inspect.list
|
||||
friends
|
||||
List.walk
|
||||
(\s -> Inspect.set
|
||||
s
|
||||
Set.walk
|
||||
(\num -> num |> Num.toU64 |> Inspect.u64)
|
||||
),
|
||||
# value: Inspect.dict
|
||||
# (@Community { people, friends })
|
||||
# walkFriendNames
|
||||
# Inspect.str
|
||||
# (\s -> Inspect.set s Set.walk Inspect.str),
|
||||
},
|
||||
]
|
||||
|> Inspect.record
|
||||
|> Inspect.apply f0
|
||||
|
||||
inspectPerson : Person -> Inspector f where f implements InspectFormatter
|
||||
inspectPerson = \@Person { firstName, lastName, age, hasBeard, favoriteColor } ->
|
||||
# In practice, this would never be done manually due to autoderive.
|
||||
# Instead you would just write:
|
||||
# Inspect.inspect innerRecord
|
||||
# This is what the auto-derive would generate.
|
||||
|
||||
f0 <- Inspect.custom
|
||||
|
||||
favoriteColorTag =
|
||||
when favoriteColor is
|
||||
Red ->
|
||||
Inspect.tag "Red" []
|
||||
|
||||
Green ->
|
||||
Inspect.tag "Green" []
|
||||
|
||||
Blue ->
|
||||
Inspect.tag "Blue" []
|
||||
|
||||
RGB (r, g, b) ->
|
||||
Inspect.tag "RGB" [Inspect.tuple [Inspect.u8 r, Inspect.u8 g, Inspect.u8 b]]
|
||||
|
||||
[
|
||||
{ key: "firstName", value: Inspect.str firstName },
|
||||
{ key: "lastName", value: Inspect.str lastName },
|
||||
{ key: "age", value: Inspect.u8 age },
|
||||
{ key: "hasBeard", value: Inspect.bool hasBeard },
|
||||
{ key: "favoriteColor", value: favoriteColorTag },
|
||||
]
|
||||
|> Inspect.record
|
||||
|> Inspect.apply f0
|
227
examples/GuiFormatter.roc
Normal file
227
examples/GuiFormatter.roc
Normal file
|
@ -0,0 +1,227 @@
|
|||
interface GuiFormatter
|
||||
exposes [
|
||||
GuiFormatter,
|
||||
toGui,
|
||||
]
|
||||
imports []
|
||||
|
||||
## Creates GUI representations of Roc values, for use in inspect-gui.roc
|
||||
|
||||
## This can't depend on the platform, so I just copied all of this.
|
||||
|
||||
Rgba : { r : F32, g : F32, b : F32, a : F32 }
|
||||
ButtonStyles : { bgColor : Rgba, borderColor : Rgba, borderWidth : F32, textColor : Rgba }
|
||||
Elem : [Button Elem ButtonStyles, Col (List Elem), Row (List Elem), Text Str]
|
||||
|
||||
GuiFormatter := { nodes : List Elem }
|
||||
implements [
|
||||
InspectFormatter {
|
||||
init: init,
|
||||
list: list,
|
||||
set: set,
|
||||
dict: dict,
|
||||
tag: tag,
|
||||
tuple: tuple,
|
||||
record: record,
|
||||
bool: bool,
|
||||
str: str,
|
||||
opaque: opaque,
|
||||
u8: u8,
|
||||
i8: i8,
|
||||
u16: u16,
|
||||
i16: i16,
|
||||
u32: u32,
|
||||
i32: i32,
|
||||
u64: u64,
|
||||
i64: i64,
|
||||
u128: u128,
|
||||
i128: i128,
|
||||
f32: f32,
|
||||
f64: f64,
|
||||
dec: dec,
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
init : {} -> GuiFormatter
|
||||
init = \{} -> @GuiFormatter { nodes: [] }
|
||||
|
||||
list : list, ElemWalker GuiFormatter list elem, (elem -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
list = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
(@GuiFormatter { nodes }) =
|
||||
init {}
|
||||
|> \f1 ->
|
||||
f2, elem <- walkFn content f1
|
||||
elem
|
||||
|> toInspector
|
||||
|> Inspect.apply f2
|
||||
|
||||
addNode f0 (Col nodes)
|
||||
|
||||
set : set, ElemWalker GuiFormatter set elem, (elem -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
set = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
(@GuiFormatter { nodes }) =
|
||||
init {}
|
||||
|> \f1 ->
|
||||
f2, elem <- walkFn content f1
|
||||
elem
|
||||
|> toInspector
|
||||
|> Inspect.apply f2
|
||||
|
||||
addNode f0 (Col nodes)
|
||||
|
||||
dict : dict, KeyValWalker GuiFormatter dict key value, (key -> Inspector GuiFormatter), (value -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
dict = \d, walkFn, keyToInspector, valueToInspector ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
(@GuiFormatter { nodes }) =
|
||||
init {}
|
||||
|> \f1 ->
|
||||
f2, key, value <- walkFn d f1
|
||||
(@GuiFormatter { nodes: innerNodes }) =
|
||||
init {}
|
||||
|> \x -> Inspect.apply (keyToInspector key) x
|
||||
|> addNode (Text ":")
|
||||
|> \x -> Inspect.apply (valueToInspector value) x
|
||||
|
||||
addNode f2 (Row innerNodes)
|
||||
|
||||
addNode f0 (Col nodes)
|
||||
|
||||
tag : Str, List (Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
tag = \name, fields ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
(@GuiFormatter { nodes }) =
|
||||
init {}
|
||||
|> addNode (Text name)
|
||||
|> \f1 ->
|
||||
f2, fieldInspector <- List.walk fields f1
|
||||
Inspect.apply fieldInspector f2
|
||||
|
||||
addNode f0 (Row nodes)
|
||||
|
||||
tuple : List (Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
tuple = \fields ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
(@GuiFormatter { nodes }) =
|
||||
init {}
|
||||
|> \f1 ->
|
||||
f2, fieldInspector <- List.walk fields f1
|
||||
Inspect.apply fieldInspector f2
|
||||
|
||||
addNode f0 (Row nodes)
|
||||
|
||||
record : List { key : Str, value : Inspector GuiFormatter } -> Inspector GuiFormatter
|
||||
record = \fields ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
(@GuiFormatter { nodes }) =
|
||||
init {}
|
||||
|> \f1 ->
|
||||
f2, { key, value } <- List.walk fields f1
|
||||
(@GuiFormatter { nodes: innerNodes }) =
|
||||
init {}
|
||||
|> addNode (Text key)
|
||||
|> addNode (Text ":")
|
||||
|> \x -> Inspect.apply value x
|
||||
|
||||
addNode f2 (Row innerNodes)
|
||||
|
||||
addNode f0 (Col nodes)
|
||||
|
||||
bool : Bool -> Inspector GuiFormatter
|
||||
bool = \b ->
|
||||
if b then
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (Text "true")
|
||||
else
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (Text "false")
|
||||
|
||||
str : Str -> Inspector GuiFormatter
|
||||
str = \s ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (Text "\"\(s)\"")
|
||||
|
||||
opaque : Str -> Inspector GuiFormatter
|
||||
opaque = \s ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (Text "<\(s)>")
|
||||
|
||||
u8 : U8 -> Inspector GuiFormatter
|
||||
u8 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
i8 : I8 -> Inspector GuiFormatter
|
||||
i8 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
u16 : U16 -> Inspector GuiFormatter
|
||||
u16 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
i16 : I16 -> Inspector GuiFormatter
|
||||
i16 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
u32 : U32 -> Inspector GuiFormatter
|
||||
u32 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
i32 : I32 -> Inspector GuiFormatter
|
||||
i32 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
u64 : U64 -> Inspector GuiFormatter
|
||||
u64 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
i64 : I64 -> Inspector GuiFormatter
|
||||
i64 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
u128 : U128 -> Inspector GuiFormatter
|
||||
u128 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
i128 : I128 -> Inspector GuiFormatter
|
||||
i128 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
f32 : F32 -> Inspector GuiFormatter
|
||||
f32 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
f64 : F64 -> Inspector GuiFormatter
|
||||
f64 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
dec : Dec -> Inspector GuiFormatter
|
||||
dec = \num ->
|
||||
f0 <- Inspect.custom
|
||||
addNode f0 (num |> Num.toStr |> Text)
|
||||
|
||||
addNode : GuiFormatter, Elem -> GuiFormatter
|
||||
addNode = \@GuiFormatter { nodes }, node ->
|
||||
@GuiFormatter { nodes: List.append nodes node }
|
||||
|
||||
toGui : GuiFormatter -> Elem
|
||||
toGui = \@GuiFormatter { nodes } -> Col nodes
|
246
examples/LogFormatter.roc
Normal file
246
examples/LogFormatter.roc
Normal file
|
@ -0,0 +1,246 @@
|
|||
interface LogFormatter
|
||||
exposes [
|
||||
LogFormatter,
|
||||
toStr,
|
||||
]
|
||||
imports []
|
||||
|
||||
## Creates String representations of Roc values, for use in inspect-logging.roc
|
||||
|
||||
LogFormatter := { data : Str }
|
||||
implements [
|
||||
InspectFormatter {
|
||||
init: init,
|
||||
list: list,
|
||||
set: set,
|
||||
dict: dict,
|
||||
tag: tag,
|
||||
tuple: tuple,
|
||||
record: record,
|
||||
bool: bool,
|
||||
str: str,
|
||||
opaque: opaque,
|
||||
u8: u8,
|
||||
i8: i8,
|
||||
u16: u16,
|
||||
i16: i16,
|
||||
u32: u32,
|
||||
i32: i32,
|
||||
u64: u64,
|
||||
i64: i64,
|
||||
u128: u128,
|
||||
i128: i128,
|
||||
f32: f32,
|
||||
f64: f64,
|
||||
dec: dec,
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
init : {} -> LogFormatter
|
||||
init = \{} -> @LogFormatter { data: "" }
|
||||
|
||||
list : list, ElemWalker (LogFormatter, Bool) list elem, (elem -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
list = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "["
|
||||
|> \f1 ->
|
||||
(f2, prependSep), elem <- walkFn content (f1, Bool.false)
|
||||
f3 =
|
||||
if prependSep then
|
||||
write f2 ", "
|
||||
else
|
||||
f2
|
||||
|
||||
elem
|
||||
|> toInspector
|
||||
|> Inspect.apply f3
|
||||
|> \f4 -> (f4, Bool.true)
|
||||
|> .0
|
||||
|> write "]"
|
||||
|
||||
set : set, ElemWalker (LogFormatter, Bool) set elem, (elem -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
set = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "{"
|
||||
|> \f1 ->
|
||||
(f2, prependSep), elem <- walkFn content (f1, Bool.false)
|
||||
f3 =
|
||||
if prependSep then
|
||||
write f2 ", "
|
||||
else
|
||||
f2
|
||||
|
||||
elem
|
||||
|> toInspector
|
||||
|> Inspect.apply f3
|
||||
|> \f4 -> (f4, Bool.true)
|
||||
|> .0
|
||||
|> write "}"
|
||||
|
||||
dict : dict, KeyValWalker (LogFormatter, Bool) dict key value, (key -> Inspector LogFormatter), (value -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
dict = \d, walkFn, keyToInspector, valueToInspector ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "{"
|
||||
|> \f1 ->
|
||||
(f2, prependSep), key, value <- walkFn d (f1, Bool.false)
|
||||
f3 =
|
||||
if prependSep then
|
||||
write f2 ", "
|
||||
else
|
||||
f2
|
||||
|
||||
Inspect.apply (keyToInspector key) f3
|
||||
|> write ": "
|
||||
|> \x -> Inspect.apply (valueToInspector value) x
|
||||
|> \f4 -> (f4, Bool.true)
|
||||
|> .0
|
||||
|> write "}"
|
||||
|
||||
tag : Str, List (Inspector LogFormatter) -> Inspector LogFormatter
|
||||
tag = \name, fields ->
|
||||
if List.isEmpty fields then
|
||||
f0 <- Inspect.custom
|
||||
write f0 name
|
||||
else
|
||||
f0 <- Inspect.custom
|
||||
write f0 "("
|
||||
|> write name
|
||||
|> \f1 ->
|
||||
f2, inspector <- List.walk fields f1
|
||||
write f2 " "
|
||||
|> \x -> Inspect.apply inspector x
|
||||
|> write ")"
|
||||
|
||||
tuple : List (Inspector LogFormatter) -> Inspector LogFormatter
|
||||
tuple = \fields ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "("
|
||||
|> \f1 ->
|
||||
(f2, prependSep), inspector <- List.walk fields (f1, Bool.false)
|
||||
f3 =
|
||||
if prependSep then
|
||||
write f2 ", "
|
||||
else
|
||||
f2
|
||||
|
||||
Inspect.apply inspector f3
|
||||
|> \f4 -> (f4, Bool.true)
|
||||
|> .0
|
||||
|> write ")"
|
||||
|
||||
record : List { key : Str, value : Inspector LogFormatter } -> Inspector LogFormatter
|
||||
record = \fields ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "{"
|
||||
|> \f1 ->
|
||||
(f2, prependSep), { key, value } <- List.walk fields (f1, Bool.false)
|
||||
f3 =
|
||||
if prependSep then
|
||||
write f2 ", "
|
||||
else
|
||||
f2
|
||||
|
||||
write f3 key
|
||||
|> write ": "
|
||||
|> \x -> Inspect.apply value x
|
||||
|> \f4 -> (f4, Bool.true)
|
||||
|> .0
|
||||
|> write "}"
|
||||
|
||||
bool : Bool -> Inspector LogFormatter
|
||||
bool = \b ->
|
||||
if b then
|
||||
f0 <- Inspect.custom
|
||||
write f0 "true"
|
||||
else
|
||||
f0 <- Inspect.custom
|
||||
write f0 "false"
|
||||
|
||||
str : Str -> Inspector LogFormatter
|
||||
str = \s ->
|
||||
f0 <- Inspect.custom
|
||||
f0
|
||||
|> write "\""
|
||||
|> write s
|
||||
|> write "\""
|
||||
|
||||
opaque : Str -> Inspector LogFormatter
|
||||
opaque = \s ->
|
||||
f0 <- Inspect.custom
|
||||
f0
|
||||
|> write "<"
|
||||
|> write s
|
||||
|> write ">"
|
||||
|
||||
u8 : U8 -> Inspector LogFormatter
|
||||
u8 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
i8 : I8 -> Inspector LogFormatter
|
||||
i8 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
u16 : U16 -> Inspector LogFormatter
|
||||
u16 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
i16 : I16 -> Inspector LogFormatter
|
||||
i16 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
u32 : U32 -> Inspector LogFormatter
|
||||
u32 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
i32 : I32 -> Inspector LogFormatter
|
||||
i32 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
u64 : U64 -> Inspector LogFormatter
|
||||
u64 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
i64 : I64 -> Inspector LogFormatter
|
||||
i64 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
u128 : U128 -> Inspector LogFormatter
|
||||
u128 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
i128 : I128 -> Inspector LogFormatter
|
||||
i128 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
f32 : F32 -> Inspector LogFormatter
|
||||
f32 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
f64 : F64 -> Inspector LogFormatter
|
||||
f64 = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
dec : Dec -> Inspector LogFormatter
|
||||
dec = \num ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 (num |> Num.toStr)
|
||||
|
||||
write : LogFormatter, Str -> LogFormatter
|
||||
write = \@LogFormatter { data }, added ->
|
||||
@LogFormatter { data: Str.concat data added }
|
||||
|
||||
toStr : LogFormatter -> Str
|
||||
toStr = \@LogFormatter { data } -> data
|
38
examples/inspect-gui.roc
Normal file
38
examples/inspect-gui.roc
Normal file
|
@ -0,0 +1,38 @@
|
|||
#
|
||||
# Visualizes Roc values in a basic GUI
|
||||
#
|
||||
app "inspect-gui"
|
||||
packages { pf: "gui/platform/main.roc" }
|
||||
imports [
|
||||
Community,
|
||||
GuiFormatter,
|
||||
]
|
||||
provides [render] to pf
|
||||
|
||||
render =
|
||||
Community.empty
|
||||
|> Community.addPerson {
|
||||
firstName: "John",
|
||||
lastName: "Smith",
|
||||
age: 27,
|
||||
hasBeard: Bool.true,
|
||||
favoriteColor: Blue,
|
||||
}
|
||||
|> Community.addPerson {
|
||||
firstName: "Debby",
|
||||
lastName: "Johnson",
|
||||
age: 47,
|
||||
hasBeard: Bool.false,
|
||||
favoriteColor: Green,
|
||||
}
|
||||
|> Community.addPerson {
|
||||
firstName: "Jane",
|
||||
lastName: "Doe",
|
||||
age: 33,
|
||||
hasBeard: Bool.false,
|
||||
favoriteColor: RGB (255, 255, 0),
|
||||
}
|
||||
|> Community.addFriend 0 2
|
||||
|> Community.addFriend 1 2
|
||||
|> Inspect.inspect
|
||||
|> GuiFormatter.toGui
|
40
examples/inspect-logging.roc
Normal file
40
examples/inspect-logging.roc
Normal file
|
@ -0,0 +1,40 @@
|
|||
#
|
||||
# Shows how Roc values can be logged
|
||||
#
|
||||
app "inspect-logging"
|
||||
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.5.0/Cufzl36_SnJ4QbOoEmiJ5dIpUxBvdB3NEySvuH82Wio.tar.br" }
|
||||
imports [
|
||||
pf.Stdout,
|
||||
LogFormatter,
|
||||
Community,
|
||||
]
|
||||
provides [main] to pf
|
||||
|
||||
main =
|
||||
Community.empty
|
||||
|> Community.addPerson {
|
||||
firstName: "John",
|
||||
lastName: "Smith",
|
||||
age: 27,
|
||||
hasBeard: Bool.true,
|
||||
favoriteColor: Blue,
|
||||
}
|
||||
|> Community.addPerson {
|
||||
firstName: "Debby",
|
||||
lastName: "Johnson",
|
||||
age: 47,
|
||||
hasBeard: Bool.false,
|
||||
favoriteColor: Green,
|
||||
}
|
||||
|> Community.addPerson {
|
||||
firstName: "Jane",
|
||||
lastName: "Doe",
|
||||
age: 33,
|
||||
hasBeard: Bool.false,
|
||||
favoriteColor: RGB (255, 255, 0),
|
||||
}
|
||||
|> Community.addFriend 0 2
|
||||
|> Community.addFriend 1 2
|
||||
|> Inspect.inspect
|
||||
|> LogFormatter.toStr
|
||||
|> Stdout.line
|
Loading…
Add table
Add a link
Reference in a new issue