Skip to content

Commit

Permalink
feat(hog): new STL functions (#27006)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
mariusandra and github-actions[bot] authored Dec 19, 2024
1 parent a99faee commit efb4063
Show file tree
Hide file tree
Showing 16 changed files with 2,005 additions and 21 deletions.
35 changes: 34 additions & 1 deletion hogvm/__tests__/__snapshots__/stl.hoge
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,37 @@
"print", 1, 35, 32, "-- isNull, isNotNull --", 2, "print", 1, 35, 31, 2, "isNull", 1, 31, 2, "isNotNull", 1, 2, "print",
2, 35, 29, 2, "isNull", 1, 29, 2, "isNotNull", 1, 2, "print", 2, 35, 32, "banana", 2, "isNull", 1, 32, "banana", 2,
"isNotNull", 1, 2, "print", 2, 35, 30, 2, "isNull", 1, 30, 2, "isNotNull", 1, 2, "print", 2, 35, 33, 0, 2, "isNull", 1,
33, 0, 2, "isNotNull", 1, 2, "print", 2, 35, 33, 1, 2, "isNull", 1, 33, 1, 2, "isNotNull", 1, 2, "print", 2, 35]
33, 0, 2, "isNotNull", 1, 2, "print", 2, 35, 33, 1, 2, "isNull", 1, 33, 1, 2, "isNotNull", 1, 2, "print", 2, 35, 32, "",
2, "print", 1, 35, 32, "-- comparisons --", 2, "print", 1, 35, 33, 1, 33, 1, 2, "equals", 2, 33, 1, 33, 2, 2, "equals",
2, 33, 1, 32, "1", 2, "equals", 2, 2, "print", 3, 35, 33, 2, 33, 3, 2, "notEquals", 2, 29, 5, 2, "print", 2, 35, 33, 2,
33, 1, 2, "greater", 2, 33, 2, 33, 2, 2, "greaterOrEquals", 2, 2, "print", 2, 35, 33, 1, 33, 2, 2, "less", 2, 33, 2, 33,
2, 2, "lessOrEquals", 2, 33, -3, 33, 2, 2, "less", 2, 2, "print", 3, 35, 30, 29, 4, 2, 33, 0, 33, 0, 4, 2, 33, 1, 33, 0,
4, 2, 33, 1, 30, 4, 2, 33, 0, 30, 4, 2, 33, 1, 2, "or", 1, 32, "string", 2, "or", 1, 33, 100, 2, "or", 1, 2, "print", 8,
35, 30, 29, 3, 2, 33, 0, 33, 0, 3, 2, 33, 1, 33, 0, 3, 2, 33, 1, 30, 3, 2, 33, 0, 30, 3, 2, 33, 1, 33, 1, 3, 2, 33, 1,
2, "and", 1, 29, 2, "and", 1, 32, "string", 2, "and", 1, 33, 100, 2, "and", 1, 2, "print", 10, 35, 32, "", 2, "print",
1, 35, 32, "-- logic --", 2, "print", 1, 35, 29, 40, 4, 32, "yes", 39, 2, 32, "no", 30, 40, 4, 32, "yes", 39, 2, 32,
"no", 2, "print", 2, 35, 29, 40, 4, 32, "one", 39, 9, 30, 40, 4, 32, "two", 39, 2, 32, "default", 2, "print", 1, 35, 32,
"", 2, "print", 1, 35, 32, "-- math --", 2, "print", 1, 35, 33, 3, 33, 5, 2, "min2", 2, 2, "print", 1, 35, 33, 10, 33,
5, 2, "plus", 2, 33, 10, 33, 5, 2, "minus", 2, 2, "print", 2, 35, 34, 3.99, 2, "floor", 1, 34, 3.5, 2, "round", 1, 2,
"print", 2, 35, 33, 5, 2, "range", 1, 2, "print", 1, 35, 33, 3, 33, 6, 2, "range", 2, 2, "print", 1, 35, 32, "", 2,
"print", 1, 35, 32, "-- string/array --", 2, "print", 1, 35, 32, "a", 32, "a", 32, "b", 32, "c", 2, "tuple", 3, 2, "in",
2, 32, "z", 32, "a", 32, "b", 32, "c", 2, "tuple", 3, 2, "in", 2, 2, "print", 2, 35, 32, "a", 32, "a", 32, "b", 32, "c",
43, 3, 2, "in", 2, 32, "z", 32, "a", 32, "b", 32, "c", 43, 3, 2, "in", 2, 2, "print", 2, 35, 32, "hello", 32, "he", 2,
"startsWith", 2, 32, "abcdef", 33, 2, 33, 3, 2, "substring", 3, 2, "print", 2, 35, 31, 31, 32, "firstNonNull", 2,
"coalesce", 3, 32, "notNull", 2, "assumeNotNull", 1, 2, "print", 2, 35, 32, "", 2, "print", 1, 35, 32, "-- date --", 2,
"print", 1, 35, 32, "2024-12-18T00:00:00Z", 2, "toDateTime", 1, 2, "toYear", 1, 32, "2024-12-18T00:00:00Z", 2,
"toDateTime", 1, 2, "toMonth", 1, 2, "print", 2, 35, 2, "now", 0, 2, "toStartOfDay", 1, 2, "now", 0, 2, "toStartOfWeek",
1, 2, "print", 2, 35, 32, "2024-12-18T00:00:00Z", 2, "toDateTime", 1, 2, "toYYYYMM", 1, 2, "print", 1, 35, 32, "day",
33, 1, 32, "2024-12-18", 2, "toDate", 1, 2, "dateAdd", 3, 32, "day", 32, "2024-12-18", 2, "toDate", 1, 32, "day", 33, 5,
32, "2024-12-18", 2, "toDate", 1, 2, "dateAdd", 3, 2, "dateDiff", 3, 2, "print", 2, 35, 32, "day", 32,
"2024-12-18T12:34:56Z", 2, "toDateTime", 1, 2, "dateTrunc", 2, 2, "print", 1, 35, 32, "2024-12-18", 2, "toDate", 1, 33,
3, 2, "addDays", 2, 2, "print", 1, 35, 33, 5, 2, "toIntervalDay", 1, 33, 2, 2, "toIntervalMonth", 1, 2, "print", 2, 35,
2, "today", 0, 2, "print", 1, 35, 32, "", 2, "print", 1, 35, 32, "-- json --", 2, "print", 1, 35, 32, "{\"a\":123.1}",
32, "a", 2, "JSONExtractInt", 2, 2, "jsonStringify", 1, 32, "{\"a\":\"hello\"}", 32, "a", 2, "JSONExtractInt", 2, 2,
"jsonStringify", 1, 2, "print", 2, 35, 32, "{\"a\":123.1}", 32, "a", 2, "JSONExtractFloat", 2, 2, "jsonStringify", 1,
32, "{\"a\":\"hello\"}", 32, "a", 2, "JSONExtractFloat", 2, 2, "jsonStringify", 1, 2, "print", 2, 35, 32,
"{\"a\":123.1}", 32, "a", 2, "JSONExtractString", 2, 2, "jsonStringify", 1, 32, "{\"a\":\"hello\"}", 32, "a", 2,
"JSONExtractString", 2, 2, "jsonStringify", 1, 2, "print", 2, 35, 32, "{\"a\":123}", 32, "a", 2, "JSONExtractArrayRaw",
2, 2, "jsonStringify", 1, 32, "{\"a\":\"hello\"}", 32, "a", 2, "JSONExtractArrayRaw", 2, 2, "jsonStringify", 1, 2,
"print", 2, 35, 32, "{\"a\":[]}", 32, "a", 2, "JSONExtractArrayRaw", 2, 2, "jsonStringify", 1, 32,
"{\"a\":[\"hello\"]}", 32, "a", 2, "JSONExtractArrayRaw", 2, 2, "jsonStringify", 1, 2, "print", 2, 35]
Loading

0 comments on commit efb4063

Please sign in to comment.