From 37c561c2f98d84fc02011b7b819ae8cf9bb4b10d Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 16 Mar 2018 23:13:12 +0100 Subject: 2018-03-16 22:29:00 --- .../context/lexers/scite-context-lexer-bnf.lua | 99 ++++++++++++++++++ doc/context/documents/general/qrcs/setup-cs.pdf | Bin 844398 -> 844254 bytes doc/context/documents/general/qrcs/setup-de.pdf | Bin 844239 -> 844110 bytes doc/context/documents/general/qrcs/setup-en.pdf | Bin 848262 -> 848123 bytes doc/context/documents/general/qrcs/setup-fr.pdf | Bin 839941 -> 839791 bytes doc/context/documents/general/qrcs/setup-it.pdf | Bin 845819 -> 845669 bytes .../documents/general/qrcs/setup-mapping-cs.pdf | Bin 359125 -> 358994 bytes .../documents/general/qrcs/setup-mapping-de.pdf | Bin 438513 -> 438373 bytes .../documents/general/qrcs/setup-mapping-en.pdf | Bin 356242 -> 356101 bytes .../documents/general/qrcs/setup-mapping-fr.pdf | Bin 359210 -> 359078 bytes .../documents/general/qrcs/setup-mapping-it.pdf | Bin 358065 -> 357924 bytes .../documents/general/qrcs/setup-mapping-nl.pdf | Bin 357525 -> 357376 bytes .../documents/general/qrcs/setup-mapping-ro.pdf | Bin 624306 -> 624174 bytes doc/context/documents/general/qrcs/setup-nl.pdf | Bin 836905 -> 836763 bytes doc/context/documents/general/qrcs/setup-ro.pdf | Bin 839880 -> 839748 bytes tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/font-otj.lua | 113 +++++++++++---------- tex/context/base/mkiv/page-ini.lua | 17 ++-- tex/context/base/mkiv/page-set.mkiv | 4 +- tex/context/base/mkiv/status-files.pdf | Bin 25802 -> 25832 bytes tex/context/base/mkiv/status-lua.pdf | Bin 254077 -> 254074 bytes tex/context/interface/mkiv/i-context.pdf | Bin 848262 -> 848123 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 60775 -> 60774 bytes tex/context/modules/mkiv/m-scite.mkiv | 5 +- tex/context/modules/mkiv/s-fonts-variable.mkiv | 3 + tex/generic/context/luatex/luatex-fonts-merged.lua | 53 +--------- 29 files changed, 185 insertions(+), 117 deletions(-) create mode 100644 context/data/scite/context/lexers/scite-context-lexer-bnf.lua diff --git a/context/data/scite/context/lexers/scite-context-lexer-bnf.lua b/context/data/scite/context/lexers/scite-context-lexer-bnf.lua new file mode 100644 index 000000000..ce57642ba --- /dev/null +++ b/context/data/scite/context/lexers/scite-context-lexer-bnf.lua @@ -0,0 +1,99 @@ +local info = { + version = 1.001, + comment = "scintilla lpeg lexer for bnf", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +-- will replace the one in metafun + +local global, lpeg = _G, lpeg +local P, R, S = lpeg.P, lpeg.R, lpeg.S + +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 bnflexer = lexer.new("bnf","scite-context-lexer-bnf") +local whitespace = bnflexer.whitespace + +-- from wikipedia: +-- +-- ::= | +-- ::= "<" ">" "::=" +-- ::= " " | "" +-- ::= | "|" +-- ::= | +-- ::= | +-- ::= | "<" ">" +-- ::= '"' '"' | "'" "'" +-- ::= "" | +-- ::= "" | +-- ::= | | +-- ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" +-- ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" +-- ::= "|" | " " | "-" | "!" | "#" | "$" | "%" | "&" | "(" | ")" | "*" | "+" | "," | "-" | "." | "/" | ":" | ";" | ">" | "=" | "<" | "?" | "@" | "[" | "\" | "]" | "^" | "_" | "`" | "{" | "}" | "~" +-- ::= | "'" +-- ::= | '"' +-- ::= | +-- ::= | | "-" + +local anything = patterns.anything +local separator = P("|") +local left = P("<") +local right = P(">") +local space = S(" \t\n\r\f") +local spaces = space^1 +local letter = R("AZ","az") +local digit = R("09") +local symbol = S([[| -!#$%&()*+,-./:;>=", + }, + ["grouping"] = { + ["<"] = 1, + [">"] = -1, + }, +} + +return bnflexer diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf index c19e41f5d..7f73888b2 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 1ed303414..e95f798bf 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 20a83a632..7b808f8da 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 50e0f897e..7e82d88c9 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 1d5903d15..fcecfbcac 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 b3f4e0e36..285347420 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-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf index ca4e724e9..56f7170da 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-de.pdf and b/doc/context/documents/general/qrcs/setup-mapping-de.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 cf1afaa70..b9a6da180 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 5726a5536..98c96cd82 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 0e7b84627..fefbe6ceb 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 aa314decf..b60af34d4 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 aedba70db..c66413500 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 70aadea90..5fbbd909d 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 a876a8a99..9e5810ceb 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/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 30c27eb44..0c189965f 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.03.15 15:27} +\newcontextversion{2018.03.16 22:20} %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 dfa109af4..2dcc7482e 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.03.15 15:27} +\edef\contextversion{2018.03.16 22:20} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 3951d8e3f..aef280dc3 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.03.15 15:27} +\newcontextversion{2018.03.16 22:20} %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 6a3eddf9f..1ff75e083 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.03.15 15:27} +\edef\contextversion{2018.03.16 22:20} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua index 1f9fd1ac1..9037939df 100644 --- a/tex/context/base/mkiv/font-otj.lua +++ b/tex/context/base/mkiv/font-otj.lua @@ -34,13 +34,20 @@ if not nodes.properties then return end local next, rawget, tonumber = next, rawget, tonumber local fastcopy = table.fastcopy -local registertracker = trackers.register +local registertracker = trackers.register +local registerdirective = directives.register local trace_injections = false registertracker("fonts.injections", function(v) trace_injections = v end) local trace_marks = false registertracker("fonts.injections.marks", function(v) trace_marks = v end) local trace_cursive = false registertracker("fonts.injections.cursive", function(v) trace_cursive = v end) local trace_spaces = false registertracker("fonts.injections.spaces", function(v) trace_spaces = v end) +-- local fix_cursive_marks = false +-- +-- registerdirective("fonts.injections.fixcursivemarks", function(v) +-- fix_cursive_marks = v +-- end) + local report_injections = logs.reporter("fonts","injections") local report_spaces = logs.reporter("fonts","spaces") @@ -1033,6 +1040,8 @@ local function inject_everything(head,where) local marks = { } local nofmarks = 0 -- + -- local applyfix = hascursives and fix_cursive_marks + -- -- move out -- local function processmark(p,n,pn) -- p = basenode @@ -1118,7 +1127,7 @@ local function inject_everything(head,where) end end -- begin of temp fix -- - local base = nil -- bah, some arabic fonts have no mark anchoring + -- local base = nil -- bah, some arabic fonts have no mark anchoring -- end of temp fix -- while current do local next = getnext(current) @@ -1126,62 +1135,62 @@ local function inject_everything(head,where) if char then local p = rawget(properties,current) -- begin of temp fix -- - if hascursives then - if not p then - local m = fontmarks[getfont(current)] - if m and m[char] then - if base then - p = { injections = { markbasenode = base } } - nofmarks = nofmarks + 1 - marks[nofmarks] = current - properties[current] = p - hasmarks = true - end - else - base = current - end - end - end + -- if applyfix then + -- if not p then + -- local m = fontmarks[getfont(current)] + -- if m and m[char] then + -- if base then + -- p = { injections = { markbasenode = base } } + -- nofmarks = nofmarks + 1 + -- marks[nofmarks] = current + -- properties[current] = p + -- hasmarks = true + -- end + -- else + -- base = current + -- end + -- end + -- end -- end of temp fix if p then local i = p.injections -- begin of temp fix -- - if hascursives then - if not i then - local m = fontmarks[getfont(current)] - if m and m[char] then - if base then - i = { markbasenode = base } - nofmarks = nofmarks + 1 - marks[nofmarks] = current - p.injections = i - hasmarks = true - end - else - base = current - end - end - end + -- if applyfix then + -- if not i then + -- local m = fontmarks[getfont(current)] + -- if m and m[char] then + -- if base then + -- i = { markbasenode = base } + -- nofmarks = nofmarks + 1 + -- marks[nofmarks] = current + -- p.injections = i + -- hasmarks = true + -- end + -- else + -- base = current + -- end + -- end + -- end -- end of temp fix -- if i then local pm = i.markbasenode -- begin of temp fix -- - if hascursives then - if not pm then - local m = fontmarks[getfont(current)] - if m and m[char] then - if base then - pm = base - i.markbasenode = pm - hasmarks = true - end - else - base = current - end - else - base = current - end - end + -- if applyfix then + -- if not pm then + -- local m = fontmarks[getfont(current)] + -- if m and m[char] then + -- if base then + -- pm = base + -- i.markbasenode = pm + -- hasmarks = true + -- end + -- else + -- base = current + -- end + -- else + -- base = current + -- end + -- end -- end of temp fix -- if pm then nofmarks = nofmarks + 1 @@ -1326,9 +1335,11 @@ local function inject_everything(head,where) prevdisc = nil prevglyph = current elseif char == false then + -- base = nil prevdisc = nil prevglyph = current elseif id == disc_code then + -- base = nil pre, post, replace, pretail, posttail, replacetail = getdisc(current,true) local done = false if pre then @@ -1460,9 +1471,9 @@ local function inject_everything(head,where) prevglyph = nil prevdisc = current else + -- base = nil prevglyph = nil prevdisc = nil -base = nil end prev = current current = next diff --git a/tex/context/base/mkiv/page-ini.lua b/tex/context/base/mkiv/page-ini.lua index 17723c421..6325e1d39 100644 --- a/tex/context/base/mkiv/page-ini.lua +++ b/tex/context/base/mkiv/page-ini.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['page-ini'] = { license = "see context related readme files" } -local tonumber, rawget, type, next = tonumber, rawget, type, next +local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next local match = string.match local sort, tohash, insert, remove = table.sort, table.tohash, table.insert, table.remove local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array, utilities.parsers.settings_to_hash @@ -14,7 +14,7 @@ local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array, local texgetcount = tex.getcount local context = context -local ctx_testcase = commands.testcase +local ctx_doifelse = commands.doifelse local data = table.setmetatableindex("table") local last = 0 @@ -69,13 +69,14 @@ function pages.mark(name,list) end end -function pages.marked(name) +local function marked(name) local realpage = texgetcount("realpageno") for i=last,realpage-1 do - data[i] = nil + rawset(data,i,nil) end local pagedata = rawget(data,realpage) - return pagedata and pagedata[name] + print(pagedata and pagedata[name] and true or false) + return pagedata and pagedata[name] and true or false end local function toranges(marked) @@ -97,8 +98,6 @@ local function toranges(marked) return list end -pages.toranges = toranges - local function allmarked(list) if list then local collected = pages.collected @@ -139,6 +138,8 @@ local function allmarked(list) end end +pages.marked = marked +pages.toranges = toranges pages.allmarked = allmarked -- An alternative is to use an attribute and identify the state by parsing the node @@ -170,7 +171,7 @@ interfaces.implement { interfaces.implement { name = "doifelsemarkedpage", arguments = "string", - actions = { marked, ctx_testcase } + actions = { marked, ctx_doifelse } } interfaces.implement { diff --git a/tex/context/base/mkiv/page-set.mkiv b/tex/context/base/mkiv/page-set.mkiv index fb6f607a1..3579e3b48 100644 --- a/tex/context/base/mkiv/page-set.mkiv +++ b/tex/context/base/mkiv/page-set.mkiv @@ -1198,12 +1198,12 @@ {\OTRSETcheckprefered \enoughcolumncellsfalse \donefalse - \dostepwiserecurse{#1}{#2}{#3#4} + \dostepwiserecurse{#1}{#2}{#31} {\ifdone \exitloop \else #4=\recurselevel - \dostepwiserecurse{#5}{#6}{#7#8} + \dostepwiserecurse{#5}{#6}{#71} {\ifdone \exitloop \else diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index 1351546fd..531068f8a 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 15354a5ea..22eee2a81 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/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 20a83a632..7b808f8da 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 14862cbb6..aad96f1a7 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-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv index 12b54b9ac..48f1022ad 100644 --- a/tex/context/modules/mkiv/m-scite.mkiv +++ b/tex/context/modules/mkiv/m-scite.mkiv @@ -294,7 +294,8 @@ visualizers.register("btx", visualizer) visualizers.register("web", visualizer) visualizers.register("cpp", visualizer) visualizers.register("txt", visualizer) ------------.register("sql", visualizer) +visualizers.register("bnf", visualizer) +visualizers.register("sql", visualizer) \stopluacode @@ -306,6 +307,8 @@ visualizers.register("txt", visualizer) \definetyping[CPP] [option=web] \definetyping[WEB] [option=web] \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[NONE][option=none] % This is a preliminary interface. diff --git a/tex/context/modules/mkiv/s-fonts-variable.mkiv b/tex/context/modules/mkiv/s-fonts-variable.mkiv index 5c9d53d33..d1bf8b69d 100644 --- a/tex/context/modules/mkiv/s-fonts-variable.mkiv +++ b/tex/context/modules/mkiv/s-fonts-variable.mkiv @@ -107,4 +107,7 @@ \showfontvariations [font=file:bahnschrift.ttf] + % \showfontvariations + % [font=file:sitka.ttc] + \stoptext diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 96398dcc0..e91fdbd93 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 : 03/15/18 15:27:14 +-- merge date : 03/16/18 22:20:58 do -- begin closure to overcome local limits and interference @@ -21208,6 +21208,7 @@ if not nodes.properties then return end local next,rawget,tonumber=next,rawget,tonumber local fastcopy=table.fastcopy local registertracker=trackers.register +local registerdirective=directives.register local trace_injections=false registertracker("fonts.injections",function(v) trace_injections=v end) local trace_marks=false registertracker("fonts.injections.marks",function(v) trace_marks=v end) local trace_cursive=false registertracker("fonts.injections.cursive",function(v) trace_cursive=v end) @@ -22161,64 +22162,15 @@ local function inject_everything(head,where) showoffset(n,true) end end - local base=nil while current do local next=getnext(current) local char,id=ischar(current) if char then local p=rawget(properties,current) - if hascursives then - if not p then - local m=fontmarks[getfont(current)] - if m and m[char] then - if base then - p={ injections={ markbasenode=base } } - nofmarks=nofmarks+1 - marks[nofmarks]=current - properties[current]=p - hasmarks=true - end - else - base=current - end - end - end if p then local i=p.injections - if hascursives then - if not i then - local m=fontmarks[getfont(current)] - if m and m[char] then - if base then - i={ markbasenode=base } - nofmarks=nofmarks+1 - marks[nofmarks]=current - p.injections=i - hasmarks=true - end - else - base=current - end - end - end if i then local pm=i.markbasenode - if hascursives then - if not pm then - local m=fontmarks[getfont(current)] - if m and m[char] then - if base then - pm=base - i.markbasenode=pm - hasmarks=true - end - else - base=current - end - else - base=current - end - end if pm then nofmarks=nofmarks+1 marks[nofmarks]=current @@ -22489,7 +22441,6 @@ local function inject_everything(head,where) else prevglyph=nil prevdisc=nil -base=nil end prev=current current=next -- cgit v1.2.3