Skip to content

Commit

Permalink
Template bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
daxida authored and ellnix committed Apr 28, 2024
1 parent e6f05f6 commit b5a6d3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions config/stub_templates/clojure/loopline.clj.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{%- set clj_split = '(filter #(not-empty %) (str/split (read-line) #" "))' -%}
{%- set vars_length = vars | length -%}

{# SINGLE_TYPE #}
Expand All @@ -6,11 +7,11 @@
{%- if var.var_type == "String" or var.var_type == "Word" -%}
{%- set fn = "" -%}
{%- else -%}
{%- set fn = "(map# " ~ type_tokens[var.var_type] ~ ") " -%}
{%- set fn = "map #(" ~ type_tokens[var.var_type] ~ " %) " -%}
{%- endif -%}

(doseq
[{{ var.ident }} {{ fn }}(filter #(not-empty %) (str/split (read-line) #" "))]
[{{ var.ident }} ({{ fn }}{{ clj_split }})]
( ))
{# MULTIPLE_TYPE #}
{%- else -%}
Expand All @@ -29,7 +30,7 @@

(doseq
[{{ idents }} (map (fn [{{ idents }}] [{{ fns | join(sep=" ") }}])
(partition {{ vars_length }} (filter #(not-empty %) (str/split (read-line) #" "))))
(partition {{ vars_length }} {{ clj_split }}))
]
( ))

Expand Down
4 changes: 2 additions & 2 deletions config/stub_templates/clojure/read_many.clj.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
{%- if var.var_type == "String" or var.var_type == "Word" -%}
{%- set fn = "" -%}
{%- else -%}
{%- set fn = "(map #(" ~ type_tokens[var.var_type] ~ " %) " -%}
{%- set fn = "map #(" ~ type_tokens[var.var_type] ~ " %) " -%}
{%- endif -%}

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

[{{ idents }}] {{ clj_split }}
Expand Down

0 comments on commit b5a6d3e

Please sign in to comment.