diff options
34 files changed, 182 insertions, 20 deletions
diff --git a/context/data/scite/context/lexers/scite-context-lexer-json.lua b/context/data/scite/context/lexers/scite-context-lexer-json.lua new file mode 100644 index 000000000..20a2d1d12 --- /dev/null +++ b/context/data/scite/context/lexers/scite-context-lexer-json.lua @@ -0,0 +1,100 @@ +local info = { + version = 1.002, + comment = "scintilla lpeg lexer for json", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +local global, string, table, lpeg = _G, string, table, lpeg +local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V +local type = type + +local lexer = require("scite-context-lexer") +local context = lexer.context +local patterns = context.patterns + +local token = lexer.token +local exact_match = lexer.exact_match + +local jsonlexer = lexer.new("json","scite-context-lexer-json") +local whitespace = jsonlexer.whitespace + +local anything = patterns.anything +local comma = P(",") +local colon = P(":") +local escape = P("\\") +----- single = P("'") +local double = P('"') +local openarray = P('[') +local closearray = P(']') +local openhash = P('{') +local closehash = P('}') +----- lineending = S("\n\r") +local space = S(" \t\n\r\f") +local spaces = space^1 +local operator = S(':,{}[]') +local fence = openarray + closearray + openhash + closehash + +local escape_un = P("\\u") / "0x" * S("09","AF","af") +local escape_bs = P([[\]]) * P(1) +local content = (escape_un + escape_bs + (1-double))^0 + +local reserved = P("true") + + P("false") + + P("null") + +local integer = P("-")^-1 * (patterns.hexadecimal + patterns.decimal) +local float = patterns.float + +local t_number = token("number", float + integer) + * (token("error",R("AZ","az","__")^1))^0 + +local t_spacing = token(whitespace, space^1) +local t_optionalws = token("default", space^1)^0 + +local t_operator = token("special", operator) + +local t_string = token("operator",double) + * token("string",content) + * token("operator",double) + +local t_key = token("operator",double) + * token("text",content) + * token("operator",double) + * t_optionalws + * token("operator",colon) + +local t_fences = token("operator",fence) -- grouping + +local t_reserved = token("primitive",reserved) + +local t_rest = token("default",anything) + +jsonlexer._rules = { + { "whitespace", t_spacing }, + { "reserved", t_reserved }, + { "key", t_key }, + { "number", t_number }, + { "string", t_string }, + { "fences", t_fences }, + { "operator", t_operator }, + { "rest", t_rest }, +} + +jsonlexer._tokenstyles = context.styleset + +jsonlexer._foldpattern = fence + +jsonlexer._foldsymbols = { + _patterns = { + "{", "}", + "[", "]", + }, + ["grouping"] = { + ["{"] = 1, ["}"] = -1, + ["["] = 1, ["]"] = -1, + }, +} + +return jsonlexer diff --git a/context/data/scite/context/scite-context-external.properties b/context/data/scite/context/scite-context-external.properties index 5df60b99b..e9d5f58ba 100644 --- a/context/data/scite/context/scite-context-external.properties +++ b/context/data/scite/context/scite-context-external.properties @@ -41,6 +41,7 @@ lexer.*.lpeg=lpeg file.patterns.cweb=*.w;*.ww; file.patterns.cpp=*.h;*.c;*.hh;*.cc;*.hpp;*.cpp;*.hxx;*.cxx; file.patterns.bib=*.bib +file.patterns.json=*.json file.patterns.sql=*.sql lexer.$(file.patterns.metapost)=lpeg_scite-context-lexer-mps @@ -54,6 +55,7 @@ lexer.$(file.patterns.cweb)=lpeg_scite-context-lexer-web lexer.$(file.patterns.cpp)=lpeg_scite-context-lexer-cpp lexer.$(file.patterns.bib)=lpeg_scite-context-lexer-bibtex lexer.$(file.patterns.sql)=lpeg_scite-context-lexer-sql +lexer.$(file.patterns.json)=lpeg_scite-context-lexer-json lexer.$(file.patterns.tex)=lpeg_scite-context-lexer-tex lexer.$(file.patterns.xml)=lpeg_scite-context-lexer-xml @@ -85,6 +87,9 @@ comment.block.at.line.start.lpeg_scite-context-lexer-cld=1 comment.block.lpeg_scite-context-lexer-bibtex=% comment.block.at.line.start.lpeg_scite-context-lexer-bibtex=1 +comment.block.lpeg_scite-context-lexer-json=% +comment.block.at.line.start.lpeg_scite-context-lexer-json=1 + comment.block.lpeg_props=# comment.block.at.line.start.lpeg_props=1 diff --git a/context/data/scite/context/scite-ctx.properties b/context/data/scite/context/scite-ctx.properties index bcd939594..1a040c2dc 100644 --- a/context/data/scite/context/scite-ctx.properties +++ b/context/data/scite/context/scite-ctx.properties @@ -66,6 +66,14 @@ ctx.menulist.lua=\ wrap=wrap_text|\ sort=sort_text +ctx.menulist.bibtex=\ + wrap=wrap_text|\ + sort=sort_text + +ctx.menulist.json=\ + wrap=wrap_text|\ + sort=sort_text + ctx.wraptext.length=80 ctx.spellcheck.language=auto @@ -129,6 +137,20 @@ command.groupundo.21.$(file.patterns.lua)=yes command.save.before.21.$(file.patterns.lua)=2 command.shortcut.21.$(file.patterns.lua)=Shift+F11 +command.name.21.$(file.patterns.bibtex)=BibTeX Action List +command.subsystem.21.$(file.patterns.bibtex)=3 +command.21.$(file.patterns.bibtex)=show_menu $(ctx.menulist.bibtex) +command.groupundo.21.$(file.patterns.bibtex)=yes +command.save.before.21.$(file.patterns.bibtex)=2 +command.shortcut.21.$(file.patterns.bibtex)=Shift+F11 + +command.name.21.$(file.patterns.json)=JSON Action List +command.subsystem.21.$(file.patterns.json)=3 +command.21.$(file.patterns.json)=show_menu $(ctx.menulist.json) +command.groupundo.21.$(file.patterns.json)=yes +command.save.before.21.$(file.patterns.json)=2 +command.shortcut.21.$(file.patterns.json)=Shift+F11 + #~ command.name.21.*=CTX Action List #~ command.subsystem.21.*=3 #~ command.21.*=show_menu $(ctx.menulist.default) diff --git a/context/data/scite/context/scite-pragma.properties b/context/data/scite/context/scite-pragma.properties index 2dea18bad..109b02230 100644 --- a/context/data/scite/context/scite-pragma.properties +++ b/context/data/scite/context/scite-pragma.properties @@ -27,6 +27,8 @@ $(filter.lua)\ $(filter.text)\ $(filter.pdf)\ $(filter.cweb)\ +$(filter.bibtex)\ +$(filter.json)\ $(filter.txt) # Editor: menus @@ -38,4 +40,6 @@ XML|xml||\ Lua|lua||\ Text|txt||\ PDF|pdf||\ -CWeb|cweb|| +CWeb|cweb||\ +BibTeX|bibtex||\ +JSON|json|| diff --git a/doc/context/documents/general/manuals/musings.pdf b/doc/context/documents/general/manuals/musings.pdf Binary files differindex d777b04b3..ea6fb90f1 100644 --- a/doc/context/documents/general/manuals/musings.pdf +++ b/doc/context/documents/general/manuals/musings.pdf diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf Binary files differindex 82b68a408..6ae7b110d 100644 --- a/doc/context/documents/general/qrcs/setup-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf Binary files differindex 021a446a4..d95f811b0 100644 --- a/doc/context/documents/general/qrcs/setup-de.pdf +++ b/doc/context/documents/general/qrcs/setup-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf Binary files differindex dc007cc91..7e43ed9cb 100644 --- a/doc/context/documents/general/qrcs/setup-en.pdf +++ b/doc/context/documents/general/qrcs/setup-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf Binary files differindex ef60b4578..3a8284457 100644 --- a/doc/context/documents/general/qrcs/setup-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf Binary files differindex 8157c21a0..4335cebd5 100644 --- a/doc/context/documents/general/qrcs/setup-it.pdf +++ b/doc/context/documents/general/qrcs/setup-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf Binary files differindex cf9d8d16f..a1a6c4217 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf Binary files differindex fa838af4f..386f7f68c 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf Binary files differindex 25b6d4c3c..60fc7fadd 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf Binary files differindex d1e851ee3..eea4c1d68 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf Binary files differindex 0123294a6..9956d5704 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf Binary files differindex 911fa9d8e..97c742ff3 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf Binary files differindex 601ee6ac3..d9df0794a 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf Binary files differindex f75663fae..e6315b938 100644 --- a/doc/context/documents/general/qrcs/setup-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf Binary files differindex 39bb7a5b4..5d31cb2a0 100644 --- a/doc/context/documents/general/qrcs/setup-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-ro.pdf diff --git a/doc/context/sources/general/manuals/musings/musings-introduction.tex b/doc/context/sources/general/manuals/musings/musings-introduction.tex index bc32f69ca..d8dadd743 100644 --- a/doc/context/sources/general/manuals/musings/musings-introduction.tex +++ b/doc/context/sources/general/manuals/musings/musings-introduction.tex @@ -12,15 +12,15 @@ or collections. Some are published, some meant as draft for a presentation. The \quotation {Children of \TEX} article is the framework for a presentation at Bacho\TEX\ 2017 in Poland, and covers the main theme of the conference. In the aftermath of that conference I wrote \quotation {Advertising \TEX} and later -quotation {Why use \TEX?}. The 2018 Bacho\TEX\ conference theme is explored in +\quotation {Why use \TEX?}. The 2018 Bacho\TEX\ conference theme is explored in \quotation {What’s to stay, what’s to go}. After a short discussion on the \CONTEXT\ mailing list about stability (at the moment that \MKII\ had been frozen for more than a decade but is still used without problems) I wrote \quotation {Stability}. Many of the thoughts in these articles are influenced by discussions with my -collegues Ton Otten en Kees van Marle. Operating in a similar arena, they provide -me the reflection needed to sort out my thoughts on these matters. +colleagues Ton Otten and Kees van Marle. Operating in a similar arena, they +provide me the reflection needed to sort out my thoughts on these matters. \startlines Hans Hagen diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 1754d01bb..40286f161 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{2018.08.15 18:45} +\newcontextversion{2018.08.16 10:17} %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 98ae174c2..290233d37 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{2018.08.15 18:45} +\edef\contextversion{2018.08.16 10:17} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cldf-bas.lua b/tex/context/base/mkiv/cldf-bas.lua index 0f9ef4e47..af698ac97 100644 --- a/tex/context/base/mkiv/cldf-bas.lua +++ b/tex/context/base/mkiv/cldf-bas.lua @@ -176,16 +176,46 @@ context.registers = { newchar = function(name,u) context([[\chardef\%s=%s\relax]],name,u) end, } -if LUATEXFUNCTIONALITY > 6780 then +do + + local ctx_flushnode = context.nodes.flush function context.latelua(f) - sprint(new_latelua(f)) -- maybe just context + ctx_flushnode(new_latelua(f)) end -else +end +-- yes or no + +do + + local NC = ctxcore.NC + local BC = ctxcore.BC + local NR = ctxcore.NR + + context.nc = setmetatable({ }, { + __call = + function(t,...) + NC() + return context(...) + end, + __index = + function(t,k) + NC() + return context[k] + end, + } + ) + + function context.bc(...) + BC() + return context(...) + end - function context.latelua(f) - context(new_latelua(f)) + function context.nr(...) + NC() + NR() end end + diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 1bc20c01a..fdf68f8d7 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2018.08.15 18:45} +\newcontextversion{2018.08.16 10:17} %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 c6262c682..f04ada119 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -42,7 +42,7 @@ %D has to match \type {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2018.08.15 18:45} +\edef\contextversion{2018.08.16 10:17} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua index 0397f0607..55d292af7 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -236,7 +236,7 @@ if not direct.getdata then elseif subtype == pdf_literal_code then return getfield(n,"data"), getfield(n,"mode") elseif subtype == late_lua_code then - return getfield(n,"data") + return getfield(n,"string") elseif subtype == pdf_setmatrix_code then return getfield(n,"data") elseif subtype == special_code then @@ -263,7 +263,7 @@ if not direct.getdata then setfield(n,"mode",vv) end elseif subtype == late_lua_code then - setfield(n,"data",v) + setfield(n,"string",v) elseif subtype == pdf_setmatrix_code then setfield(n,"data",v) elseif subtype == special_code then diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 84771a875..5b0fd601e 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex e89ba0959..5a9ff773c 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-lst.mkvi b/tex/context/base/mkiv/strc-lst.mkvi index ae9e0c042..f082615bb 100644 --- a/tex/context/base/mkiv/strc-lst.mkvi +++ b/tex/context/base/mkiv/strc-lst.mkvi @@ -147,7 +147,7 @@ % \unexpanded \def\strc_lists_inject_enhance#listindex#internal% - {\normalexpanded{\clf_deferredenhancelist#listindex}} + {\clf_deferredenhancelist#listindex\relax} \unexpanded\def\strc_lists_inject_yes[#settings][#userdata]% can be used directly {\setupcurrentlist[\c!type=userdata,\c!location=\v!none,#settings]% grouped (use \let... diff --git a/tex/context/base/mkiv/util-sql-imp-ffi.lua b/tex/context/base/mkiv/util-sql-imp-ffi.lua index 2a2bc6569..fededa63f 100644 --- a/tex/context/base/mkiv/util-sql-imp-ffi.lua +++ b/tex/context/base/mkiv/util-sql-imp-ffi.lua @@ -262,8 +262,6 @@ local mt = { __index = { } } -local nt = setmetatable({},mt) - -- session local function close(t) @@ -297,7 +295,8 @@ local function execute(t,query) } return setmetatable(t,mt) else - return nt + return false + -- return setmetatable({},mt) end end end diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex dc007cc91..7e43ed9cb 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 915c8f545..c73529dcd 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv index f1a45574e..0c258a860 100644 --- a/tex/context/modules/mkiv/m-scite.mkiv +++ b/tex/context/modules/mkiv/m-scite.mkiv @@ -297,6 +297,7 @@ visualizers.register("cpp", visualizer) visualizers.register("txt", visualizer) visualizers.register("bnf", visualizer) visualizers.register("sql", visualizer) +visualizers.register("json", visualizer) \stopluacode @@ -310,6 +311,7 @@ visualizers.register("sql", visualizer) \definetyping[TXT] [option=txt] \definetyping[BNF] [option=bnf] % I might use this in the metafun manual. \definetyping[SQL] [option=sql] % To be tested in an upcoming manual. +\definetyping[JSON][option=json] % To be tested in an upcoming manual. \definetyping[NONE][option=none] % This is a preliminary interface. diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e7ce88bfd..d37e64216 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 : 08/15/18 18:45:58 +-- merge date : 08/16/18 10:17:32 do -- begin closure to overcome local limits and interference |