From c8c0121153c97ab80ac87ba275e530c632306eef Mon Sep 17 00:00:00 2001 From: Marius Date: Fri, 10 Aug 2012 21:00:15 +0300 Subject: beta 2012.08.10 19:40 --- .../lexers/data/scite-context-data-context.lua | 2 +- .../scite/scite-context-data-context.properties | 2 +- context/data/scite/scite-context-readme.pdf | Bin 205340 -> 204979 bytes scripts/context/lua/mtxrun.lua | 88 ++++++-- scripts/context/stubs/mswin/mtxrun.lua | 88 ++++++-- scripts/context/stubs/unix/mtxrun | 88 ++++++-- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4083 -> 4085 bytes tex/context/base/context-version.png | Bin 106289 -> 106470 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/l-lpeg.lua | 29 ++- tex/context/base/l-os.lua | 12 +- tex/context/base/luat-env.lua | 26 ++- tex/context/base/lxml-lpt.lua | 17 +- tex/context/base/lxml-tab.lua | 4 +- tex/context/base/m-spreadsheet.lua | 8 +- tex/context/base/m-spreadsheet.mkiv | 2 +- tex/context/base/mult-def.mkiv | 2 + tex/context/base/mult-low.lua | 2 +- tex/context/base/status-files.pdf | Bin 24437 -> 24430 bytes tex/context/base/status-lua.pdf | Bin 190377 -> 190389 bytes tex/context/base/strc-tag.lua | 1 + tex/context/base/strc-tag.mkiv | 1 + tex/context/base/supp-box.mkiv | 7 +- tex/context/base/typo-scr.mkiv | 249 +++++++++++++++++---- tex/generic/context/luatex/luatex-fonts-merged.lua | 31 ++- 28 files changed, 540 insertions(+), 127 deletions(-) diff --git a/context/data/scite/lexers/data/scite-context-data-context.lua b/context/data/scite/lexers/data/scite-context-data-context.lua index 210dd61de..24a14d615 100644 --- a/context/data/scite/lexers/data/scite-context-data-context.lua +++ b/context/data/scite/lexers/data/scite-context-data-context.lua @@ -1,4 +1,4 @@ return { ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "plussixteen", "plushundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "etexversion", "pdftexversion", "xetexversion", "xetexrevision", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "spaceasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vcentergroupcode", "mathchoicegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "vadjustgroupcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "charifcode", "catifcode", "numifcode", "dimifcode", "oddifcode", "vmodeifcode", "hmodeifcode", "mmodeifcode", "innerifcode", "voidifcode", "hboxifcode", "vboxifcode", "xifcode", "eofifcode", "trueifcode", "falseifcode", "caseifcode", "definedifcode", "csnameifcode", "fontcharifcode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathsupdisplay", "mathsupnormal", "mathsupcramped", "mathsubnormal", "mathsubcombined", "mathaxisheight", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifmodeelse", "doifnotmode", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "startmodule", "stopmodule", "usemodule", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordcode", "mathopcode", "mathbincode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctcode", "mathalphacode", "mathinnercode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathboxcode", "mathchoicecode", "mathaccentcode", "mathradicalcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "continueifinputfile" }, - ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "doifelsecommandhandler", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "then", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthsargumenttrue", "sixthargumentfalse", "sixtsargumenttrue", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "dontcomplain", "forgetall", "donetrue", "donefalse", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruledvcenter", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "availablehsize", "localhsize", "setlocalhsize", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextbgroupelse", "doifnextparenthesiselse", "doiffastoptionalcheckelse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifnumber", "doifnotnumber", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "doifassignmentelse", "docheckassignment", "tracingall", "tracingnone", "loggingall", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "everyendpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "obeyspaces", "obeylines", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "wait", "writestatus", "define", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "measure", "getvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "newconstant", "setnewconstant", "newconditional", "settrue", "setfalse", "setconstant", "newmacro", "setnewmacro", "newfraction", "newsignal", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse", "startnointerference", "stopnointerference", "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "begstrut", "endstrut", "lineheight" }, + ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "doifelsecommandhandler", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "then", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthsargumenttrue", "sixthargumentfalse", "sixtsargumenttrue", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "dontcomplain", "forgetall", "donetrue", "donefalse", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruledvcenter", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "availablehsize", "localhsize", "setlocalhsize", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextbgroupelse", "doifnextparenthesiselse", "doiffastoptionalcheckelse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifnumber", "doifnotnumber", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "doifassignmentelse", "docheckassignment", "tracingall", "tracingnone", "loggingall", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "everyendpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "obeyspaces", "obeylines", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "wait", "writestatus", "define", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "measure", "getvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "newconstant", "setnewconstant", "newconditional", "settrue", "setfalse", "setconstant", "newmacro", "setnewmacro", "newfraction", "newsignal", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse", "startnointerference", "stopnointerference", "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "begstrut", "endstrut", "lineheight" }, } \ No newline at end of file diff --git a/context/data/scite/scite-context-data-context.properties b/context/data/scite/scite-context-data-context.properties index 6e8699b19..6a1cd1e9c 100644 --- a/context/data/scite/scite-context-data-context.properties +++ b/context/data/scite/scite-context-data-context.properties @@ -81,7 +81,7 @@ doseventupleargument dosinglegroupempty dodoublegroupempty dotriplegroupempty do doquintuplegroupempty nopdfcompression maximumpdfcompression normalpdfcompression modulonumber \ dividenumber getfirstcharacter doiffirstcharelse startnointerference stopnointerference \ strut setstrut strutbox strutht strutdp \ -strutwd begstrut endstrut lineheight +strutwd struthtdp begstrut endstrut lineheight keywordclass.context.constants=\ zerocount minusone minustwo plusone \ diff --git a/context/data/scite/scite-context-readme.pdf b/context/data/scite/scite-context-readme.pdf index 32c9628b6..4c6160191 100644 Binary files a/context/data/scite/scite-context-readme.pdf and b/context/data/scite/scite-context-readme.pdf differ diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 3ebe0c0ba..3045b6866 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -1135,6 +1135,23 @@ local lpeg = require("lpeg") local report = texio and texio.write_nl or print +-- Watch this: Lua does some juggling with replacement values and although lpeg itself is agnostic of +-- % characters, the replacement isn't. Now, in all of the context sources these are only a few cases +-- where capture replacement instring happens. Interesting is that the string parsing already happens +-- when the lpeg is made, but nevertheless is a not that useful (at least for me) feature that has the +-- side effect that one always has to do %% in order to get a %. Okay, now that I know it is there, I +-- might use it more often. +-- +-- local p = P("@") / "%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = P("@") / "%%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = C("@") * C("!") / "%2%1" +-- lpeg.print(p) print(lpeg.match(p,"@!")) + + -- local lpmatch = lpeg.match -- local lpprint = lpeg.print -- local lpp = lpeg.P @@ -1170,7 +1187,7 @@ local report = texio and texio.write_nl or print -- function lpeg.Carg (l) local p = lpcarg(l) report("LPEG Carg =") lpprint(l) return p end local type = type -local byte, char, gmatch = string.byte, string.char, string.gmatch +local byte, char, gmatch, format = string.byte, string.char, string.gmatch, string.format -- Beware, we predefine a bunch of patterns here and one reason for doing so -- is that we get consistent behaviour in some of the visualizers. @@ -1848,6 +1865,16 @@ end -- utfchar(0x205F), -- math thinspace -- } ) +-- handy from within tex: + +local lpegmatch = lpeg.match + +local replacer = lpeg.replacer("@","%%") -- Watch the escaped % in lpeg! + +function string.tformat(fmt,...) + return format(lpegmatch(replacer,fmt),...) +end + end -- of closure @@ -2497,12 +2524,14 @@ else os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' } end +local launchers = { + windows = "start %s", + macosx = "open %s", + unix = "$BROWSER %s &> /dev/null &", +} + function os.launch(str) - if os.type == "windows" then - os.execute("start " .. str) -- os.spawn ? - else - os.execute(str .. " &") -- os.spawn ? - end + os.execute(format(launchers[os.name] or launchers.unix,str)) end if not os.times then @@ -6932,7 +6961,7 @@ local allocate, mark = utilities.storage.allocate, utilities.storage.mark local format, sub, match, gsub, find = string.format, string.sub, string.match, string.gsub, string.find local unquoted, quoted = string.unquoted, string.quoted -local concat = table.concat +local concat, insert, remove = table.concat, table.insert, table.remove local loadedluacode = utilities.lua.loadedluacode -- precautions @@ -6951,8 +6980,28 @@ if arg and (arg[0] == 'luatex' or arg[0] == 'luatex.exe') and arg[1] == "--luaon for k=3,#arg do arg[k-2] = arg[k] end - arg[#arg] = nil -- last - arg[#arg] = nil -- pre-last + remove(arg) -- last + remove(arg) -- pre-last +end + +-- This is an ugly hack but it permits symlinking a script (say 'context') to 'mtxrun' as in: +-- +-- ln -s /opt/minimals/tex/texmf-linux-64/bin/mtxrun context +-- +-- The special mapping hack is needed because 'luatools' boils down to 'mtxrun --script base' +-- but it's unlikely that there will be more of this + +do + + local originalzero = file.basename(arg[0]) + local specialmapping = { luatools == "base" } + + if originalzero ~= "mtxrun" and originalzero ~= "mtxrun.lua" then + arg[0] = specialmapping[originalzero] or originalzero + insert(arg,0,"--script") + insert(arg,0,"mtxrun") + end + end -- environment @@ -8040,7 +8089,7 @@ function xml.checkbom(root) -- can be made faster return end end - insert(dt, 1, { special=true, ns="", tg="@pi@", dt = { "xml version='1.0' standalone='yes'"} } ) + insert(dt, 1, { special = true, ns = "", tg = "@pi@", dt = { "xml version='1.0' standalone='yes'" } } ) insert(dt, 2, "\n" ) end end @@ -8411,7 +8460,7 @@ function xml.tocdata(e,wrapper) -- a few more in the aux module if wrapper then whatever = format("<%s>%s",wrapper,whatever,wrapper) end - local t = { special = true, ns = "", tg = "@cd@", at = {}, rn = "", dt = { whatever }, __p__ = e } + local t = { special = true, ns = "", tg = "@cd@", at = { }, rn = "", dt = { whatever }, __p__ = e } setmetatable(t,getmetatable(e)) e.dt = { t } end @@ -8949,14 +8998,21 @@ local lp_builtin = P ( -- for the moment we keep namespaces with attributes local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * ((R("az","AZ") + S("-_:"))^1) * Cc("'])") -local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end) -local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end) + +----- lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end +----- lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end +local lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / "l==%1" +local lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / "(%1<0 and (#list+%1==l))" + local lp_fastpos = lp_fastpos_n + lp_fastpos_p + local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false") -local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling - return t .. "(" -end +-- local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling +-- return t .. "(" +-- end + +local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / "%1(" local lp_function = C(R("az","AZ","__")^1) * P("(") / function(t) -- todo: better . handling if expressions[t] then diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 3ebe0c0ba..3045b6866 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -1135,6 +1135,23 @@ local lpeg = require("lpeg") local report = texio and texio.write_nl or print +-- Watch this: Lua does some juggling with replacement values and although lpeg itself is agnostic of +-- % characters, the replacement isn't. Now, in all of the context sources these are only a few cases +-- where capture replacement instring happens. Interesting is that the string parsing already happens +-- when the lpeg is made, but nevertheless is a not that useful (at least for me) feature that has the +-- side effect that one always has to do %% in order to get a %. Okay, now that I know it is there, I +-- might use it more often. +-- +-- local p = P("@") / "%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = P("@") / "%%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = C("@") * C("!") / "%2%1" +-- lpeg.print(p) print(lpeg.match(p,"@!")) + + -- local lpmatch = lpeg.match -- local lpprint = lpeg.print -- local lpp = lpeg.P @@ -1170,7 +1187,7 @@ local report = texio and texio.write_nl or print -- function lpeg.Carg (l) local p = lpcarg(l) report("LPEG Carg =") lpprint(l) return p end local type = type -local byte, char, gmatch = string.byte, string.char, string.gmatch +local byte, char, gmatch, format = string.byte, string.char, string.gmatch, string.format -- Beware, we predefine a bunch of patterns here and one reason for doing so -- is that we get consistent behaviour in some of the visualizers. @@ -1848,6 +1865,16 @@ end -- utfchar(0x205F), -- math thinspace -- } ) +-- handy from within tex: + +local lpegmatch = lpeg.match + +local replacer = lpeg.replacer("@","%%") -- Watch the escaped % in lpeg! + +function string.tformat(fmt,...) + return format(lpegmatch(replacer,fmt),...) +end + end -- of closure @@ -2497,12 +2524,14 @@ else os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' } end +local launchers = { + windows = "start %s", + macosx = "open %s", + unix = "$BROWSER %s &> /dev/null &", +} + function os.launch(str) - if os.type == "windows" then - os.execute("start " .. str) -- os.spawn ? - else - os.execute(str .. " &") -- os.spawn ? - end + os.execute(format(launchers[os.name] or launchers.unix,str)) end if not os.times then @@ -6932,7 +6961,7 @@ local allocate, mark = utilities.storage.allocate, utilities.storage.mark local format, sub, match, gsub, find = string.format, string.sub, string.match, string.gsub, string.find local unquoted, quoted = string.unquoted, string.quoted -local concat = table.concat +local concat, insert, remove = table.concat, table.insert, table.remove local loadedluacode = utilities.lua.loadedluacode -- precautions @@ -6951,8 +6980,28 @@ if arg and (arg[0] == 'luatex' or arg[0] == 'luatex.exe') and arg[1] == "--luaon for k=3,#arg do arg[k-2] = arg[k] end - arg[#arg] = nil -- last - arg[#arg] = nil -- pre-last + remove(arg) -- last + remove(arg) -- pre-last +end + +-- This is an ugly hack but it permits symlinking a script (say 'context') to 'mtxrun' as in: +-- +-- ln -s /opt/minimals/tex/texmf-linux-64/bin/mtxrun context +-- +-- The special mapping hack is needed because 'luatools' boils down to 'mtxrun --script base' +-- but it's unlikely that there will be more of this + +do + + local originalzero = file.basename(arg[0]) + local specialmapping = { luatools == "base" } + + if originalzero ~= "mtxrun" and originalzero ~= "mtxrun.lua" then + arg[0] = specialmapping[originalzero] or originalzero + insert(arg,0,"--script") + insert(arg,0,"mtxrun") + end + end -- environment @@ -8040,7 +8089,7 @@ function xml.checkbom(root) -- can be made faster return end end - insert(dt, 1, { special=true, ns="", tg="@pi@", dt = { "xml version='1.0' standalone='yes'"} } ) + insert(dt, 1, { special = true, ns = "", tg = "@pi@", dt = { "xml version='1.0' standalone='yes'" } } ) insert(dt, 2, "\n" ) end end @@ -8411,7 +8460,7 @@ function xml.tocdata(e,wrapper) -- a few more in the aux module if wrapper then whatever = format("<%s>%s",wrapper,whatever,wrapper) end - local t = { special = true, ns = "", tg = "@cd@", at = {}, rn = "", dt = { whatever }, __p__ = e } + local t = { special = true, ns = "", tg = "@cd@", at = { }, rn = "", dt = { whatever }, __p__ = e } setmetatable(t,getmetatable(e)) e.dt = { t } end @@ -8949,14 +8998,21 @@ local lp_builtin = P ( -- for the moment we keep namespaces with attributes local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * ((R("az","AZ") + S("-_:"))^1) * Cc("'])") -local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end) -local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end) + +----- lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end +----- lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end +local lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / "l==%1" +local lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / "(%1<0 and (#list+%1==l))" + local lp_fastpos = lp_fastpos_n + lp_fastpos_p + local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false") -local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling - return t .. "(" -end +-- local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling +-- return t .. "(" +-- end + +local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / "%1(" local lp_function = C(R("az","AZ","__")^1) * P("(") / function(t) -- todo: better . handling if expressions[t] then diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 3ebe0c0ba..3045b6866 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -1135,6 +1135,23 @@ local lpeg = require("lpeg") local report = texio and texio.write_nl or print +-- Watch this: Lua does some juggling with replacement values and although lpeg itself is agnostic of +-- % characters, the replacement isn't. Now, in all of the context sources these are only a few cases +-- where capture replacement instring happens. Interesting is that the string parsing already happens +-- when the lpeg is made, but nevertheless is a not that useful (at least for me) feature that has the +-- side effect that one always has to do %% in order to get a %. Okay, now that I know it is there, I +-- might use it more often. +-- +-- local p = P("@") / "%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = P("@") / "%%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = C("@") * C("!") / "%2%1" +-- lpeg.print(p) print(lpeg.match(p,"@!")) + + -- local lpmatch = lpeg.match -- local lpprint = lpeg.print -- local lpp = lpeg.P @@ -1170,7 +1187,7 @@ local report = texio and texio.write_nl or print -- function lpeg.Carg (l) local p = lpcarg(l) report("LPEG Carg =") lpprint(l) return p end local type = type -local byte, char, gmatch = string.byte, string.char, string.gmatch +local byte, char, gmatch, format = string.byte, string.char, string.gmatch, string.format -- Beware, we predefine a bunch of patterns here and one reason for doing so -- is that we get consistent behaviour in some of the visualizers. @@ -1848,6 +1865,16 @@ end -- utfchar(0x205F), -- math thinspace -- } ) +-- handy from within tex: + +local lpegmatch = lpeg.match + +local replacer = lpeg.replacer("@","%%") -- Watch the escaped % in lpeg! + +function string.tformat(fmt,...) + return format(lpegmatch(replacer,fmt),...) +end + end -- of closure @@ -2497,12 +2524,14 @@ else os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' } end +local launchers = { + windows = "start %s", + macosx = "open %s", + unix = "$BROWSER %s &> /dev/null &", +} + function os.launch(str) - if os.type == "windows" then - os.execute("start " .. str) -- os.spawn ? - else - os.execute(str .. " &") -- os.spawn ? - end + os.execute(format(launchers[os.name] or launchers.unix,str)) end if not os.times then @@ -6932,7 +6961,7 @@ local allocate, mark = utilities.storage.allocate, utilities.storage.mark local format, sub, match, gsub, find = string.format, string.sub, string.match, string.gsub, string.find local unquoted, quoted = string.unquoted, string.quoted -local concat = table.concat +local concat, insert, remove = table.concat, table.insert, table.remove local loadedluacode = utilities.lua.loadedluacode -- precautions @@ -6951,8 +6980,28 @@ if arg and (arg[0] == 'luatex' or arg[0] == 'luatex.exe') and arg[1] == "--luaon for k=3,#arg do arg[k-2] = arg[k] end - arg[#arg] = nil -- last - arg[#arg] = nil -- pre-last + remove(arg) -- last + remove(arg) -- pre-last +end + +-- This is an ugly hack but it permits symlinking a script (say 'context') to 'mtxrun' as in: +-- +-- ln -s /opt/minimals/tex/texmf-linux-64/bin/mtxrun context +-- +-- The special mapping hack is needed because 'luatools' boils down to 'mtxrun --script base' +-- but it's unlikely that there will be more of this + +do + + local originalzero = file.basename(arg[0]) + local specialmapping = { luatools == "base" } + + if originalzero ~= "mtxrun" and originalzero ~= "mtxrun.lua" then + arg[0] = specialmapping[originalzero] or originalzero + insert(arg,0,"--script") + insert(arg,0,"mtxrun") + end + end -- environment @@ -8040,7 +8089,7 @@ function xml.checkbom(root) -- can be made faster return end end - insert(dt, 1, { special=true, ns="", tg="@pi@", dt = { "xml version='1.0' standalone='yes'"} } ) + insert(dt, 1, { special = true, ns = "", tg = "@pi@", dt = { "xml version='1.0' standalone='yes'" } } ) insert(dt, 2, "\n" ) end end @@ -8411,7 +8460,7 @@ function xml.tocdata(e,wrapper) -- a few more in the aux module if wrapper then whatever = format("<%s>%s",wrapper,whatever,wrapper) end - local t = { special = true, ns = "", tg = "@cd@", at = {}, rn = "", dt = { whatever }, __p__ = e } + local t = { special = true, ns = "", tg = "@cd@", at = { }, rn = "", dt = { whatever }, __p__ = e } setmetatable(t,getmetatable(e)) e.dt = { t } end @@ -8949,14 +8998,21 @@ local lp_builtin = P ( -- for the moment we keep namespaces with attributes local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * ((R("az","AZ") + S("-_:"))^1) * Cc("'])") -local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end) -local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end) + +----- lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end +----- lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end +local lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / "l==%1" +local lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / "(%1<0 and (#list+%1==l))" + local lp_fastpos = lp_fastpos_n + lp_fastpos_p + local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false") -local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling - return t .. "(" -end +-- local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling +-- return t .. "(" +-- end + +local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / "%1(" local lp_function = C(R("az","AZ","__")^1) * P("(") / function(t) -- todo: better . handling if expressions[t] then diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 6b6fc5b67..cf0b9bc4f 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.08.10 00:32} +\newcontextversion{2012.08.10 19:40} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 60612b657..c1eb31960 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.08.10 00:32} +\newcontextversion{2012.08.10 19:40} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index bd6ba9775..c2b73175e 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png index 07dca37eb..738fa1b3f 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index e5b8e6591..b173fe811 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2012.08.10 00:32} +\edef\contextversion{2012.08.10 19:40} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 7d9f444f5..6ee088294 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2012.08.10 00:32} +\edef\contextversion{2012.08.10 19:40} %D For those who want to use this: diff --git a/tex/context/base/l-lpeg.lua b/tex/context/base/l-lpeg.lua index fa3b210af..70c5f14e1 100644 --- a/tex/context/base/l-lpeg.lua +++ b/tex/context/base/l-lpeg.lua @@ -15,6 +15,23 @@ local lpeg = require("lpeg") local report = texio and texio.write_nl or print +-- Watch this: Lua does some juggling with replacement values and although lpeg itself is agnostic of +-- % characters, the replacement isn't. Now, in all of the context sources these are only a few cases +-- where capture replacement instring happens. Interesting is that the string parsing already happens +-- when the lpeg is made, but nevertheless is a not that useful (at least for me) feature that has the +-- side effect that one always has to do %% in order to get a %. Okay, now that I know it is there, I +-- might use it more often. +-- +-- local p = P("@") / "%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = P("@") / "%%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = C("@") * C("!") / "%2%1" +-- lpeg.print(p) print(lpeg.match(p,"@!")) + + -- local lpmatch = lpeg.match -- local lpprint = lpeg.print -- local lpp = lpeg.P @@ -50,7 +67,7 @@ local report = texio and texio.write_nl or print -- function lpeg.Carg (l) local p = lpcarg(l) report("LPEG Carg =") lpprint(l) return p end local type = type -local byte, char, gmatch = string.byte, string.char, string.gmatch +local byte, char, gmatch, format = string.byte, string.char, string.gmatch, string.format -- Beware, we predefine a bunch of patterns here and one reason for doing so -- is that we get consistent behaviour in some of the visualizers. @@ -766,3 +783,13 @@ end -- utfchar(0x202F), -- narrownobreakspace -- utfchar(0x205F), -- math thinspace -- } ) + +-- handy from within tex: + +local lpegmatch = lpeg.match + +local replacer = lpeg.replacer("@","%%") -- Watch the escaped % in lpeg! + +function string.tformat(fmt,...) + return format(lpegmatch(replacer,fmt),...) +end diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua index f9bd46e51..7c9ce307b 100644 --- a/tex/context/base/l-os.lua +++ b/tex/context/base/l-os.lua @@ -136,12 +136,14 @@ else os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' } end +local launchers = { + windows = "start %s", + macosx = "open %s", + unix = "$BROWSER %s &> /dev/null &", +} + function os.launch(str) - if os.type == "windows" then - os.execute("start " .. str) -- os.spawn ? - else - os.execute(str .. " &") -- os.spawn ? - end + os.execute(format(launchers[os.name] or launchers.unix,str)) end if not os.times then diff --git a/tex/context/base/luat-env.lua b/tex/context/base/luat-env.lua index 181e3b237..6e31b5a98 100644 --- a/tex/context/base/luat-env.lua +++ b/tex/context/base/luat-env.lua @@ -20,7 +20,7 @@ local allocate, mark = utilities.storage.allocate, utilities.storage.mark local format, sub, match, gsub, find = string.format, string.sub, string.match, string.gsub, string.find local unquoted, quoted = string.unquoted, string.quoted -local concat = table.concat +local concat, insert, remove = table.concat, table.insert, table.remove local loadedluacode = utilities.lua.loadedluacode -- precautions @@ -39,8 +39,28 @@ if arg and (arg[0] == 'luatex' or arg[0] == 'luatex.exe') and arg[1] == "--luaon for k=3,#arg do arg[k-2] = arg[k] end - arg[#arg] = nil -- last - arg[#arg] = nil -- pre-last + remove(arg) -- last + remove(arg) -- pre-last +end + +-- This is an ugly hack but it permits symlinking a script (say 'context') to 'mtxrun' as in: +-- +-- ln -s /opt/minimals/tex/texmf-linux-64/bin/mtxrun context +-- +-- The special mapping hack is needed because 'luatools' boils down to 'mtxrun --script base' +-- but it's unlikely that there will be more of this + +do + + local originalzero = file.basename(arg[0]) + local specialmapping = { luatools == "base" } + + if originalzero ~= "mtxrun" and originalzero ~= "mtxrun.lua" then + arg[0] = specialmapping[originalzero] or originalzero + insert(arg,0,"--script") + insert(arg,0,"mtxrun") + end + end -- environment diff --git a/tex/context/base/lxml-lpt.lua b/tex/context/base/lxml-lpt.lua index 37f07f030..b04c80550 100644 --- a/tex/context/base/lxml-lpt.lua +++ b/tex/context/base/lxml-lpt.lua @@ -539,14 +539,21 @@ local lp_builtin = P ( -- for the moment we keep namespaces with attributes local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * ((R("az","AZ") + S("-_:"))^1) * Cc("'])") -local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end) -local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end) + +----- lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end +----- lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end +local lp_fastpos_p = (P("+")^0 * R("09")^1 * P(-1)) / "l==%1" +local lp_fastpos_n = (P("-") * R("09")^1 * P(-1)) / "(%1<0 and (#list+%1==l))" + local lp_fastpos = lp_fastpos_n + lp_fastpos_p + local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false") -local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling - return t .. "(" -end +-- local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling +-- return t .. "(" +-- end + +local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / "%1(" local lp_function = C(R("az","AZ","__")^1) * P("(") / function(t) -- todo: better . handling if expressions[t] then diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua index b5c860787..97ae924a1 100644 --- a/tex/context/base/lxml-tab.lua +++ b/tex/context/base/lxml-tab.lua @@ -907,7 +907,7 @@ function xml.checkbom(root) -- can be made faster return end end - insert(dt, 1, { special=true, ns="", tg="@pi@", dt = { "xml version='1.0' standalone='yes'"} } ) + insert(dt, 1, { special = true, ns = "", tg = "@pi@", dt = { "xml version='1.0' standalone='yes'" } } ) insert(dt, 2, "\n" ) end end @@ -1317,7 +1317,7 @@ function xml.tocdata(e,wrapper) -- a few more in the aux module if wrapper then whatever = format("<%s>%s",wrapper,whatever,wrapper) end - local t = { special = true, ns = "", tg = "@cd@", at = {}, rn = "", dt = { whatever }, __p__ = e } + local t = { special = true, ns = "", tg = "@cd@", at = { }, rn = "", dt = { whatever }, __p__ = e } setmetatable(t,getmetatable(e)) e.dt = { t } end diff --git a/tex/context/base/m-spreadsheet.lua b/tex/context/base/m-spreadsheet.lua index 5ed44646d..049154f27 100644 --- a/tex/context/base/m-spreadsheet.lua +++ b/tex/context/base/m-spreadsheet.lua @@ -137,13 +137,7 @@ function functions.sum(c,f,t) end end -function functions.fmt(pattern,n) - if find(pattern,"^%%") then - return format(pattern,n) - else - return format("%"..pattern,n) - end -end +functions.fmt= string.tformat local template = [[ local _m_ = moduledata.spreadsheets diff --git a/tex/context/base/m-spreadsheet.mkiv b/tex/context/base/m-spreadsheet.mkiv index c21e10f1d..e065ac7e8 100644 --- a/tex/context/base/m-spreadsheet.mkiv +++ b/tex/context/base/m-spreadsheet.mkiv @@ -144,7 +144,7 @@ \bTD[nx=2] \bf \getspr{string.format("\letterpercent0.3f",(A[3] + B[3]) /100)} \eTD \eTR \bTR - \bTD[nx=2] \bf \getspr{fmt("0.3f",(sum(A,1,2)) / 10)} \eTD + \bTD[nx=2] \bf \getspr{fmt("@0.3f",(sum(A,1,2)) / 10)} \eTD \eTR \eTABLE diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv index eed2e63ac..eade6496c 100644 --- a/tex/context/base/mult-def.mkiv +++ b/tex/context/base/mult-def.mkiv @@ -49,6 +49,8 @@ \def\c!monthconversion {monthconversion} \def\c!comment {comment} \def\c!textalign {textalign} +\def\c!up {up} +\def\c!down {down} \def\v!compressseparator{compressseparator} \def\v!notation {notation} diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index abc159f7c..047b4bdbd 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -271,6 +271,6 @@ return { -- "startnointerference", "stopnointerference", -- - "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "begstrut", "endstrut", "lineheight", + "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "begstrut", "endstrut", "lineheight", } } diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index db7eac92d..16ade95a6 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 2b53e30ec..17bbb0a67 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/strc-tag.lua b/tex/context/base/strc-tag.lua index 78b807487..7e5c6f993 100644 --- a/tex/context/base/strc-tag.lua +++ b/tex/context/base/strc-tag.lua @@ -161,6 +161,7 @@ local properties = allocate { metadata = { pdf = "Div", nature = "display" }, metavariable = { pdf = "Span", nature = "mixed" }, + mid = { pdf = "Span", nature = "inline" }, sub = { pdf = "Span", nature = "inline" }, sup = { pdf = "Span", nature = "inline" }, subsup = { pdf = "Span", nature = "inline" }, diff --git a/tex/context/base/strc-tag.mkiv b/tex/context/base/strc-tag.mkiv index b84efc92c..6563e884e 100644 --- a/tex/context/base/strc-tag.mkiv +++ b/tex/context/base/strc-tag.mkiv @@ -126,6 +126,7 @@ \def\t!ignore {ignore} % Span +\def\t!mid {mid} % Span \def\t!sub {sub} % Span \def\t!sup {sup} % Span \def\t!subsup {subsup} % Span diff --git a/tex/context/base/supp-box.mkiv b/tex/context/base/supp-box.mkiv index 5925c591b..dc6358202 100644 --- a/tex/context/base/supp-box.mkiv +++ b/tex/context/base/supp-box.mkiv @@ -75,9 +75,10 @@ %D core macros \type {\strutdepth} and alike, which are %D values. -\def\strutdp{\dp\strutbox} -\def\strutht{\ht\strutbox} -\def\strutwd{\wd\strutbox} +\def\strutdp {\dp\strutbox} +\def\strutht {\ht\strutbox} +\def\strutwd {\wd\strutbox} +\def\struthtdp{\dimexpr\ht\strutbox+\dp\strutbox\relax} %D \macros %D {voidbox,nextbox} diff --git a/tex/context/base/typo-scr.mkiv b/tex/context/base/typo-scr.mkiv index 4b4487522..1a6a80d06 100644 --- a/tex/context/base/typo-scr.mkiv +++ b/tex/context/base/typo-scr.mkiv @@ -19,7 +19,7 @@ %D \type {shiftup} and \type {shiftdown} that can work across paragraphs. %D \macros -%D {low, high, lohi, hilo} +%D {low, high, definelow, definehigh, setuplow, setuphigh} %D %D Although \TEX\ is pretty well aware of super- and subscripts, its mechanism %D is mainly tuned for math mode. The next few commands take care of script @@ -36,69 +36,232 @@ %D space. The implementation looks a bit fuzzy, since some \type {\fontdimen}'s %D are involved to determine the optimal placement. -% These might become parameters: \setupscripts but we need fo come up with -% nice keys. +\installcorenamespace {low} +\installcorenamespace {high} -\def\highvfraction {0} -\def\lowvfraction {0} -\def\highlowvfraction{.1} -\def\highlowhfraction{.1} +\installcommandhandler \??low {low} \??low +\installcommandhandler \??high {high} \??high -\unexpanded\def\low {\typo_scripts_high_low\lower\mathsubnormal{.48}\lowvfraction \t!sub} -\unexpanded\def\high{\typo_scripts_high_low\raise\mathsupnormal{.86}\highvfraction\t!sup} +\setuplow [\c!style=\tx,\c!distance=\zeropoint,\c!down=.48\exheight] % historical +\setuphigh[\c!style=\tx,\c!distance=\zeropoint,\c!up =.86\exheight] % values -\def\typo_scripts_high_low#1#2#3#4#5#6% textscript mathscript fraction extra tag +\appendtoks \setuevalue\currentlow {\typo_scripts_low {\currentlow }}\to \everydefinelow +\appendtoks \setuevalue\currenthigh{\typo_scripts_high{\currenthigh}}\to \everydefinehigh + +\unexpanded\def\typo_scripts_low#1#2% + {\dontleavehmode + \begingroup + \edef\currentlow{#1}% + \kern\lowparameter\c!distance\relax + \setbox\scratchbox\hbox\bgroup + \lower\lowparameter\c!down\hbox\bgroup + \ifx\fontsize\empty + \ifmmode + \mr % no color yet + \else + \uselowstyleandcolor\c!style\c!color + \fi + \else + \uselowstyleandcolor\c!style\c!color + \fi + \dostarttagged\t!sub\currentlow + #2% + \dostoptagged + \egroup + \egroup + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \box\scratchbox + \endgroup} + +\unexpanded\def\typo_scripts_high#1#2% {\dontleavehmode \begingroup - \scratchdimen\dimexpr#3\exheight+#4\exheight\relax - \kern\highlowhfraction\exheight - \setbox\scratchbox\hbox{#1\scratchdimen\hbox - {\ifx\fontsize\empty\ifmmode\mr\else\tx\fi\else\tx\fi - \dostarttagged - #5\empty#6% - \dostoptagged}}% - \ht\scratchbox\strutheight - \dp\scratchbox\strutdepth + \edef\currenthigh{#1}% + \kern\highparameter\c!distance\relax + \setbox\scratchbox\hbox\bgroup + \raise\highparameter\c!up\hbox\bgroup + \ifx\fontsize\empty + \ifmmode + \mr % no color yet + \else + \usehighstyleandcolor\c!style\c!color + \fi + \else + \usehighstyleandcolor\c!style\c!color + \fi + \dostarttagged\t!sup\currenthigh + #2% + \dostoptagged + \egroup + \egroup + \ht\scratchbox\strutht + \dp\scratchbox\strutdp \box\scratchbox \endgroup} +\unexpanded\def\low {\typo_scripts_low \empty} +\unexpanded\def\high{\typo_scripts_high\empty} + +%D \macros +%D {lohi, hilo, definelohi, setuplohi} +%D %D You can provide an optional keyword \type {left}, in which case the super and %D subscripts will be aligned in a way that permits placement at the left of a word %D (which means that it will be right aligned). %D %D \startbuffer -%D \lohi{aha}{ah} test \lohi{aha}{ah} test -%D \lohi[left]{aha}{ah} test \lohi[left]{aha}{ah} test -%D \lohi{aha}{ah} test\lohi{aha}{ah} test -%D \lohi[left]{aha}{ah}test \lohi[left]{aha}{ah}test +%D \lohi {aha} {ah} test \lohi {aha} {ah} test +%D \lohi [left] {aha} {ah} test \lohi [left] {aha} {ah} test +%D \lohi {aha} {ah} test \lohi {aha} {ah} test +%D \lohi [left] {aha} {ah}test \lohi [left] {aha} {ah} test %D \stopbuffer %D %D \typebuffer %D \getbuffer -\unexpanded\def\lohi{\dosingleempty\typo_scripts_lohi} -\unexpanded\def\hilo{\dosingleempty\typo_scripts_hilo} +\installcorenamespace {lowhigh} + +\installcommandhandler \??lowhigh {lowhigh} \??lowhigh + +\setuplowhigh + [\c!style=\tx, + \c!distance=.1\exheight, % these are + \c!up=.96\exheight, % historical + \c!down=.58\exheight] % values -\def\typo_scripts_lohi[#1]#2#3% +\appendtoks + \setuevalue\currentlowhigh{\typo_scripts_lowhigh{\currentlowhigh}\typo_scripts_lowhigh_indeed}% +\to \everydefinelowhigh + +\unexpanded\def\typo_scripts_lowhigh#1% #2 {\dontleavehmode - \hbox - {\dostarttagged\t!subsup\empty - \setbox4\hbox{\typo_scripts_high_low\lower\mathsubnormal{.48}\highlowvfraction\t!sub{#2}}% - \setbox6\hbox{\typo_scripts_high_low\raise\mathsupnormal{.86}\highlowvfraction\t!sup{#3}}% - \doif{#1}{\v!left} - {\ifdim\wd4<\wd6 - \setbox4\hbox to \wd6{\hss\box4}% - \else - \setbox6\hbox to \wd4{\hss\box6}% - \fi}% - \ifdim\wd4<\wd6 - \wd4=\zeropoint\box4\box6 + \hbox\bgroup + \edef\currentlowhigh{#1}% + \dosingleempty} % #2 + +\unexpanded\def\typo_scripts_lowhigh_indeed[#1]#2#3% + {\dostarttagged\t!subsup\currentlowhigh + \setbox\plusfour\hbox{\typo_scripts_lowhigh_low_high\lower\c!down\t!sub{#2}}% + \setbox\plussix \hbox{\typo_scripts_lowhigh_low_high\raise\c!up \t!sup{#3}}% + \doif{#1}{\v!left} + {\ifdim\wd\plusfour<\wd\plussix + \setbox\plusfour\hbox to \wd\plussix {\hss\box\plusfour}% \else - \wd6=\zeropoint\box6\box4 - \fi - \dostoptagged}} + \setbox\plussix \hbox to \wd\plusfour{\hss\box\plussix }% + \fi}% + \ifdim\wd\plusfour<\wd\plussix + \wd\plusfour\zeropoint + \box\plusfour + \box\plussix + \else + \wd\plussix\zeropoint + \box\plussix + \box\plusfour + \fi + \dostoptagged + \egroup} + +\def\typo_scripts_lowhigh_low_high#1#2#3#4% + {\dontleavehmode + \begingroup + \kern\lowhighparameter\c!distance\relax + \setbox\scratchbox\hbox\bgroup + #1\lowhighparameter#2\hbox\bgroup + \ifx\fontsize\empty + \ifmmode + \mr % no color yet + \else + \uselowhighstyleandcolor\c!style\c!color + \fi + \else + \uselowhighstyleandcolor\c!style\c!color + \fi + \dostarttagged#3\empty + #4% + \dostoptagged + \egroup + \egroup + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \box\scratchbox + \endgroup} + +\unexpanded\def\typo_scripts_highlow_indeed[#1]#2#3% + {\typo_scripts_lowhigh_indeed[#1]{#3}{#2}} + +\unexpanded\def\lohi{\typo_scripts_lowhigh\empty\typo_scripts_lowhigh_indeed} +\unexpanded\def\hilo{\typo_scripts_lowhigh\empty\typo_scripts_highlow_indeed} + +%D \macros +%D {lowmidhigh, definelowmidhigh, setuplowmidhigh} +%D +%D The previous command originally didn't have definers. These were introduced when +%D the next showed up: +%D +%D \startbuffer +%D \definelow [MyLow] [style=\txx] +%D \definehigh [MyHigh] [style=\txx] +%D \definelowhigh [MyLoHi] [style=\txx] +%D \definelowmidhigh[MyLoMiHi][style=\txx] +%D +%D We have +%D \ruledhbox{\low {L}} and \ruledhbox{\MyLow {L}} and +%D \ruledhbox{\high {H}} and \ruledhbox{\MyHigh {H}} and +%D \ruledhbox{\lohi {L}{H}} and \ruledhbox{\MyLoHi {L}{H}} and +%D \ruledhbox{\lomihi{L}{M}{H}} and \ruledhbox{\MyLoMiHi{L}{M}{H}}. +%D \stopbuffer +%D +%D \typebuffer \getbuffer + +\installcorenamespace {lowmidhigh} + +\installcommandhandler \??lowmidhigh {lowmidhigh} \??lowmidhigh + +\setuplowmidhigh + [\c!style=\tx, + \c!up=.8\struthtdp, + \c!down=.8\struthtdp] + +\appendtoks + \setuevalue\currentlowmidhigh{\typo_scripts_lowmidhigh{\currentlowmidhigh}}% +\to \everydefinelowmidhigh + +\unexpanded\def\typo_scripts_lowmidhigh#1#2#3#4% + {\dontleavehmode \hbox \bgroup + \edef\currentlowmidhigh{#1}% + \dostarttagged\t!subsup\currentlowmidhigh + \uselowmidhighstyleandcolor\c!style\c!color + \setstrut + \setbox\plustwo \hbox{\strut\dostarttagged\t!sub\empty#2\dostoptagged}% + \setbox\plusfour\hbox{\strut\dostarttagged\t!mid\empty#3\dostoptagged}% inefficient + \setbox\plussix \hbox{\strut\dostarttagged\t!sup\empty#4\dostoptagged}% + \scratchdimen \wd + \ifdim\wd\plustwo>\wd\plusfour + \ifdim\wd\plustwo>\wd\plussix + \plustwo + \else + \plussix + \fi + \else + \ifdim\wd\plusfour>\wd\plussix + \plusfour + \else + \plussix + \fi + \fi + \relax + \setbox\plustwo \hbox to \scratchdimen{\hss \box\plustwo \hss}% + \setbox\plusfour\hbox to \scratchdimen{\hss\raise\lowmidhighparameter\c!up \box\plusfour\hss}% + \setbox\plussix \hbox to \scratchdimen{\hss\lower\lowmidhighparameter\c!down\box\plussix \hss}% + \wd\plustwo \zeropoint + \wd\plusfour\zeropoint + \box\plusfour + \box\plustwo + \box\plussix + \dostoptagged + \egroup} -\def\typo_scripts_hilo[#1]#2#3% - {\typo_scripts_lohi[#1]{#3}{#2}} +\unexpanded\def\lomihi{\typo_scripts_lowmidhigh\empty} \protect \endinput diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 4e9816bd8..fb1bba060 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 08/10/12 00:32:43 +-- merge date : 08/10/12 19:40:14 do -- begin closure to overcome local limits and interference @@ -1121,6 +1121,23 @@ local lpeg = require("lpeg") local report = texio and texio.write_nl or print +-- Watch this: Lua does some juggling with replacement values and although lpeg itself is agnostic of +-- % characters, the replacement isn't. Now, in all of the context sources these are only a few cases +-- where capture replacement instring happens. Interesting is that the string parsing already happens +-- when the lpeg is made, but nevertheless is a not that useful (at least for me) feature that has the +-- side effect that one always has to do %% in order to get a %. Okay, now that I know it is there, I +-- might use it more often. +-- +-- local p = P("@") / "%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = P("@") / "%%" +-- lpeg.print(p) print(lpeg.match(p,"@")) +-- +-- local p = C("@") * C("!") / "%2%1" +-- lpeg.print(p) print(lpeg.match(p,"@!")) + + -- local lpmatch = lpeg.match -- local lpprint = lpeg.print -- local lpp = lpeg.P @@ -1156,7 +1173,7 @@ local report = texio and texio.write_nl or print -- function lpeg.Carg (l) local p = lpcarg(l) report("LPEG Carg =") lpprint(l) return p end local type = type -local byte, char, gmatch = string.byte, string.char, string.gmatch +local byte, char, gmatch, format = string.byte, string.char, string.gmatch, string.format -- Beware, we predefine a bunch of patterns here and one reason for doing so -- is that we get consistent behaviour in some of the visualizers. @@ -1873,6 +1890,16 @@ end -- utfchar(0x205F), -- math thinspace -- } ) +-- handy from within tex: + +local lpegmatch = lpeg.match + +local replacer = lpeg.replacer("@","%%") -- Watch the escaped % in lpeg! + +function string.tformat(fmt,...) + return format(lpegmatch(replacer,fmt),...) +end + end -- closure do -- begin closure to overcome local limits and interference -- cgit v1.2.3