diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-08-05 11:51:52 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-08-05 11:51:52 +0200 |
commit | e92fac1b64f7969cadd8ae60f336c43624250d42 (patch) | |
tree | f44286816267846b1af5f7f8847bcdcd8cbe7991 /tex/context/base/mkiv/toks-ini.lua | |
parent | 3668eb2ecc0f7dcc6c44fd1e971cbe37fa010fd6 (diff) | |
download | context-e92fac1b64f7969cadd8ae60f336c43624250d42.tar.gz |
2019-08-05 10:42:00
Diffstat (limited to 'tex/context/base/mkiv/toks-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/toks-ini.lua | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/toks-ini.lua b/tex/context/base/mkiv/toks-ini.lua index af93d3bc1..eef26574e 100644 --- a/tex/context/base/mkiv/toks-ini.lua +++ b/tex/context/base/mkiv/toks-ini.lua @@ -42,7 +42,7 @@ local scan_glue = token.scan_glue local scan_keyword = token.scan_keyword local scan_keyword_cs = token.scan_keyword_cs or scan_keyword local scan_token = token.scan_token -local scan_list = token.scan_list +local scan_box = token.scan_box local scan_word = token.scan_word local scan_key = token.scan_key local scan_value = token.scan_value @@ -138,11 +138,29 @@ local function scan_verbatim() return scan_argument(false) end +if not scan_box then + + local scan_list = token.scan_list + local put_next = token.put_next + + scan_box = function(s) + if s == "hbox" or s == "vbox" or s == "vtop" then + put_next(create_token(s)) + end + end + + token.scan_box = scan_box + +end + tokens.scanners = { -- these expand token = scan_token, toks = scan_toks, tokens = scan_toks, - list = scan_list, + box = scan_box, + hbox = function() return scan_box("hbox") end, + vbox = function() return scan_box("vbox") end, + vtop = function() return scan_box("vtop") end, dimen = scan_dimen, dimension = scan_dimen, glue = scan_glue, |