From 4bc28891615011ed3581836e9259434720e25830 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 4 Jul 2019 13:50:48 +0200 Subject: 2019-07-04 12:36:00 --- .../lexers/data/scite-context-data-metafun.lua | 4 +- .../lexers/data/scite-context-data-metapost.lua | 2 +- .../context/lexers/scite-context-lexer-cpp.lua | 1 + .../lexers/scite-context-lexer-web-snippets.lua | 3 +- .../context/scite-context-data-metafun.properties | 4 +- .../context/scite-context-data-metapost.properties | 86 ++-- .../context/data/scite-context-data-metafun.lua | 4 +- .../context/data/scite-context-data-metapost.lua | 2 +- .../context/lexers/scite-context-lexer-cpp.lua | 1 + .../lexers/scite-context-lexer-web-snippets.lua | 3 +- .../context/syntaxes/context-syntax-mps.json | 6 +- doc/context/documents/general/manuals/bidi.pdf | Bin 136679 -> 88603 bytes doc/context/documents/general/qrcs/setup-cs.pdf | Bin 970757 -> 970867 bytes doc/context/documents/general/qrcs/setup-de.pdf | Bin 968803 -> 968914 bytes doc/context/documents/general/qrcs/setup-en.pdf | Bin 973215 -> 973481 bytes doc/context/documents/general/qrcs/setup-fr.pdf | Bin 967334 -> 967445 bytes doc/context/documents/general/qrcs/setup-it.pdf | Bin 972473 -> 972572 bytes .../documents/general/qrcs/setup-mapping-cs.pdf | Bin 378267 -> 378358 bytes .../documents/general/qrcs/setup-mapping-en.pdf | Bin 376300 -> 376542 bytes .../documents/general/qrcs/setup-mapping-fr.pdf | Bin 377912 -> 378028 bytes .../documents/general/qrcs/setup-mapping-it.pdf | Bin 377719 -> 377831 bytes .../documents/general/qrcs/setup-mapping-nl.pdf | Bin 377246 -> 377358 bytes .../documents/general/qrcs/setup-mapping-ro.pdf | Bin 748740 -> 748857 bytes doc/context/documents/general/qrcs/setup-nl.pdf | Bin 964625 -> 964732 bytes doc/context/documents/general/qrcs/setup-ro.pdf | Bin 967166 -> 967265 bytes doc/context/sources/general/manuals/bidi/bidi.tex | 41 +- .../sources/general/manuals/onandon/onandon-53.tex | 25 ++ .../general/manuals/onandon/onandon-execute.tex | 28 +- metapost/context/base/mpiv/metafun.mpiv | 6 +- metapost/context/base/mpiv/minifun.mpiv | 2 + metapost/context/base/mpiv/mp-luas.mpiv | 121 ++++-- metapost/context/base/mpiv/mp-mlib.mpiv | 16 - scripts/context/lua/mtxrun.lua | 16 +- scripts/context/stubs/mswin/mtxrun.lua | 16 +- scripts/context/stubs/unix/mtxrun | 16 +- scripts/context/stubs/win64/mtxrun.lua | 16 +- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-cs.mkii | 1 + tex/context/base/mkii/mult-de.mkii | 1 + tex/context/base/mkii/mult-it.mkii | 2 + tex/context/base/mkii/mult-pe.mkii | 1 + tex/context/base/mkiv/cldf-ini.lua | 33 ++ tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/font-ctx.lua | 5 + tex/context/base/mkiv/font-otj.lua | 4 +- tex/context/base/mkiv/l-string.lua | 12 +- tex/context/base/mkiv/lpdf-emb.lua | 4 - tex/context/base/mkiv/lpdf-lmt.lua | 4 +- tex/context/base/mkiv/math-noa.lua | 145 ++++--- tex/context/base/mkiv/mlib-ctx.mkiv | 10 +- tex/context/base/mkiv/mlib-lmp.lua | 137 +++++++ tex/context/base/mkiv/mlib-lua.lua | 216 +++++----- tex/context/base/mkiv/mlib-run.lua | 452 +++++++++++++++------ tex/context/base/mkiv/mtx-context-listing.tex | 8 +- tex/context/base/mkiv/mult-fun.lua | 3 + tex/context/base/mkiv/mult-mps.lua | 4 +- tex/context/base/mkiv/node-nut.lua | 5 +- tex/context/base/mkiv/node-res.lua | 2 +- tex/context/base/mkiv/node-rul.lua | 6 +- tex/context/base/mkiv/node-syn.lua | 2 +- tex/context/base/mkiv/status-files.pdf | Bin 26995 -> 26899 bytes tex/context/base/mkiv/status-lua.pdf | Bin 249058 -> 251955 bytes tex/context/base/mkiv/strc-flt.mkvi | 10 +- tex/context/base/mkiv/tabl-tsp.mkiv | 2 + tex/context/base/mkiv/typo-wrp.lua | 4 +- tex/context/interface/mkii/keys-cs.xml | 1 + tex/context/interface/mkii/keys-de.xml | 1 + tex/context/interface/mkii/keys-it.xml | 2 + tex/context/interface/mkii/keys-pe.xml | 1 + tex/context/interface/mkiv/i-context.pdf | Bin 973215 -> 973481 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 27520 -> 27517 bytes tex/context/modules/mkiv/m-simulate.mkiv | 222 ++++++++++ tex/generic/context/luatex/luatex-basics-chr.lua | 4 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 13 +- 76 files changed, 1253 insertions(+), 491 deletions(-) create mode 100644 tex/context/base/mkiv/mlib-lmp.lua create mode 100644 tex/context/modules/mkiv/m-simulate.mkiv diff --git a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua index d0acd9a20..af1da89ee 100644 --- a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua +++ b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "mp", "MP", "luacall", "mirrored", "mirroredabout" }, - ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption" }, + ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex" }, + ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "contextlmtxmode" }, } \ No newline at end of file diff --git a/context/data/scite/context/lexers/data/scite-context-data-metapost.lua b/context/data/scite/context/lexers/data/scite-context-data-metapost.lua index 8d1b88052..d25b11098 100644 --- a/context/data/scite/context/lexers/data/scite-context-data-metapost.lua +++ b/context/data/scite/context/lexers/data/scite-context-data-metapost.lua @@ -3,7 +3,7 @@ return { ["disabled"]={ "verbatimtex", "troffmode" }, ["internals"]={ "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", "charscale", "ditto", "EOF", "pen_lft", "pen_rt", "pen_top", "pen_bot" }, ["metafont"]={ "autorounding", "beginchar", "blacker", "boundarychar", "capsule_def", "capsule_end", "change_width", "chardp", "chardx", "chardy", "charexists", "charext", "charht", "charic", "charlist", "charwd", "cull", "cullit", "currenttransform", "currentwindow", "define_blacker_pixels", "define_corrected_pixels", "define_good_x_pixels", "define_good_y_pixels", "define_horizontal_corrected_pixels", "define_pixels", "define_whole_blacker_pixels", "define_whole_pixels", "define_whole_vertical_blacker_pixels", "define_whole_vertical_pixels", "designsize", "display", "displaying", "endchar", "extensible", "extra_beginchar", "extra_endchar", "extra_setup", "fillin", "font_coding_scheme", "font_extra_space", "font_identifier", "font_normal_shrink", "font_normal_space", "font_normal_stretch", "font_quad", "font_size", "font_slant", "font_x_height", "fontdimen", "fontmaking", "gfcorners", "granularity", "grayfont", "headerbyte", "hppp", "hround", "imagerules", "italcorr", "kern", "labelfont", "ligtable", "lowres_fix", "makebox", "makegrid", "maketicks", "mode_def", "mode_setup", "nodisplays", "notransforms", "numspecial", "o_correction", "openit", "openwindow", "pixels_per_inch", "proofing", "proofoffset", "proofrule", "proofrulethickness", "rulepen", "screenchars", "screenrule", "screenstrokes", "screen_cols", "screen_rows", "showit", "slantfont", "smode", "smoothing", "titlefont", "totalweight", "tracingedges", "tracingpens", "turningcheck", "unitpixel", "vppp", "vround", "xoffset", "yoffset" }, - ["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "penspec", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "interpath", "on", "off", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withcmykcolor", "withpen", "dashed", "envelope", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "readstring", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "colormodel", "graypart", "greypart", "greycolor", "graycolor", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", "runscript", "maketext" }, + ["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "penspec", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "void", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "interpath", "on", "off", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withcmykcolor", "withpen", "dashed", "envelope", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "closefrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "colormodel", "graypart", "greypart", "greycolor", "graycolor", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", "runscript", "maketext" }, ["shortcuts"]={ "..", "...", "--", "---", "&", "\\" }, ["tex"]={ "btex", "etex", "verbatimtex" }, } \ No newline at end of file diff --git a/context/data/scite/context/lexers/scite-context-lexer-cpp.lua b/context/data/scite/context/lexers/scite-context-lexer-cpp.lua index 7ad187eaf..c46ae5a2a 100644 --- a/context/data/scite/context/lexers/scite-context-lexer-cpp.lua +++ b/context/data/scite/context/lexers/scite-context-lexer-cpp.lua @@ -28,6 +28,7 @@ local keywords = { -- copied from cpp.lua "restrict", -- hm "_Bool", "_Complex", "_Pragma", "_Imaginary", + "boolean", -- c++. "catch", "class", "const_cast", "delete", "dynamic_cast", "explicit", "export", "friend", "mutable", "namespace", "new", "operator", "private", diff --git a/context/data/scite/context/lexers/scite-context-lexer-web-snippets.lua b/context/data/scite/context/lexers/scite-context-lexer-web-snippets.lua index 3cef71739..5121030cc 100644 --- a/context/data/scite/context/lexers/scite-context-lexer-web-snippets.lua +++ b/context/data/scite/context/lexers/scite-context-lexer-web-snippets.lua @@ -75,7 +75,7 @@ local t_reference = token("label",p_reference) * token("function",(1-p_endofweb) -- @'char' (ascii code) -local p_character = p_beginofweb * S("'") +local p_character = p_beginofweb * squote local t_character = token("label",p_character) * token("reserved",(1-squote)^1) * token("label",squote) -- @l nonascii @@ -129,5 +129,4 @@ websnippets.pattern = P ( + t_escape ) - return websnippets diff --git a/context/data/scite/context/scite-context-data-metafun.properties b/context/data/scite/context/scite-context-data-metafun.properties index 164abbc69..2ea557d0c 100644 --- a/context/data/scite/context/scite-context-data-metafun.properties +++ b/context/data/scite/context/scite-context-data-metafun.properties @@ -72,7 +72,7 @@ dppart texvar texstr inpath pointof \ leftof rightof utflen utfsub newhash \ disposehash inhash tohash isarray prefix \ isobject comment report lua mp \ -MP luacall mirrored mirroredabout +MP luacall mirrored mirroredabout scriptindex keywordclass.metafun.internals=\ nocolormodel greycolormodel graycolormodel rgbcolormodel \ @@ -82,5 +82,5 @@ colordodgetransparent colorburntransparent darkentransparent lightentransparent exclusiontransparent huetransparent saturationtransparent colortransparent luminositytransparent \ ahvariant ahdimple ahfactor ahscale metapostversion \ maxdimensions drawoptionsfactor dq sq crossingscale \ -crossingoption +crossingoption contextlmtxmode diff --git a/context/data/scite/context/scite-context-data-metapost.properties b/context/data/scite/context/scite-context-data-metapost.properties index 3a197144b..31e14f2dd 100644 --- a/context/data/scite/context/scite-context-data-metapost.properties +++ b/context/data/scite/context/scite-context-data-metapost.properties @@ -73,50 +73,50 @@ penspec true and angle arclength \ arctime ASCII boolean bot char \ color cosd cycle decimal directiontime \ floor fontsize hex infont intersectiontimes \ -known length llcorner lrcorner makepath \ -makepen mexp mlog normaldeviate not \ -numeric oct odd or path \ -pair pen penoffset picture point \ -postcontrol precontrol reverse rotated scaled \ -shifted sind slanted sqrt str \ -string subpath substring transform transformed \ -ulcorner uniformdeviate unknown urcorner xpart \ -xscaled xxpart xypart ypart yscaled \ -yxpart yypart zscaled addto clip \ -input interim let newinternal save \ -setbounds shipout show showdependencies showtoken \ -showvariable special begingroup endgroup of \ -curl tension and controls interpath \ -on off def vardef enddef \ -expr suffix text primary secondary \ -tertiary primarydef secondarydef tertiarydef randomseed \ -also contour doublepath withcolor withcmykcolor \ -withpen dashed envelope if else \ -elseif fi for endfor forever \ -exitif within forsuffixes step until \ -charlist extensible fontdimen headerbyte kern \ -ligtable boundarychar chardp charext charht \ -charic charwd designsize fontmaking charexists \ -cullit currenttransform gfcorners grayfont hround \ -imagerules lowres_fix nodisplays notransforms openit \ -displaying currentwindow screen_rows screen_cols pixels_per_inch \ -cull display openwindow numspecial totalweight \ -autorounding fillin proofing tracingpens xoffset \ -chardx granularity smoothing turningcheck yoffset \ -chardy hppp tracingedges vppp extra_beginfig \ -extra_endfig mpxbreak endinput message delimiters \ -turningnumber errmessage readstring scantokens end \ +known void length llcorner lrcorner \ +makepath makepen mexp mlog normaldeviate \ +not numeric oct odd or \ +path pair pen penoffset picture \ +point postcontrol precontrol reverse rotated \ +scaled shifted sind slanted sqrt \ +str string subpath substring transform \ +transformed ulcorner uniformdeviate unknown urcorner \ +xpart xscaled xxpart xypart ypart \ +yscaled yxpart yypart zscaled addto \ +clip input interim let newinternal \ +save setbounds shipout show showdependencies \ +showtoken showvariable special begingroup endgroup \ +of curl tension and controls \ +interpath on off def vardef \ +enddef expr suffix text primary \ +secondary tertiary primarydef secondarydef tertiarydef \ +randomseed also contour doublepath withcolor \ +withcmykcolor withpen dashed envelope if \ +else elseif fi for endfor \ +forever exitif within forsuffixes step \ +until charlist extensible fontdimen headerbyte \ +kern ligtable boundarychar chardp charext \ +charht charic charwd designsize fontmaking \ +charexists cullit currenttransform gfcorners grayfont \ +hround imagerules lowres_fix nodisplays notransforms \ +openit displaying currentwindow screen_rows screen_cols \ +pixels_per_inch cull display openwindow numspecial \ +totalweight autorounding fillin proofing tracingpens \ +xoffset chardx granularity smoothing turningcheck \ +yoffset chardy hppp tracingedges vppp \ +extra_beginfig extra_endfig mpxbreak endinput message \ +delimiters turningnumber errmessage scantokens end \ outer inner write to readfrom \ -withprescript withpostscript top bot lft \ -rt ulft urt llft lrt \ -redpart greenpart bluepart cyanpart magentapart \ -yellowpart blackpart prescriptpart postscriptpart rgbcolor \ -cmykcolor colormodel graypart greypart greycolor \ -graycolor dashpart penpart stroked filled \ -textual clipped bounded pathpart expandafter \ -minute hour outputformat outputtemplate filenametemplate \ -fontmapfile fontmapline fontpart fontsize glyph \ -restoreclipcolor troffmode runscript maketext +closefrom withprescript withpostscript top bot \ +lft rt ulft urt llft \ +lrt redpart greenpart bluepart cyanpart \ +magentapart yellowpart blackpart prescriptpart postscriptpart \ +rgbcolor cmykcolor colormodel graypart greypart \ +greycolor graycolor dashpart penpart stroked \ +filled textual clipped bounded pathpart \ +expandafter minute hour outputformat outputtemplate \ +filenametemplate fontmapfile fontmapline fontpart fontsize \ +glyph restoreclipcolor troffmode runscript maketext keywordclass.metapost.shortcuts=\ .. ... -- --- \ diff --git a/context/data/textadept/context/data/scite-context-data-metafun.lua b/context/data/textadept/context/data/scite-context-data-metafun.lua index d0acd9a20..af1da89ee 100644 --- a/context/data/textadept/context/data/scite-context-data-metafun.lua +++ b/context/data/textadept/context/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "mp", "MP", "luacall", "mirrored", "mirroredabout" }, - ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption" }, + ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex" }, + ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "contextlmtxmode" }, } \ No newline at end of file diff --git a/context/data/textadept/context/data/scite-context-data-metapost.lua b/context/data/textadept/context/data/scite-context-data-metapost.lua index 8d1b88052..d25b11098 100644 --- a/context/data/textadept/context/data/scite-context-data-metapost.lua +++ b/context/data/textadept/context/data/scite-context-data-metapost.lua @@ -3,7 +3,7 @@ return { ["disabled"]={ "verbatimtex", "troffmode" }, ["internals"]={ "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", "charscale", "ditto", "EOF", "pen_lft", "pen_rt", "pen_top", "pen_bot" }, ["metafont"]={ "autorounding", "beginchar", "blacker", "boundarychar", "capsule_def", "capsule_end", "change_width", "chardp", "chardx", "chardy", "charexists", "charext", "charht", "charic", "charlist", "charwd", "cull", "cullit", "currenttransform", "currentwindow", "define_blacker_pixels", "define_corrected_pixels", "define_good_x_pixels", "define_good_y_pixels", "define_horizontal_corrected_pixels", "define_pixels", "define_whole_blacker_pixels", "define_whole_pixels", "define_whole_vertical_blacker_pixels", "define_whole_vertical_pixels", "designsize", "display", "displaying", "endchar", "extensible", "extra_beginchar", "extra_endchar", "extra_setup", "fillin", "font_coding_scheme", "font_extra_space", "font_identifier", "font_normal_shrink", "font_normal_space", "font_normal_stretch", "font_quad", "font_size", "font_slant", "font_x_height", "fontdimen", "fontmaking", "gfcorners", "granularity", "grayfont", "headerbyte", "hppp", "hround", "imagerules", "italcorr", "kern", "labelfont", "ligtable", "lowres_fix", "makebox", "makegrid", "maketicks", "mode_def", "mode_setup", "nodisplays", "notransforms", "numspecial", "o_correction", "openit", "openwindow", "pixels_per_inch", "proofing", "proofoffset", "proofrule", "proofrulethickness", "rulepen", "screenchars", "screenrule", "screenstrokes", "screen_cols", "screen_rows", "showit", "slantfont", "smode", "smoothing", "titlefont", "totalweight", "tracingedges", "tracingpens", "turningcheck", "unitpixel", "vppp", "vround", "xoffset", "yoffset" }, - ["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "penspec", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "interpath", "on", "off", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withcmykcolor", "withpen", "dashed", "envelope", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "readstring", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "colormodel", "graypart", "greypart", "greycolor", "graycolor", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", "runscript", "maketext" }, + ["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "penspec", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "void", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "interpath", "on", "off", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withcmykcolor", "withpen", "dashed", "envelope", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "closefrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "colormodel", "graypart", "greypart", "greycolor", "graycolor", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", "runscript", "maketext" }, ["shortcuts"]={ "..", "...", "--", "---", "&", "\\" }, ["tex"]={ "btex", "etex", "verbatimtex" }, } \ No newline at end of file diff --git a/context/data/textadept/context/lexers/scite-context-lexer-cpp.lua b/context/data/textadept/context/lexers/scite-context-lexer-cpp.lua index 7ad187eaf..c46ae5a2a 100644 --- a/context/data/textadept/context/lexers/scite-context-lexer-cpp.lua +++ b/context/data/textadept/context/lexers/scite-context-lexer-cpp.lua @@ -28,6 +28,7 @@ local keywords = { -- copied from cpp.lua "restrict", -- hm "_Bool", "_Complex", "_Pragma", "_Imaginary", + "boolean", -- c++. "catch", "class", "const_cast", "delete", "dynamic_cast", "explicit", "export", "friend", "mutable", "namespace", "new", "operator", "private", diff --git a/context/data/textadept/context/lexers/scite-context-lexer-web-snippets.lua b/context/data/textadept/context/lexers/scite-context-lexer-web-snippets.lua index 3cef71739..5121030cc 100644 --- a/context/data/textadept/context/lexers/scite-context-lexer-web-snippets.lua +++ b/context/data/textadept/context/lexers/scite-context-lexer-web-snippets.lua @@ -75,7 +75,7 @@ local t_reference = token("label",p_reference) * token("function",(1-p_endofweb) -- @'char' (ascii code) -local p_character = p_beginofweb * S("'") +local p_character = p_beginofweb * squote local t_character = token("label",p_character) * token("reserved",(1-squote)^1) * token("label",squote) -- @l nonascii @@ -129,5 +129,4 @@ websnippets.pattern = P ( + t_escape ) - return websnippets diff --git a/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json b/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json index f1644ff58..476caf7d3 100644 --- a/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json +++ b/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json @@ -60,7 +60,7 @@ "name" : "context.extra" }, "helper" : { - "match" : "(zmod|ystretched|ysized|xysized|xyscaled|xstretched|xsized|withtransparency|withshadevector|withshadetransform|withshadestep|withshaderadius|withshadeorigin|withshademethod|withshadefraction|withshadefactor|withshadedomain|withshadedirection|withshadecolors|withshadecenter|withshade|withproperties|withmask|withlinearshade|withgrey|withgray|withcircularshade|whitecolor|wdpart|visualizepaths|visualizedfill|visualizeddraw|verbatim|utfsub|utflen|urtriangle|urmoved|urenlarged|urcircle|uptriangle|unspiked|unitvector|unittriangle|unitdiamond|unitcircle|uniquelist|undrawfill|undecorated|undashed|uncolored|ultriangle|ulmoved|ulenlarged|ulcircle|tripled|triangle|transparent|transparency|tostring|topenlarged|topboundary|topath|topair|tolist|tohash|tocycle|thetextext|thetexbox|theoffset|thelabel|texvar|texvar|textextoffset|textext|texstr|texstr|texmode|texbox|tensecircle|tcircle|tanh|tand|tan|systemmode|superellipsed|strut|stretched|straightpath|straightpairs|straightfunction|stoppassingvariable|startpassingvariable|squeezed|squarepath|sqr|spotcolor|space|sortlist|softened|snapped|smoothed|sized|sinh|sin|simplified|shownshadevector|shownshadeorigin|shortened|shapedlist|shadedup|shadedright|shadedleft|shadedinto|shadeddown|shaded|settoks|setmacro|setdimen|setcount|rule|roundedsquare|righttriangle|rightof|rightenlarged|rightboundary|rightarrow|resolvedcolor|resetdrawoptions|resetarrows|report|register|redecorated|readfile|rcircle|rawtextext|rawtexbox|randomshifted|randomizedcontrols|randomized|radian|quote|quotation|pushcurrentpicture|pushboundingbox|punked|property|properties|prefix|prefix|pow|positionxy|positionwhd|positionregion|positionpxy|positionpath|positionpage|positioninregion|positioncurve|positionbox|positionatanchor|positionanchor|popcurrentpicture|popboundingbox|pointof|pi|perpendicular|percent|penpoint|pencilled|peepholed|pathconnectors|passvariable|passarrayvariable|paralleled|paired|outsideof|outlinetexttopath|outlinetext|outerboundingbox|originpath|onlayer|oddly|nothing|notcached|normalfill|normaldraw|nofill|newhash|naturalizepaths|namedcolor|multitonecolor|mp|mirroredabout|mirrored|luacall|lua|lrtriangle|lrmoved|lrenlarged|lrcircle|log|loadmodule|loadimage|loadfile|loadfigure|ln|lltriangle|llmoved|llenlarged|llcircle|listtolines|listtocurves|listsize|listlast|linearpath|lefttriangle|leftof|leftenlarged|leftboundary|leftarrow|lcircle|laddered|label|keepcached|istextext|isobject|isarray|isarray|invtan|invsin|inverted|invcos|inv|intersection_point|intersection_found|interpolated|insideof|inpath|innerboundingbox|inhash|infont|infinite|htpart|greyscale|greyed|grayscale|grayed|graphictext|gettoks|getmacro|getdimen|getcount|function|fulltriangle|fullsquare|fulldiamond|formatted|format|fillup|filloutlinetext|figure|externalfigure|exp|evenly|epsed|eofillup|eofill|eoclip|enlonged|enlarged|drawwholepath|drawpoints|drawpointoptions|drawpointlabels|drawpoint|drawpathoptions|drawpathonly|drawpath|drawoutlinetext|draworiginoptions|draworigin|drawlineoptions|drawlabeloptions|drawfill|drawdoublearrows|drawcontrolpoints|drawcontroloptions|drawcontrollines|drawboundoptions|drawboundingbox|drawboundary|dquote|dppart|downtriangle|disposehash|dispose|dimension|detailpaths|detaileddraw|defineshade|decorated|ddecimal|dddecimal|ddddecimal|cutends|curvedpath|curvedpairs|curvedfunction|curved|crossingunder|crossed|crlf|cotd|cot|cosh|cos|cornered|copylist|constructedpath|constructedpairs|constructedfunction|condition|complemented|complementary|comment|colortype|colorpart|colorlike|colordecimalslist|colordecimals|cmyk|clearxy|circularpath|checkedbounds|checkbounds|centerarrow|center|break|boundingradius|boundingpoint|boundingcircle|boundingbox|bottomenlarged|bottomboundary|blownup|blackcolor|bitmapimage|bcircle|bbwidth|bbheight|basiccolors|autoalign|atan|asinh|asin|asgroup|arrowpath|area|anchored|along|addbackground|acosh|acos|SPACE|PERCENT|MP|DQUOTE|CRLF)(?=[^a-zA-Z\u005C_@!?-ÿ])", + "match" : "(zmod|ystretched|ysized|xysized|xyscaled|xstretched|xsized|withtransparency|withshadevector|withshadetransform|withshadestep|withshaderadius|withshadeorigin|withshademethod|withshadefraction|withshadefactor|withshadedomain|withshadedirection|withshadecolors|withshadecenter|withshade|withproperties|withmask|withlinearshade|withgrey|withgray|withcircularshade|whitecolor|wdpart|visualizepaths|visualizedfill|visualizeddraw|verbatim|utfsub|utflen|urtriangle|urmoved|urenlarged|urcircle|uptriangle|unspiked|unitvector|unittriangle|unitdiamond|unitcircle|uniquelist|undrawfill|undecorated|undashed|uncolored|ultriangle|ulmoved|ulenlarged|ulcircle|tripled|triangle|transparent|transparency|tostring|topenlarged|topboundary|topath|topair|tolist|tohash|tocycle|thetextext|thetexbox|theoffset|thelabel|texvar|texvar|textextoffset|textext|texstr|texstr|texmode|texbox|tensecircle|tcircle|tanh|tand|tan|systemmode|superellipsed|strut|stretched|straightpath|straightpairs|straightfunction|stoppassingvariable|startpassingvariable|squeezed|squarepath|sqr|spotcolor|space|sortlist|softened|snapped|smoothed|sized|sinh|sin|simplified|shownshadevector|shownshadeorigin|shortened|shapedlist|shadedup|shadedright|shadedleft|shadedinto|shadeddown|shaded|settoks|setmacro|setdimen|setcount|scriptindex|rule|roundedsquare|righttriangle|rightof|rightenlarged|rightboundary|rightarrow|resolvedcolor|resetdrawoptions|resetarrows|report|register|redecorated|readfile|rcircle|rawtextext|rawtexbox|randomshifted|randomizedcontrols|randomized|radian|quote|quotation|pushcurrentpicture|pushboundingbox|punked|property|properties|prefix|prefix|pow|positionxy|positionwhd|positionregion|positionpxy|positionpath|positionpage|positioninregion|positioncurve|positionbox|positionatanchor|positionanchor|popcurrentpicture|popboundingbox|pointof|pi|perpendicular|percent|penpoint|pencilled|peepholed|pathconnectors|passvariable|passarrayvariable|paralleled|paired|outsideof|outlinetexttopath|outlinetext|outerboundingbox|originpath|onlayer|oddly|nothing|notcached|normalfill|normaldraw|nofill|newhash|naturalizepaths|namedcolor|multitonecolor|mp|mirroredabout|mirrored|luacall|lua|lrtriangle|lrmoved|lrenlarged|lrcircle|log|loadmodule|loadimage|loadfile|loadfigure|ln|lltriangle|llmoved|llenlarged|llcircle|listtolines|listtocurves|listsize|listlast|linearpath|lefttriangle|leftof|leftenlarged|leftboundary|leftarrow|lcircle|laddered|label|keepcached|istextext|isobject|isarray|isarray|invtan|invsin|inverted|invcos|inv|intersection_point|intersection_found|interpolated|insideof|inpath|innerboundingbox|inhash|infont|infinite|htpart|greyscale|greyed|grayscale|grayed|graphictext|gettoks|getmacro|getdimen|getcount|function|fulltriangle|fullsquare|fulldiamond|formatted|format|fillup|filloutlinetext|figure|externalfigure|exp|evenly|epsed|eofillup|eofill|eoclip|enlonged|enlarged|drawwholepath|drawpoints|drawpointoptions|drawpointlabels|drawpoint|drawpathoptions|drawpathonly|drawpath|drawoutlinetext|draworiginoptions|draworigin|drawlineoptions|drawlabeloptions|drawfill|drawdoublearrows|drawcontrolpoints|drawcontroloptions|drawcontrollines|drawboundoptions|drawboundingbox|drawboundary|dquote|dppart|downtriangle|disposehash|dispose|dimension|detailpaths|detaileddraw|defineshade|decorated|ddecimal|dddecimal|ddddecimal|cutends|curvedpath|curvedpairs|curvedfunction|curved|crossingunder|crossed|crlf|cotd|cot|cosh|cos|cornered|copylist|constructedpath|constructedpairs|constructedfunction|condition|complemented|complementary|comment|colortype|colorpart|colorlike|colordecimalslist|colordecimals|cmyk|clearxy|circularpath|checkedbounds|checkbounds|centerarrow|center|break|boundingradius|boundingpoint|boundingcircle|boundingbox|bottomenlarged|bottomboundary|blownup|blackcolor|bitmapimage|bcircle|bbwidth|bbheight|basiccolors|autoalign|atan|asinh|asin|asgroup|arrowpath|area|anchored|along|addbackground|acosh|acos|SPACE|PERCENT|MP|DQUOTE|CRLF)(?=[^a-zA-Z\u005C_@!?-ÿ])", "name" : "context.command.metafun.helper.mps" }, "identifier" : { @@ -119,7 +119,7 @@ "name" : "context.plain.plain.mps" }, "primitive" : { - "match" : "(zscaled|yypart|yxpart|yscaled|ypart|yoffset|yellowpart|year|xypart|xxpart|xscaled|xpart|xoffset|write|withprescript|withpostscript|withpen|within|withcolor|withcmykcolor|warningcheck|vppp|vardef|urt|urcorner|until|unknown|uniformdeviate|ulft|ulcorner|turningnumber|turningcheck|truecorners|true|troffmode|transformed|transform|tracingtitles|tracingstats|tracingspecs|tracingrestores|tracingpens|tracingoutput|tracingonline|tracingmacros|tracinglostchars|tracingequations|tracingedges|tracingcommands|tracingchoices|tracingcapsules|totalweight|top|to|time|textual|text|tertiarydef|tertiary|tension|suffix|substring|subpath|stroked|string|str|step|sqrt|special|smoothing|slanted|sind|showvariable|showtoken|showstopping|showdependencies|show|shipout|shifted|setbounds|secondarydef|secondary|screen_rows|screen_cols|scantokens|scaled|save|runscript|rt|rotated|rgbcolor|reverse|restoreclipcolor|redpart|readstring|readfrom|randomseed|proofing|prologues|primarydef|primary|prescriptpart|precontrol|postscriptpart|postcontrol|point|pixels_per_inch|picture|penspec|penpart|penoffset|pencircle|pen|pausing|pathpart|path|pair|outputtemplate|outputformat|outer|or|openwindow|openit|on|off|of|odd|oct|numspecial|numeric|nullpicture|notransforms|not|normaldeviate|nodisplays|newinternal|mpxbreak|mpprocset|month|mlog|miterlimit|minute|mexp|message|maketext|makepen|makepath|magentapart|lrt|lrcorner|lowres_fix|llft|llcorner|linejoin|linecap|ligtable|lft|let|length|known|kern|intersectiontimes|interpath|interim|input|inner|infont|imagerules|if|hround|hppp|hour|hex|headerbyte|greypart|greycolor|greenpart|graypart|grayfont|graycolor|granularity|glyph|gfcorners|forsuffixes|forever|for|fontsize|fontsize|fontpart|fontmapline|fontmapfile|fontmaking|fontdimen|floor|fillin|filled|filenametemplate|fi|false|extra_endfig|extra_beginfig|extensible|expr|expandafter|exitif|errmessage|envelope|endinput|endgroup|endfor|enddef|end|elseif|else|doublepath|displaying|display|directiontime|designsize|delimiters|def|decimal|day|dashpart|dashed|cycle|cyanpart|currentwindow|currenttransform|curl|cullit|cull|cosd|controls|contour|colormodel|color|cmykcolor|clipped|clip|charwd|charlist|charic|charht|charext|charexists|chardy|chardx|chardp|charcode|char|bounded|boundarychar|bot|bot|boolean|bluepart|blackpart|begingroup|autorounding|arctime|arclength|angle|and|and|also|addto|ASCII)(?=[^a-zA-Z\u005C_@!?-ÿ])", + "match" : "(zscaled|yypart|yxpart|yscaled|ypart|yoffset|yellowpart|year|xypart|xxpart|xscaled|xpart|xoffset|write|withprescript|withpostscript|withpen|within|withcolor|withcmykcolor|warningcheck|vppp|void|vardef|urt|urcorner|until|unknown|uniformdeviate|ulft|ulcorner|turningnumber|turningcheck|truecorners|true|troffmode|transformed|transform|tracingtitles|tracingstats|tracingspecs|tracingrestores|tracingpens|tracingoutput|tracingonline|tracingmacros|tracinglostchars|tracingequations|tracingedges|tracingcommands|tracingchoices|tracingcapsules|totalweight|top|to|time|textual|text|tertiarydef|tertiary|tension|suffix|substring|subpath|stroked|string|str|step|sqrt|special|smoothing|slanted|sind|showvariable|showtoken|showstopping|showdependencies|show|shipout|shifted|setbounds|secondarydef|secondary|screen_rows|screen_cols|scantokens|scaled|save|runscript|rt|rotated|rgbcolor|reverse|restoreclipcolor|redpart|readfrom|randomseed|proofing|prologues|primarydef|primary|prescriptpart|precontrol|postscriptpart|postcontrol|point|pixels_per_inch|picture|penspec|penpart|penoffset|pencircle|pen|pausing|pathpart|path|pair|outputtemplate|outputformat|outer|or|openwindow|openit|on|off|of|odd|oct|numspecial|numeric|nullpicture|notransforms|not|normaldeviate|nodisplays|newinternal|mpxbreak|mpprocset|month|mlog|miterlimit|minute|mexp|message|maketext|makepen|makepath|magentapart|lrt|lrcorner|lowres_fix|llft|llcorner|linejoin|linecap|ligtable|lft|let|length|known|kern|intersectiontimes|interpath|interim|input|inner|infont|imagerules|if|hround|hppp|hour|hex|headerbyte|greypart|greycolor|greenpart|graypart|grayfont|graycolor|granularity|glyph|gfcorners|forsuffixes|forever|for|fontsize|fontsize|fontpart|fontmapline|fontmapfile|fontmaking|fontdimen|floor|fillin|filled|filenametemplate|fi|false|extra_endfig|extra_beginfig|extensible|expr|expandafter|exitif|errmessage|envelope|endinput|endgroup|endfor|enddef|end|elseif|else|doublepath|displaying|display|directiontime|designsize|delimiters|def|decimal|day|dashpart|dashed|cycle|cyanpart|currentwindow|currenttransform|curl|cullit|cull|cosd|controls|contour|colormodel|color|cmykcolor|closefrom|clipped|clip|charwd|charlist|charic|charht|charext|charexists|chardy|chardx|chardp|charcode|char|bounded|boundarychar|bot|bot|boolean|bluepart|blackpart|begingroup|autorounding|arctime|arclength|angle|and|and|also|addto|ASCII)(?=[^a-zA-Z\u005C_@!?-ÿ])", "name" : "context.primitive.primitive.mps" }, "quoted" : { @@ -138,7 +138,7 @@ "name" : "context.string.string.text.mps" }, "shortcut" : { - "match" : "(textextoffset|textextanchor|squared|sq|softlighttransparent|shadefactor|screentransparent|saturationtransparent|rounded|rgbcolormodel|pen_top|pen_rt|pen_lft|pen_bot|overlaytransparent|normaltransparent|nocolormodel|multiplytransparent|mitered|metapostversion|maxdimensions|luminositytransparent|lightentransparent|labeloffset|join_radius|infinity|huetransparent|hardlighttransparent|greycolormodel|graycolormodel|exclusiontransparent|epsilon|eps|drawoptionsfactor|dq|dotlabeldiam|ditto|differencetransparent|defaultscale|defaultpen|darkentransparent|crossingscale|crossingoption|colortransparent|colordodgetransparent|colorburntransparent|cmykcolormodel|charscale|butt|beveled|bboxmargin|ahvariant|ahscale|ahlength|ahfactor|ahdimple|ahangle|EOF)(?=[^a-zA-Z\u005C_@!?-ÿ])", + "match" : "(textextoffset|textextanchor|squared|sq|softlighttransparent|shadefactor|screentransparent|saturationtransparent|rounded|rgbcolormodel|pen_top|pen_rt|pen_lft|pen_bot|overlaytransparent|normaltransparent|nocolormodel|multiplytransparent|mitered|metapostversion|maxdimensions|luminositytransparent|lightentransparent|labeloffset|join_radius|infinity|huetransparent|hardlighttransparent|greycolormodel|graycolormodel|exclusiontransparent|epsilon|eps|drawoptionsfactor|dq|dotlabeldiam|ditto|differencetransparent|defaultscale|defaultpen|darkentransparent|crossingscale|crossingoption|contextlmtxmode|colortransparent|colordodgetransparent|colorburntransparent|cmykcolormodel|charscale|butt|beveled|bboxmargin|ahvariant|ahscale|ahlength|ahfactor|ahdimple|ahangle|EOF)(?=[^a-zA-Z\u005C_@!?-ÿ])", "name" : "context.data.shortcut.mps" }, "special" : { diff --git a/doc/context/documents/general/manuals/bidi.pdf b/doc/context/documents/general/manuals/bidi.pdf index feec5913e..c9cba69b1 100644 Binary files a/doc/context/documents/general/manuals/bidi.pdf and b/doc/context/documents/general/manuals/bidi.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf index bde11d0b4..50429afa6 100644 Binary files a/doc/context/documents/general/qrcs/setup-cs.pdf and b/doc/context/documents/general/qrcs/setup-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf index 74be65e0c..4852eb2a4 100644 Binary files a/doc/context/documents/general/qrcs/setup-de.pdf and b/doc/context/documents/general/qrcs/setup-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf index 51806d7e1..97b13f0d0 100644 Binary files a/doc/context/documents/general/qrcs/setup-en.pdf and b/doc/context/documents/general/qrcs/setup-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf index fe545f06f..7b7f180cc 100644 Binary files a/doc/context/documents/general/qrcs/setup-fr.pdf and b/doc/context/documents/general/qrcs/setup-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf index d7f3b1b11..3769f1385 100644 Binary files a/doc/context/documents/general/qrcs/setup-it.pdf and b/doc/context/documents/general/qrcs/setup-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf index dd99323e7..fb53b7470 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf and b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf index c5075de53..330403d71 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-en.pdf and b/doc/context/documents/general/qrcs/setup-mapping-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf index 2733671a1..a2d76bcec 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf and b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf index 65e1810df..49824dd90 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-it.pdf and b/doc/context/documents/general/qrcs/setup-mapping-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf index 8fe0b8427..90a16e638 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf and b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf index 87f12c9c8..a3af97a7b 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf and b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf index 94404dd30..3ec45c3b3 100644 Binary files a/doc/context/documents/general/qrcs/setup-nl.pdf and b/doc/context/documents/general/qrcs/setup-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf index b1ad7aca2..7d7f87273 100644 Binary files a/doc/context/documents/general/qrcs/setup-ro.pdf and b/doc/context/documents/general/qrcs/setup-ro.pdf differ diff --git a/doc/context/sources/general/manuals/bidi/bidi.tex b/doc/context/sources/general/manuals/bidi/bidi.tex index abd3f64fa..fb3705a37 100644 --- a/doc/context/sources/general/manuals/bidi/bidi.tex +++ b/doc/context/sources/general/manuals/bidi/bidi.tex @@ -461,38 +461,39 @@ We assume that you run \CONTEXT\ \MKIV\ in combination with \LUATEX. Direction support in this engine has been improved over time. Originally the \OMEGA\ (\ALEPH) direction model was used but in the meantime it has been stripped to the basics, and what used to be so called whatsits (extension nodes) are now first -class nodes. In the \LUA\ interface we still support the: - -\startitemize[packed] -\startitem - \type {TLT} and \type {TRT} keywords for local par nodes -\stopitem -\startitem - \type {+TLT}, \type {-TLT}, \type {+TRT} and \type {-TRT} keywords for - direction nodes -\stopitem -\stopitemize - -However, because we use dedicated nodes, and because nodes actually store numbers -and not strings we also expose the numeric model: +class nodes. Of the many directions only four are kept in \LUATEX\ and they are +indicated by three letters: \starttabulate[|l|l|l|] \NC 0 \NC \type {TLT} \NC left to right \NC \NR \NC 1 \NC \type {TRT} \NC right to left \NC \NR -\NC 2 \NC \type {LTL} \NC not used in context \NC \NR -\NC 3 \NC \type {RTT} \NC not used in context \NC \NR +\NC 2 \NC \type {LTL} \NC not used in context (obsolete) \NC \NR +\NC 3 \NC \type {RTT} \NC not used in context (obsolete) \NC \NR \stoptabulate -These values are used for local par nodes as well as direction nodes. In addition -a direction node has a subtype: +In \LUAMETATEX, and therefore \CONTEXT\ \LMTX\ we only have the first two. +Therefore in \LMTX\ you normally don't have to worry about checking for them at +the \LUA\ end because they are irrelevant for calculations (the vertical ones +swapped the horizontal and vertical progression). Also, when really needed, we +use the \type {direction} keys with numerical indicators, so zero for \type {l2r} +and one for \type {r2l}. These values are used for local par nodes as well as +direction nodes. In addition a direction node has a subtype: \starttabulate[|l|l|l|] \NC 0 \NC \type {normal} \NC comparable to \type {+} \NC \NR \NC 1 \NC \type {cancel} \NC comparable to \type {-} \NC \NR \stoptabulate -The \type {dir} field uses the strings, the \type {direction} field the number -(both of course share the same internal node variable). +\stopchapter + +\startchapter[title={Going vertical}] + +Normally the term bidi is reserved for horizontal direction swapping but there is +no reason to limit our view to that. So, here I will spend some words on how we +can deal with vertical directions. + +{\em I will move some (not yet public) explanation from elsewhere to here in due +time.} \stopchapter diff --git a/doc/context/sources/general/manuals/onandon/onandon-53.tex b/doc/context/sources/general/manuals/onandon/onandon-53.tex index 0d5dc1b9c..46eac3510 100644 --- a/doc/context/sources/general/manuals/onandon/onandon-53.tex +++ b/doc/context/sources/general/manuals/onandon/onandon-53.tex @@ -281,6 +281,31 @@ intermediate versions of the \LUA\ 5.3 binary will end up on the \CONTEXT\ garden, probably with number 1.08 and 1.09 (who knows what else we will add or change in the meantime). +\subsubject{addendum} + +Around the 2018 meeting I started with what is to become the next major upgrade +of \CONTEXT, this time using \LUAMETATEX. When working on that I decided to try +\LUA\ 5.4 and see what consequences that would have for us. There are no real +conceptual changes, as with the number model in 5.3, so the tests didn't reveal +any issues. But as an additional step towards a bit cleaner distinction between +strings and numbers, I disabled the casting so that mixing them in expression for +instance is no longer permitted. If I remember right only in one place I had to +adapt the source (and in the meantime we're talking of a pretty large code base). + +There is a new mechanism for freezing constants but I'm not yet sure if it makes +much sense to use it. It goes along with some other restrictions, like the +possibility to adapt loop counters inside the loop. Inside the body of a loop one +could always adapt such a variable, which (I can imagine) can come in handy. I +didn't check yet the source code for that, but probably I don't do that. + +Another new features is an alternative garbage collector which seems to perform +better when there are many variables with s short live span. For now I decided +to default to this variant in future releases. + +Overall the performance of \LUA\ 5.4 is better than its predecessors which means +that the gape between \LUATEX\ and \LUAJITTEX\ is closing. This is good because +in \LUAMETATEX\ I will not support that variant. + \stopchapter \stopcomponent diff --git a/doc/context/sources/general/manuals/onandon/onandon-execute.tex b/doc/context/sources/general/manuals/onandon/onandon-execute.tex index abb3b4d8a..bd11dfa73 100644 --- a/doc/context/sources/general/manuals/onandon/onandon-execute.tex +++ b/doc/context/sources/general/manuals/onandon/onandon-execute.tex @@ -134,14 +134,17 @@ which can also be achieved by \directlua{print("Hi there!")} \stoptyping -which sometimes can be more convenient. Anyway, a function call is what we can -use for our purpose as it doesn't involve interpretation and effectively behaves -like a tail call. The following snippet shows what we have in mind: +which sometimes can be more convenient. Don't overestimate the gain in speed +because \type {directlua} is quite efficient too, and on an average run a user +doesn't call it that often (millions of times that is). Anyway, a function call +is what we can use for our purpose as it doesn't involve interpretation and +effectively behaves like a tail call. The following snippet shows what we have in +mind: \startbuffer[code] local stepper = nil local stack = { } -local fid = 0xFFFFFF +local fid = 2 -- make sure to take a frees slot local goback = "\\luafunction" .. fid .. "\\relax" function tex.resume() @@ -166,6 +169,14 @@ function tex.routine(f) stepper = coroutine.create(f) tex.sprint(goback) end + +-- Because we protect against abuse and overload of functions, in ConTeXt we +-- need to do the following: + +if context then + fid = context.functions.register(tex.resume) + goback = "\\luafunction" .. fid .. "\\relax" +end \stopbuffer \ctxluabuffer[code] @@ -238,7 +249,7 @@ course figuring it out took a while): \startbuffer[code] local stepper = nil local stack = { } -local fid = 0xFFFFFF +local fid = 3 -- make sure to take a frees slot local goback = "\\luafunction" .. fid .. "\\relax" function tex.resume() @@ -270,6 +281,13 @@ function tex.routine(f) stepper = coroutine.create(f) tex.sprint(goback) end + +-- Again we need to do it as follows in ConTeXt: + +if context then + fid = context.functions.register(tex.resume) + goback = "\\luafunction" .. fid .. "\\relax" +end \stopbuffer \ctxluabuffer[code] diff --git a/metapost/context/base/mpiv/metafun.mpiv b/metapost/context/base/mpiv/metafun.mpiv index fa43d3460..5a47280c4 100644 --- a/metapost/context/base/mpiv/metafun.mpiv +++ b/metapost/context/base/mpiv/metafun.mpiv @@ -15,8 +15,10 @@ %D prevent dependency problems and in the end even may use a patched version, %D we prefer to use a copy. -prologues := 0 ; -mpprocset := 1 ; +boolean contextlmtxmode ; contextlmtxmode := if known fontmaking : false else: true fi; + +prologues := 0 ; % not used +mpprocset := 1 ; % not used input "mp-base.mpiv" ; input "mp-tool.mpiv" ; diff --git a/metapost/context/base/mpiv/minifun.mpiv b/metapost/context/base/mpiv/minifun.mpiv index 6d877fddb..ea4634c85 100644 --- a/metapost/context/base/mpiv/minifun.mpiv +++ b/metapost/context/base/mpiv/minifun.mpiv @@ -14,6 +14,8 @@ %D This is a minimal \METAFUN\ instance which can be handy for isolated %D subruns. +boolean contextlmtxmode ; contextlmtxmode := if known fontmaking : false else: true fi; + prologues := 0 ; mpprocset := 1 ; diff --git a/metapost/context/base/mpiv/mp-luas.mpiv b/metapost/context/base/mpiv/mp-luas.mpiv index 03f445014..1ba4a6dc9 100644 --- a/metapost/context/base/mpiv/mp-luas.mpiv +++ b/metapost/context/base/mpiv/mp-luas.mpiv @@ -24,6 +24,23 @@ if known context_luas : endinput ; fi ; boolean context_luas ; context_luas := true ; +% Experimental + +if contextlmtxmode : + + % not yet (timing issue) + + newinternal mfid_scriptindex ; + mfid_scriptindex := runscript("mp.mf_script_index('scriptindex')") ; + + def scriptindex = runscript mfid_scriptindex enddef ; + +% def scriptindex expr name = +% lua.mp.mf_script_index(name) +% enddef ; + +fi ; + % First variant: % % let lua = runscript ; @@ -110,7 +127,7 @@ def mlib_luas_luadone = exitif numeric begingroup mfun_luas_b := 1 ; endgroup ; enddef ; -vardef mlib_luas_lualist(expr c)(text t) = +vardef mlib_luas_lualist(expr c)(text t) = % we could use mlib_luas_s instead of c interim mfun_luas_b := 0 ; runscript(c & for s = t : if mfun_luas_b = 0 : @@ -164,6 +181,32 @@ def message expr t = lua.mp.report(tostring(t)) ; enddef ; +% Color: + +% We do a low level runscript: +% +% lua.mp.namedcolor(s) % conflicts with macro namedcolor +% lua.mp.mf_named_color(s) % okay but, can also be +% lua.mp("mf_named_color",s) % which gives expansion mess + +if contextlmtxmode : + + newinternal mfid_resolvedcolor ; mfid_resolvedcolor := scriptindex "namedcolor" ; + + def resolvedcolor = runscript mfid_resolvedcolor enddef ; + +else : + + def resolvedcolor primary s = % no vardef + if string s : + runscript("mp.mf_named_color('" & s & "')") % faster anyway + else : + s + fi + enddef ; + +fi ; + % Modes: vardef texmode (expr s) = lua.mp("mode", s) enddef ; @@ -214,45 +257,53 @@ vardef texstr(expr name) = lua.mp.texstr(name) enddef ; %D New experimental feature for Alan-The-Number-Cruncher: -% \startMPcode{doublefun} -% path p ; p := ( -% for i=1 upto 20000 : -% origin randomized 10000 .. -% endfor cycle -% ) xysized (TextWidth,TextHeight) ; -% draw for i inpath p: -% pointof i .. controls (leftof i) and (rightof i) .. -% endfor cycle ; -% \stopMPcode - -% def inpath suffix p = -% = 1 step 1 until lua.mp.mf_path_length(str p) -% enddef ; +if contextlmtxmode : -% def inpath suffix p = -% % = 1 step 1 until lua.mp.mf_path_length(str p) -% = 1 step 1 until (begingroup save n ; n := lua.mp.mf_path_length(str p) ; if n = 0 : 1 else : n fi endgroup) -% enddef ; + newinternal mfid_path_lengthof ; mfid_path_lengthof := scriptindex "pathlengthof" ; + newinternal mfid_path_pointof ; mfid_path_pointof := scriptindex "pathpointof" ; + newinternal mfid_path_leftof ; mfid_path_leftof := scriptindex "pathleftof" ; + newinternal mfid_path_rightof ; mfid_path_rightof := scriptindex "pathrightof" ; + newinternal mfid_path_reset ; mfid_path_reset := scriptindex "pathreset" ; -def inpath suffix p = % permits p[0] - = 1 step 1 until - begingroup - save mfun_inpath_r,mfun_inpath_n ; path mfun_inpath_r ; - mfun_inpath_r = p ; - mfun_inpath_n := lua.mp.mf_path_length(str mfun_inpath_r) ; - if mfun_inpath_n = 0 : 1 else : mfun_inpath_n fi - endgroup -enddef ; + % 25 pct gain + + def inpath = = 1 step 1 until runscript mfid_path_lengthof enddef ; + vardef pointof primary i = runscript mfid_path_pointof i enddef ; + vardef leftof primary i = runscript mfid_path_leftof i enddef ; + vardef rightof primary i = runscript mfid_path_rightof i enddef ; + + % another 10 pct gain + + % def inpath = = 1 step 1 until runscript mfid_path_lengthof enddef ; + % def pointof = runscript mfid_path_pointof enddef ; + % def leftof = runscript mfid_path_leftof enddef ; + % def rightof = runscript mfid_path_rightof enddef ; + + extra_endfig := extra_endfig & " runscript mfid_path_reset ; " ; + +else : + + def inpath suffix p = % permits p[0] + = 1 step 1 until + begingroup + save mfun_inpath_r,mfun_inpath_n ; path mfun_inpath_r ; + mfun_inpath_r = p ; + mfun_inpath_n := lua.mp.mf_path_length(str mfun_inpath_r) ; + if mfun_inpath_n = 0 : 1 else : mfun_inpath_n fi + endgroup + enddef ; + + % vardef pointof primary i = lua.mp.mf_path_point(i) enddef ; + % vardef leftof primary i = lua.mp.mf_path_left (i) enddef ; + % vardef rightof primary i = lua.mp.mf_path_right(i) enddef ; -% vardef pointof primary i = lua.mp.mf_path_point(i) enddef ; -% vardef leftof primary i = lua.mp.mf_path_left (i) enddef ; -% vardef rightof primary i = lua.mp.mf_path_right(i) enddef ; + vardef pointof primary i = runscript("mp.mf_path_point(" & decimal i & ")") enddef ; + vardef leftof primary i = runscript("mp.mf_path_left(" & decimal i & ")") enddef ; + vardef rightof primary i = runscript("mp.mf_path_right(" & decimal i & ")") enddef ; -vardef pointof primary i = runscript("mp.mf_path_point(" & decimal i & ")") enddef ; -vardef leftof primary i = runscript("mp.mf_path_left(" & decimal i & ")") enddef ; -vardef rightof primary i = runscript("mp.mf_path_right(" & decimal i & ")") enddef ; + extra_endfig := extra_endfig & " lua.mp.mf_path_reset() ; " ; -extra_endfig := extra_endfig & " lua.mp.mf_path_reset() ; " ; +fi ; vardef utflen(expr s) = lua.mp.utflen(s) enddef ; vardef utfsub(expr s,f,t) = lua.mp.utfsub(s,f,t) enddef ; diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv index a6ac3db3f..430c2e493 100644 --- a/metapost/context/base/mpiv/mp-mlib.mpiv +++ b/metapost/context/base/mpiv/mp-mlib.mpiv @@ -1681,22 +1681,6 @@ def nofill text t = fill t withpostscript "collect" enddef ; % if (t = "even-odd") or (t = "evenodd") : withpostscript "evenodd" fi % enddef ; -% so we can do: withcolor "red" - -% We do a low level runscript: -% -% lua.mp.namedcolor(s) % conflicts with macro namedcolor -% lua.mp.mf_named_color(s) % okay but, can also be -% lua.mp("mf_named_color",s) % which gives expansion mess - -def resolvedcolor primary s = % no vardef - if string s : - runscript("mp.mf_named_color('" & s & "')") % faster anyway - else : - s - fi -enddef ; - % A comment will end up on top of the graphic in the output. This can be handy for % locating a graphic: comment("test graphic"). diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 3d975f94e..bec9e23ec 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -1967,7 +1967,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6461, stripped down to: 3255 +-- original size: 6644, stripped down to: 3410 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -2031,9 +2031,11 @@ function string.is_empty(str) end end local anything=patterns.anything -local allescapes=Cc("%")*S(".-+%?()[]*") -local someescapes=Cc("%")*S(".-+%()[]") -local matchescapes=Cc(".")*S("*?") +local moreescapes=Cc("%")*S(".-+%?()[]*$^{}") +local allescapes=Cc("%")*S(".-+%?()[]*") +local someescapes=Cc("%")*S(".-+%()[]") +local matchescapes=Cc(".")*S("*?") +local pattern_m=Cs ((moreescapes+anything )^0 ) local pattern_a=Cs ((allescapes+anything )^0 ) local pattern_b=Cs ((someescapes+matchescapes+anything )^0 ) local pattern_c=Cs (Cc("^")*(someescapes+matchescapes+anything )^0*Cc("$") ) @@ -2043,6 +2045,8 @@ end function string.topattern(str,lowercase,strict) if str=="" or type(str)~="string" then return ".*" + elseif strict=="all" then + str=lpegmatch(pattern_m,str) elseif strict then str=lpegmatch(pattern_c,str) else @@ -25646,8 +25650,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1022862 --- stripped bytes : 405178 +-- original bytes : 1023045 +-- stripped bytes : 405206 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 3d975f94e..bec9e23ec 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -1967,7 +1967,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6461, stripped down to: 3255 +-- original size: 6644, stripped down to: 3410 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -2031,9 +2031,11 @@ function string.is_empty(str) end end local anything=patterns.anything -local allescapes=Cc("%")*S(".-+%?()[]*") -local someescapes=Cc("%")*S(".-+%()[]") -local matchescapes=Cc(".")*S("*?") +local moreescapes=Cc("%")*S(".-+%?()[]*$^{}") +local allescapes=Cc("%")*S(".-+%?()[]*") +local someescapes=Cc("%")*S(".-+%()[]") +local matchescapes=Cc(".")*S("*?") +local pattern_m=Cs ((moreescapes+anything )^0 ) local pattern_a=Cs ((allescapes+anything )^0 ) local pattern_b=Cs ((someescapes+matchescapes+anything )^0 ) local pattern_c=Cs (Cc("^")*(someescapes+matchescapes+anything )^0*Cc("$") ) @@ -2043,6 +2045,8 @@ end function string.topattern(str,lowercase,strict) if str=="" or type(str)~="string" then return ".*" + elseif strict=="all" then + str=lpegmatch(pattern_m,str) elseif strict then str=lpegmatch(pattern_c,str) else @@ -25646,8 +25650,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1022862 --- stripped bytes : 405178 +-- original bytes : 1023045 +-- stripped bytes : 405206 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 3d975f94e..bec9e23ec 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -1967,7 +1967,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6461, stripped down to: 3255 +-- original size: 6644, stripped down to: 3410 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -2031,9 +2031,11 @@ function string.is_empty(str) end end local anything=patterns.anything -local allescapes=Cc("%")*S(".-+%?()[]*") -local someescapes=Cc("%")*S(".-+%()[]") -local matchescapes=Cc(".")*S("*?") +local moreescapes=Cc("%")*S(".-+%?()[]*$^{}") +local allescapes=Cc("%")*S(".-+%?()[]*") +local someescapes=Cc("%")*S(".-+%()[]") +local matchescapes=Cc(".")*S("*?") +local pattern_m=Cs ((moreescapes+anything )^0 ) local pattern_a=Cs ((allescapes+anything )^0 ) local pattern_b=Cs ((someescapes+matchescapes+anything )^0 ) local pattern_c=Cs (Cc("^")*(someescapes+matchescapes+anything )^0*Cc("$") ) @@ -2043,6 +2045,8 @@ end function string.topattern(str,lowercase,strict) if str=="" or type(str)~="string" then return ".*" + elseif strict=="all" then + str=lpegmatch(pattern_m,str) elseif strict then str=lpegmatch(pattern_c,str) else @@ -25646,8 +25650,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1022862 --- stripped bytes : 405178 +-- original bytes : 1023045 +-- stripped bytes : 405206 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 3d975f94e..bec9e23ec 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -1967,7 +1967,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6461, stripped down to: 3255 +-- original size: 6644, stripped down to: 3410 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -2031,9 +2031,11 @@ function string.is_empty(str) end end local anything=patterns.anything -local allescapes=Cc("%")*S(".-+%?()[]*") -local someescapes=Cc("%")*S(".-+%()[]") -local matchescapes=Cc(".")*S("*?") +local moreescapes=Cc("%")*S(".-+%?()[]*$^{}") +local allescapes=Cc("%")*S(".-+%?()[]*") +local someescapes=Cc("%")*S(".-+%()[]") +local matchescapes=Cc(".")*S("*?") +local pattern_m=Cs ((moreescapes+anything )^0 ) local pattern_a=Cs ((allescapes+anything )^0 ) local pattern_b=Cs ((someescapes+matchescapes+anything )^0 ) local pattern_c=Cs (Cc("^")*(someescapes+matchescapes+anything )^0*Cc("$") ) @@ -2043,6 +2045,8 @@ end function string.topattern(str,lowercase,strict) if str=="" or type(str)~="string" then return ".*" + elseif strict=="all" then + str=lpegmatch(pattern_m,str) elseif strict then str=lpegmatch(pattern_c,str) else @@ -25646,8 +25650,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1022862 --- stripped bytes : 405178 +-- original bytes : 1023045 +-- stripped bytes : 405206 -- end library merge diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index e19a3dfbb..ba4e48db1 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2019.06.20 18:47} +\newcontextversion{2019.07.04 12:29} %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/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 4a72dae8b..0caeb26a7 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2019.06.20 18:47} +\edef\contextversion{2019.07.04 12:29} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-cs.mkii b/tex/context/base/mkii/mult-cs.mkii index 902bd5445..23345c05c 100644 --- a/tex/context/base/mkii/mult-cs.mkii +++ b/tex/context/base/mkii/mult-cs.mkii @@ -731,6 +731,7 @@ \setinterfaceconstant{component}{component} \setinterfaceconstant{compoundhyphen}{compoundhyphen} \setinterfaceconstant{compress}{compress} +\setinterfaceconstant{compressdistance}{compressdistance} \setinterfaceconstant{compressseparator}{compressseparator} \setinterfaceconstant{concerns}{concerns} \setinterfaceconstant{connector}{connector} diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii index 45a9ded24..d52003728 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -731,6 +731,7 @@ \setinterfaceconstant{component}{component} \setinterfaceconstant{compoundhyphen}{compoundhyphen} \setinterfaceconstant{compress}{compress} +\setinterfaceconstant{compressdistance}{compressdistance} \setinterfaceconstant{compressseparator}{compressseparator} \setinterfaceconstant{concerns}{concerns} \setinterfaceconstant{connector}{connector} diff --git a/tex/context/base/mkii/mult-it.mkii b/tex/context/base/mkii/mult-it.mkii index fe387aa1a..2bbf93141 100644 --- a/tex/context/base/mkii/mult-it.mkii +++ b/tex/context/base/mkii/mult-it.mkii @@ -570,6 +570,7 @@ \setinterfacevariable{temporary}{temporaneo} \setinterfacevariable{test}{test} \setinterfacevariable{text}{testo} +\setinterfacevariable{textnote}{textnote} \setinterfacevariable{three}{tre} \setinterfacevariable{thursday}{giovedi} \setinterfacevariable{tight}{tight} @@ -730,6 +731,7 @@ \setinterfaceconstant{component}{component} \setinterfaceconstant{compoundhyphen}{compoundhyphen} \setinterfaceconstant{compress}{compress} +\setinterfaceconstant{compressdistance}{compressdistance} \setinterfaceconstant{compressseparator}{compressseparator} \setinterfaceconstant{concerns}{concerns} \setinterfaceconstant{connector}{connector} diff --git a/tex/context/base/mkii/mult-pe.mkii b/tex/context/base/mkii/mult-pe.mkii index d2efcd7e9..0b121d288 100644 --- a/tex/context/base/mkii/mult-pe.mkii +++ b/tex/context/base/mkii/mult-pe.mkii @@ -731,6 +731,7 @@ \setinterfaceconstant{component}{مولÙÙ‡} \setinterfaceconstant{compoundhyphen}{compoundhyphen} \setinterfaceconstant{compress}{Ùشردن} +\setinterfaceconstant{compressdistance}{compressdistance} \setinterfaceconstant{compressseparator}{compressseparator} \setinterfaceconstant{concerns}{concerns} \setinterfaceconstant{connector}{connector} diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua index 0778ced4e..ff4f5e3b1 100644 --- a/tex/context/base/mkiv/cldf-ini.lua +++ b/tex/context/base/mkiv/cldf-ini.lua @@ -326,6 +326,39 @@ end setmetatablecall(knownfunctions,function(t,n) return knownfunctions[n](n) end) +-- some protection + +do + + local stub = { } + local done = false + local message = function() + -- one time message + if not done then + report_cld("") + report_cld("use : slot = context.functions.register(f)") + report_cld("and : context.functions.unregister(slot)") + report_cld("") + done = true + end + end + + setmetatable(stub, { + __index = message, + __newindex = message, + }) + + function lua.getfunctionstable() + message() + return stub + end + + lua.get_functions_table = lua.getfunctionstable + +end + +-- so far + -- The next hack is a convenient way to define scanners at the Lua end and -- get them available at the TeX end. There is some dirty magic needed to -- prevent overload during format loading. diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index dbf340dc5..428ff4f95 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2019.06.20 18:47} +\newcontextversion{2019.07.04 12:29} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 2d0bf8881..26a46a8bc 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.06.20 18:47} +\edef\contextversion{2019.07.04 12:29} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua index 2d528728a..02cf6093c 100644 --- a/tex/context/base/mkiv/font-ctx.lua +++ b/tex/context/base/mkiv/font-ctx.lua @@ -3252,3 +3252,8 @@ function fonts.helpers.collectanchors(tfmdata) return anchors end + +if CONTEXTLMTXMODE > 0 then + fonts.constructors.addtounicode = false + fonts.constructors.autocleanup = false +end diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua index b8be2ec75..2e7878d3d 100644 --- a/tex/context/base/mkiv/font-otj.lua +++ b/tex/context/base/mkiv/font-otj.lua @@ -836,8 +836,8 @@ local function inject_positions_only(head,where) if replace then -- error, we expect an empty one else ---KE setfield(next,"replace",fontkern(rightkern)) -- maybe also leftkern - replace = fontkern(rightkern) -- maybe also leftkern --KE + -- KE setfield(next,"replace",fontkern(rightkern)) -- maybe also leftkern + replace = fontkern(rightkern) -- maybe also leftkern done = true --KE end end diff --git a/tex/context/base/mkiv/l-string.lua b/tex/context/base/mkiv/l-string.lua index 8ae8d8d1d..1dee85e28 100644 --- a/tex/context/base/mkiv/l-string.lua +++ b/tex/context/base/mkiv/l-string.lua @@ -155,11 +155,13 @@ end --- needs checking local anything = patterns.anything -local allescapes = Cc("%") * S(".-+%?()[]*") -- also {} and ^$ ? -local someescapes = Cc("%") * S(".-+%()[]") -- also {} and ^$ ? -local matchescapes = Cc(".") * S("*?") -- wildcard and single match +local moreescapes = Cc("%") * S(".-+%?()[]*$^{}") +local allescapes = Cc("%") * S(".-+%?()[]*") -- also {} and ^$ ? +local someescapes = Cc("%") * S(".-+%()[]") -- also {} and ^$ ? +local matchescapes = Cc(".") * S("*?") -- wildcard and single match -local pattern_a = Cs ( ( allescapes + anything )^0 ) +local pattern_m = Cs ( ( moreescapes + anything )^0 ) +local pattern_a = Cs ( ( allescapes + anything )^0 ) local pattern_b = Cs ( ( someescapes + matchescapes + anything )^0 ) local pattern_c = Cs ( Cc("^") * ( someescapes + matchescapes + anything )^0 * Cc("$") ) @@ -170,6 +172,8 @@ end function string.topattern(str,lowercase,strict) if str == "" or type(str) ~= "string" then return ".*" + elseif strict == "all" then + str = lpegmatch(pattern_m,str) elseif strict then str = lpegmatch(pattern_c,str) else diff --git a/tex/context/base/mkiv/lpdf-emb.lua b/tex/context/base/mkiv/lpdf-emb.lua index 5255eb038..88b323a3f 100644 --- a/tex/context/base/mkiv/lpdf-emb.lua +++ b/tex/context/base/mkiv/lpdf-emb.lua @@ -1848,10 +1848,6 @@ statistics.register("font embedding time",function() end end) -updaters.register("backend.update.pdf",function() - fonts.constructors.addtounicode = false -end) - -- this is temporary local done = false diff --git a/tex/context/base/mkiv/lpdf-lmt.lua b/tex/context/base/mkiv/lpdf-lmt.lua index 0c6f1f3e4..25a73fe67 100644 --- a/tex/context/base/mkiv/lpdf-lmt.lua +++ b/tex/context/base/mkiv/lpdf-lmt.lua @@ -2350,9 +2350,7 @@ do luatex.registerpageactions(1,function() lpdf.finalizepage(true) end) - -- - fonts.constructors.autocleanup = false - -- + -- -- lpdf.registerdocumentfinalizer(wrapup,nil,"wrapping up") end -- diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua index 112972d8f..29b5cbd7e 100644 --- a/tex/context/base/mkiv/math-noa.lua +++ b/tex/context/base/mkiv/math-noa.lua @@ -835,8 +835,8 @@ do if chr == dummyfencechar then chr = 0 end - setfield(d,"small_char",chr) - setfield(d,"small_fam",fam) + setchar(d,chr) + setfam(d,fam) flush_node(sym) end setattrlist(d,char) @@ -847,73 +847,61 @@ do return f end - -- will become +-- local function show(where,pointer) +-- print("") +-- local i = 0 +-- for n in nuts.traverse(pointer) do +-- i = i + 1 +-- print(i,where,nuts.tonode(n)) +-- end +-- print("") +-- end - -- local function makefence(what,char) - -- local d = new_delimiter() -- todo: attr - -- local f = new_fence() -- todo: attr - -- if char then - -- local sym = getnucleus(char) - -- local chr = getchar(sym) - -- local fam = getfam(sym) - -- if chr == dummyfencechar then - -- chr = 0 - -- end - -- setchar(d,chr) - -- setfam(d,fam) - -- flush_node(sym) - -- end - -- setsubtype(f,what) - -- setfield(f,"delim",d) - -- setfield(f,"class",-1) -- tex itself does this, so not fenceclasses[what] - -- return f - -- end - - local function makelist(noad,f_o,o_next,c_prev,f_c,middle) + local function makelist(middle, noad, f_o,o_next,c_prev,f_c) local list = new_submlist() - setlist(list,f_o) setsubtype(noad,innernoad_code) setnucleus(noad,list) - setlink(f_o,o_next) - setlink(c_prev,f_c) + setlist(list,f_o) + setlink(f_o,o_next) -- prev of list is nil + setlink(c_prev,f_c) -- next of list is nil if middle and next(middle) then local prev = f_o local current = o_next while current ~= f_c do - local m = middle[current] - if m then - local next = getnext(current) + local midl = middle[current] + local next = getnext(current) + if midl then local fence = makefence(middlefence_code,current) setnucleus(current) flush_node(current) middle[current] = nil -- replace_node setlink(prev,fence,next) - prev = fence - current = next + prev = fence else prev = current - current = getnext(current) end + current = next end end + return noad end + -- relinking is not somewhat overdone + local function convert_both(open,close,middle) local o_prev, o_next = getboth(open) - local c_prev, c_next = getboth(close) if o_next == close then return close else + local c_prev, c_next = getboth(close) local f_o = makefence(leftfence_code,open) local f_c = makefence(rightfence_code,close) - makelist(open,f_o,o_next,c_prev,f_c,middle) + makelist(middle, open, f_o,o_next,c_prev,f_c) setnucleus(close) flush_node(close) - if c_next then - setprev(c_next,open) - end - setnext(open,c_next) + -- open is now a list + setlink(open,c_next) return open end end @@ -923,24 +911,29 @@ do local f_c = makefence(rightfence_code) local o_prev, o_next = getboth(open) local l_prev, l_next = getboth(last) - makelist(open,f_o,o_next,last,f_c,middle) - if l_next then - setprev(l_next,open) - end - setnext(open,l_next) + makelist(middle, open, f_o,o_next,l_prev,f_c) + -- open is now a list + setlink(open,l_next) return open end - local function convert_close(close,first,middle) + local function convert_close(first,close,middle) local f_o = makefence(leftfence_code) local f_c = makefence(rightfence_code,close) - local c_prev = getprev(close) - makelist(close,f_o,first,c_prev,f_c,middle) + local c_prev, c_next = getboth(close) + local f_prev, f_next = getboth(first) + makelist(middle, close, f_o,f_next,c_prev,f_c) + -- close is now a list + if c_prev ~= first then + setlink(first,close) + end return close end local stacks = setmetatableindex("table") + -- 1=open 2=close 3=middle 4=both + local function processfences(pointer,n,parent) local current = pointer local last = pointer @@ -950,47 +943,75 @@ do local stack = nil local middle = nil -- todo: use properties while current do +-- show("before",pointer) local id = getid(current) if id == noad_code then local a = getattr(current,a_autofence) if a and a > 0 then local stack = stacks[n] - setattr(current,a_autofence,0) - if a == 1 or (a == 4 and (not stack or #stack == 0)) then + setattr(current,a_autofence,0) -- hm, better use a property + local level = #stack + if a == 1 then if trace_fences then - report_fences("%2i: pushing open on stack",n) + report_fences("%2i: level %i, handling %s, action %s",n,level,"open","open") end insert(stack,current) - elseif a == 2 or a == 4 then + elseif a == 2 then local open = remove(stack) if open then if trace_fences then - report_fences("%2i: handling %s, stack depth %i",n,"both",#stack+1) + report_fences("%2i: level %i, handling %s, action %s",n,level,"close","both") end current = convert_both(open,current,middle) elseif current == start then - -- skip + if trace_fences then + report_fences("%2i: level %i, handling %s, action %s",n,level,"close","skip") + end else if trace_fences then - report_fences("%2i: handling %s, stack depth %i",n,"close",#stack+1) + report_fences("%2i: level %i, handling %s, action %s",n,level,"close","close") end - current = convert_close(current,initial,middle) + current = convert_close(initial,current,middle) if not parent then initial = current end end - if trace_fences then - report_fences("%2i: popping close from stack",n) - end elseif a == 3 then if trace_fences then - report_fences("%2i: registering middle",n) + report_fences("%2i: level %i, handling %s, action %s",n,level,"middle","middle") end if middle then middle[current] = last else middle = { [current] = last } end + elseif a == 4 then + if not stack or #stack == 0 then + if trace_fences then + report_fences("%2i: level %i, handling %s, action %s",n,level,"both","open") + end + insert(stack,current) + else + local open = remove(stack) + if open then + if trace_fences then + report_fences("%2i: level %i, handling %s, action %s",n,level,"both","both") + end + current = convert_both(open,current,middle) + elseif current == start then + if trace_fences then + report_fences("%2i: level %i, handling %s, action %s",n,level,"both","skip") + end + else + if trace_fences then + report_fences("%2i: level %i, handling %s, action %s",n,level,"both","close") + end + current = convert_close(initial,current,middle) + if not parent then + initial = current + end + end + end end done = true else @@ -1000,6 +1021,7 @@ do -- next at current level processstep(current,processfences,n,id) end +-- show("after",pointer) last = current current = getnext(current) end @@ -1007,13 +1029,10 @@ do local stack = stacks[n] local s = #stack if s > 0 then - if trace_fences then - report_fences("%2i: handling %s stack levels",n,s) - end for i=1,s do local open = remove(stack) if trace_fences then - report_fences("%2i: handling %s, stack depth %i",n,"open",#stack) + report_fences("%2i: level %i, handling %s, action %s",#stack,"flush","open") end last = convert_open(open,last,middle) end diff --git a/tex/context/base/mkiv/mlib-ctx.mkiv b/tex/context/base/mkiv/mlib-ctx.mkiv index 1f05b6ef8..21d211c1b 100644 --- a/tex/context/base/mkiv/mlib-ctx.mkiv +++ b/tex/context/base/mkiv/mlib-ctx.mkiv @@ -19,7 +19,15 @@ \registerctxluafile{mlib-run}{} \registerctxluafile{mlib-ctx}{} \registerctxluafile{mlib-lua}{} -\registerctxluafile{mlib-int}{} % here ? + +\doifelsefileexists{mlib-scn.lua} { + \registerctxluafile{mlib-scn}{} +} { + % experimental code for Alan and me +} + +\registerctxluafile{mlib-lmp}{} +\registerctxluafile{mlib-int}{} \unprotect diff --git a/tex/context/base/mkiv/mlib-lmp.lua b/tex/context/base/mkiv/mlib-lmp.lua new file mode 100644 index 000000000..292265be1 --- /dev/null +++ b/tex/context/base/mkiv/mlib-lmp.lua @@ -0,0 +1,137 @@ +if not modules then modules = { } end modules ['mlib-lmp'] = { + version = 1.001, + comment = "companion to mlib-ctx.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +local get = mp.get +local aux = mp.aux +local scan = mp.scan + +local mpnumeric = aux.numeric +local mppair = aux.pair +local mpquoted = aux.quoted + +local scannumber = scan.number +local scanpath = scan.path + +local registerscript = metapost.registerscript + +do + + -- todo: use a stack? + + local p = nil + local n = 0 + + local function mf_path_reset() + p = nil + n = 0 + end + + if CONTEXTLMTXMODE > 0 then + + local function mf_path_length() + p = scanpath() + n = p and #p or 1 + mpnumeric(n) + end + + local function mf_path_point() + local i = scannumber() + if i > 0 and i <= n then + local pi = p[i] + mppair(pi[1],pi[2]) + end + end + + local function mf_path_left() + local i = scannumber() + if i > 0 and i <= n then + local pi = p[i] + mppair(pi[5],pi[6]) + end + end + + local function mf_path_right() + local i = scannumber() + if i > 0 and i <= n then + local pn + if i == 1 then + pn = p[2] or p[1] + else + pn = p[i+1] or p[1] + end + mppair(pn[3],pn[4]) + end + end + + registerscript("pathreset", mf_path_reset) + registerscript("pathlengthof", mf_path_length) + registerscript("pathpointof", mf_path_point) + registerscript("pathleftof", mf_path_left) + registerscript("pathrightof", mf_path_right) + + else + + local mpgetpath = get.path + + local function mf_path_length(name) + p = mpgetpath(name) + n = p and #p or 0 + mpnumeric(n) + end + + local function mf_path_point(i) + if i > 0 and i <= n then + local pi = p[i] + mppair(pi[1],pi[2]) + end + end + + local function mf_path_left(i) + if i > 0 and i <= n then + local pi = p[i] + mppair(pi[5],pi[6]) + end + end + + local function mf_path_right(i) + if i > 0 and i <= n then + local pn + if i == 1 then + pn = p[2] or p[1] + else + pn = p[i+1] or p[1] + end + mppair(pn[3],pn[4]) + end + end + + mp.mf_path_length = mf_path_length mp.pathlength = mf_path_length + mp.mf_path_point = mf_path_point mp.pathpoint = mf_path_point + mp.mf_path_left = mf_path_left mp.pathleft = mf_path_left + mp.mf_path_right = mf_path_right mp.pathright = mf_path_right + mp.mf_path_reset = mf_path_reset mp.pathreset = mf_path_reset + + end + +end + +do + + -- if needed we can optimize the sub (cache last split) + + local utflen, utfsub = utf.len, utf.sub + + function mp.utflen(s) + mpnumeric(utflen(s)) + end + + function mp.utfsub(s,f,t) + mpquoted(utfsub(s,f,t or f)) + end + +end diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index b205946f9..3b08eb79a 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -21,6 +21,7 @@ local lpegpatterns = lpeg.patterns local P, S, Ct, Cs, Cc, C = lpeg.P, lpeg.S, lpeg.Ct, lpeg.Cs, lpeg.Cc, lpeg.C local report_luarun = logs.reporter("metapost","lua") +local report_script = logs.reporter("metapost","script") local report_message = logs.reporter("metapost") local trace_luarun = false trackers.register("metapost.lua",function(v) trace_luarun = v end) @@ -28,12 +29,13 @@ local trace_enabled = true local be_tolerant = true directives.register("metapost.lua.tolerant", function(v) be_tolerant = v end) -local get, set, aux = { }, { }, { } +local get, set, aux, scan = { }, { }, { }, { } mp = mp or { -- system namespace - set = set, - get = get, - aux = aux, + set = set, + get = get, + aux = aux, + scan = scan, } MP = MP or { -- user namespace @@ -56,22 +58,50 @@ table.setmetatablecall(MP,function(t,k,...) return t[k](...) end) do - local currentmpx = nil - local stack = { } + local currentmpx = nil + local stack = { } local get_numeric = mplib.get_numeric local get_string = mplib.get_string local get_boolean = mplib.get_boolean local get_path = mplib.get_path - local set_path = mplib.set_path get.numeric = function(s) return get_numeric(currentmpx,s) end + get.number = function(s) return get_numeric(currentmpx,s) end get.string = function(s) return get_string (currentmpx,s) end get.boolean = function(s) return get_boolean(currentmpx,s) end get.path = function(s) return get_path (currentmpx,s) end - get.number = function(s) return get_numeric(currentmpx,s) end - set.path = function(s,t) return set_path(currentmpx,s,t) end -- not working yet + local set_path = mplib.set_path + + set.path = function(s,t) return set_path(currentmpx,s,t) end -- not working yet + + local scan_next = mplib.scan_next + local scan_expression = mplib.scan_expression + local scan_token = mplib.scan_token + local scan_symbol = mplib.scan_symbol + local scan_numeric = mplib.scan_numeric + local scan_boolean = mplib.scan_boolean + local scan_string = mplib.scan_string + local scan_pair = mplib.scan_pair + local scan_color = mplib.scan_color + local scan_cmykcolor = mplib.scan_cmykcolor + local scan_transform = mplib.scan_transform + local scan_path = mplib.scan_path + + scan.next = function(k) return scan_next (currentmpx,k) end + scan.expression = function(k) return scan_expression(currentmpx,k) end + scan.token = function(k) return scan_token (currentmpx,k) end + scan.symbol = function(k) return scan_symbol (currentmpx,k) end + scan.numeric = function() return scan_numeric (currentmpx) end + scan.number = function() return scan_numeric (currentmpx) end + scan.boolean = function() return scan_boolean (currentmpx) end + scan.string = function() return scan_string (currentmpx) end + scan.pair = function(t) return scan_pair (currentmpx,t) end + scan.color = function(t) return scan_color (currentmpx,t) end + scan.cmykcolor = function(t) return scan_cmykcolor (currentmpx,t) end + scan.transform = function(t) return scan_transform (currentmpx,t) end + scan.path = function(t) return scan_path (currentmpx,t) end function metapost.pushscriptrunner(mpx) insert(stack,mpx) @@ -86,7 +116,6 @@ do return currentmpx end - end do @@ -101,14 +130,14 @@ do if trace_enabled and trace_luarun then local result = concat(buffer," ",1,n) if n > max then - buffer = { } + buffer = { } -- newtable(20,0) end n = 0 report_luarun("%i: data: %s",nesting,result) return result else if n == 0 then - return "" + return "" -- can be nil end local result if n == 1 then @@ -117,7 +146,7 @@ do result = concat(buffer," ",1,n) end if n > max then - buffer = { } + buffer = { } -- newtable(20,0) end n = 0 return result @@ -464,31 +493,67 @@ do local cache = table.makeweak() + local runscripts = { } + local runnames = { } + local nofscripts = 0 + + function metapost.registerscript(name,f) + nofscripts = nofscripts + 1 + if f then + runscripts[nofscripts] = f + runnames[name] = nofscripts + else + runscripts[nofscripts] = name + end + return nofscripts + end + + function metapost.scriptindex(name) + return runnames[name] or 0 + end + function metapost.runscript(code) nesting = nesting + 1 + local index = type(code) == "number" local trace = trace_enabled and trace_luarun - if trace then - report_luarun("%i: code: %s",nesting,code) - end runs = runs + 1 - local f = cache[code] - if not f then - f = loadstring(code .. " return mp._f_()") - if f then - cache[code] = f - elseif be_tolerant then - f = loadstring(code) + local f + if index then + f = runscripts[code] + if not f then + report_luarun("%i: bad index: %s",nesting,code) + elseif trace then + report_luarun("%i: index: %i",nesting,code) + end + else + if trace then + report_luarun("%i: code: %s",nesting,code) + end + f = cache[code] + if not f then + f = loadstring(code .. " return mp._f_()") if f then cache[code] = f + elseif be_tolerant then + f = loadstring(code) + if f then + cache[code] = f + end end end end + + -- returning nil is more efficient and a signel not to scan in mp + if f then local _buffer_ = buffer local _n_ = n buffer = { } n = 0 local result = f() + if index and not result then + result = _f_() + end if result then local t = type(result) if t == "number" then @@ -524,15 +589,47 @@ do end +do + + -- Another experimental feature: + + local mpnumeric = mp.numeric + local scanstring = scan.string + local scriptindex = metapost.scriptindex + + function mp.mf_script_index(name) + local index = scriptindex(name) + -- report_script("method %i, name %a, index %i",1,name,index) + mpnumeric(index) + end + + -- once bootstrapped ... (needs pushed mpx instances) + + metapost.registerscript("scriptindex",function() + local name = scanstring() + local index = scriptindex(name) + -- report_script("method %i, name %a, index %i",2,name,index) + mpnumeric(index) + end) + +end + +-- the next will move to mlib-lmp.lua + do local mpnamedcolor = attributes.colors.mpnamedcolor local mpprint = aux.print + local scanstring = scan.string mp.mf_named_color = function(str) mpprint(mpnamedcolor(str)) end + metapost.registerscript("namedcolor",function() + mpprint(mpnamedcolor(scanstring())) + end) + end function mp.n(t) -- used ? @@ -978,76 +1075,3 @@ do end end - -do - - local mpnumeric = aux.numeric - local mppair = aux.pair - local mpgetpath = get.path - - local p = nil - local n = 0 - - local function mf_path_length(name) - p = mpgetpath(name) - n = p and #p or 0 - mpnumeric(n) - end - - local function mf_path_point(i) - if i > 0 and i <= n then - local pi = p[i] - mppair(pi[1],pi[2]) - end - end - - local function mf_path_left(i) - if i > 0 and i <= n then - local pi = p[i] - mppair(pi[5],pi[6]) - end - end - - local function mf_path_right(i) - if i > 0 and i <= n then - local pn - if i == 1 then - pn = p[2] or p[1] - else - pn = p[i+1] or p[1] - end - mppair(pn[3],pn[4]) - end - end - - local function mf_path_reset() - p = nil - n = 0 - end - - mp.mf_path_length = mf_path_length mp.pathlength = mf_path_length - mp.mf_path_point = mf_path_point mp.pathpoint = mf_path_point - mp.mf_path_left = mf_path_left mp.pathleft = mf_path_left - mp.mf_path_right = mf_path_right mp.pathright = mf_path_right - mp.mf_path_reset = mf_path_reset mp.pathreset = mf_path_reset - -end - -do - - -- if needed we can optimize the sub (cache last split) - - local utflen, utfsub = utf.len, utf.sub - - local mpnumeric = aux.numeric - local mpquoted = aux.quoted - - function mp.utflen(s) - mpnumeric(utflen(s)) - end - - function mp.utfsub(s,f,t) - mpquoted(utfsub(s,f,t or f)) - end - -end diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua index bd4818659..0118f6cbd 100644 --- a/tex/context/base/mkiv/mlib-run.lua +++ b/tex/context/base/mkiv/mlib-run.lua @@ -6,8 +6,6 @@ if not modules then modules = { } end modules ['mlib-run'] = { license = "see context related readme files", } --- todo mpx :execute -> mlib.execute(mpx,) - -- cmyk -> done, native -- spot -> done, but needs reworking (simpler) -- multitone -> @@ -32,7 +30,7 @@ nears zero.

--ldx]]-- local type, tostring, tonumber, next = type, tostring, tonumber, next -local striplines = utilities.strings.striplines +local find, striplines = string.find, utilities.strings.striplines local concat, insert, remove = table.concat, table.insert, table.remove local emptystring = string.is_empty @@ -40,8 +38,10 @@ local P = lpeg.P local trace_graphics = false trackers.register("metapost.graphics", function(v) trace_graphics = v end) local trace_tracingall = false trackers.register("metapost.tracingall", function(v) trace_tracingall = v end) +local trace_terminal = false trackers.register("metapost.terminal", function(v) trace_terminal = v end) local report_metapost = logs.reporter("metapost") +local report_terminal = logs.reporter("metapost","terminal") local texerrormessage = logs.texerrormessage local starttiming = statistics.starttiming @@ -55,11 +55,53 @@ local metapost = metapost metapost.showlog = false metapost.lastlog = "" -metapost.collapse = true -- currently mplib cannot deal with begingroup/endgroup mismatch in stepwise processing metapost.texerrors = false metapost.exectime = metapost.exectime or { } -- hack --- metapost.collapse = false +local mpxformats = { } +local mpxterminals = { } +local nofformats = 0 +local mpxpreambles = { } +local mpxextradata = { } + +-- The flatten hack is needed because the library currently barks on \n\n and the +-- collapse because mp cannot handle snippets due to grouping issues. + +-- todo: pass tables to executempx instead of preparing beforehand, +-- as it's more efficient for the terminal + +local function flatten(source,target) + for i=1,#source do + local d = source[i] + if type(d) == "table" then + flatten(d,target) + elseif d and d ~= "" then + target[#target+1] = d + end + end + return target +end + +local function prepareddata(data) + if data and data ~= "" then + if type(data) == "table" then + data = flatten(data,{ }) + data = #data > 1 and concat(data,"\n") or data[1] + end + return data + end +end + +local function executempx(mpx,data) + local terminal = mpxterminals[mpx] + if terminal then + terminal.writer(data) + data = "" + elseif type(data) == "table" then + data = prepareddata(data,collapse) + end + return mpx:execute(data) +end directives.register("mplib.texerrors", function(v) metapost.texerrors = v end) trackers.register ("metapost.showlog", function(v) metapost.showlog = v end) @@ -77,7 +119,7 @@ local mpbasepath = lpeg.instringchecker(P("/metapost/") * (P("context") + P("bas -- for some reason mp sometimes calls this function twice which is inefficient -- but we cannot catch this -do +local realtimelogging do local finders = { } mplib.finders = finders -- also used in meta-lua.lua @@ -85,12 +127,10 @@ do local new_instance = mplib.new local function validftype(ftype) - if ftype == "" then - -- whatever - elseif ftype == 0 then - -- mplib bug + if ftype == "mp" then + return "mp" else - return ftype + return nil end end @@ -98,6 +138,8 @@ do return resolvers.findfile(name,validftype(ftype)) end + -- this will be redone in lmtx + local function i_finder(name,mode,ftype) -- fake message for mpost.map and metafun.mpvi local specification = url.hashed(name) local finder = finders[specification.scheme] or finders.file @@ -115,9 +157,172 @@ do return (mode == "w" and o_finder or i_finder)(name,mode,validftype(ftype)) end - function mplib.new(specification) - specification.find_file = finder -- so we block an overload - return new_instance(specification) + local report_logger = logs.reporter("metapost log") + local report_error = logs.reporter("metapost error") + + local l, nl, dl = { }, 0, false + local t, nt, dt = { }, 0, false + local e, ne, de = { }, 0, false + + local function logger(target,str) + if target == 1 then + -- log + elseif target == 2 or target == 3 then + -- term + if str == "\n" then + realtimelogging = true + if nl > 0 then + report_logger(concat(l,"",1,nl)) + nl, dl = 0, false + elseif not dl then + report_logger("") + dl = true + end + else + nl = nl + 1 + l[nl] = str + end + elseif target == 4 then + report_error(str) + end + end + + -- experiment, todo: per instance, just a push / pop ? + + local findtexfile = resolvers.findtexfile + local opentexfile = resolvers.opentexfile + local splitlines = string.splitlines + + local function writetoterminal(terminaldata,maxterm,d) + local t = type(d) + local n = 0 + if t == "string" then + d = splitlines(d) + n = #d + for i=1,#d do + maxterm = maxterm + 1 + terminaldata[maxterm] = d[i] + end + elseif t == "table" then + for i=1,#d do + local l = d[i] + if find(l,"[\n\r]") then + local s = splitlines(l) + local m = #s + for i=1,m do + maxterm = maxterm + 1 + terminaldata[maxterm] = s[i] + end + n = n + m + else + maxterm = maxterm + 1 + terminaldata[maxterm] = d[i] + n = 1 + end + end + end + if trace_terminal then + report_metapost("writing %i lines, in cache %s",n,maxterm) + end + return maxterm + end + + local function readfromterminal(terminaldata,maxterm,nowterm) + if nowterm >= maxterm then + terminaldata[nowterm] = false + maxterm = 0 + nowterm = 0 + if trace_terminal then + report_metapost("resetting, maxcache %i",#terminaldata) + end + return maxterm, nowterm, nil + else + if nowterm > 0 then + terminaldata[nowterm] = false + end + nowterm = nowterm + 1 + local s = terminaldata[nowterm] + if trace_terminal then + report_metapost("reading line %i: %s",nowterm,s) + end + return maxterm, nowterm, s + end + end + + local function fileopener() + + -- these can go into the table itself + + local terminaldata = { } + local maxterm = 0 + local nowterm = 0 + + local terminal = { + name = "terminal", + close = function() + -- terminal = { } + -- maxterm = 0 + -- nowterm = 0 + end, + reader = function() + local line + maxterm, nowterm, line = readfromterminal(terminaldata,maxterm,nowterm) + return line + end, + writer = function(d) + maxterm = writetoterminal(terminaldata,maxterm,d) + end, + } + + return function(name,mode,kind) + if name == "terminal" then + -- report_metapost("opening terminal") + return terminal + elseif mode == "w" then + local f = io.open(name,"wb") + if f then + -- report_metapost("opening file %a for writing",full) + return { + name = full, + writer = function(s) return f:write(s) end, -- io.write(f,s) + close = function() f:close() end, + } + end + else + local full = findtexfile(name,validftype(ftype)) + if full then + -- report_metapost("opening file %a for reading",full) + return opentexfile(full) + end + end + end + + end + + -- end of experiment + + if CONTEXTLMTXMODE > 0 then + + function mplib.new(specification) + local openfile = fileopener() + specification.find_file = finder + specification.run_logger = logger + specification.open_file = openfile + specification.interaction = "silent" + specification.halt_on_error = true + local instance = new_instance(specification) + mpxterminals[instance] = openfile("terminal") + return instance + end + + else + + function mplib.new(specification) + specification.find_file = finder + specification.run_logger = logger + return new_instance(specification) + end + end mplib.finder = finder @@ -130,7 +335,12 @@ local find_file = mplib.finder function metapost.reporterror(result) if not result then report_metapost("error: no result object returned") - elseif result.status > 0 then + return true + elseif result.status == 0 then + return false + elseif realtimelogging then + return false -- we already reported + else local t = result.term local e = result.error local l = result.log @@ -150,10 +360,8 @@ function metapost.reporterror(result) else report_metapost("error: unknown, no error, terminal or log messages") end - else - return false + return true end - return true end local f_preamble = formatters [ [[ @@ -173,7 +381,7 @@ local methods = { } function metapost.runscript(code) - return code + return "" end function metapost.scripterror(str) @@ -210,7 +418,10 @@ function metapost.load(name,method) if not mpx then result = { status = 99, error = "out of memory"} else - result = mpx:execute(f_preamble(file.addsuffix(name,"mp"),seed)) -- addsuffix is redundant + -- pushing permits advanced features + metapost.pushscriptrunner(mpx) + result = executempx(mpx,f_preamble(file.addsuffix(name,"mp"),seed)) + metapost.popscriptrunner() end stoptiming(mplib) metapost.reporterror(result) @@ -254,42 +465,10 @@ function metapost.unload(mpx) stoptiming(mplib) end --- The flatten hack is needed because the library currently barks on \n\n and the --- collapse because mp cannot handle snippets due to grouping issues. - -local function flatten(source,target) - for i=1,#source do - local d = source[i] - if type(d) == "table" then - flatten(d,target) - elseif d and d ~= "" then - target[#target+1] = d - end - end - return target -end - -local function prepareddata(data,collapse) - if data and data ~= "" then - if type(data) == "table" then - data = flatten(data,{ }) - if collapse then - data = #data > 1 and concat(data,"\n") or data[1] - end - end - return data - end -end - metapost.defaultformat = "metafun" metapost.defaultinstance = "metafun" metapost.defaultmethod = "default" -local mpxformats = { } -local nofformats = 0 -local mpxpreambles = { } -local mpxextradata = { } - function metapost.getextradata(mpx) return mpxextradata[mpx] end @@ -332,24 +511,24 @@ function metapost.pushformat(specification,f,m) -- was: instance, name, method end nofformats = nofformats + 1 local usedinstance = instance .. ":" .. nofformats - local mpx = mpxformats[usedinstance] + local mpx = mpxformats [usedinstance] local mpp = mpxpreambles[instance] or "" if preamble then - preamble = prepareddata(preamble,true) + preamble = prepareddata(preamble) mpp = mpp .. "\n" .. preamble mpxpreambles[instance] = mpp end if not mpx then report_metapost("initializing instance %a using format %a and method %a",usedinstance,format,method) mpx = metapost.checkformat(format,method) - mpxformats[usedinstance] = mpx + mpxformats [usedinstance] = mpx mpxextradata[mpx] = { } if mpp ~= "" then preamble = mpp end end if preamble then - mpx:execute(preamble) + executempx(mpx,preamble) end specification.mpx = mpx return mpx @@ -370,16 +549,19 @@ function metapost.reset(mpx) -- nothing elseif type(mpx) == "string" then if mpxformats[mpx] then - mpxextradata[mpx] = nil - mpxformats[mpx] = nil - mpxformats[mpx]:finish() + local instance = mpxformats[mpx] + instance:finish() + mpxterminals[instance] = nil + mpxextradata[mpx] = nil + mpxformats [mpx] = nil end else for name, instance in next, mpxformats do if instance == mpx then - mpxextradata[mpx] = nil - mpxformats[mpx] = nil mpx:finish() + mpxextradata[mpx] = nil + mpxformats [mpx] = nil + mpxterminals[mpx] = nil break end end @@ -469,7 +651,7 @@ function metapost.run(specification) end if mpx and data then local tra = nil - starttiming(metapost) + starttiming(metapost) -- why not at the outer level ... metapost.variables = { } -- todo also push / pop metapost.pushscriptrunner(mpx) if trace_graphics then @@ -487,20 +669,25 @@ function metapost.run(specification) tra.inp:write(banner) tra.log:write(banner) end - local data = prepareddata(data,metapost.collapse) local function process(d,i) if d then if trace_graphics then if i then tra.inp:write(formatters["\n%% begin snippet %s\n"](i)) end - tra.inp:write(d) + if type(d) == "table" then + for i=1,#d do + tra.inp:write(d[i]) + end + else + tra.inp:write(d) + end if i then tra.inp:write(formatters["\n%% end snippet %s\n"](i)) end end starttiming(metapost.exectime) - result = mpx:execute(d) + result = executempx(mpx,d) stoptiming(metapost.exectime) if trace_graphics and result then local str = result.log or result.error @@ -510,6 +697,7 @@ function metapost.run(specification) end if not metapost.reporterror(result) then if metapost.showlog then + -- make function and overload in lmtx local str = result.term ~= "" and result.term or "no terminal output" if not emptystring(str) then metapost.lastlog = metapost.lastlog .. "\n" .. str @@ -527,14 +715,16 @@ function metapost.run(specification) end end +-- local data = prepareddata(data) if type(data) == "table" then if trace_tracingall then - mpx:execute("tracingall;") + executempx(mpx,"tracingall;") end - for i=1,#data do - process(data[i],i) - end - else + process(data) +-- for i=1,#data do +-- process(data[i],i) +-- end + else if trace_tracingall then data = "tracingall;" .. data end @@ -562,67 +752,71 @@ if not metapost.convert then end --- handy +-- This will be redone as we no longer output svg of ps! + +-- function metapost.directrun(formatname,filename,outputformat,astable,mpdata) +-- local fullname = file.addsuffix(filename,"mp") +-- local data = mpdata or io.loaddata(fullname) +-- if outputformat ~= "svg" then +-- outputformat = "mps" +-- end +-- if not data then +-- report_metapost("unknown file %a",filename) +-- else +-- local mpx = metapost.checkformat(formatname) +-- if not mpx then +-- report_metapost("unknown format %a",formatname) +-- else +-- report_metapost("processing %a",(mpdata and (filename or "data")) or fullname) +-- local result = executempx(mpx,data) +-- if not result then +-- report_metapost("error: no result object returned") +-- elseif result.status > 0 then +-- report_metapost("error: %s",(result.term or "no-term") .. "\n" .. (result.error or "no-error")) +-- else +-- if metapost.showlog then +-- metapost.lastlog = metapost.lastlog .. "\n" .. result.term +-- report_metapost("info: %s",result.term or "no-term") +-- end +-- local figures = result.fig +-- if figures then +-- local sorted = table.sortedkeys(figures) +-- if astable then +-- local result = { } +-- report_metapost("storing %s figures in table",#sorted) +-- for k=1,#sorted do +-- local v = sorted[k] +-- if outputformat == "mps" then +-- result[v] = figures[v]:postscript() +-- else +-- result[v] = figures[v]:svg() -- (3) for prologues +-- end +-- end +-- return result +-- else +-- local basename = file.removesuffix(file.basename(filename)) +-- for k=1,#sorted do +-- local v = sorted[k] +-- local output +-- if outputformat == "mps" then +-- output = figures[v]:postscript() +-- else +-- output = figures[v]:svg() -- (3) for prologues +-- end +-- local outname = formatters["%s-%s.%s"](basename,v,outputformat) +-- report_metapost("saving %s bytes in %a",#output,outname) +-- io.savedata(outname,output) +-- end +-- return #sorted +-- end +-- end +-- end +-- end +-- end +-- end function metapost.directrun(formatname,filename,outputformat,astable,mpdata) - local fullname = file.addsuffix(filename,"mp") - local data = mpdata or io.loaddata(fullname) - if outputformat ~= "svg" then - outputformat = "mps" - end - if not data then - report_metapost("unknown file %a",filename) - else - local mpx = metapost.checkformat(formatname) - if not mpx then - report_metapost("unknown format %a",formatname) - else - report_metapost("processing %a",(mpdata and (filename or "data")) or fullname) - local result = mpx:execute(data) - if not result then - report_metapost("error: no result object returned") - elseif result.status > 0 then - report_metapost("error: %s",(result.term or "no-term") .. "\n" .. (result.error or "no-error")) - else - if metapost.showlog then - metapost.lastlog = metapost.lastlog .. "\n" .. result.term - report_metapost("info: %s",result.term or "no-term") - end - local figures = result.fig - if figures then - local sorted = table.sortedkeys(figures) - if astable then - local result = { } - report_metapost("storing %s figures in table",#sorted) - for k=1,#sorted do - local v = sorted[k] - if outputformat == "mps" then - result[v] = figures[v]:postscript() - else - result[v] = figures[v]:svg() -- (3) for prologues - end - end - return result - else - local basename = file.removesuffix(file.basename(filename)) - for k=1,#sorted do - local v = sorted[k] - local output - if outputformat == "mps" then - output = figures[v]:postscript() - else - output = figures[v]:svg() -- (3) for prologues - end - local outname = formatters["%s-%s.%s"](basename,v,outputformat) - report_metapost("saving %s bytes in %a",#output,outname) - io.savedata(outname,output) - end - return #sorted - end - end - end - end - end + report_metapost("producing postscript and svg is no longer supported") end -- goodie diff --git a/tex/context/base/mkiv/mtx-context-listing.tex b/tex/context/base/mkiv/mtx-context-listing.tex index 285113850..1053e80b9 100644 --- a/tex/context/base/mkiv/mtx-context-listing.tex +++ b/tex/context/base/mkiv/mtx-context-listing.tex @@ -116,10 +116,10 @@ -- forced end context.page() --- context.setupfootertexts( -- return true: we need to keep this entry --- { function() context.detokenize(pattern and filename or file.basename(filename)) return true end }, --- { function() context.pagenumber() return true end } --- ) + context.setupfootertexts( -- return true: we need to keep this entry + { function() context.detokenize(pattern and filename or file.basename(filename)) return true end }, + { function() context.pagenumber() return true end } + ) if scite then context.scitefile { filename } -- here { } elseif pretty then diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua index 57cf4778a..eb5cc4f08 100644 --- a/tex/context/base/mkiv/mult-fun.lua +++ b/tex/context/base/mkiv/mult-fun.lua @@ -17,6 +17,7 @@ return { "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", + "contextlmtxmode", }, commands = { "loadfile", "loadimage", "loadmodule", @@ -174,5 +175,7 @@ return { "comment", "report", "lua", "mp", "MP", "luacall", -- "mirrored", "mirroredabout", + -- + "scriptindex", }, } diff --git a/tex/context/base/mkiv/mult-mps.lua b/tex/context/base/mkiv/mult-mps.lua index 1d7252c29..b42beb2b8 100644 --- a/tex/context/base/mkiv/mult-mps.lua +++ b/tex/context/base/mkiv/mult-mps.lua @@ -15,7 +15,7 @@ return { "false", "nullpicture", "pencircle", "penspec", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", - "hex", "infont", "intersectiontimes", "known", "length", "llcorner", + "hex", "infont", "intersectiontimes", "known", "void", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", @@ -49,7 +49,7 @@ return { "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", - "readstring", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", + "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "closefrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", -- diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua index ebccab04c..b097fb8b1 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -147,8 +147,9 @@ local nuts = nodes.nuts nuts.check_discretionaries = direct.check_discretionaries nuts.copy = direct.copy -nuts.copy_list = direct.copy_list nuts.copy_node = direct.copy +nuts.copy_only = direct.copy_only or direct.copy +nuts.copy_list = direct.copy_list nuts.count = direct.count nuts.current_attr = direct.current_attr nuts.delete = direct.delete @@ -367,7 +368,7 @@ local d_setlink = direct.setlink local d_setboth = direct.setboth local d_getboth = direct.getboth -local function remove(head,current,free_too) +local remove = (CONTEXTLMTXMODE > 0 and LUATEXFUNCTIONALITY >= 20190704) and d_remove_node or function(head,current,free_too) if current then local h, c = d_remove_node(head,current) if free_too then diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua index 4b8187fa3..5012e771a 100644 --- a/tex/context/base/mkiv/node-res.lua +++ b/tex/context/base/mkiv/node-res.lua @@ -99,7 +99,7 @@ local setdata = nuts.setdata local setruledata = nuts.setruledata local setvalue = nuts.setvalue -local copy_nut = nuts.copy +local copy_nut = nuts.copy_only or nuts.copy local new_nut = nuts.new local flush_nut = nuts.flush diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua index 5a8fdc48a..1b86c9716 100644 --- a/tex/context/base/mkiv/node-rul.lua +++ b/tex/context/base/mkiv/node-rul.lua @@ -543,8 +543,8 @@ local function find_attr(head,attr) end function linefillers.handler(head) - for current, subtype, list in nexthlist, head do - if list and subtype == linelist_code then + for current, subtype in nexthlist, head do + if current and subtype == linelist_code then -- why doesn't leftskip take the attributes -- or list[linefiller] or maybe first match (maybe we need a fast helper for that) local a = getattr(current,a_linefiller) @@ -568,6 +568,8 @@ function linefillers.handler(head) rightlocal = true end -- + local list = getlist(current) + -- if location == v_left or location == v_both then local lskip = nil -- leftskip local iskip = nil -- indentation diff --git a/tex/context/base/mkiv/node-syn.lua b/tex/context/base/mkiv/node-syn.lua index bb2eba780..9f333315b 100644 --- a/tex/context/base/mkiv/node-syn.lua +++ b/tex/context/base/mkiv/node-syn.lua @@ -168,7 +168,7 @@ local getdimensions = nuts.dimensions local getrangedimensions = nuts.rangedimensions local get_synctex_fields = nuts.get_synctex_fields -local set_synctex_fields = nuts.set_synctex_fields +----- set_synctex_fields = nuts.set_synctex_fields local set_synctex_line = tex.set_synctex_line local set_synctex_tag = tex.set_synctex_tag local force_synctex_tag = tex.force_synctex_tag diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index c171029ad..472dee79a 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 0f13f1cb4..4b9db0b9a 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/strc-flt.mkvi b/tex/context/base/mkiv/strc-flt.mkvi index a1289bf1d..5daf2b44d 100644 --- a/tex/context/base/mkiv/strc-flt.mkvi +++ b/tex/context/base/mkiv/strc-flt.mkvi @@ -1068,8 +1068,9 @@ \def\floatcaptionattribute {\iflocation - %\ifnofloatnumber - %\else + \ifx\currentfloatattribute\empty + % safeguard, can be samepage too + \else \ifnofloatcaption \else \ifinsidesplitfloat @@ -1081,7 +1082,7 @@ attr \destinationattribute \currentfloatattribute \fi \fi - %\fi + \fi \fi} \newconditional\usesamefloatnumber @@ -1144,7 +1145,7 @@ \glet\currentfloatsynchronize\m_strc_counters_last_registered_synchronize \fi % - \global\setfalse\usesamefloatnumber % one shot + \iftrialtypesetting\else\global\setfalse\usesamefloatnumber\fi % one shot % check float box \strc_floats_set_natural_dimensions\nextbox \global\setbox\floatbox\vbox{\floatparameter\c!command{\box\nextbox}}% can be anything so no pack @@ -1170,6 +1171,7 @@ \strc_floats_get_box \global\insidefloatfalse} + \newdimen\availablefloatwidth \newdimen\availablefloatheight diff --git a/tex/context/base/mkiv/tabl-tsp.mkiv b/tex/context/base/mkiv/tabl-tsp.mkiv index e0ddce38a..9395f4039 100644 --- a/tex/context/base/mkiv/tabl-tsp.mkiv +++ b/tex/context/base/mkiv/tabl-tsp.mkiv @@ -187,7 +187,9 @@ \bgroup \forcelocalfloats \setuplocalfloats[\c!before=,\c!after=,\c!inbetween=]% + \settrialtypesetting % this controls samepage resetting too \splitfloatcommand{\hbox to #1{\strut}}% dummy line + \resettrialtypesetting \setbox\scratchbox\vbox{\flushlocalfloats}% \vpack ? \getnoflines{\ht\scratchbox}% \resetlocalfloats diff --git a/tex/context/base/mkiv/typo-wrp.lua b/tex/context/base/mkiv/typo-wrp.lua index 9fb544152..f2ca43b56 100644 --- a/tex/context/base/mkiv/typo-wrp.lua +++ b/tex/context/base/mkiv/typo-wrp.lua @@ -32,7 +32,7 @@ local getprev = nuts.getprev local getid = nuts.getid local getsubtype = nuts.getsubtype local getpenalty = nuts.getpenalty -local remove = nuts.remove +local remove_node = nuts.remove local enableaction = nodes.tasks.enableaction @@ -66,7 +66,7 @@ local function remove_dangling_crlf(head,tail) if trace_wrappers then report("removing a probably unwanted end-of-par break in line %s (guess)",tex.inputlineno) end - remove(head,tail,true) + remove_node(head,tail,true) return head, tail end end diff --git a/tex/context/interface/mkii/keys-cs.xml b/tex/context/interface/mkii/keys-cs.xml index 1b8ce2fa6..bb4800900 100644 --- a/tex/context/interface/mkii/keys-cs.xml +++ b/tex/context/interface/mkii/keys-cs.xml @@ -737,6 +737,7 @@ + diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml index 97a18d711..2ab5c9c12 100644 --- a/tex/context/interface/mkii/keys-de.xml +++ b/tex/context/interface/mkii/keys-de.xml @@ -737,6 +737,7 @@ + diff --git a/tex/context/interface/mkii/keys-it.xml b/tex/context/interface/mkii/keys-it.xml index 0c1d450ec..c852ae515 100644 --- a/tex/context/interface/mkii/keys-it.xml +++ b/tex/context/interface/mkii/keys-it.xml @@ -573,6 +573,7 @@ + @@ -736,6 +737,7 @@ + diff --git a/tex/context/interface/mkii/keys-pe.xml b/tex/context/interface/mkii/keys-pe.xml index 8532d9894..710f9d74b 100644 --- a/tex/context/interface/mkii/keys-pe.xml +++ b/tex/context/interface/mkii/keys-pe.xml @@ -737,6 +737,7 @@ + diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 51806d7e1..97b13f0d0 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index 97206e852..9f90949bb 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/context/modules/mkiv/m-simulate.mkiv b/tex/context/modules/mkiv/m-simulate.mkiv new file mode 100644 index 000000000..dc4448903 --- /dev/null +++ b/tex/context/modules/mkiv/m-simulate.mkiv @@ -0,0 +1,222 @@ +%D \module +%D [ file=m-simulate, +%D version=2016.02.18, % follow up on m-visual of 2000.01.10 +%D title=\CONTEXT\ Extra Modules, +%D subtitle=Visualization and Faking Redone, +%D author={Hans Hagen \& Ton Otten}, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\definepalet + [fakerule] + [fr1c=darkred, + fr2c=darkgreen, + fr3c=darkblue, + fr4c=darkyellow, + fr5c=darkgray, + fr6c=darkred, + fr7c=darkgreen, + fr8c=darkblue, + fr9c=darkyellow, + fr0c=darkgray] + +\installcorenamespace {simulatewords} + +\installcommandhandler \??simulatewords {simulatewords} \??simulatewords + +\setupsimulatewords + [\c!n =\plusten, + \c!m =40, + \c!min =\plusone, + \c!max =\plusfive, + \c!minwidth=0.50\emwidth, + \c!maxwidth=1.25\emwidth, + \c!color =\empty, + \c!hyphen =\v!yes, + \c!distance=-.2\onebasepoint] + +\unexpanded\def\dosimulatedword + {\clf_fakeword + factor \exheight + name {\p_line} + min \scratchdimenone + max \scratchdimentwo + \relax} + +\def\simulatedhyphen + {\kern.2\points-\kern.2\points} + +\unexpanded\def\simulatewords + {\dodoubleempty\dosimulatewords} + +\unexpanded\def\dosimulatewords[#1][#2]% + {\dontleavehmode + \begingroup + \begstrut + \ifsecondargument + \edef\currentsimulatewords{#1}% + \setupcurrentsimulatewords[#2]% + \else + \doifassignmentelse{#1} + {\let\currentsimulatewords\empty + \setupcurrentsimulatewords[#1]} + {\edef\currentsimulatewords{#1}% + \setupcurrentsimulatewords[#2]}% + \fi + \scratchcounterone\simulatewordsparameter\c!n + \scratchcountertwo\simulatewordsparameter\c!m + \scratchmin \simulatewordsparameter\c!min + \scratchmax \simulatewordsparameter\c!max + \scratchdimenone \simulatewordsparameter\c!minwidth + \scratchdimentwo \simulatewordsparameter\c!maxwidth + \scratchdimenthree\simulatewordsparameter\c!distance + \edef\p_random{\simulatewordsparameter\c!random}% + \edef\p_color {\simulatewordsparameter\c!color}% + \edef\p_line {\simulatewordsparameter\c!line}% + \edef\p_hyphen{\simulatewordsparameter\c!hyphen}% + \edef\p_line {fake:\ifx\p_line\v!yes word\else rule\fi}% + \ifx\p_color\v!text + % no need + \else + \setuppalet[fakerule]% + \ifx\p_color\empty + \directcolored[fakerulecolor]% + \else\ifx\p_color\v!auto + % different + \else + \directcolored[\p_color]% + \fi\fi + \fi + \edef\p_hyphen + {\ifx\p_hyphen\v!yes + \discretionary{\bf\simulatedhyphen}{}{\kern\scratchdimenthree}% + \else\ifx\p_hyphen\v!margin + \discretionary{\hpack to \zeropoint{\bf\simulatedhyphen\hss}}{}{\kern\scratchdimenthree}% + \else\ifx\p_hyphen\v!none + \allowbreak\kern\scratchdimenthree + \else\ifx\p_hyphen\v!no + \allowbreak\kern\scratchdimenthree + \else\ifx\p_hyphen\v!both + \discretionary{\bf\simulatedhyphen}{\bf\simulatedhyphen}{\kern\scratchdimenthree}% + \else\ifx\p_hyphen\empty + \allowbreak\kern\scratchdimenthree + \else + \discretionary{\p_hyphen}{}{\kern\scratchdimenthree}% + \fi\fi\fi\fi\fi\fi}% + \edef\truncated##1##2\relax{##1}% + % trialtypesetting: tricky + \ifx\p_random\empty \else + \pushrandomseed + \setrandomseed\p_random + \fi + \dorecurse{\randomnumber\scratchcounterone\scratchcountertwo} {% + \let\dosimulatedhyphen\relax + \dorecurse{\randomnumber\scratchmin\scratchmax} {% + \dosimulatedhyphen + \begingroup + \ifx\p_color\v!auto + \directcolored[fr\truncated####1\relax c]% + \fi + \dosimulatedword + \endgroup + \let\dosimulatedhyphen\p_hyphen + }% + \relax + \space + }% + \ifx\p_random\empty \else + \poprandomseed + \fi + \removeunwantedspaces + \endstrut + \endgroup} + +%D For old times sake: + +\unexpanded\def\fakewords#1#2% + {\simulatewords[\c!n=#1,\c!m=#2,\c!min=1,\c!max=5,\c!hyphen=\v!none,\c!color=\v!text,\c!line=\v!yes]} + +%D Lines + +\unexpanded\def\fakeline + {\dosingleempty\dofakeline} + +\unexpanded\def\dofakeline[#1]% + {\par + \dontleavehmode + \hpack\bgroup + \scratchwidth \availablehsize + \scratchheight.8\strutht + \scratchdepth .8\strutdp + \iffirstargument + \letsimulatewordsparameter\c!width \scratchwidth + \letsimulatewordsparameter\c!height\scratchheight + \letsimulatewordsparameter\c!depth \scratchdepth + \getcurrentsimulatewords[#1]% + \scratchwidth \simulatewordsparameter\c!width + \scratchheight\simulatewordsparameter\c!height + \scratchdepth \simulatewordsparameter\c!depth + \fi + \edef\p_color{\simulatewordsparameter\c!color}% + \begingroup + \ifx\p_color\empty + \directcolored[fakerulecolor]% + \else\ifx\p_color\v!auto + % text color + \else + \directcolored[\p_color]% + \fi\fi + \vrule + \s!width \scratchwidth + \s!height\scratchheight + \s!depth \scratchdepth + \endgroup + \hskip-\scratchwidth + \directcolored[\s!white]% + \scratchdimen.5\onepoint + \vrule + \s!width \scratchwidth + \s!height\scratchdimen + \s!depth \scratchdimen + \egroup + \par} + +\protect + +\continueifinputfile{m-simulate.mkiv} + +\starttext + + \simulatewords[n=50,m=100,min=1,max=5,color=auto,hyphen=margin,line=yes]\par + \simulatewords[n=50,m=100,min=3,max=9,color=auto,hyphen=margin,line=yes]\par + \simulatewords[n=50,m=100,min=3,max=9,color=auto,hyphen=margin,line=yes]\par + \page + \simulatewords[n=50,m=100,min=2,max=6,hyphen=yes]\par + \simulatewords[n=50,m=100,min=2,max=6,hyphen=both]\par + \simulatewords[n=50,m=100,min=2,max=6,hyphen=both]\par + + \startcolor[red] + \simulatewords[n=50,m=100,min=2,max=6,color=text]\par + \stopcolor + + \definesimulatewords[foo][n=50,m=100,min=2,max=6,color=text] + + \startcolor[green] + \simulatewords[foo][color=darkyellow,random=1234] + \stopcolor + + \page + + \fakeline + + \startnarrower + \fakeline + \stopnarrower + +\stoptext diff --git a/tex/generic/context/luatex/luatex-basics-chr.lua b/tex/generic/context/luatex/luatex-basics-chr.lua index 9036b2977..0ac0eab14 100644 --- a/tex/generic/context/luatex/luatex-basics-chr.lua +++ b/tex/generic/context/luatex/luatex-basics-chr.lua @@ -3614,6 +3614,6 @@ characters.indicgroups={ }, } --- done +-- done, uncomment for testing: -return characters.indicgroups +-- return characters.indicgroups diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index b72b1a888..6bd9bbd59 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 06/20/19 18:47:00 +-- merge date : 07/04/19 12:29:22 do -- begin closure to overcome local limits and interference @@ -977,9 +977,11 @@ function string.is_empty(str) end end local anything=patterns.anything -local allescapes=Cc("%")*S(".-+%?()[]*") -local someescapes=Cc("%")*S(".-+%()[]") -local matchescapes=Cc(".")*S("*?") +local moreescapes=Cc("%")*S(".-+%?()[]*$^{}") +local allescapes=Cc("%")*S(".-+%?()[]*") +local someescapes=Cc("%")*S(".-+%()[]") +local matchescapes=Cc(".")*S("*?") +local pattern_m=Cs ((moreescapes+anything )^0 ) local pattern_a=Cs ((allescapes+anything )^0 ) local pattern_b=Cs ((someescapes+matchescapes+anything )^0 ) local pattern_c=Cs (Cc("^")*(someescapes+matchescapes+anything )^0*Cc("$") ) @@ -989,6 +991,8 @@ end function string.topattern(str,lowercase,strict) if str=="" or type(str)~="string" then return ".*" + elseif strict=="all" then + str=lpegmatch(pattern_m,str) elseif strict then str=lpegmatch(pattern_c,str) else @@ -8591,7 +8595,6 @@ characters.indicgroups={ [43249]=true, }, } -return characters.indicgroups end -- closure -- cgit v1.2.3