zorp-corp / jock-lang

A simple scripting language that compiles to Nock.
https://jock.org
MIT License
20 stars 4 forks source link

Builds without faces have something buggy. #10

Open sigilante opened 4 hours ago

sigilante commented 4 hours ago

Building the following Hoon test case with /* works:

/*  test-let-edit         %hoon  /tests/lib/let-edit
/+  jock,
    test
::
|%
++  text
  'let a:? = true;\0aa = false;\0aa'
++  test-tokenize
  %+  expect-eq:test
    !>  ~[[%keyword %let] [%name %a] [%punctuator %':'] [%punctuator %'?'] [%punctuator %'='] [%literal [%loobean %.y]] [%punctuator %';'] [%name %a] [%punctuator %'='] [%literal [%loobean %.n]] [%punctuator %';'] [%name %a]]
    !>  (rash text parse-tokens:jock)
::
++  test-jeam
  %+  expect-eq:test
    !>  ~[%let type=[p=[%atom p=%loobean] name=%a] val=[%atom p=[%loobean %.y]] next=[%edit limb=~[[%name p=%a]] val=[%atom p=[%loobean %.n]] next=[%limb p=~[[%name p=%a]]]]]
    !>  (jeam:jock txt)
::
++  test-mint
  %+  expect-eq:test
    !>  [8 [1 0] 7 [10 [2 1 1] 0 1] 0 2]
    !>  (mint:jock txt)
--

Building it without faces on test fails:

/+  jock,
    *test
::
|%
++  text
  'let a:? = true;\0aa = false;\0aa'
++  test-tokenize
  %+  expect-eq
    !>  ~[[%keyword %let] [%name %a] [%punctuator %':'] [%punctuator %'?'] [%punctuator %'='] [%literal [%loobean %.y]] [%punctuator %';'] [%name %a] [%punctuator %'='] [%literal [%loobean %.n]] [%punctuator %';'] [%name %a]]
    !>  (rash text parse-tokens:jock)
::
++  test-jeam
  %+  expect-eq
    !>  ~[%let type=[p=[%atom p=%loobean] name=%a] val=[%atom p=[%loobean %.y]] next=[%edit limb=~[[%name p=%a]] val=[%atom p=[%loobean %.n]] next=[%limb p=~[[%name p=%a]]]]]
    !>  (jeam:jock txt)
::
++  test-mint
  %+  expect-eq
    !>  [8 [1 0] 7 [10 [2 1 1] 0 1] 0 2]
    !>  (mint:jock txt)
--

with the error:

-find.parse-tokens

Building with /= fails entirely:

/=  test-let-edit                /tests/lib/let-edit

with the error;

-find.test-let-edit
sigilante commented 3 hours ago

The /= case is a bit of a blocker for a folder layout I have in mind, but I can work around it with /* for the time being until we have time to investigate this.