Skip to content

Commit

Permalink
Prepare clojure templates for Preprocessor (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellnix committed Apr 28, 2024
1 parent e5c3cc9 commit c3d4cd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions config/stub_templates/clojure/read_many.clj.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
{%- set fn = "(map #(" ~ type_tokens[var.var_type] ~ " %) " -%}
{%- endif -%}

(def [[{{ idents }}] {{ fn }}{{ clj_split }})]
{{ idents }} {{ fn }}{{ clj_split }}
{% else -%}

(let [{{ idents }}] {{ clj_split }}
{{ idents }}] {{ clj_split }}
{% for var in vars -%}
{%- if var.var_type != "String" and var.var_type != "Word" -%}
(let {{ var.ident }} ({{type_tokens[var.var_type]}} {{var.ident}}))
{{ var.ident }} ({{type_tokens[var.var_type]}} {{var.ident}}
{% endif -%}
{%- endfor -%}
)
{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion config/stub_templates/clojure/read_one.clj.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

{%- if var.input_comment %}; {{ var.input_comment }}
{% endif -%}
(let [{{ var.ident }} {{ fn }}])
{{ var.ident }} {{ fn }}]
4 changes: 4 additions & 0 deletions config/stub_templates/clojure/stub_config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name = "clojure"
source_file_ext = "clj"

preprocessors = [
"s-expression"
]

[type_tokens]
Int = "Integer/parseInt"
Long = "Long/parseLong"
Expand Down

0 comments on commit c3d4cd9

Please sign in to comment.