feat: add cJSON and SQLite amalgamation source files under deps/
Add the cJSON library (cJSON.c, cJSON.h) and SQLite amalgamation (sqlite3.c, sqlite3.h, sqlite3ext.h, shell.c) as vendored dependencies in the deps/ directory for use by the project build system.
This commit is contained in:
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "jinja" for Environment, DictLoader
|
||||
|
||||
var env = Environment.new(DictLoader.new({
|
||||
"math": "{{ 2 + 3 * 4 }}",
|
||||
"paren": "{{ (2 + 3) * 4 }}",
|
||||
"mod": "{{ 10 \% 3 }}",
|
||||
"div": "{{ 10 / 4 }}",
|
||||
"neg": "{{ -5 }}",
|
||||
"compare_chain": "{\% if 1 < 2 and 2 < 3 \%}yes{\% endif \%}",
|
||||
"bool_and": "{{ true and false }}",
|
||||
"bool_or": "{{ true or false }}",
|
||||
"bool_not": "{{ not false }}",
|
||||
"string_in": "{\% if \"b\" in \"abc\" \%}found{\% endif \%}",
|
||||
"list_in": "{\% if 2 in [1, 2, 3] \%}found{\% endif \%}",
|
||||
"nested_access": "{{ data.items[0].name }}",
|
||||
"filter_chain": "{{ text|trim|upper }}",
|
||||
"method_call": "{{ items|join(\", \")|upper }}"
|
||||
}))
|
||||
|
||||
System.print(env.getTemplate("math").render({})) // expect: 14
|
||||
System.print(env.getTemplate("paren").render({})) // expect: 20
|
||||
System.print(env.getTemplate("mod").render({})) // expect: 1
|
||||
System.print(env.getTemplate("div").render({})) // expect: 2.5
|
||||
System.print(env.getTemplate("neg").render({})) // expect: -5
|
||||
System.print(env.getTemplate("compare_chain").render({})) // expect: yes
|
||||
System.print(env.getTemplate("bool_and").render({})) // expect: false
|
||||
System.print(env.getTemplate("bool_or").render({})) // expect: true
|
||||
System.print(env.getTemplate("bool_not").render({})) // expect: true
|
||||
System.print(env.getTemplate("string_in").render({})) // expect: found
|
||||
System.print(env.getTemplate("list_in").render({})) // expect: found
|
||||
System.print(env.getTemplate("nested_access").render({"data": {"items": [{"name": "test"}]}})) // expect: test
|
||||
System.print(env.getTemplate("filter_chain").render({"text": " hello "})) // expect: HELLO
|
||||
System.print(env.getTemplate("method_call").render({"items": ["a", "b", "c"]})) // expect: A, B, C
|
||||
Reference in New Issue
Block a user