017ebd0b2cbf — Danielle Hutzley 2 years ago
Add raw directive to formspec
3 files changed, 4 insertions(+), 2 deletions(-)

M .tup/db
M examples/yalib_guessing_port/init.fnl
M yalib-macros.fnl
M .tup/db +0 -0

        
M examples/yalib_guessing_port/init.fnl +2 -1
@@ 20,7 20,8 @@ 
   (form {:size [6 3.476]}
         (label [0.375 0.5] [:escape text])
         (field [0.375 1.25] [5.25 0.8] :number "Number;")
-        (field_close_on_enter :number false)
+        ; This is an example of the raw directive, should just inline here
+        (raw "field_close_on_enter[number;false]")
         ; This is an example of using the run directive, should use a literal here
         (button [1 2.3] [2 0.8] :guess [:run #"Guess"])
         (button_exit [3 2.3] [2 0.8] :exit "Exit")))

          
M yalib-macros.fnl +2 -1
@@ 24,7 24,8 @@ 
 
     (icollect [_ entry (ipairs [...])]
       (match (tostring (. entry 1))
-        (where block (. blocks block)) `(.. ,(form-entry block (. entry 2)) ,(unpack entry 3) ,(form-entry (. blocks block)))
+        (where block (. blocks block)) `(.. ,(form-entry block (. entry 2)) ,(parse-entries (unpack entry 3)) ,(form-entry (. blocks block)))
+        :raw (. entry 2)
         _ (form-entry (unpack entry)))))
 
   ; Prefer a more up-to-date formspec default