]> git.lizzy.rs Git - metalua.git/blob - src/lib/metalua/extension/H.mlua
2012a1261d16755843b46d1d26fb26c5cc9f5939
[metalua.git] / src / lib / metalua / extension / H.mlua
1 require 'metalua.walk.id'
2 -{extension 'log'}
3
4 mlp.expr.prefix:add{ '!', prec = 5,
5    builder = function(_,x)
6                 local v = mlp.gensym()
7                 return `Stat{ +{ block:
8                                  local -{v} = -{x};
9                                  (-{v}).h_boundary=true },
10                               v }
11              end }
12
13 mlp.stat:add{ '!', mlp.expr, builder = |x| +{stat: (-{x[1]}).h_boundary=true } }
14
15 -- * if there's no boundary in it, is there a need to rename vars?
16 --   ==> first pass to mark binders which contain boundaries,
17 --       then 2nd pass only touched those which have a splice
18 --       in them.
19
20
21 +{ require -{ `String{ package.metalua_extension_prefix .. 'H-runtime' } } }
22