summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/texlive/linked_scripts/ChangeLog6
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.am4
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.in4
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/context/stubs/unix/contextjit5
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun2417
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrunjit5
l---------Master/bin/alpha-linux/contextjit1
l---------Master/bin/alpha-linux/ctxtools1
l---------Master/bin/alpha-linux/mtxrunjit1
l---------Master/bin/alpha-linux/pstopdf1
l---------Master/bin/amd64-freebsd/contextjit1
l---------Master/bin/amd64-freebsd/ctxtools1
l---------Master/bin/amd64-freebsd/mtxrunjit1
l---------Master/bin/amd64-freebsd/pstopdf1
l---------Master/bin/amd64-kfreebsd/contextjit1
l---------Master/bin/amd64-kfreebsd/ctxtools1
l---------Master/bin/amd64-kfreebsd/mtxrunjit1
l---------Master/bin/amd64-kfreebsd/pstopdf1
l---------Master/bin/amd64-netbsd/contextjit1
l---------Master/bin/amd64-netbsd/ctxtools1
l---------Master/bin/amd64-netbsd/mtxrunjit1
l---------Master/bin/amd64-netbsd/pstopdf1
l---------Master/bin/armel-linux/contextjit1
l---------Master/bin/armel-linux/ctxtools1
l---------Master/bin/armel-linux/mtxrunjit1
l---------Master/bin/armel-linux/pstopdf1
l---------Master/bin/armhf-linux/contextjit1
l---------Master/bin/armhf-linux/ctxtools1
l---------Master/bin/armhf-linux/mtxrunjit1
l---------Master/bin/armhf-linux/pstopdf1
l---------Master/bin/i386-cygwin/contextjit1
l---------Master/bin/i386-cygwin/ctxtools1
l---------Master/bin/i386-cygwin/mtxrunjit1
l---------Master/bin/i386-cygwin/pstopdf1
l---------Master/bin/i386-freebsd/contextjit1
l---------Master/bin/i386-freebsd/ctxtools1
l---------Master/bin/i386-freebsd/mtxrunjit1
l---------Master/bin/i386-freebsd/pstopdf1
l---------Master/bin/i386-kfreebsd/contextjit1
l---------Master/bin/i386-kfreebsd/ctxtools1
l---------Master/bin/i386-kfreebsd/mtxrunjit1
l---------Master/bin/i386-kfreebsd/pstopdf1
l---------Master/bin/i386-linux/contextjit1
l---------Master/bin/i386-linux/ctxtools1
l---------Master/bin/i386-linux/mtxrunjit1
l---------Master/bin/i386-linux/pstopdf1
l---------Master/bin/i386-netbsd/contextjit1
l---------Master/bin/i386-netbsd/ctxtools1
l---------Master/bin/i386-netbsd/mtxrunjit1
l---------Master/bin/i386-netbsd/pstopdf1
l---------Master/bin/i386-solaris/contextjit1
l---------Master/bin/i386-solaris/ctxtools1
l---------Master/bin/i386-solaris/mtxrunjit1
l---------Master/bin/i386-solaris/pstopdf1
l---------Master/bin/mipsel-linux/contextjit1
l---------Master/bin/mipsel-linux/ctxtools1
l---------Master/bin/mipsel-linux/mtxrunjit1
l---------Master/bin/mipsel-linux/pstopdf1
l---------Master/bin/powerpc-linux/contextjit1
l---------Master/bin/powerpc-linux/ctxtools1
l---------Master/bin/powerpc-linux/mtxrunjit1
l---------Master/bin/powerpc-linux/pstopdf1
l---------Master/bin/sparc-solaris/contextjit1
l---------Master/bin/sparc-solaris/ctxtools1
l---------Master/bin/sparc-solaris/mtxrunjit1
l---------Master/bin/sparc-solaris/pstopdf1
l---------Master/bin/universal-darwin/contextjit1
l---------Master/bin/universal-darwin/ctxtools1
l---------Master/bin/universal-darwin/mtxrunjit1
l---------Master/bin/universal-darwin/pstopdf1
-rwxr-xr-xMaster/bin/win32/context.exebin1536 -> 4608 bytes
-rwxr-xr-xMaster/bin/win32/ctxtools.exebin1536 -> 0 bytes
-rwxr-xr-xMaster/bin/win32/luatools.exebin1536 -> 4608 bytes
-rwxr-xr-xMaster/bin/win32/mtxrun.dllbin6656 -> 7680 bytes
-rwxr-xr-xMaster/bin/win32/mtxrun.exebin1536 -> 4608 bytes
-rwxr-xr-xMaster/bin/win32/mtxrun.lua22
-rwxr-xr-xMaster/bin/win32/mtxrunjit.exebin0 -> 4608 bytes
-rwxr-xr-xMaster/bin/win32/pstopdf.exebin1536 -> 0 bytes
-rwxr-xr-xMaster/bin/win32/texexec.exebin1536 -> 4608 bytes
-rwxr-xr-xMaster/bin/win32/texmfstart.exebin1536 -> 4608 bytes
l---------Master/bin/x86_64-cygwin/contextjit1
l---------Master/bin/x86_64-cygwin/ctxtools1
l---------Master/bin/x86_64-cygwin/mtxrunjit1
l---------Master/bin/x86_64-cygwin/pstopdf1
l---------Master/bin/x86_64-darwin/contextjit1
l---------Master/bin/x86_64-darwin/ctxtools1
l---------Master/bin/x86_64-darwin/mtxrunjit1
l---------Master/bin/x86_64-darwin/pstopdf1
l---------Master/bin/x86_64-linux/contextjit1
l---------Master/bin/x86_64-linux/ctxtools1
l---------Master/bin/x86_64-linux/mtxrunjit1
l---------Master/bin/x86_64-linux/pstopdf1
l---------Master/bin/x86_64-solaris/contextjit1
l---------Master/bin/x86_64-solaris/ctxtools1
l---------Master/bin/x86_64-solaris/mtxrunjit1
l---------Master/bin/x86_64-solaris/pstopdf1
-rw-r--r--Master/texmf-dist/context/data/scite/context/documents/scite-context-readme.pdf (renamed from Master/texmf-dist/context/data/scite/documents/scite-context-readme.pdf)bin221437 -> 221437 bytes
-rw-r--r--Master/texmf-dist/context/data/scite/context/documents/scite-context-readme.tex (renamed from Master/texmf-dist/context/data/scite/documents/scite-context-readme.tex)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/documents/scite-context-visual.pdf (renamed from Master/texmf-dist/context/data/scite/documents/scite-context-visual.pdf)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/documents/scite-context-visual.png (renamed from Master/texmf-dist/context/data/scite/documents/scite-context-visual.png)bin77849 -> 77849 bytes
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-context.lua (renamed from Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-context.lua)4
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-interfaces.lua (renamed from Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-interfaces.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua4
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metapost.lua (renamed from Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-metapost.lua)2
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-tex.lua (renamed from Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-tex.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/lexer.lua (renamed from Master/texmf-dist/context/data/scite/lexers/lexer.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-bibtex.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-bibtex.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cld.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cld.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cpp-web.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cpp-web.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cpp.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cpp.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-lua-longstring.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-lua.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-lua.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-mps.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf-object.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf-object.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf-xref.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf-xref.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-tex-web.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-tex-web.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-tex.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-tex.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-txt.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-txt.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-web-snippets.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-web-snippets.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-web.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-web.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-cdata.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-cdata.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-comment.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-comment.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-script.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer.lua (renamed from Master/texmf-dist/context/data/scite/lexers/scite-context-lexer.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/lexers/themes/scite-context-theme.lua (renamed from Master/texmf-dist/context/data/scite/lexers/themes/scite-context-theme.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-data-context.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-data-context.properties)77
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-data-interfaces.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-data-interfaces.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-data-metafun.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-data-metafun.properties)3
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-data-metapost.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-data-metapost.properties)2
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-data-tex.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-data-tex.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-external.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-external.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-internal.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-internal.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context-user.properties (renamed from Master/texmf-dist/context/data/scite/scite-context-user.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-context.properties (renamed from Master/texmf-dist/context/data/scite/scite-context.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-ctx-context.properties (renamed from Master/texmf-dist/context/data/scite/scite-ctx-context.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-ctx-example.properties (renamed from Master/texmf-dist/context/data/scite/scite-ctx-example.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-ctx.lua (renamed from Master/texmf-dist/context/data/scite/scite-ctx.lua)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-ctx.properties (renamed from Master/texmf-dist/context/data/scite/scite-ctx.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-metapost.properties (renamed from Master/texmf-dist/context/data/scite/scite-metapost.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-pragma.properties (renamed from Master/texmf-dist/context/data/scite/scite-pragma.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/context/scite-tex.properties (renamed from Master/texmf-dist/context/data/scite/scite-tex.properties)0
-rw-r--r--Master/texmf-dist/context/data/scite/documents/scite-context-visual.tex52
-rw-r--r--Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-metafun.lua4
-rw-r--r--Master/texmf-dist/doc/man/man1/context.man1.pdfbin7609 -> 7613 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/ctxtools.175
-rw-r--r--Master/texmf-dist/doc/man/man1/ctxtools.man1.pdfbin5094 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/luatools.man1.pdfbin5102 -> 5105 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdfbin3672 -> 3673 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-base.man1.pdfbin5122 -> 5124 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdfbin3495 -> 3493 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdfbin3708 -> 3708 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdfbin3565 -> 3566 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-check.man1.pdfbin3582 -> 3581 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdfbin3443 -> 3442 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-context.man1.pdfbin7609 -> 7613 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdfbin3537 -> 3536 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdfbin3960 -> 3960 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdfbin3669 -> 3669 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdfbin4211 -> 4207 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdfbin3547 -> 3545 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdfbin4106 -> 4105 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdfbin3713 -> 3711 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdfbin3630 -> 3630 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdfbin3758 -> 3761 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-package.man1.pdfbin3569 -> 3568 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdfbin4085 -> 4084 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdfbin3696 -> 3695 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdfbin3704 -> 3711 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdfbin3688 -> 3691 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdfbin3637 -> 3636 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdfbin3751 -> 3752 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-server.man1.pdfbin3752 -> 3752 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdfbin3559 -> 3558 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdfbin3681 -> 3679 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdfbin3991 -> 3995 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdfbin3600 -> 3597 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-update.man1.pdfbin5031 -> 5030 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdfbin3867 -> 3868 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdfbin3856 -> 3859 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/mtxrun.man1.pdfbin7033 -> 7032 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/pstopdf.130
-rw-r--r--Master/texmf-dist/doc/man/man1/pstopdf.man1.pdfbin3558 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/texexec.man1.pdfbin4709 -> 4713 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/texmfstart.man1.pdfbin7033 -> 7032 bytes
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-base.mpiv11
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-form.mpiv2
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-mlib.mpiv3
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-tool.mpiv9
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-context.lua3
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-plain.lua6
-rwxr-xr-xMaster/texmf-dist/scripts/context/lua/mtxrun.lua22
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/install/first-setup.bat87
-rw-r--r--Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua22
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exebin0 -> 4608 bytes
-rw-r--r--Master/texmf-dist/scripts/context/stubs/setup/setuptex167
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/setup/setuptex.bat70
-rw-r--r--Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh164
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/unix/contextjit5
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/unix/ctxtools2
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/unix/mptopdf2
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/unix/mtxrun22
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/unix/mtxrunjit5
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/unix/pstopdf2
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/win64/contextjit.exebin0 -> 15360 bytes
-rw-r--r--Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua22
-rwxr-xr-xMaster/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exebin0 -> 15360 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/back-exp.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/back-ini.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/back-ini.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/back-u3d.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/char-ini.lua53
-rw-r--r--Master/texmf-dist/tex/context/base/cont-new.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/context-version.pdfbin4056 -> 4283 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/context.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/data-tex.lua28
-rw-r--r--Master/texmf-dist/tex/context/base/font-con.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/font-otb.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/font-otc.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/grph-inc.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/l-lpeg.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-grp.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-ini.lua23
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-u3d.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-ini.mkiv155
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-tex.lua84
-rw-r--r--Master/texmf-dist/tex/context/base/m-pipemode.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/math-frc.mkiv45
-rw-r--r--Master/texmf-dist/tex/context/base/math-ini.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/math-map.lua251
-rw-r--r--Master/texmf-dist/tex/context/base/math-noa.lua34
-rw-r--r--Master/texmf-dist/tex/context/base/meta-ini.mkiv1
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-lua.lua77
-rw-r--r--Master/texmf-dist/tex/context/base/mult-de.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/mult-def.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mult-def.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/mult-en.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/mult-fr.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/mult-fun.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mult-it.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/mult-low.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mps.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mult-nl.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/mult-pe.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/mult-ro.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/node-acc.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/node-typ.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/pack-mrl.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/page-lin.mkiv557
-rw-r--r--Master/texmf-dist/tex/context/base/page-mix.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/publ-dat.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/publ-imp-cite.mkiv223
-rw-r--r--Master/texmf-dist/tex/context/base/publ-ini.lua1276
-rw-r--r--Master/texmf-dist/tex/context/base/publ-ini.mkiv264
-rw-r--r--Master/texmf-dist/tex/context/base/s-math-coverage.lua158
-rw-r--r--Master/texmf-dist/tex/context/base/s-math-coverage.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/spac-chr.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/spac-chr.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/status-files.pdfbin24657 -> 24609 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/status-lua.pdfbin242871 -> 244006 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ref.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ref.mkvi15
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-ntb.mkiv27
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-tbl.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/trac-deb.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/trac-log.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/type-imp-cambria.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/type-imp-lato.mkiv56
-rw-r--r--Master/texmf-dist/tex/context/base/util-str.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/x-asciimath.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/x-asciimath.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/x-mathml.lua2
-rw-r--r--Master/texmf-dist/tex/context/fonts/lm-math.lfg2
-rw-r--r--Master/texmf-dist/tex/context/fonts/lm.lfg15
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-cs.xml1
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-de.xml1
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-en.xml1
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-fr.xml1
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-it.xml1
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-nl.xml1
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-pe.xml1
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-ro.xml1
-rw-r--r--Master/texmf-dist/tex/context/patterns/word-xx.lua14
-rw-r--r--Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua13
-rw-r--r--Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua7
-rw-r--r--Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua63
-rw-r--r--Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex79
-rw-r--r--Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex26
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds8
-rw-r--r--Master/tlpkg/tlpsrc/context.tlpsrc6
291 files changed, 4552 insertions, 2696 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/ChangeLog b/Build/source/texk/texlive/linked_scripts/ChangeLog
index bc60926f723..9980d197639 100644
--- a/Build/source/texk/texlive/linked_scripts/ChangeLog
+++ b/Build/source/texk/texlive/linked_scripts/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-19 Karl Berry <karl@tug.org>
+
+ * Makefile.am (texmf_context_scripts): add contextjit, mtxrunjit.
+ Remove ctxtools and pstopdf, which are not to be user-level
+ executables any more even though they remain in stubs, per Hans.
+
2013-04-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am [WIN32], ../w32_wrapper/context/mtxrun.{dll,exe}:
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am
index d8a0ea86e4e..ffc64d4d26e 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.am
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.am
@@ -169,10 +169,10 @@ texmf_other_scripts = \
vpe/vpe.pl
texmf_context_scripts = \
context/stubs/unix/context \
- context/stubs/unix/ctxtools \
+ context/stubs/unix/contextjit \
context/stubs/unix/luatools \
context/stubs/unix/mtxrun \
- context/stubs/unix/pstopdf \
+ context/stubs/unix/mtxrunjit \
context/stubs/unix/texexec \
context/stubs/unix/texmfstart
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in
index 70b189cc588..948d5c6ae93 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.in
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.in
@@ -376,10 +376,10 @@ texmf_other_scripts = \
texmf_context_scripts = \
context/stubs/unix/context \
- context/stubs/unix/ctxtools \
+ context/stubs/unix/contextjit \
context/stubs/unix/luatools \
context/stubs/unix/mtxrun \
- context/stubs/unix/pstopdf \
+ context/stubs/unix/mtxrunjit \
context/stubs/unix/texexec \
context/stubs/unix/texmfstart
diff --git a/Build/source/texk/texlive/linked_scripts/context/stubs/unix/contextjit b/Build/source/texk/texlive/linked_scripts/context/stubs/unix/contextjit
new file mode 100755
index 00000000000..5ac1947c78e
--- /dev/null
+++ b/Build/source/texk/texlive/linked_scripts/context/stubs/unix/contextjit
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+luajittex --luaonly $(dirname $0)/mtxrun --script context "$@"
+
+# luajittex --luaonly ${0%contextjit}mtxrun --script context "$@"
diff --git a/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun b/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun
index d07dfc9a7a1..c3d4111626e 100755
--- a/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun
+++ b/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun
@@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lua"] = package.loaded["l-lua"] or true
--- original size: 3123, stripped down to: 1694
+-- original size: 3409, stripped down to: 1763
if not modules then modules={} end modules ['l-lua']={
version=1.001,
@@ -136,6 +136,9 @@ function optionalrequire(...)
return result
end
end
+if lua then
+ lua.mask=load([[τεχ = 1]]) and "utf" or "ascii"
+end
end -- of closure
@@ -144,7 +147,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-package"] = package.loaded["l-package"] or true
--- original size: 9893, stripped down to: 7253
+-- original size: 10587, stripped down to: 7815
if not modules then modules={} end modules ['l-package']={
version=1.001,
@@ -154,7 +157,7 @@ if not modules then modules={} end modules ['l-package']={
license="see context related readme files"
}
local type=type
-local gsub,format=string.gsub,string.format
+local gsub,format,find=string.gsub,string.format,string.find
local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match
local package=package
local searchers=package.searchers or package.loaders
@@ -184,6 +187,7 @@ local helpers=package.helpers or {
sequence={
"already loaded",
"preload table",
+ "qualified path",
"lua extra list",
"lib extra list",
"path specification",
@@ -329,14 +333,32 @@ local function loadedbypath(name,rawname,paths,islib,what)
end
end
helpers.loadedbypath=loadedbypath
+local function loadedbyname(name,rawname)
+ if find(name,"^/") or find(name,"^[a-zA-Z]:/") then
+ local trace=helpers.trace
+ if trace then
+ helpers.report("qualified name, identifying '%s'",what,name)
+ end
+ if isreadable(name) then
+ if trace then
+ helpers.report("qualified name, '%s' found",what,name)
+ end
+ return loadfile(name)
+ end
+ end
+end
+helpers.loadedbyname=loadedbyname
methods["already loaded"]=function(name)
return package.loaded[name]
end
methods["preload table"]=function(name)
return builtin["preload table"](name)
end
+methods["qualified path"]=function(name)
+ return loadedbyname(addsuffix(lualibfile(name),"lua"),name)
+end
methods["lua extra list"]=function(name)
- return loadedbypath(addsuffix(lualibfile(name),"lua" ),name,getextraluapaths(),false,"lua")
+ return loadedbypath(addsuffix(lualibfile(name),"lua"),name,getextraluapaths(),false,"lua")
end
methods["lib extra list"]=function(name)
return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib")
@@ -415,7 +437,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 26252, stripped down to: 14371
+-- original size: 29983, stripped down to: 16202
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -425,12 +447,15 @@ if not modules then modules={} end modules ['l-lpeg']={
license="see context related readme files"
}
lpeg=require("lpeg")
+if not lpeg.print then function lpeg.print(...) print(lpeg.pcode(...)) end end
local type,next,tostring=type,next,tostring
local byte,char,gmatch,format=string.byte,string.char,string.gmatch,string.format
local floor=math.floor
local P,R,S,V,Ct,C,Cs,Cc,Cp,Cmt=lpeg.P,lpeg.R,lpeg.S,lpeg.V,lpeg.Ct,lpeg.C,lpeg.Cs,lpeg.Cc,lpeg.Cp,lpeg.Cmt
local lpegtype,lpegmatch,lpegprint=lpeg.type,lpeg.match,lpeg.print
-setinspector(function(v) if lpegtype(v) then lpegprint(v) return true end end)
+if setinspector then
+ setinspector(function(v) if lpegtype(v) then lpegprint(v) return true end end)
+end
lpeg.patterns=lpeg.patterns or {}
local patterns=lpeg.patterns
local anything=P(1)
@@ -440,28 +465,46 @@ patterns.anything=anything
patterns.endofstring=endofstring
patterns.beginofstring=alwaysmatched
patterns.alwaysmatched=alwaysmatched
-local digit,sign=R('09'),S('+-')
+local sign=S('+-')
+local zero=P('0')
+local digit=R('09')
+local octdigit=R("07")
+local lowercase=R("az")
+local uppercase=R("AZ")
+local underscore=P("_")
+local hexdigit=digit+lowercase+uppercase
local cr,lf,crlf=P("\r"),P("\n"),P("\r\n")
-local newline=crlf+S("\r\n")
+local newline=P("\r")*(P("\n")+P(true))+P("\n")
local escaped=P("\\")*anything
local squote=P("'")
local dquote=P('"')
local space=P(" ")
-local utfbom_32_be=P('\000\000\254\255')
-local utfbom_32_le=P('\255\254\000\000')
-local utfbom_16_be=P('\255\254')
-local utfbom_16_le=P('\254\255')
-local utfbom_8=P('\239\187\191')
+local period=P(".")
+local comma=P(",")
+local utfbom_32_be=P('\000\000\254\255')
+local utfbom_32_le=P('\255\254\000\000')
+local utfbom_16_be=P('\254\255')
+local utfbom_16_le=P('\255\254')
+local utfbom_8=P('\239\187\191')
local utfbom=utfbom_32_be+utfbom_32_le+utfbom_16_be+utfbom_16_le+utfbom_8
local utftype=utfbom_32_be*Cc("utf-32-be")+utfbom_32_le*Cc("utf-32-le")+utfbom_16_be*Cc("utf-16-be")+utfbom_16_le*Cc("utf-16-le")+utfbom_8*Cc("utf-8")+alwaysmatched*Cc("utf-8")
+local utfstricttype=utfbom_32_be*Cc("utf-32-be")+utfbom_32_le*Cc("utf-32-le")+utfbom_16_be*Cc("utf-16-be")+utfbom_16_le*Cc("utf-16-le")+utfbom_8*Cc("utf-8")
local utfoffset=utfbom_32_be*Cc(4)+utfbom_32_le*Cc(4)+utfbom_16_be*Cc(2)+utfbom_16_le*Cc(2)+utfbom_8*Cc(3)+Cc(0)
local utf8next=R("\128\191")
+patterns.utfbom_32_be=utfbom_32_be
+patterns.utfbom_32_le=utfbom_32_le
+patterns.utfbom_16_be=utfbom_16_be
+patterns.utfbom_16_le=utfbom_16_le
+patterns.utfbom_8=utfbom_8
+patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
+patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
patterns.utf8one=R("\000\127")
patterns.utf8two=R("\194\223")*utf8next
patterns.utf8three=R("\224\239")*utf8next*utf8next
patterns.utf8four=R("\240\244")*utf8next*utf8next*utf8next
patterns.utfbom=utfbom
patterns.utftype=utftype
+patterns.utfstricttype=utfstricttype
patterns.utfoffset=utfoffset
local utf8char=patterns.utf8one+patterns.utf8two+patterns.utf8three+patterns.utf8four
local validutf8char=utf8char^0*endofstring*Cc(true)+Cc(false)
@@ -481,27 +524,14 @@ patterns.spacer=spacer
patterns.whitespace=whitespace
patterns.nonspacer=nonspacer
patterns.nonwhitespace=nonwhitespace
-local stripper=spacer^0*C((spacer^0*nonspacer^1)^0)
+local stripper=spacer^0*C((spacer^0*nonspacer^1)^0)
+local fullstripper=whitespace^0*C((whitespace^0*nonwhitespace^1)^0)
local collapser=Cs(spacer^0/""*nonspacer^0*((spacer^0/" "*nonspacer^1)^0))
patterns.stripper=stripper
+patterns.fullstripper=fullstripper
patterns.collapser=collapser
-patterns.digit=digit
-patterns.sign=sign
-patterns.cardinal=sign^0*digit^1
-patterns.integer=sign^0*digit^1
-patterns.unsigned=digit^0*P('.')*digit^1
-patterns.float=sign^0*patterns.unsigned
-patterns.cunsigned=digit^0*P(',')*digit^1
-patterns.cfloat=sign^0*patterns.cunsigned
-patterns.number=patterns.float+patterns.integer
-patterns.cnumber=patterns.cfloat+patterns.integer
-patterns.oct=P("0")*R("07")^1
-patterns.octal=patterns.oct
-patterns.HEX=P("0x")*R("09","AF")^1
-patterns.hex=P("0x")*R("09","af")^1
-patterns.hexadecimal=P("0x")*R("09","AF","af")^1
-patterns.lowercase=R("az")
-patterns.uppercase=R("AZ")
+patterns.lowercase=lowercase
+patterns.uppercase=uppercase
patterns.letter=patterns.lowercase+patterns.uppercase
patterns.space=space
patterns.tab=P("\t")
@@ -509,12 +539,12 @@ patterns.spaceortab=patterns.space+patterns.tab
patterns.newline=newline
patterns.emptyline=newline^1
patterns.equal=P("=")
-patterns.comma=P(",")
-patterns.commaspacer=P(",")*spacer^0
-patterns.period=P(".")
+patterns.comma=comma
+patterns.commaspacer=comma*spacer^0
+patterns.period=period
patterns.colon=P(":")
patterns.semicolon=P(";")
-patterns.underscore=P("_")
+patterns.underscore=underscore
patterns.escaped=escaped
patterns.squote=squote
patterns.dquote=dquote
@@ -527,10 +557,29 @@ patterns.unspacer=((patterns.spacer^1)/"")^0
patterns.singlequoted=squote*patterns.nosquote*squote
patterns.doublequoted=dquote*patterns.nodquote*dquote
patterns.quoted=patterns.doublequoted+patterns.singlequoted
-patterns.propername=R("AZ","az","__")*R("09","AZ","az","__")^0*P(-1)
+patterns.digit=digit
+patterns.octdigit=octdigit
+patterns.hexdigit=hexdigit
+patterns.sign=sign
+patterns.cardinal=digit^1
+patterns.integer=sign^-1*digit^1
+patterns.unsigned=digit^0*period*digit^1
+patterns.float=sign^-1*patterns.unsigned
+patterns.cunsigned=digit^0*comma*digit^1
+patterns.cfloat=sign^-1*patterns.cunsigned
+patterns.number=patterns.float+patterns.integer
+patterns.cnumber=patterns.cfloat+patterns.integer
+patterns.oct=zero*octdigit^1
+patterns.octal=patterns.oct
+patterns.HEX=zero*P("X")*(digit+uppercase)^1
+patterns.hex=zero*P("x")*(digit+lowercase)^1
+patterns.hexadecimal=zero*S("xX")*hexdigit^1
+patterns.hexafloat=sign^-1*zero*S("xX")*(hexdigit^0*period*hexdigit^1+hexdigit^1*period*hexdigit^0+hexdigit^1)*(S("pP")*sign^-1*hexdigit^1)^-1
+patterns.decafloat=sign^-1*(digit^0*period*digit^1+digit^1*period*digit^0+digit^1)*S("eE")*sign^-1*digit^1
+patterns.propername=(uppercase+lowercase+underscore)*(uppercase+lowercase+underscore+digit)^0*endofstring
patterns.somecontent=(anything-newline-space)^1
patterns.beginline=#(1-newline)
-patterns.longtostring=Cs(whitespace^0/""*nonwhitespace^0*((whitespace^0/" "*(patterns.quoted+nonwhitespace)^1)^0))
+patterns.longtostring=Cs(whitespace^0/""*((patterns.quoted+nonwhitespace^1+whitespace^1/""*(P(-1)+Cc(" ")))^0))
local function anywhere(pattern)
return P { P(pattern)+1*V(1) }
end
@@ -702,7 +751,7 @@ function lpeg.replacer(one,two,makefunction,isutf)
return pattern
end
end
-function lpeg.finder(lst,makefunction)
+function lpeg.finder(lst,makefunction,isutf)
local pattern
if type(lst)=="table" then
pattern=P(false)
@@ -718,7 +767,11 @@ function lpeg.finder(lst,makefunction)
else
pattern=P(lst)
end
- pattern=(1-pattern)^0*pattern
+ if isutf then
+ pattern=((utf8char or 1)-pattern)^0*pattern
+ else
+ pattern=(1-pattern)^0*pattern
+ end
if makefunction then
return function(str)
return lpegmatch(pattern,str)
@@ -731,8 +784,8 @@ local splitters_f,splitters_s={},{}
function lpeg.firstofsplit(separator)
local splitter=splitters_f[separator]
if not splitter then
- separator=P(separator)
- splitter=C((1-separator)^0)
+ local pattern=P(separator)
+ splitter=C((1-pattern)^0)
splitters_f[separator]=splitter
end
return splitter
@@ -740,12 +793,31 @@ end
function lpeg.secondofsplit(separator)
local splitter=splitters_s[separator]
if not splitter then
- separator=P(separator)
- splitter=(1-separator)^0*separator*C(anything^0)
+ local pattern=P(separator)
+ splitter=(1-pattern)^0*pattern*C(anything^0)
splitters_s[separator]=splitter
end
return splitter
end
+local splitters_s,splitters_p={},{}
+function lpeg.beforesuffix(separator)
+ local splitter=splitters_s[separator]
+ if not splitter then
+ local pattern=P(separator)
+ splitter=C((1-pattern)^0)*pattern*endofstring
+ splitters_s[separator]=splitter
+ end
+ return splitter
+end
+function lpeg.afterprefix(separator)
+ local splitter=splitters_p[separator]
+ if not splitter then
+ local pattern=P(separator)
+ splitter=pattern*C(anything^0)
+ splitters_p[separator]=splitter
+ end
+ return splitter
+end
function lpeg.balancer(left,right)
left,right=P(left),P(right)
return P { left*((1-left-right)+V(1))^0*right }
@@ -977,9 +1049,6 @@ end
function lpeg.times(pattern,n)
return P(nextstep(n,2^16,{ "start",["1"]=pattern }))
end
-local digit=R("09")
-local period=P(".")
-local zero=P("0")
local trailingzeros=zero^0*-digit
local case_1=period*trailingzeros/""
local case_2=period*(digit-trailingzeros)^1*(trailingzeros/"")
@@ -1013,7 +1082,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-string"] = package.loaded["l-string"] or true
--- original size: 5513, stripped down to: 2708
+-- original size: 5671, stripped down to: 2827
if not modules then modules={} end modules ['l-string']={
version=1.001,
@@ -1049,11 +1118,15 @@ function string.limit(str,n,sentinel)
end
end
local stripper=patterns.stripper
+local fullstripper=patterns.fullstripper
local collapser=patterns.collapser
local longtostring=patterns.longtostring
function string.strip(str)
return lpegmatch(stripper,str) or ""
end
+function string.fullstrip(str)
+ return lpegmatch(fullstripper,str) or ""
+end
function string.collapsespaces(str)
return lpegmatch(collapser,str) or ""
end
@@ -1114,7 +1187,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 44626, stripped down to: 19688
+-- original size: 31860, stripped down to: 20846
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -1192,6 +1265,36 @@ local function sortedkeys(tab)
return {}
end
end
+local function sortedhashonly(tab)
+ if tab then
+ local srt,s={},0
+ for key,_ in next,tab do
+ if type(key)=="string" then
+ s=s+1
+ srt[s]=key
+ end
+ end
+ sort(srt)
+ return srt
+ else
+ return {}
+ end
+end
+local function sortedindexonly(tab)
+ if tab then
+ local srt,s={},0
+ for key,_ in next,tab do
+ if type(key)=="number" then
+ s=s+1
+ srt[s]=key
+ end
+ end
+ sort(srt)
+ return srt
+ else
+ return {}
+ end
+end
local function sortedhashkeys(tab,cmp)
if tab then
local srt,s={},0
@@ -1217,6 +1320,8 @@ function table.allkeys(t)
return sortedkeys(keys)
end
table.sortedkeys=sortedkeys
+table.sortedhashonly=sortedhashonly
+table.sortedindexonly=sortedindexonly
table.sortedhashkeys=sortedhashkeys
local function nothing() end
local function sortedhash(t,cmp)
@@ -1228,10 +1333,13 @@ local function sortedhash(t,cmp)
s=sortedkeys(t)
end
local n=0
+ local m=#s
local function kv(s)
- n=n+1
- local k=s[n]
- return k,t[k]
+ if n<m then
+ n=n+1
+ local k=s[n]
+ return k,t[k]
+ end
end
return kv,s
else
@@ -1382,6 +1490,7 @@ local noquotes,hexify,handle,reduce,compact,inline,functions
local reserved=table.tohash {
'and','break','do','else','elseif','end','false','for','function','if',
'in','local','nil','not','or','repeat','return','then','true','until','while',
+ 'NaN','goto',
}
local function simple_table(t)
if #t>0 then
@@ -1401,12 +1510,12 @@ local function simple_table(t)
else
tt[nt]=tostring(v)
end
- elseif tv=="boolean" then
- nt=nt+1
- tt[nt]=tostring(v)
elseif tv=="string" then
nt=nt+1
tt[nt]=format("%q",v)
+ elseif tv=="boolean" then
+ nt=nt+1
+ tt[nt]=v and "true" or "false"
else
tt=nil
break
@@ -1439,7 +1548,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s[%q]={",depth,name))
end
elseif tn=="boolean" then
- handle(format("%s[%s]={",depth,tostring(name)))
+ handle(format("%s[%s]={",depth,name and "true" or "false"))
else
handle(format("%s{",depth))
end
@@ -1463,21 +1572,21 @@ local function do_serialize(root,name,depth,level,indexed)
for i=1,#sk do
local k=sk[i]
local v=root[k]
- local t,tk=type(v),type(k)
+ local tv,tk=type(v),type(k)
if compact and first and tk=="number" and k>=first and k<=last then
- if t=="number" then
+ if tv=="number" then
if hexify then
handle(format("%s 0x%04X,",depth,v))
else
handle(format("%s %s,",depth,v))
end
- elseif t=="string" then
+ elseif tv=="string" then
if reduce and tonumber(v) then
handle(format("%s %s,",depth,v))
else
handle(format("%s %q,",depth,v))
end
- elseif t=="table" then
+ elseif tv=="table" then
if not next(v) then
handle(format("%s {},",depth))
elseif inline then
@@ -1490,11 +1599,11 @@ local function do_serialize(root,name,depth,level,indexed)
else
do_serialize(v,k,depth,level+1,true)
end
- elseif t=="boolean" then
- handle(format("%s %s,",depth,tostring(v)))
- elseif t=="function" then
+ elseif tv=="boolean" then
+ handle(format("%s %s,",depth,v and "true" or "false"))
+ elseif tv=="function" then
if functions then
- handle(format('%s load(%q),',depth,dump(v)))
+ handle(format('%s load(%q),',depth,dump(v)))
else
handle(format('%s "function",',depth))
end
@@ -1505,7 +1614,7 @@ local function do_serialize(root,name,depth,level,indexed)
if false then
handle(format("%s __p__=nil,",depth))
end
- elseif t=="number" then
+ elseif tv=="number" then
if tk=="number" then
if hexify then
handle(format("%s [0x%04X]=0x%04X,",depth,k,v))
@@ -1514,9 +1623,9 @@ local function do_serialize(root,name,depth,level,indexed)
end
elseif tk=="boolean" then
if hexify then
- handle(format("%s [%s]=0x%04X,",depth,tostring(k),v))
+ handle(format("%s [%s]=0x%04X,",depth,k and "true" or "false",v))
else
- handle(format("%s [%s]=%s,",depth,tostring(k),v))
+ handle(format("%s [%s]=%s,",depth,k and "true" or "false",v))
end
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
if hexify then
@@ -1531,7 +1640,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s [%q]=%s,",depth,k,v))
end
end
- elseif t=="string" then
+ elseif tv=="string" then
if reduce and tonumber(v) then
if tk=="number" then
if hexify then
@@ -1540,7 +1649,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s [%s]=%s,",depth,k,v))
end
elseif tk=="boolean" then
- handle(format("%s [%s]=%s,",depth,tostring(k),v))
+ handle(format("%s [%s]=%s,",depth,k and "true" or "false",v))
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
handle(format("%s %s=%s,",depth,k,v))
else
@@ -1554,14 +1663,14 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s [%s]=%q,",depth,k,v))
end
elseif tk=="boolean" then
- handle(format("%s [%s]=%q,",depth,tostring(k),v))
+ handle(format("%s [%s]=%q,",depth,k and "true" or "false",v))
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
handle(format("%s %s=%q,",depth,k,v))
else
handle(format("%s [%q]=%q,",depth,k,v))
end
end
- elseif t=="table" then
+ elseif tv=="table" then
if not next(v) then
if tk=="number" then
if hexify then
@@ -1570,7 +1679,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s [%s]={},",depth,k))
end
elseif tk=="boolean" then
- handle(format("%s [%s]={},",depth,tostring(k)))
+ handle(format("%s [%s]={},",depth,k and "true" or "false"))
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
handle(format("%s %s={},",depth,k))
else
@@ -1586,7 +1695,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s [%s]={ %s },",depth,k,concat(st,", ")))
end
elseif tk=="boolean" then
- handle(format("%s [%s]={ %s },",depth,tostring(k),concat(st,", ")))
+ handle(format("%s [%s]={ %s },",depth,k and "true" or "false",concat(st,", ")))
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
handle(format("%s %s={ %s },",depth,k,concat(st,", ")))
else
@@ -1598,21 +1707,21 @@ local function do_serialize(root,name,depth,level,indexed)
else
do_serialize(v,k,depth,level+1)
end
- elseif t=="boolean" then
+ elseif tv=="boolean" then
if tk=="number" then
if hexify then
- handle(format("%s [0x%04X]=%s,",depth,k,tostring(v)))
+ handle(format("%s [0x%04X]=%s,",depth,k,v and "true" or "false"))
else
- handle(format("%s [%s]=%s,",depth,k,tostring(v)))
+ handle(format("%s [%s]=%s,",depth,k,v and "true" or "false"))
end
elseif tk=="boolean" then
- handle(format("%s [%s]=%s,",depth,tostring(k),tostring(v)))
+ handle(format("%s [%s]=%s,",depth,tostring(k),v and "true" or "false"))
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
- handle(format("%s %s=%s,",depth,k,tostring(v)))
+ handle(format("%s %s=%s,",depth,k,v and "true" or "false"))
else
- handle(format("%s [%q]=%s,",depth,k,tostring(v)))
+ handle(format("%s [%q]=%s,",depth,k,v and "true" or "false"))
end
- elseif t=="function" then
+ elseif tv=="function" then
if functions then
local f=getinfo(v).what=="C" and dump(dummy) or dump(v)
if tk=="number" then
@@ -1622,7 +1731,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s [%s]=load(%q),",depth,k,f))
end
elseif tk=="boolean" then
- handle(format("%s [%s]=load(%q),",depth,tostring(k),f))
+ handle(format("%s [%s]=load(%q),",depth,k and "true" or "false",f))
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
handle(format("%s %s=load(%q),",depth,k,f))
else
@@ -1637,7 +1746,7 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s [%s]=%q,",depth,k,tostring(v)))
end
elseif tk=="boolean" then
- handle(format("%s [%s]=%q,",depth,tostring(k),tostring(v)))
+ handle(format("%s [%s]=%q,",depth,k and "true" or "false",tostring(v)))
elseif noquotes and not reserved[k] and lpegmatch(propername,k) then
handle(format("%s %s=%q,",depth,k,tostring(v)))
else
@@ -1938,7 +2047,9 @@ function table.print(t,...)
serialize(print,t,...)
end
end
-setinspector(function(v) if type(v)=="table" then serialize(print,v,"table") return true end end)
+if setinspector then
+ setinspector(function(v) if type(v)=="table" then serialize(print,v,"table") return true end end)
+end
function table.sub(t,i,j)
return { unpack(t,i,j) }
end
@@ -1973,6 +2084,24 @@ function table.sorted(t,...)
sort(t,...)
return t
end
+function table.values(t,s)
+ if t then
+ local values,keys,v={},{},0
+ for key,value in next,t do
+ if not keys[value] then
+ v=v+1
+ values[v]=value
+ keys[k]=key
+ end
+ end
+ if s then
+ sort(values)
+ end
+ return values
+ else
+ return {}
+ end
+end
end -- of closure
@@ -1981,7 +2110,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-io"] = package.loaded["l-io"] or true
--- original size: 8799, stripped down to: 6325
+-- original size: 8824, stripped down to: 6347
if not modules then modules={} end modules ['l-io']={
version=1.001,
@@ -1995,7 +2124,7 @@ local byte,find,gsub,format=string.byte,string.find,string.gsub,string.format
local concat=table.concat
local floor=math.floor
local type=type
-if string.find(os.getenv("PATH"),";") then
+if string.find(os.getenv("PATH"),";",1,true) then
io.fileseparator,io.pathseparator="\\",";"
else
io.fileseparator,io.pathseparator="/",":"
@@ -2012,6 +2141,7 @@ local function readall(f)
return f:read('*all')
else
local done=f:seek("set",0)
+ local step
if size<1024*1024 then
step=1024*1024
elseif size>16*1024*1024 then
@@ -2515,7 +2645,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-os"] = package.loaded["l-os"] or true
--- original size: 14017, stripped down to: 8504
+-- original size: 16093, stripped down to: 9704
if not modules then modules={} end modules ['l-os']={
version=1.001,
@@ -2596,10 +2726,16 @@ function os.exec (...) ioflush() return exec (...) end
function io.popen (...) ioflush() return iopopen(...) end
function os.resultof(command)
local handle=io.popen(command,"r")
- return handle and handle:read("*all") or ""
+ if handle then
+ local result=handle:read("*all") or ""
+ handle:close()
+ return result
+ else
+ return ""
+ end
end
if not io.fileseparator then
- if find(os.getenv("PATH"),";") then
+ if find(os.getenv("PATH"),";",1,true) then
io.fileseparator,io.pathseparator,os.type="\\",";",os.type or "mswin"
else
io.fileseparator,io.pathseparator,os.type="/",":",os.type or "unix"
@@ -2630,13 +2766,14 @@ if not os.times then
}
end
end
-os.gettimeofday=os.gettimeofday or os.clock
-local startuptime=os.gettimeofday()
+local gettimeofday=os.gettimeofday or os.clock
+os.gettimeofday=gettimeofday
+local startuptime=gettimeofday()
function os.runtime()
- return os.gettimeofday()-startuptime
+ return gettimeofday()-startuptime
end
-os.resolvers=os.resolvers or {}
-local resolvers=os.resolvers
+local resolvers=os.resolvers or {}
+os.resolvers=resolvers
setmetatable(os,{ __index=function(t,k)
local r=resolvers[k]
return r and r(t,k) or nil
@@ -2656,10 +2793,10 @@ end
if platform~="" then
os.platform=platform
elseif os.type=="windows" then
- function os.resolvers.platform(t,k)
+ function resolvers.platform(t,k)
local platform,architecture="",os.getenv("PROCESSOR_ARCHITECTURE") or ""
- if find(architecture,"AMD64") then
- platform="mswin-64"
+ if find(architecture,"AMD64",1,true) then
+ platform="win64"
else
platform="mswin"
end
@@ -2668,11 +2805,11 @@ elseif os.type=="windows" then
return platform
end
elseif name=="linux" then
- function os.resolvers.platform(t,k)
+ function resolvers.platform(t,k)
local platform,architecture="",os.getenv("HOSTTYPE") or os.resultof("uname -m") or ""
- if find(architecture,"x86_64") then
+ if find(architecture,"x86_64",1,true) then
platform="linux-64"
- elseif find(architecture,"ppc") then
+ elseif find(architecture,"ppc",1,true) then
platform="linux-ppc"
else
platform="linux"
@@ -2682,13 +2819,13 @@ elseif name=="linux" then
return platform
end
elseif name=="macosx" then
- function os.resolvers.platform(t,k)
+ function resolvers.platform(t,k)
local platform,architecture="",os.resultof("echo $HOSTTYPE") or ""
if architecture=="" then
platform="osx-intel"
- elseif find(architecture,"i386") then
+ elseif find(architecture,"i386",1,true) then
platform="osx-intel"
- elseif find(architecture,"x86_64") then
+ elseif find(architecture,"x86_64",1,true) then
platform="osx-64"
else
platform="osx-ppc"
@@ -2698,9 +2835,9 @@ elseif name=="macosx" then
return platform
end
elseif name=="sunos" then
- function os.resolvers.platform(t,k)
+ function resolvers.platform(t,k)
local platform,architecture="",os.resultof("uname -m") or ""
- if find(architecture,"sparc") then
+ if find(architecture,"sparc",1,true) then
platform="solaris-sparc"
else
platform="solaris-intel"
@@ -2710,9 +2847,9 @@ elseif name=="sunos" then
return platform
end
elseif name=="freebsd" then
- function os.resolvers.platform(t,k)
+ function resolvers.platform(t,k)
local platform,architecture="",os.resultof("uname -m") or ""
- if find(architecture,"amd64") then
+ if find(architecture,"amd64",1,true) then
platform="freebsd-amd64"
else
platform="freebsd"
@@ -2722,9 +2859,9 @@ elseif name=="freebsd" then
return platform
end
elseif name=="kfreebsd" then
- function os.resolvers.platform(t,k)
+ function resolvers.platform(t,k)
local platform,architecture="",os.getenv("HOSTTYPE") or os.resultof("uname -m") or ""
- if find(architecture,"x86_64") then
+ if find(architecture,"x86_64",1,true) then
platform="kfreebsd-amd64"
else
platform="kfreebsd-i386"
@@ -2734,13 +2871,18 @@ elseif name=="kfreebsd" then
return platform
end
else
- function os.resolvers.platform(t,k)
+ function resolvers.platform(t,k)
local platform="linux"
os.setenv("MTX_PLATFORM",platform)
os.platform=platform
return platform
end
end
+function resolvers.bits(t,k)
+ local bits=find(os.platform,"64",1,true) and 64 or 32
+ os.bits=bits
+ return bits
+end
local t={ 8,9,"a","b" }
function os.uuid()
return format("%04x%04x-4%03x-%s%03x-%04x-%04x%04x%04x",
@@ -2766,26 +2908,38 @@ function os.timezone(delta)
end
local timeformat=format("%%s%s",os.timezone(true))
local dateformat="!%Y-%m-%d %H:%M:%S"
+local lasttime=nil
+local lastdate=nil
function os.fulltime(t,default)
- t=tonumber(t) or 0
+ t=t and tonumber(t) or 0
if t>0 then
elseif default then
return default
else
- t=nil
+ t=time()
+ end
+ if t~=lasttime then
+ lasttime=t
+ lastdate=format(timeformat,date(dateformat))
end
- return format(timeformat,date(dateformat,t))
+ return lastdate
end
local dateformat="%Y-%m-%d %H:%M:%S"
+local lasttime=nil
+local lastdate=nil
function os.localtime(t,default)
- t=tonumber(t) or 0
+ t=t and tonumber(t) or 0
if t>0 then
elseif default then
return default
else
- t=nil
+ t=time()
end
- return date(dateformat,t)
+ if t~=lasttime then
+ lasttime=t
+ lastdate=date(dateformat,t)
+ end
+ return lastdate
end
function os.converttime(t,default)
local t=tonumber(t)
@@ -2835,6 +2989,38 @@ if not os.sleep then
socket.sleep(n)
end
end
+local function isleapyear(year)
+ return (year%400==0) or ((year%100~=0) and (year%4==0))
+end
+os.isleapyear=isleapyear
+local days={ 31,28,31,30,31,30,31,31,30,31,30,31 }
+local function nofdays(year,month)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ else
+ return month==2 and isleapyear(year) and 29 or days[month]
+ end
+end
+os.nofdays=nofdays
+function os.weekday(day,month,year)
+ return date("%w",time { year=year,month=month,day=day })+1
+end
+function os.validdate(year,month,day)
+ if month<1 then
+ month=1
+ elseif month>12 then
+ month=12
+ end
+ if day<1 then
+ day=1
+ else
+ local max=nofdays(year,month)
+ if day>max then
+ day=max
+ end
+ end
+ return year,month,day
+end
end -- of closure
@@ -2843,7 +3029,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-file"] = package.loaded["l-file"] or true
--- original size: 17777, stripped down to: 9653
+-- original size: 18308, stripped down to: 9948
if not modules then modules={} end modules ['l-file']={
version=1.001,
@@ -3086,17 +3272,24 @@ end
function file.joinpath(tab,separator)
return tab and concat(tab,separator or io.pathseparator)
end
+local someslash=S("\\/")
local stripper=Cs(P(fwslash)^0/""*reslasher)
-local isnetwork=fwslash*fwslash*(1-fwslash)+(1-fwslash-colon)^1*colon
+local isnetwork=someslash*someslash*(1-someslash)+(1-fwslash-colon)^1*colon
local isroot=fwslash^1*-1
local hasroot=fwslash^1
+local reslasher=lpeg.replacer(S("\\/"),"/")
local deslasher=lpeg.replacer(S("\\/")^1,"/")
function file.join(...)
local lst={... }
local one=lst[1]
if lpegmatch(isnetwork,one) then
+ local one=lpegmatch(reslasher,one)
local two=lpegmatch(deslasher,concat(lst,"/",2))
- return one.."/"..two
+ if lpegmatch(hasroot,two) then
+ return one..two
+ else
+ return one.."/"..two
+ end
elseif lpegmatch(isroot,one) then
local two=lpegmatch(deslasher,concat(lst,"/",2))
if lpegmatch(hasroot,two) then
@@ -3113,7 +3306,9 @@ end
local drivespec=R("az","AZ")^1*colon
local anchors=fwslash+drivespec
local untouched=periods+(1-period)^1*P(-1)
-local splitstarter=(Cs(drivespec*(bwslash/"/"+fwslash)^0)+Cc(false))*Ct(lpeg.splitat(S("/\\")^1))
+local mswindrive=Cs(drivespec*(bwslash/"/"+fwslash)^0)
+local mswinuncpath=(bwslash+fwslash)*(bwslash+fwslash)*Cc("//")
+local splitstarter=(mswindrive+mswinuncpath+Cc(false))*Ct(lpeg.splitat(S("/\\")^1))
local absolute=fwslash
function file.collapsepath(str,anchor)
if not str then
@@ -3361,7 +3556,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-url"] = package.loaded["l-url"] or true
--- original size: 11806, stripped down to: 5417
+-- original size: 12292, stripped down to: 5585
if not modules then modules={} end modules ['l-url']={
version=1.001,
@@ -3388,7 +3583,7 @@ local hexdigit=R("09","AF","af")
local plus=P("+")
local nothing=Cc("")
local escapedchar=(percent*C(hexdigit*hexdigit))/tochar
-local escaped=(plus/" ")+escapedchar
+local escaped=(plus/" ")+escapedchar
local noslash=P("/")/""
local schemestr=Cs((escaped+(1-colon-slash-qmark-hash))^2)
local authoritystr=Cs((escaped+(1- slash-qmark-hash))^0)
@@ -3412,9 +3607,14 @@ setmetatable(escapes,{ __index=function(t,k)
end })
local escaper=Cs((R("09","AZ","az")^1+P(" ")/"%%20"+S("-./_")^1+P(1)/escapes)^0)
local unescaper=Cs((escapedchar+1)^0)
+local getcleaner=Cs((P("+++")/"%%2B"+P("+")/"%%20"+P(1))^1)
lpegpatterns.urlunescaped=escapedchar
lpegpatterns.urlescaper=escaper
lpegpatterns.urlunescaper=unescaper
+lpegpatterns.urlgetcleaner=getcleaner
+function url.unescapeget(str)
+ return lpegmatch(getcleaner,str)
+end
local function split(str)
return (type(str)=="string" and lpegmatch(parser,str)) or str
end
@@ -3567,7 +3767,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-dir"] = package.loaded["l-dir"] or true
--- original size: 13738, stripped down to: 8560
+-- original size: 14788, stripped down to: 9096
if not modules then modules={} end modules ['l-dir']={
version=1.001,
@@ -3590,6 +3790,8 @@ local isdir=lfs.isdir
local isfile=lfs.isfile
local currentdir=lfs.currentdir
local chdir=lfs.chdir
+local mkdir=lfs.mkdir
+local onwindows=os.type=="windows" or find(os.getenv("PATH"),";",1,true)
if not isdir then
function isdir(name)
local a=attributes(name)
@@ -3661,11 +3863,21 @@ local function collectpattern(path,patt,recurse,result)
return result
end
dir.collectpattern=collectpattern
-local pattern=Ct {
- [1]=(C(P(".")+P("/")^1)+C(R("az","AZ")*P(":")*P("/")^0)+Cc("./"))*V(2)*V(3),
- [2]=C(((1-S("*?/"))^0*P("/"))^0),
- [3]=C(P(1)^0)
-}
+local separator
+if onwindows then
+ local slash=S("/\\")/"/"
+ pattern=Ct {
+ [1]=(Cs(P(".")+slash^1)+Cs(R("az","AZ")*P(":")*slash^0)+Cc("./"))*V(2)*V(3),
+ [2]=Cs(((1-S("*?/\\"))^0*slash)^0),
+ [3]=Cs(P(1)^0)
+ }
+else
+ pattern=Ct {
+ [1]=(C(P(".")+P("/")^1)+Cc("./"))*V(2)*V(3),
+ [2]=C(((1-S("*?/"))^0*P("/"))^0),
+ [3]=C(P(1)^0)
+ }
+end
local filter=Cs ((
P("**")/".*"+P("*")/"[^/]*"+P("?")/"[^/]"+P(".")/"%%."+P("+")/"%%+"+P("-")/"%%-"+P(1)
)^0 )
@@ -3681,7 +3893,7 @@ local function glob(str,t)
local split=lpegmatch(pattern,str)
if split then
local root,path,base=split[1],split[2],split[3]
- local recurse=find(base,"%*%*")
+ local recurse=find(base,"**",1,true)
local start=root..path
local result=lpegmatch(filter,start..base)
globpattern(start,result,recurse,t)
@@ -3707,7 +3919,7 @@ local function glob(str,t)
local t=t or {}
local action=action or function(name) t[#t+1]=name end
local root,path,base=split[1],split[2],split[3]
- local recurse=find(base,"%*%*")
+ local recurse=find(base,"**",1,true)
local start=root..path
local result=lpegmatch(filter,start..base)
globpattern(start,result,recurse,action)
@@ -3749,22 +3961,30 @@ function dir.ls(pattern)
return concat(glob(pattern),"\n")
end
local make_indeed=true
-local onwindows=os.type=="windows" or find(os.getenv("PATH"),";")
if onwindows then
function dir.mkdirs(...)
- local str,pth="",""
- for i=1,select("#",...) do
- local s=select(i,...)
- if s=="" then
- elseif str=="" then
- str=s
- else
- str=str.."/"..s
+ local n=select("#",...)
+ local str
+ if n==1 then
+ str=select(1,...)
+ if isdir(str) then
+ return str,true
+ end
+ else
+ str=""
+ for i=1,n do
+ local s=select(i,...)
+ if s=="" then
+ elseif str=="" then
+ str=s
+ else
+ str=str.."/"..s
+ end
end
end
- local first,middle,last
+ local pth=""
local drive=false
- first,middle,last=match(str,"^(//)(//*)(.*)$")
+ local first,middle,last=match(str,"^(//)(//*)(.*)$")
if first then
else
first,last=match(str,"^(//)/*(.-)$")
@@ -3797,21 +4017,30 @@ if onwindows then
pth=pth.."/"..s
end
if make_indeed and not isdir(pth) then
- lfs.mkdir(pth)
+ mkdir(pth)
end
end
return pth,(isdir(pth)==true)
end
else
function dir.mkdirs(...)
- local str,pth="",""
- for i=1,select("#",...) do
- local s=select(i,...)
- if s and s~="" then
- if str~="" then
- str=str.."/"..s
- else
- str=s
+ local n=select("#",...)
+ local str,pth
+ if n==1 then
+ str=select(1,...)
+ if isdir(str) then
+ return str,true
+ end
+ else
+ str=""
+ for i=1,n do
+ local s=select(i,...)
+ if s and s~="" then
+ if str~="" then
+ str=str.."/"..s
+ else
+ str=s
+ end
end
end
end
@@ -3826,7 +4055,7 @@ else
pth=pth.."/"..s
end
if make_indeed and not first and not isdir(pth) then
- lfs.mkdir(pth)
+ mkdir(pth)
end
end
else
@@ -3834,7 +4063,7 @@ else
for s in gmatch(str,"[^/]+") do
pth=pth.."/"..s
if make_indeed and not isdir(pth) then
- lfs.mkdir(pth)
+ mkdir(pth)
end
end
end
@@ -3925,7 +4154,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-boolean"] = package.loaded["l-boolean"] or true
--- original size: 1781, stripped down to: 1503
+-- original size: 1809, stripped down to: 1527
if not modules then modules={} end modules ['l-boolean']={
version=1.001,
@@ -3981,9 +4210,9 @@ function string.booleanstring(str)
end
function string.is_boolean(str,default)
if type(str)=="string" then
- if str=="true" or str=="yes" or str=="on" or str=="t" then
+ if str=="true" or str=="yes" or str=="on" or str=="t" or str=="1" then
return true
- elseif str=="false" or str=="no" or str=="off" or str=="f" then
+ elseif str=="false" or str=="no" or str=="off" or str=="f" or str=="0" then
return false
end
end
@@ -3997,7 +4226,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-unicode"] = package.loaded["l-unicode"] or true
--- original size: 26810, stripped down to: 11943
+-- original size: 33706, stripped down to: 14938
if not modules then modules={} end modules ['l-unicode']={
version=1.001,
@@ -4010,7 +4239,7 @@ utf=utf or (unicode and unicode.utf8) or {}
utf.characters=utf.characters or string.utfcharacters
utf.values=utf.values or string.utfvalues
local type=type
-local char,byte,format,sub=string.char,string.byte,string.format,string.sub
+local char,byte,format,sub,gmatch=string.char,string.byte,string.format,string.sub,string.gmatch
local concat=table.concat
local P,C,R,Cs,Ct,Cmt,Cc,Carg,Cp=lpeg.P,lpeg.C,lpeg.R,lpeg.Cs,lpeg.Ct,lpeg.Cmt,lpeg.Cc,lpeg.Carg,lpeg.Cp
local lpegmatch,patterns=lpeg.match,lpeg.patterns
@@ -4020,6 +4249,7 @@ local replacer=lpeg.replacer
local utfvalues=utf.values
local utfgmatch=utf.gmatch
local p_utftype=patterns.utftype
+local p_utfstricttype=patterns.utfstricttype
local p_utfoffset=patterns.utfoffset
local p_utf8char=patterns.utf8char
local p_utf8byte=patterns.utf8byte
@@ -4276,112 +4506,181 @@ function utf.magic(f)
end
return lpegmatch(p_utftype,str)
end
-local function utf16_to_utf8_be(t)
- if type(t)=="string" then
- t=lpegmatch(utflinesplitter,t)
- end
- local result={}
- for i=1,#t do
- local r,more=0,0
- for left,right in bytepairs(t[i]) do
- if right then
- local now=256*left+right
- if more>0 then
- now=(more-0xD800)*0x400+(now-0xDC00)+0x10000
- more=0
- r=r+1
- result[r]=utfchar(now)
- elseif now>=0xD800 and now<=0xDBFF then
- more=now
- else
- r=r+1
- result[r]=utfchar(now)
+local utf16_to_utf8_be,utf16_to_utf8_le
+local utf32_to_utf8_be,utf32_to_utf8_le
+local utf_16_be_linesplitter=patterns.utfbom_16_be^-1*lpeg.tsplitat(patterns.utf_16_be_nl)
+local utf_16_le_linesplitter=patterns.utfbom_16_le^-1*lpeg.tsplitat(patterns.utf_16_le_nl)
+if bytepairs then
+ utf16_to_utf8_be=function(t)
+ if type(t)=="string" then
+ t=lpegmatch(utf_16_be_linesplitter,t)
+ end
+ local result={}
+ for i=1,#t do
+ local r,more=0,0
+ for left,right in bytepairs(t[i]) do
+ if right then
+ local now=256*left+right
+ if more>0 then
+ now=(more-0xD800)*0x400+(now-0xDC00)+0x10000
+ more=0
+ r=r+1
+ result[r]=utfchar(now)
+ elseif now>=0xD800 and now<=0xDBFF then
+ more=now
+ else
+ r=r+1
+ result[r]=utfchar(now)
+ end
end
end
+ t[i]=concat(result,"",1,r)
end
- t[i]=concat(result,"",1,r)
+ return t
end
- return t
-end
-local function utf16_to_utf8_le(t)
- if type(t)=="string" then
- t=lpegmatch(utflinesplitter,t)
+ utf16_to_utf8_le=function(t)
+ if type(t)=="string" then
+ t=lpegmatch(utf_16_le_linesplitter,t)
+ end
+ local result={}
+ for i=1,#t do
+ local r,more=0,0
+ for left,right in bytepairs(t[i]) do
+ if right then
+ local now=256*right+left
+ if more>0 then
+ now=(more-0xD800)*0x400+(now-0xDC00)+0x10000
+ more=0
+ r=r+1
+ result[r]=utfchar(now)
+ elseif now>=0xD800 and now<=0xDBFF then
+ more=now
+ else
+ r=r+1
+ result[r]=utfchar(now)
+ end
+ end
+ end
+ t[i]=concat(result,"",1,r)
+ end
+ return t
end
- local result={}
- for i=1,#t do
- local r,more=0,0
- for left,right in bytepairs(t[i]) do
- if right then
- local now=256*right+left
- if more>0 then
- now=(more-0xD800)*0x400+(now-0xDC00)+0x10000
- more=0
- r=r+1
- result[r]=utfchar(now)
- elseif now>=0xD800 and now<=0xDBFF then
- more=now
+ utf32_to_utf8_be=function(t)
+ if type(t)=="string" then
+ t=lpegmatch(utflinesplitter,t)
+ end
+ local result={}
+ for i=1,#t do
+ local r,more=0,-1
+ for a,b in bytepairs(t[i]) do
+ if a and b then
+ if more<0 then
+ more=256*256*256*a+256*256*b
+ else
+ r=r+1
+ result[t]=utfchar(more+256*a+b)
+ more=-1
+ end
else
- r=r+1
- result[r]=utfchar(now)
+ break
end
end
+ t[i]=concat(result,"",1,r)
end
- t[i]=concat(result,"",1,r)
- end
- return t
-end
-local function utf32_to_utf8_be(t)
- if type(t)=="string" then
- t=lpegmatch(utflinesplitter,t)
+ return t
end
- local result={}
- for i=1,#t do
- local r,more=0,-1
- for a,b in bytepairs(t[i]) do
- if a and b then
- if more<0 then
- more=256*256*256*a+256*256*b
+ utf32_to_utf8_le=function(t)
+ if type(t)=="string" then
+ t=lpegmatch(utflinesplitter,t)
+ end
+ local result={}
+ for i=1,#t do
+ local r,more=0,-1
+ for a,b in bytepairs(t[i]) do
+ if a and b then
+ if more<0 then
+ more=256*b+a
+ else
+ r=r+1
+ result[t]=utfchar(more+256*256*256*b+256*256*a)
+ more=-1
+ end
else
- r=r+1
- result[t]=utfchar(more+256*a+b)
- more=-1
+ break
end
- else
- break
end
+ t[i]=concat(result,"",1,r)
end
- t[i]=concat(result,"",1,r)
+ return t
end
- return t
-end
-local function utf32_to_utf8_le(t)
- if type(t)=="string" then
- t=lpegmatch(utflinesplitter,t)
+else
+ utf16_to_utf8_be=function(t)
+ if type(t)=="string" then
+ t=lpegmatch(utf_16_be_linesplitter,t)
+ end
+ local result={}
+ for i=1,#t do
+ local r,more=0,0
+ for left,right in gmatch(t[i],"(.)(.)") do
+ if left=="\000" then
+ r=r+1
+ result[r]=utfchar(byte(right))
+ elseif right then
+ local now=256*byte(left)+byte(right)
+ if more>0 then
+ now=(more-0xD800)*0x400+(now-0xDC00)+0x10000
+ more=0
+ r=r+1
+ result[r]=utfchar(now)
+ elseif now>=0xD800 and now<=0xDBFF then
+ more=now
+ else
+ r=r+1
+ result[r]=utfchar(now)
+ end
+ end
+ end
+ t[i]=concat(result,"",1,r)
+ end
+ return t
end
- local result={}
- for i=1,#t do
- local r,more=0,-1
- for a,b in bytepairs(t[i]) do
- if a and b then
- if more<0 then
- more=256*b+a
- else
+ utf16_to_utf8_le=function(t)
+ if type(t)=="string" then
+ t=lpegmatch(utf_16_le_linesplitter,t)
+ end
+ local result={}
+ for i=1,#t do
+ local r,more=0,0
+ for left,right in gmatch(t[i],"(.)(.)") do
+ if right=="\000" then
r=r+1
- result[t]=utfchar(more+256*256*256*b+256*256*a)
- more=-1
+ result[r]=utfchar(byte(left))
+ elseif right then
+ local now=256*byte(right)+byte(left)
+ if more>0 then
+ now=(more-0xD800)*0x400+(now-0xDC00)+0x10000
+ more=0
+ r=r+1
+ result[r]=utfchar(now)
+ elseif now>=0xD800 and now<=0xDBFF then
+ more=now
+ else
+ r=r+1
+ result[r]=utfchar(now)
+ end
end
- else
- break
end
+ t[i]=concat(result,"",1,r)
end
- t[i]=concat(result,"",1,r)
+ return t
end
- return t
+ utf32_to_utf8_le=function() return {} end
+ utf32_to_utf8_be=function() return {} end
end
-utf.utf32_to_utf8_be=utf32_to_utf8_be
-utf.utf32_to_utf8_le=utf32_to_utf8_le
-utf.utf16_to_utf8_be=utf16_to_utf8_be
utf.utf16_to_utf8_le=utf16_to_utf8_le
+utf.utf16_to_utf8_be=utf16_to_utf8_be
+utf.utf32_to_utf8_le=utf32_to_utf8_le
+utf.utf32_to_utf8_be=utf32_to_utf8_be
function utf.utf8_to_utf8(t)
return type(t)=="string" and lpegmatch(utflinesplitter,t) or t
end
@@ -4413,13 +4712,27 @@ local function big(c)
end
local _,l_remap=utf.remapper(little)
local _,b_remap=utf.remapper(big)
-function utf.utf8_to_utf16(str,littleendian)
- if littleendian then
- return char(255,254)..lpegmatch(l_remap,str)
+function utf.utf8_to_utf16_be(str,nobom)
+ if nobom then
+ return lpegmatch(b_remap,str)
else
return char(254,255)..lpegmatch(b_remap,str)
end
end
+function utf.utf8_to_utf16_le(str,nobom)
+ if nobom then
+ return lpegmatch(l_remap,str)
+ else
+ return char(255,254)..lpegmatch(l_remap,str)
+ end
+end
+function utf.utf8_to_utf16(str,littleendian,nobom)
+ if littleendian then
+ return utf.utf8_to_utf16_le(str,nobom)
+ else
+ return utf.utf8_to_utf16_be(str,nobom)
+ end
+end
local pattern=Cs (
(p_utf8byte/function(unicode ) return format("0x%04X",unicode) end)*(p_utf8byte*Carg(1)/function(unicode,separator) return format("%s0x%04X",separator,unicode) end)^0
)
@@ -4432,6 +4745,21 @@ end
function utf.xstring(s)
return format("0x%05X",type(s)=="number" and s or utfbyte(s))
end
+function utf.toeight(str)
+ if not str then
+ return nil
+ end
+ local utftype=lpegmatch(p_utfstricttype,str)
+ if utftype=="utf-8" then
+ return sub(str,4)
+ elseif utftype=="utf-16-le" then
+ return utf16_to_utf8_le(str)
+ elseif utftype=="utf-16-be" then
+ return utf16_to_utf8_ne(str)
+ else
+ return str
+ end
+end
local p_nany=p_utf8char/""
if utfgmatch then
function utf.count(str,what)
@@ -4489,6 +4817,15 @@ if not utf.values then
end
string.utfvalues=utf.values
end
+function utf.chrlen(u)
+ return
+ (u<0x80 and 1) or
+ (u<0xE0 and 2) or
+ (u<0xF0 and 3) or
+ (u<0xF8 and 4) or
+ (u<0xFC and 5) or
+ (u<0xFE and 6) or 0
+end
end -- of closure
@@ -4534,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 22834, stripped down to: 12570
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -4553,15 +4890,28 @@ local unpack,concat=table.unpack,table.concat
local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
local patterns,lpegmatch=lpeg.patterns,lpeg.match
local utfchar,utfbyte=utf.char,utf.byte
-local loadstripped=_LUAVERSION<5.2 and load or function(str)
- return load(dump(load(str),true))
+local loadstripped=nil
+if _LUAVERSION<5.2 then
+ loadstripped=function(str,shortcuts)
+ return load(str)
+ end
+else
+ loadstripped=function(str,shortcuts)
+ if shortcuts then
+ return load(dump(load(str),true),nil,nil,shortcuts)
+ else
+ return load(dump(load(str),true))
+ end
+ end
end
if not number then number={} end
local stripper=patterns.stripzeros
local function points(n)
+ n=tonumber(n)
return (not n or n==0) and "0pt" or lpegmatch(stripper,format("%.5fpt",n/65536))
end
local function basepoints(n)
+ n=tonumber(n)
return (not n or n==0) and "0bp" or lpegmatch(stripper,format("%.5fbp",n*(7200/7227)/65536))
end
number.points=points
@@ -4624,11 +4974,39 @@ local pattern=Carg(1)/function(t)
function strings.tabtospace(str,tab)
return lpegmatch(pattern,str,1,tab or 7)
end
-function strings.striplong(str)
- str=gsub(str,"^%s*","")
- str=gsub(str,"[\n\r]+ *","\n")
- return str
+local newline=patterns.newline
+local endofstring=patterns.endofstring
+local whitespace=patterns.whitespace
+local spacer=patterns.spacer
+local space=spacer^0
+local nospace=space/""
+local endofline=nospace*newline
+local stripend=(whitespace^1*endofstring)/""
+local normalline=(nospace*((1-space*(newline+endofstring))^1)*nospace)
+local stripempty=endofline^1/""
+local normalempty=endofline^1
+local singleempty=endofline*(endofline^0/"")
+local doubleempty=endofline*endofline^-1*(endofline^0/"")
+local stripstart=stripempty^0
+local p_prune_normal=Cs (stripstart*(stripend+normalline+normalempty )^0 )
+local p_prune_collapse=Cs (stripstart*(stripend+normalline+doubleempty )^0 )
+local p_prune_noempty=Cs (stripstart*(stripend+normalline+singleempty )^0 )
+local p_retain_normal=Cs ((normalline+normalempty )^0 )
+local p_retain_collapse=Cs ((normalline+doubleempty )^0 )
+local p_retain_noempty=Cs ((normalline+singleempty )^0 )
+local striplinepatterns={
+ ["prune"]=p_prune_normal,
+ ["prune and collapse"]=p_prune_collapse,
+ ["prune and no empty"]=p_prune_noempty,
+ ["retain"]=p_retain_normal,
+ ["retain and collapse"]=p_retain_collapse,
+ ["retain and no empty"]=p_retain_noempty,
+}
+strings.striplinepatterns=striplinepatterns
+function strings.striplines(str,how)
+ return str and lpegmatch(how and striplinepatterns[how] or p_prune_collapse,str) or str
end
+strings.striplong=strings.striplines
function strings.nice(str)
str=gsub(str,"[:%-+_]+"," ")
return str
@@ -4679,29 +5057,83 @@ function number.signed(i)
return "-",-i
end
end
-local preamble=[[
-local type = type
-local tostring = tostring
-local tonumber = tonumber
-local format = string.format
-local concat = table.concat
-local signed = number.signed
-local points = number.points
-local basepoints = number.basepoints
-local utfchar = utf.char
-local utfbyte = utf.byte
-local lpegmatch = lpeg.match
-local nspaces = string.nspaces
-local tracedchar = string.tracedchar
-local autosingle = string.autosingle
-local autodouble = string.autodouble
-local sequenced = table.sequenced
-]]
+local zero=P("0")^1/""
+local plus=P("+")/""
+local minus=P("-")
+local separator=S(".")
+local digit=R("09")
+local trailing=zero^1*#S("eE")
+local exponent=(S("eE")*(plus+Cs((minus*zero^0*P(-1))/"")+minus)*zero^0*(P(-1)*Cc("0")+P(1)^1))
+local pattern_a=Cs(minus^0*digit^1*(separator/""*trailing+separator*(trailing+digit)^0)*exponent)
+local pattern_b=Cs((exponent+P(1))^0)
+function number.sparseexponent(f,n)
+ if not n then
+ n=f
+ f="%e"
+ end
+ local tn=type(n)
+ if tn=="string" then
+ local m=tonumber(n)
+ if m then
+ return lpegmatch((f=="%e" or f=="%E") and pattern_a or pattern_b,format(f,m))
+ end
+ elseif tn=="number" then
+ return lpegmatch((f=="%e" or f=="%E") and pattern_a or pattern_b,format(f,n))
+ end
+ return tostring(n)
+end
local template=[[
%s
%s
return function(%s) return %s end
]]
+local preamble,environment="",{}
+if _LUAVERSION<5.2 then
+ preamble=[[
+local lpeg=lpeg
+local type=type
+local tostring=tostring
+local tonumber=tonumber
+local format=string.format
+local concat=table.concat
+local signed=number.signed
+local points=number.points
+local basepoints= number.basepoints
+local utfchar=utf.char
+local utfbyte=utf.byte
+local lpegmatch=lpeg.match
+local nspaces=string.nspaces
+local tracedchar=string.tracedchar
+local autosingle=string.autosingle
+local autodouble=string.autodouble
+local sequenced=table.sequenced
+local formattednumber=number.formatted
+local sparseexponent=number.sparseexponent
+ ]]
+else
+ environment={
+ global=global or _G,
+ lpeg=lpeg,
+ type=type,
+ tostring=tostring,
+ tonumber=tonumber,
+ format=string.format,
+ concat=table.concat,
+ signed=number.signed,
+ points=number.points,
+ basepoints=number.basepoints,
+ utfchar=utf.char,
+ utfbyte=utf.byte,
+ lpegmatch=lpeg.match,
+ nspaces=string.nspaces,
+ tracedchar=string.tracedchar,
+ autosingle=string.autosingle,
+ autodouble=string.autodouble,
+ sequenced=table.sequenced,
+ formattednumber=number.formatted,
+ sparseexponent=number.sparseexponent,
+ }
+end
local arguments={ "a1" }
setmetatable(arguments,{ __index=function(t,k)
local v=t[k-1]..",a"..k
@@ -4710,7 +5142,7 @@ setmetatable(arguments,{ __index=function(t,k)
end
})
local prefix_any=C((S("+- .")+R("09"))^0)
-local prefix_tab=C((1-R("az","AZ","09","%%"))^0)
+local prefix_tab=P("{")*C((1-P("}"))^0)*P("}")+C((1-R("az","AZ","09","%%"))^0)
local format_s=function(f)
n=n+1
if f and f~="" then
@@ -4740,7 +5172,7 @@ local format_i=function(f)
if f and f~="" then
return format("format('%%%si',a%s)",f,n)
else
- return format("a%s",n)
+ return format("format('%%i',a%s)",n)
end
end
local format_d=format_i
@@ -4752,6 +5184,14 @@ local format_f=function(f)
n=n+1
return format("format('%%%sf',a%s)",f,n)
end
+local format_F=function(f)
+ n=n+1
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
+end
local format_g=function(f)
n=n+1
return format("format('%%%sg',a%s)",f,n)
@@ -4768,6 +5208,14 @@ local format_E=function(f)
n=n+1
return format("format('%%%sE',a%s)",f,n)
end
+local format_j=function(f)
+ n=n+1
+ return format("sparseexponent('%%%se',a%s)",f,n)
+end
+local format_J=function(f)
+ n=n+1
+ return format("sparseexponent('%%%sE',a%s)",f,n)
+end
local format_x=function(f)
n=n+1
return format("format('%%%sx',a%s)",f,n)
@@ -4892,6 +5340,43 @@ end
local format_W=function(f)
return format("nspaces[%s]",tonumber(f) or 0)
end
+local digit=patterns.digit
+local period=patterns.period
+local three=digit*digit*digit
+local splitter=Cs (
+ (((1-(three^1*period))^1+C(three))*(Carg(1)*three)^1+C((1-period)^1))*(P(1)/""*Carg(2))*C(2)
+)
+patterns.formattednumber=splitter
+function number.formatted(n,sep1,sep2)
+ local s=type(s)=="string" and n or format("%0.2f",n)
+ if sep1==true then
+ return lpegmatch(splitter,s,1,".",",")
+ elseif sep1=="." then
+ return lpegmatch(splitter,s,1,sep1,sep2 or ",")
+ elseif sep1=="," then
+ return lpegmatch(splitter,s,1,sep1,sep2 or ".")
+ else
+ return lpegmatch(splitter,s,1,sep1 or ",",sep2 or ".")
+ end
+end
+local format_m=function(f)
+ n=n+1
+ if not f or f=="" then
+ f=","
+ end
+ return format([[formattednumber(a%s,%q,".")]],n,f)
+end
+local format_M=function(f)
+ n=n+1
+ if not f or f=="" then
+ f="."
+ end
+ return format([[formattednumber(a%s,%q,",")]],n,f)
+end
+local format_z=function(f)
+ n=n+(tonumber(f) or 1)
+ return "''"
+end
local format_rest=function(s)
return format("%q",s)
end
@@ -4921,15 +5406,17 @@ local builder=Cs { "start",
(
P("%")/""*(
V("!")
-+V("s")+V("q")+V("i")+V("d")+V("f")+V("g")+V("G")+V("e")+V("E")+V("x")+V("X")+V("o")
++V("s")+V("q")+V("i")+V("d")+V("f")+V("F")+V("g")+V("G")+V("e")+V("E")+V("x")+V("X")+V("o")
+V("c")+V("C")+V("S")
+V("Q")
+V("N")
-+V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("b")+V("t")+V("T")+V("l")+V("L")+V("I")+V("h")
-+V("w")
++V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("b")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w")
+V("W")
+V("a")
-+V("A")
++V("A")
++V("j")+V("J")
++V("m")+V("M")
++V("z")
+V("*")
)+V("*")
)*(P(-1)+Carg(1))
@@ -4939,6 +5426,7 @@ local builder=Cs { "start",
["i"]=(prefix_any*P("i"))/format_i,
["d"]=(prefix_any*P("d"))/format_d,
["f"]=(prefix_any*P("f"))/format_f,
+ ["F"]=(prefix_any*P("F"))/format_F,
["g"]=(prefix_any*P("g"))/format_g,
["G"]=(prefix_any*P("G"))/format_G,
["e"]=(prefix_any*P("e"))/format_e,
@@ -4960,19 +5448,24 @@ local builder=Cs { "start",
["b"]=(prefix_any*P("b"))/format_b,
["t"]=(prefix_tab*P("t"))/format_t,
["T"]=(prefix_tab*P("T"))/format_T,
- ["l"]=(prefix_tab*P("l"))/format_l,
- ["L"]=(prefix_tab*P("L"))/format_L,
+ ["l"]=(prefix_any*P("l"))/format_l,
+ ["L"]=(prefix_any*P("L"))/format_L,
["I"]=(prefix_any*P("I"))/format_I,
["w"]=(prefix_any*P("w"))/format_w,
["W"]=(prefix_any*P("W"))/format_W,
+ ["j"]=(prefix_any*P("j"))/format_j,
+ ["J"]=(prefix_any*P("J"))/format_J,
+ ["m"]=(prefix_tab*P("m"))/format_m,
+ ["M"]=(prefix_tab*P("M"))/format_M,
+ ["z"]=(prefix_any*P("z"))/format_z,
["a"]=(prefix_any*P("a"))/format_a,
["A"]=(prefix_any*P("A"))/format_A,
- ["*"]=Cs(((1-P("%"))^1+P("%%")/"%%%%")^1)/format_rest,
+ ["*"]=Cs(((1-P("%"))^1+P("%%")/"%%")^1)/format_rest,
["!"]=Carg(2)*prefix_any*P("!")*C((1-P("!"))^1)*P("!")/format_extension,
}
local direct=Cs (
- P("%")/""*Cc([[local format = string.format return function(str) return format("%]])*(S("+- .")+R("09"))^0*S("sqidfgGeExXo")*Cc([[",str) end]])*P(-1)
- )
+ P("%")*(S("+- .")+R("09"))^0*S("sqidfgGeExXo")*P(-1)/[[local format = string.format return function(str) return format("%0",str) end]]
+)
local function make(t,str)
local f
local p
@@ -4981,10 +5474,10 @@ local function make(t,str)
f=loadstripped(p)()
else
n=0
- p=lpegmatch(builder,str,1,"..",t._extensions_)
+ p=lpegmatch(builder,str,1,t._connector_,t._extensions_)
if n>0 then
p=format(template,preamble,t._preamble_,arguments[n],p)
- f=loadstripped(p)()
+ f=loadstripped(p,t._environment_)()
else
f=function() return str end
end
@@ -4996,10 +5489,22 @@ local function use(t,fmt,...)
return t[fmt](...)
end
strings.formatters={}
-function strings.formatters.new()
- local t={ _extensions_={},_preamble_="",_type_="formatter" }
- setmetatable(t,{ __index=make,__call=use })
- return t
+if _LUAVERSION<5.2 then
+ function strings.formatters.new(noconcat)
+ local t={ _type_="formatter",_connector_=noconcat and "," or "..",_extensions_={},_preamble_=preamble,_environment_={} }
+ setmetatable(t,{ __index=make,__call=use })
+ return t
+ end
+else
+ function strings.formatters.new(noconcat)
+ local e={}
+ for k,v in next,environment do
+ e[k]=v
+ end
+ local t={ _type_="formatter",_connector_=noconcat and "," or "..",_extensions_={},_preamble_="",_environment_=e }
+ setmetatable(t,{ __index=make,__call=use })
+ return t
+ end
end
local formatters=strings.formatters.new()
string.formatters=formatters
@@ -5007,16 +5512,29 @@ string.formatter=function(str,...) return formatters[str](...) end
local function add(t,name,template,preamble)
if type(t)=="table" and t._type_=="formatter" then
t._extensions_[name]=template or "%s"
- if preamble then
+ if type(preamble)=="string" then
t._preamble_=preamble.."\n"..t._preamble_
+ elseif type(preamble)=="table" then
+ for k,v in next,preamble do
+ t._environment_[k]=v
+ end
end
end
end
strings.formatters.add=add
-lpeg.patterns.xmlescape=Cs((P("<")/"&lt;"+P(">")/"&gt;"+P("&")/"&amp;"+P('"')/"&quot;"+P(1))^0)
-lpeg.patterns.texescape=Cs((C(S("#$%\\{}"))/"\\%1"+P(1))^0)
-add(formatters,"xml",[[lpegmatch(xmlescape,%s)]],[[local xmlescape = lpeg.patterns.xmlescape]])
-add(formatters,"tex",[[lpegmatch(texescape,%s)]],[[local texescape = lpeg.patterns.texescape]])
+patterns.xmlescape=Cs((P("<")/"&lt;"+P(">")/"&gt;"+P("&")/"&amp;"+P('"')/"&quot;"+P(1))^0)
+patterns.texescape=Cs((C(S("#$%\\{}"))/"\\%1"+P(1))^0)
+patterns.luaescape=Cs(((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0)
+patterns.luaquoted=Cs(Cc('"')*((1-S('"\n'))^1+P('"')/'\\"'+P('\n')/'\\n"')^0*Cc('"'))
+if _LUAVERSION<5.2 then
+ add(formatters,"xml",[[lpegmatch(xmlescape,%s)]],"local xmlescape = lpeg.patterns.xmlescape")
+ add(formatters,"tex",[[lpegmatch(texescape,%s)]],"local texescape = lpeg.patterns.texescape")
+ add(formatters,"lua",[[lpegmatch(luaescape,%s)]],"local luaescape = lpeg.patterns.luaescape")
+else
+ add(formatters,"xml",[[lpegmatch(xmlescape,%s)]],{ xmlescape=lpeg.patterns.xmlescape })
+ add(formatters,"tex",[[lpegmatch(texescape,%s)]],{ texescape=lpeg.patterns.texescape })
+ add(formatters,"lua",[[lpegmatch(luaescape,%s)]],{ luaescape=lpeg.patterns.luaescape })
+end
end -- of closure
@@ -5025,7 +5543,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-tab"] = package.loaded["util-tab"] or true
--- original size: 14510, stripped down to: 8531
+-- original size: 23985, stripped down to: 16069
if not modules then modules={} end modules ['util-tab']={
version=1.001,
@@ -5037,35 +5555,38 @@ if not modules then modules={} end modules ['util-tab']={
utilities=utilities or {}
utilities.tables=utilities.tables or {}
local tables=utilities.tables
-local format,gmatch,gsub=string.format,string.gmatch,string.gsub
+local format,gmatch,gsub,sub=string.format,string.gmatch,string.gsub,string.sub
local concat,insert,remove=table.concat,table.insert,table.remove
local setmetatable,getmetatable,tonumber,tostring=setmetatable,getmetatable,tonumber,tostring
local type,next,rawset,tonumber,tostring,load,select=type,next,rawset,tonumber,tostring,load,select
local lpegmatch,P,Cs,Cc=lpeg.match,lpeg.P,lpeg.Cs,lpeg.Cc
-local serialize,sortedkeys,sortedpairs=table.serialize,table.sortedkeys,table.sortedpairs
+local sortedkeys,sortedpairs=table.sortedkeys,table.sortedpairs
local formatters=string.formatters
+local utftoeight=utf.toeight
local splitter=lpeg.tsplitat(".")
-function tables.definetable(target,nofirst,nolast)
- local composed,shortcut,t=nil,nil,{}
+function utilities.tables.definetable(target,nofirst,nolast)
+ local composed,t=nil,{}
local snippets=lpegmatch(splitter,target)
for i=1,#snippets-(nolast and 1 or 0) do
local name=snippets[i]
if composed then
- composed=shortcut.."."..name
- shortcut=shortcut.."_"..name
- t[#t+1]=formatters["local %s = %s if not %s then %s = { } %s = %s end"](shortcut,composed,shortcut,shortcut,composed,shortcut)
+ composed=composed.."."..name
+ t[#t+1]=formatters["if not %s then %s = { } end"](composed,composed)
else
composed=name
- shortcut=name
if not nofirst then
t[#t+1]=formatters["%s = %s or { }"](composed,composed)
end
end
end
- if nolast then
- composed=shortcut.."."..snippets[#snippets]
+ if composed then
+ if nolast then
+ composed=composed.."."..snippets[#snippets]
+ end
+ return concat(t,"\n"),composed
+ else
+ return "",target
end
- return concat(t,"\n"),composed
end
function tables.definedtable(...)
local t=_G
@@ -5092,7 +5613,7 @@ function tables.accesstable(target,root)
end
function tables.migratetable(target,v,root)
local t=root or _G
- local names=string.split(target,".")
+ local names=lpegmatch(splitter,target)
for i=1,#names-1 do
local name=names[i]
t[name]=t[name] or {}
@@ -5247,47 +5768,78 @@ function tables.encapsulate(core,capsule,protect)
} )
end
end
-local function fastserialize(t,r,outer)
- r[#r+1]="{"
- local n=#t
- if n>0 then
- for i=1,n do
- local v=t[i]
- local tv=type(v)
- if tv=="string" then
- r[#r+1]=formatters["%q,"](v)
- elseif tv=="number" then
- r[#r+1]=formatters["%s,"](v)
- elseif tv=="table" then
- fastserialize(v,r)
- elseif tv=="boolean" then
- r[#r+1]=formatters["%S,"](v)
+local f_hashed_string=formatters["[%q]=%q,"]
+local f_hashed_number=formatters["[%q]=%s,"]
+local f_hashed_boolean=formatters["[%q]=%l,"]
+local f_hashed_table=formatters["[%q]="]
+local f_indexed_string=formatters["[%s]=%q,"]
+local f_indexed_number=formatters["[%s]=%s,"]
+local f_indexed_boolean=formatters["[%s]=%l,"]
+local f_indexed_table=formatters["[%s]="]
+local f_ordered_string=formatters["%q,"]
+local f_ordered_number=formatters["%s,"]
+local f_ordered_boolean=formatters["%l,"]
+function table.fastserialize(t,prefix)
+ local r={ type(prefix)=="string" and prefix or "return" }
+ local m=1
+ local function fastserialize(t,outer)
+ local n=#t
+ m=m+1
+ r[m]="{"
+ if n>0 then
+ for i=0,n do
+ local v=t[i]
+ local tv=type(v)
+ if tv=="string" then
+ m=m+1 r[m]=f_ordered_string(v)
+ elseif tv=="number" then
+ m=m+1 r[m]=f_ordered_number(v)
+ elseif tv=="table" then
+ fastserialize(v)
+ elseif tv=="boolean" then
+ m=m+1 r[m]=f_ordered_boolean(v)
+ end
end
end
- else
for k,v in next,t do
- local tv=type(v)
- if tv=="string" then
- r[#r+1]=formatters["[%q]=%q,"](k,v)
- elseif tv=="number" then
- r[#r+1]=formatters["[%q]=%s,"](k,v)
- elseif tv=="table" then
- r[#r+1]=formatters["[%q]="](k)
- fastserialize(v,r)
- elseif tv=="boolean" then
- r[#r+1]=formatters["[%q]=%S,"](k,v)
+ local tk=type(k)
+ if tk=="number" then
+ if k>n or k<0 then
+ local tv=type(v)
+ if tv=="string" then
+ m=m+1 r[m]=f_indexed_string(k,v)
+ elseif tv=="number" then
+ m=m+1 r[m]=f_indexed_number(k,v)
+ elseif tv=="table" then
+ m=m+1 r[m]=f_indexed_table(k)
+ fastserialize(v)
+ elseif tv=="boolean" then
+ m=m+1 r[m]=f_indexed_boolean(k,v)
+ end
+ end
+ else
+ local tv=type(v)
+ if tv=="string" then
+ m=m+1 r[m]=f_hashed_string(k,v)
+ elseif tv=="number" then
+ m=m+1 r[m]=f_hashed_number(k,v)
+ elseif tv=="table" then
+ m=m+1 r[m]=f_hashed_table(k)
+ fastserialize(v)
+ elseif tv=="boolean" then
+ m=m+1 r[m]=f_hashed_boolean(k,v)
+ end
end
end
+ m=m+1
+ if outer then
+ r[m]="}"
+ else
+ r[m]="},"
+ end
+ return r
end
- if outer then
- r[#r+1]="}"
- else
- r[#r+1]="},"
- end
- return r
-end
-function table.fastserialize(t,prefix)
- return concat(fastserialize(t,{ prefix or "return" },true))
+ return concat(fastserialize(t,true))
end
function table.deserialize(str)
if not str or str=="" then
@@ -5307,6 +5859,7 @@ function table.load(filename,loader)
if filename then
local t=(loader or io.loaddata)(filename)
if t and t~="" then
+ local t=utftoeight(t)
t=load(t)
if type(t)=="function" then
t=t()
@@ -5318,9 +5871,12 @@ function table.load(filename,loader)
end
end
function table.save(filename,t,n,...)
- io.savedata(filename,serialize(t,n==nil and true or n,...))
+ io.savedata(filename,table.serialize(t,n==nil and true or n,...))
end
-local function slowdrop(t)
+local f_key_value=formatters["%s=%q"]
+local f_add_table=formatters[" {%t},\n"]
+local f_return_table=formatters["return {\n%t}"]
+local function slowdrop(t)
local r={}
local l={}
for i=1,#t do
@@ -5328,23 +5884,25 @@ local function slowdrop(t)
local j=0
for k,v in next,ti do
j=j+1
- l[j]=formatters["%s=%q"](k,v)
+ l[j]=f_key_value(k,v)
end
- r[i]=formatters[" {%t},\n"](l)
+ r[i]=f_add_table(l)
end
- return formatters["return {\n%st}"](r)
+ return f_return_table(r)
end
local function fastdrop(t)
local r={ "return {\n" }
+ local m=1
for i=1,#t do
local ti=t[i]
- r[#r+1]=" {"
+ m=m+1 r[m]=" {"
for k,v in next,ti do
- r[#r+1]=formatters["%s=%q"](k,v)
+ m=m+1 r[m]=f_key_value(k,v)
end
- r[#r+1]="},\n"
+ m=m+1 r[m]="},\n"
end
- r[#r+1]="}"
+ m=m+1
+ r[m]="}"
return concat(r)
end
function table.drop(t,slow)
@@ -5379,6 +5937,216 @@ function table.twowaymapper(t)
setmetatable(t,selfmapper)
return t
end
+local f_start_key_idx=formatters["%w{"]
+local f_start_key_num=formatters["%w[%s]={"]
+local f_start_key_str=formatters["%w[%q]={"]
+local f_start_key_boo=formatters["%w[%l]={"]
+local f_start_key_nop=formatters["%w{"]
+local f_stop=formatters["%w},"]
+local f_key_num_value_num=formatters["%w[%s]=%s,"]
+local f_key_str_value_num=formatters["%w[%q]=%s,"]
+local f_key_boo_value_num=formatters["%w[%l]=%s,"]
+local f_key_num_value_str=formatters["%w[%s]=%q,"]
+local f_key_str_value_str=formatters["%w[%q]=%q,"]
+local f_key_boo_value_str=formatters["%w[%l]=%q,"]
+local f_key_num_value_boo=formatters["%w[%s]=%l,"]
+local f_key_str_value_boo=formatters["%w[%q]=%l,"]
+local f_key_boo_value_boo=formatters["%w[%l]=%l,"]
+local f_key_num_value_not=formatters["%w[%s]={},"]
+local f_key_str_value_not=formatters["%w[%q]={},"]
+local f_key_boo_value_not=formatters["%w[%l]={},"]
+local f_key_num_value_seq=formatters["%w[%s]={ %, t },"]
+local f_key_str_value_seq=formatters["%w[%q]={ %, t },"]
+local f_key_boo_value_seq=formatters["%w[%l]={ %, t },"]
+local f_val_num=formatters["%w%s,"]
+local f_val_str=formatters["%w%q,"]
+local f_val_boo=formatters["%w%l,"]
+local f_val_not=formatters["%w{},"]
+local f_val_seq=formatters["%w{ %, t },"]
+local f_table_return=formatters["return {"]
+local f_table_name=formatters["%s={"]
+local f_table_direct=formatters["{"]
+local f_table_entry=formatters["[%q]={"]
+local f_table_finish=formatters["}"]
+local spaces=utilities.strings.newrepeater(" ")
+local serialize=table.serialize
+function table.serialize(root,name,specification)
+ if type(specification)=="table" then
+ return serialize(root,name,specification)
+ end
+ local t
+ local n=1
+ local function simple_table(t)
+ if #t>0 then
+ local n=0
+ for _,v in next,t do
+ n=n+1
+ if type(v)=="table" then
+ return nil
+ end
+ end
+ if n==#t then
+ local tt={}
+ local nt=0
+ for i=1,#t do
+ local v=t[i]
+ local tv=type(v)
+ nt=nt+1
+ if tv=="number" then
+ tt[nt]=v
+ elseif tv=="string" then
+ tt[nt]=format("%q",v)
+ elseif tv=="boolean" then
+ tt[nt]=v and "true" or "false"
+ else
+ return nil
+ end
+ end
+ return tt
+ end
+ end
+ return nil
+ end
+ local function do_serialize(root,name,depth,level,indexed)
+ if level>0 then
+ n=n+1
+ if indexed then
+ t[n]=f_start_key_idx(depth)
+ else
+ local tn=type(name)
+ if tn=="number" then
+ t[n]=f_start_key_num(depth,name)
+ elseif tn=="string" then
+ t[n]=f_start_key_str(depth,name)
+ elseif tn=="boolean" then
+ t[n]=f_start_key_boo(depth,name)
+ else
+ t[n]=f_start_key_nop(depth)
+ end
+ end
+ depth=depth+1
+ end
+ if root and next(root) then
+ local first=nil
+ local last=0
+ last=#root
+ for k=1,last do
+ if root[k]==nil then
+ last=k-1
+ break
+ end
+ end
+ if last>0 then
+ first=1
+ end
+ local sk=sortedkeys(root)
+ for i=1,#sk do
+ local k=sk[i]
+ local v=root[k]
+ local tv=type(v)
+ local tk=type(k)
+ if first and tk=="number" and k>=first and k<=last then
+ if tv=="number" then
+ n=n+1 t[n]=f_val_num(depth,v)
+ elseif tv=="string" then
+ n=n+1 t[n]=f_val_str(depth,v)
+ elseif tv=="table" then
+ if not next(v) then
+ n=n+1 t[n]=f_val_not(depth)
+ else
+ local st=simple_table(v)
+ if st then
+ n=n+1 t[n]=f_val_seq(depth,st)
+ else
+ do_serialize(v,k,depth,level+1,true)
+ end
+ end
+ elseif tv=="boolean" then
+ n=n+1 t[n]=f_val_boo(depth,v)
+ end
+ elseif tv=="number" then
+ if tk=="number" then
+ n=n+1 t[n]=f_key_num_value_num(depth,k,v)
+ elseif tk=="string" then
+ n=n+1 t[n]=f_key_str_value_num(depth,k,v)
+ elseif tk=="boolean" then
+ n=n+1 t[n]=f_key_boo_value_num(depth,k,v)
+ end
+ elseif tv=="string" then
+ if tk=="number" then
+ n=n+1 t[n]=f_key_num_value_str(depth,k,v)
+ elseif tk=="string" then
+ n=n+1 t[n]=f_key_str_value_str(depth,k,v)
+ elseif tk=="boolean" then
+ n=n+1 t[n]=f_key_boo_value_str(depth,k,v)
+ end
+ elseif tv=="table" then
+ if not next(v) then
+ if tk=="number" then
+ n=n+1 t[n]=f_key_num_value_not(depth,k,v)
+ elseif tk=="string" then
+ n=n+1 t[n]=f_key_str_value_not(depth,k,v)
+ elseif tk=="boolean" then
+ n=n+1 t[n]=f_key_boo_value_not(depth,k,v)
+ end
+ else
+ local st=simple_table(v)
+ if not st then
+ do_serialize(v,k,depth,level+1)
+ elseif tk=="number" then
+ n=n+1 t[n]=f_key_num_value_seq(depth,k,st)
+ elseif tk=="string" then
+ n=n+1 t[n]=f_key_str_value_seq(depth,k,st)
+ elseif tk=="boolean" then
+ n=n+1 t[n]=f_key_boo_value_seq(depth,k,st)
+ end
+ end
+ elseif tv=="boolean" then
+ if tk=="number" then
+ n=n+1 t[n]=f_key_num_value_boo(depth,k,v)
+ elseif tk=="string" then
+ n=n+1 t[n]=f_key_str_value_boo(depth,k,v)
+ elseif tk=="boolean" then
+ n=n+1 t[n]=f_key_boo_value_boo(depth,k,v)
+ end
+ end
+ end
+ end
+ if level>0 then
+ n=n+1 t[n]=f_stop(depth-1)
+ end
+ end
+ local tname=type(name)
+ if tname=="string" then
+ if name=="return" then
+ t={ f_table_return() }
+ else
+ t={ f_table_name(name) }
+ end
+ elseif tname=="number" then
+ t={ f_table_entry(name) }
+ elseif tname=="boolean" then
+ if name then
+ t={ f_table_return() }
+ else
+ t={ f_table_direct() }
+ end
+ else
+ t={ f_table_name("t") }
+ end
+ if root then
+ if getmetatable(root) then
+ local dummy=root._w_h_a_t_e_v_e_r_
+ root._w_h_a_t_e_v_e_r_=nil
+ end
+ if next(root) then
+ do_serialize(root,name,1,0)
+ end
+ end
+ n=n+1
+ t[n]=f_table_finish()
+ return concat(t,"\n")
+end
end -- of closure
@@ -5387,7 +6155,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-sto"] = package.loaded["util-sto"] or true
--- original size: 4432, stripped down to: 3123
+-- original size: 4172, stripped down to: 2953
if not modules then modules={} end modules ['util-sto']={
version=1.001,
@@ -5457,56 +6225,47 @@ end
local function f_empty () return "" end
local function f_self (t,k) t[k]=k return k end
local function f_table (t,k) local v={} t[k]=v return v end
+local function f_number(t,k) t[k]=0 return 0 end
local function f_ignore() end
-local t_empty={ __index=f_empty }
-local t_self={ __index=f_self }
-local t_table={ __index=f_table }
-local t_ignore={ __newindex=f_ignore }
+local f_index={
+ ["empty"]=f_empty,
+ ["self"]=f_self,
+ ["table"]=f_table,
+ ["number"]=f_number,
+}
+local t_index={
+ ["empty"]={ __index=f_empty },
+ ["self"]={ __index=f_self },
+ ["table"]={ __index=f_table },
+ ["number"]={ __index=f_number },
+}
function table.setmetatableindex(t,f)
if type(t)~="table" then
f,t=t,{}
end
local m=getmetatable(t)
if m then
- if f=="empty" then
- m.__index=f_empty
- elseif f=="key" then
- m.__index=f_self
- elseif f=="table" then
- m.__index=f_table
- else
- m.__index=f
- end
+ m.__index=f_index[f] or f
else
- if f=="empty" then
- setmetatable(t,t_empty)
- elseif f=="key" then
- setmetatable(t,t_self)
- elseif f=="table" then
- setmetatable(t,t_table)
- else
- setmetatable(t,{ __index=f })
- end
+ setmetatable(t,t_index[f] or { __index=f })
end
return t
end
+local f_index={
+ ["ignore"]=f_ignore,
+}
+local t_index={
+ ["ignore"]={ __newindex=f_ignore },
+}
function table.setmetatablenewindex(t,f)
if type(t)~="table" then
f,t=t,{}
end
local m=getmetatable(t)
if m then
- if f=="ignore" then
- m.__newindex=f_ignore
- else
- m.__newindex=f
- end
+ m.__newindex=f_index[f] or f
else
- if f=="ignore" then
- setmetatable(t,t_ignore)
- else
- setmetatable(t,{ __newindex=f })
- end
+ setmetatable(t,t_index[f] or { __newindex=f })
end
return t
end
@@ -5543,7 +6302,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-prs"] = package.loaded["util-prs"] or true
--- original size: 17827, stripped down to: 12722
+-- original size: 19618, stripped down to: 14012
if not modules then modules={} end modules ['util-prs']={
version=1.001,
@@ -5555,8 +6314,9 @@ if not modules then modules={} end modules ['util-prs']={
local lpeg,table,string=lpeg,table,string
local P,R,V,S,C,Ct,Cs,Carg,Cc,Cg,Cf,Cp=lpeg.P,lpeg.R,lpeg.V,lpeg.S,lpeg.C,lpeg.Ct,lpeg.Cs,lpeg.Carg,lpeg.Cc,lpeg.Cg,lpeg.Cf,lpeg.Cp
local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
-local concat,format,gmatch,find=table.concat,string.format,string.gmatch,string.find
+local concat,gmatch,find=table.concat,string.gmatch,string.find
local tostring,type,next,rawset=tostring,type,next,rawset
+local mod,div=math.mod,math.div
utilities=utilities or {}
local parsers=utilities.parsers or {}
utilities.parsers=parsers
@@ -5687,13 +6447,34 @@ function parsers.settings_to_array(str,strict)
elseif not str or str=="" then
return {}
elseif strict then
- if find(str,"{") then
+ if find(str,"{",1,true) then
return lpegmatch(pattern,str)
else
return { str }
end
- else
+ elseif find(str,",",1,true) then
return lpegmatch(pattern,str)
+ else
+ return { str }
+ end
+end
+local separator=space^0*comma*space^0
+local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C((nestedbraces+(1-(space^0*(comma+P(-1)))))^0)
+local withvalue=Carg(1)*value/function(f,s) return f(s) end
+local pattern_a=spaces*Ct(value*(separator*value)^0)
+local pattern_b=spaces*withvalue*(separator*withvalue)^0
+function parsers.stripped_settings_to_array(str)
+ if not str or str=="" then
+ return {}
+ else
+ return lpegmatch(pattern_a,str)
+ end
+end
+function parsers.process_stripped_settings(str,action)
+ if not str or str=="" then
+ return {}
+ else
+ return lpegmatch(pattern_b,str,1,action)
end
end
local function set(t,v)
@@ -5760,6 +6541,12 @@ function parsers.simple_hash_to_string(h,separator)
end
return concat(t,separator or ",")
end
+local str=C((1-whitespace-equal)^1)
+local setting=Cf(Carg(1)*(whitespace^0*Cg(str*whitespace^0*(equal*whitespace^0*str+Cc(""))))^1,rawset)
+local splitter=setting^1
+function utilities.parsers.options_to_hash(str,target)
+ return str and lpegmatch(splitter,str,1,target or {}) or {}
+end
local value=P(lbrace*C((nobrace+nestedbraces)^0)*rbrace)+C(digit^1*lparent*(noparent+nestedparents)^1*rparent)+C((nestedbraces+(1-comma))^1)
local pattern_a=spaces*Ct(value*(separator*value)^0)
local function repeater(n,str)
@@ -5864,7 +6651,7 @@ function parsers.csvsplitter(specification)
end
whatever=quotedata+whatever
end
- local parser=Ct((Ct(whatever*(separator*whatever)^0)*S("\n\r"))^0 )
+ local parser=Ct((Ct(whatever*(separator*whatever)^0)*S("\n\r")^1)^0 )
return function(data)
return lpegmatch(parser,data)
end
@@ -5878,8 +6665,8 @@ function parsers.rfc4180splitter(specification)
local separator=S(separator~="" and separator or ",")
local escaped=quotechar*Cs((dquotechar+(1-quotechar))^0)*quotechar
local non_escaped=C((1-quotechar-newline-separator)^1)
- local field=escaped+non_escaped
- local record=Ct((field*separator^-1)^1)
+ local field=escaped+non_escaped+Cc("")
+ local record=Ct(field*(separator*field)^1)
local headerline=record*Cp()
local wholeblob=Ct((newline^-1*record)^0)
return function(data,getheader)
@@ -5972,7 +6759,7 @@ end
local function fetch(t,name)
return t[name] or {}
end
-function process(result,more)
+local function process(result,more)
for k,v in next,more do
result[k]=v
end
@@ -5984,6 +6771,18 @@ local merge=Cf(parser,process)
function utilities.parsers.mergehashes(hash,list)
return lpegmatch(merge,list,1,hash)
end
+function utilities.parsers.runtime(time)
+ if not time then
+ time=os.runtime()
+ end
+ local days=div(time,24*60*60)
+ time=mod(time,24*60*60)
+ local hours=div(time,60*60)
+ time=mod(time,60*60)
+ local minutes=div(time,60)
+ local seconds=mod(time,60)
+ return days,hours,minutes,seconds
+end
end -- of closure
@@ -6385,7 +7184,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 21914, stripped down to: 14287
+-- original size: 25613, stripped down to: 16617
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -6398,11 +7197,11 @@ local write_nl,write=texio and texio.write_nl or print,texio and texio.write or
local format,gmatch,find=string.format,string.gmatch,string.find
local concat,insert,remove=table.concat,table.insert,table.remove
local topattern=string.topattern
-local texcount=tex and tex.count
local next,type,select=next,type,select
local utfchar=utf.char
local setmetatableindex=table.setmetatableindex
local formatters=string.formatters
+local texgetcount=tex and tex.getcount
logs=logs or {}
local logs=logs
local moreinfo=[[
@@ -6423,7 +7222,7 @@ utilities.strings.formatters.add (
local function ignore() end
setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
local report,subreport,status,settarget,setformats,settranslations
-local direct,subdirect,writer,pushtarget,poptarget
+local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters
if tex and (tex.jobname or tex.formatname) then
local valueiskey={ __index=function(t,k) t[k]=k return k end }
local target="term and log"
@@ -6436,67 +7235,67 @@ if tex and (tex.jobname or tex.formatname) then
newline=function()
write_nl(target,"\n")
end
- local f_one=formatters["%-15s > %s\n"]
- local f_two=formatters["%-15s >\n"]
+ local report_yes=formatters["%-15s > %s\n"]
+ local report_nop=formatters["%-15s >\n"]
report=function(a,b,c,...)
if c then
- write_nl(target,f_one(translations[a],formatters[formats[b]](c,...)))
+ write_nl(target,report_yes(translations[a],formatters[formats[b]](c,...)))
elseif b then
- write_nl(target,f_one(translations[a],formats[b]))
+ write_nl(target,report_yes(translations[a],formats[b]))
elseif a then
- write_nl(target,f_two(translations[a]))
+ write_nl(target,report_nop(translations[a]))
else
write_nl(target,"\n")
end
end
- local f_one=formatters["%-15s > %s"]
- local f_two=formatters["%-15s >"]
+ local direct_yes=formatters["%-15s > %s"]
+ local direct_nop=formatters["%-15s >"]
direct=function(a,b,c,...)
if c then
- return f_one(translations[a],formatters[formats[b]](c,...))
+ return direct_yes(translations[a],formatters[formats[b]](c,...))
elseif b then
- return f_one(translations[a],formats[b])
+ return direct_yes(translations[a],formats[b])
elseif a then
- return f_two(translations[a])
+ return direct_nop(translations[a])
else
return ""
end
end
- local f_one=formatters["%-15s > %s > %s\n"]
- local f_two=formatters["%-15s > %s >\n"]
+ local subreport_yes=formatters["%-15s > %s > %s\n"]
+ local subreport_nop=formatters["%-15s > %s >\n"]
subreport=function(a,s,b,c,...)
if c then
- write_nl(target,f_one(translations[a],translations[s],formatters[formats[b]](c,...)))
+ write_nl(target,subreport_yes(translations[a],translations[s],formatters[formats[b]](c,...)))
elseif b then
- write_nl(target,f_one(translations[a],translations[s],formats[b]))
+ write_nl(target,subreport_yes(translations[a],translations[s],formats[b]))
elseif a then
- write_nl(target,f_two(translations[a],translations[s]))
+ write_nl(target,subreport_nop(translations[a],translations[s]))
else
write_nl(target,"\n")
end
end
- local f_one=formatters["%-15s > %s > %s"]
- local f_two=formatters["%-15s > %s >"]
+ local subdirect_yes=formatters["%-15s > %s > %s"]
+ local subdirect_nop=formatters["%-15s > %s >"]
subdirect=function(a,s,b,c,...)
if c then
- return f_one(translations[a],translations[s],formatters[formats[b]](c,...))
+ return subdirect_yes(translations[a],translations[s],formatters[formats[b]](c,...))
elseif b then
- return f_one(translations[a],translations[s],formats[b])
+ return subdirect_yes(translations[a],translations[s],formats[b])
elseif a then
- return f_two(translations[a],translations[s])
+ return subdirect_nop(translations[a],translations[s])
else
return ""
end
end
- local f_one=formatters["%-15s : %s\n"]
- local f_two=formatters["%-15s :\n"]
+ local status_yes=formatters["%-15s : %s\n"]
+ local status_nop=formatters["%-15s :\n"]
status=function(a,b,c,...)
if c then
- write_nl(target,f_one(translations[a],formatters[formats[b]](c,...)))
+ write_nl(target,status_yes(translations[a],formatters[formats[b]](c,...)))
elseif b then
- write_nl(target,f_one(translations[a],formats[b]))
+ write_nl(target,status_yes(translations[a],formats[b]))
elseif a then
- write_nl(target,f_two(translations[a]))
+ write_nl(target,status_nop(translations[a]))
else
write_nl(target,"\n")
end
@@ -6533,47 +7332,69 @@ if tex and (tex.jobname or tex.formatname) then
settranslations=function(t)
translations=t
end
+ setprocessor=function(f)
+ local writeline=write_nl
+ write_nl=function(target,...)
+ writeline(target,f(...))
+ end
+ end
+ setformatters=function(f)
+ report_yes=f.report_yes or report_yes
+ report_nop=f.report_nop or report_nop
+ subreport_yes=f.subreport_yes or subreport_yes
+ subreport_nop=f.subreport_nop or subreport_nop
+ direct_yes=f.direct_yes or direct_yes
+ direct_nop=f.direct_nop or direct_nop
+ subdirect_yes=f.subdirect_yes or subdirect_yes
+ subdirect_nop=f.subdirect_nop or subdirect_nop
+ status_yes=f.status_yes or status_yes
+ status_nop=f.status_nop or status_nop
+ end
+ setlogfile=ignore
+ settimedlog=ignore
else
logs.flush=ignore
- writer=write_nl
+ writer=function(s)
+ write_nl(s)
+ end
newline=function()
write_nl("\n")
end
- local f_one=formatters["%-15s | %s"]
- local f_two=formatters["%-15s |"]
+ local report_yes=formatters["%-15s | %s"]
+ local report_nop=formatters["%-15s |"]
report=function(a,b,c,...)
if c then
- write_nl(f_one(a,formatters[b](c,...)))
+ write_nl(report_yes(a,formatters[b](c,...)))
elseif b then
- write_nl(f_one(a,b))
+ write_nl(report_yes(a,b))
elseif a then
- write_nl(f_two(a))
+ write_nl(report_nop(a))
else
write_nl("")
end
end
- local f_one=formatters["%-15s | %s | %s"]
- local f_two=formatters["%-15s | %s |"]
+ local subreport_yes=formatters["%-15s | %s | %s"]
+ local subreport_nop=formatters["%-15s | %s |"]
subreport=function(a,sub,b,c,...)
if c then
- write_nl(f_one(a,sub,formatters[b](c,...)))
+ write_nl(subreport_yes(a,sub,formatters[b](c,...)))
elseif b then
- write_nl(f_one(a,sub,b))
+ write_nl(subreport_yes(a,sub,b))
elseif a then
- write_nl(f_two(a,sub))
+ write_nl(subreport_nop(a,sub))
else
write_nl("")
end
end
- local f_one=formatters["%-15s : %s\n"]
- local f_two=formatters["%-15s :\n"]
+ local status_yes=formatters["%-15s : %s\n"]
+ local status_nop=formatters["%-15s :\n"]
status=function(a,b,c,...)
if c then
- write_nl(f_one(a,formatters[b](c,...)))
+ write_nl(status_yes(a,formatters[b](c,...)))
elseif b then
- write_nl(f_one(a,b))
+ write_nl(status_yes(a,b))
elseif a then
- write_nl(f_two(a))
+ write_nl(status_nop(a))
else
write_nl("\n")
end
@@ -6585,6 +7406,49 @@ else
poptarget=ignore
setformats=ignore
settranslations=ignore
+ setprocessor=function(f)
+ local writeline=write_nl
+ write_nl=function(s)
+ writeline(f(s))
+ end
+ end
+ setformatters=function(f)
+ report_yes=f.report_yes or report_yes
+ report_nop=f.report_nop or report_nop
+ subreport_yes=f.subreport_yes or subreport_yes
+ subreport_nop=f.subreport_nop or subreport_nop
+ status_yes=f.status_yes or status_yes
+ status_nop=f.status_nop or status_nop
+ end
+ setlogfile=function(name,keepopen)
+ if name and name~="" then
+ local localtime=os.localtime
+ local writeline=write_nl
+ if keepopen then
+ local f=io.open(name,"ab")
+ write_nl=function(s)
+ writeline(s)
+ f:write(localtime()," | ",s,"\n")
+ end
+ else
+ write_nl=function(s)
+ writeline(s)
+ local f=io.open(name,"ab")
+ f:write(localtime()," | ",s,"\n")
+ f:close()
+ end
+ end
+ end
+ setlogfile=ignore
+ end
+ settimedlog=function()
+ local localtime=os.localtime
+ local writeline=write_nl
+ write_nl=function(s)
+ writeline(localtime().." | "..s)
+ end
+ settimedlog=ignore
+ end
end
logs.report=report
logs.subreport=subreport
@@ -6594,6 +7458,10 @@ logs.pushtarget=pushtarget
logs.poptarget=poptarget
logs.setformats=setformats
logs.settranslations=settranslations
+logs.setlogfile=setlogfile
+logs.settimedlog=settimedlog
+logs.setprocessor=setprocessor
+logs.setformatters=setformatters
logs.direct=direct
logs.subdirect=subdirect
logs.writer=writer
@@ -6670,9 +7538,10 @@ local function setblocked(category,value)
v.state=value
end
else
- states=utilities.parsers.settings_to_hash(category)
+ states=utilities.parsers.settings_to_hash(category,type(states)=="table" and states or nil)
for c,_ in next,states do
- if data[c] then
+ local v=data[c]
+ if v then
v.state=value
else
c=topattern(c,true,true)
@@ -6744,7 +7613,9 @@ end)
local report_pages=logs.reporter("pages")
local real,user,sub
function logs.start_page_number()
- real,user,sub=texcount.realpageno,texcount.userpageno,texcount.subpageno
+ real=texgetcount("realpageno")
+ user=texgetcount("userpageno")
+ sub=texgetcount("subpageno")
end
local timing=false
local starttime=nil
@@ -6949,7 +7820,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-inf"] = package.loaded["trac-inf"] or true
--- original size: 5678, stripped down to: 4448
+-- original size: 7011, stripped down to: 5590
if not modules then modules={} end modules ['trac-inf']={
version=1.001,
@@ -6958,16 +7829,19 @@ if not modules then modules={} end modules ['trac-inf']={
copyright="PRAGMA ADE / ConTeXt Development Team",
license="see context related readme files"
}
-local type,tonumber=type,tonumber
-local format,lower=string.format,string.lower
+local type,tonumber,select=type,tonumber,select
+local format,lower,find=string.format,string.lower,string.find
local concat=table.concat
local clock=os.gettimeofday or os.clock
+local setmetatableindex=table.setmetatableindex
+local serialize=table.serialize
+local formatters=string.formatters
statistics=statistics or {}
local statistics=statistics
statistics.enable=true
statistics.threshold=0.01
local statusinfo,n,registered,timers={},0,{},{}
-table.setmetatableindex(timers,function(t,k)
+setmetatableindex(timers,function(t,k)
local v={ timing=0,loadtime=0 }
t[k]=v
return v
@@ -7046,6 +7920,10 @@ local report=logs.reporter("mkiv lua stats")
function statistics.show()
if statistics.enable then
local register=statistics.register
+ register("used platform",function()
+ return format("%s, type: %s, binary subtree: %s",
+ os.platform or "unknown",os.type or "unknown",environment.texos or "unknown")
+ end)
register("luatex banner",function()
return lower(status.banner)
end)
@@ -7057,14 +7935,23 @@ function statistics.show()
return format("%s direct, %s indirect, %s total",total-indirect,indirect,total)
end)
if jit then
- local status={ jit.status() }
- if status[1] then
- register("luajit status",function()
- return concat(status," ",2)
- end)
- end
- end
- register("current memory usage",statistics.memused)
+ local jitstatus={ jit.status() }
+ if jitstatus[1] then
+ register("luajit options",concat(jitstatus," ",2))
+ end
+ end
+ register("lua properties",function()
+ local list=status.list()
+ local hashchar=tonumber(list.luatex_hashchars)
+ local mask=lua.mask or "ascii"
+ return format("engine: %s, used memory: %s, hash type: %s, hash chars: min(%s,40), symbol mask: %s (%s)",
+ jit and "luajit" or "lua",
+ statistics.memused(),
+ list.luatex_hashtype or "default",
+ hashchar and 2^hashchar or "unknown",
+ mask,
+ mask=="utf" and "τεχ" or "tex")
+ end)
register("runtime",statistics.runtime)
logs.newline()
for i=1,#statusinfo do
@@ -7094,7 +7981,17 @@ function statistics.timed(action)
starttiming("run")
action()
stoptiming("run")
- report("total runtime: %s",elapsedtime("run"))
+ report("total runtime: %s seconds",elapsedtime("run"))
+end
+function statistics.tracefunction(base,tag,...)
+ for i=1,select("#",...) do
+ local name=select(i,...)
+ local stat={}
+ local func=base[name]
+ setmetatableindex(stat,function(t,k) t[k]=0 return 0 end)
+ base[name]=function(n,k,v) stat[k]=stat[k]+1 return func(n,k,v) end
+ statistics.register(formatters["%s.%s"](tag,name),function() return serialize(stat,"calls") end)
+ end
end
commands=commands or {}
function commands.resettimer(name)
@@ -7113,7 +8010,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-pro"] = package.loaded["trac-pro"] or true
--- original size: 5773, stripped down to: 3453
+-- original size: 5829, stripped down to: 3501
if not modules then modules={} end modules ['trac-pro']={
version=1.001,
@@ -7130,14 +8027,16 @@ local namespaces=namespaces
local registered={}
local function report_index(k,name)
if trace_namespaces then
- report_system("reference to %a in protected namespace %a: %s",k,name,debug.traceback())
+ report_system("reference to %a in protected namespace %a: %s",k,name)
+ debugger.showtraceback(report_system)
else
report_system("reference to %a in protected namespace %a",k,name)
end
end
local function report_newindex(k,name)
if trace_namespaces then
- report_system("assignment to %a in protected namespace %a: %s",k,name,debug.traceback())
+ report_system("assignment to %a in protected namespace %a: %s",k,name)
+ debugger.showtraceback(report_system)
else
report_system("assignment to %a in protected namespace %a",k,name)
end
@@ -7258,7 +8157,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lua"] = package.loaded["util-lua"] or true
--- original size: 12575, stripped down to: 8700
+-- original size: 4982, stripped down to: 3511
if not modules then modules={} end modules ['util-lua']={
version=1.001,
@@ -7293,251 +8192,92 @@ luautilities.suffixes={
tua="tua",
tuc="tuc",
}
-if jit or status.luatex_version>=74 then
- local function register(name)
- if tracestripping then
- report_lua("stripped bytecode from %a",name or "unknown")
- end
- strippedchunks[#strippedchunks+1]=name
- luautilities.nofstrippedchunks=luautilities.nofstrippedchunks+1
- end
- local function stupidcompile(luafile,lucfile,strip)
- local code=io.loaddata(luafile)
- if code and code~="" then
- code=load(code)
- if code then
- code=dump(code,strip and luautilities.stripcode or luautilities.alwaysstripcode)
- if code and code~="" then
- register(name)
- io.savedata(lucfile,code)
- return true,0
- end
- else
- report_lua("fatal error %a in file %a",1,luafile)
- end
- else
- report_lua("fatal error %a in file %a",2,luafile)
- end
- return false,0
+local function register(name)
+ if tracestripping then
+ report_lua("stripped bytecode from %a",name or "unknown")
end
- function luautilities.loadedluacode(fullname,forcestrip,name)
- name=name or fullname
- local code=environment.loadpreprocessedfile and environment.loadpreprocessedfile(fullname) or loadfile(fullname)
+ strippedchunks[#strippedchunks+1]=name
+ luautilities.nofstrippedchunks=luautilities.nofstrippedchunks+1
+end
+local function stupidcompile(luafile,lucfile,strip)
+ local code=io.loaddata(luafile)
+ if code and code~="" then
+ code=load(code)
if code then
- code()
- end
- if forcestrip and luautilities.stripcode then
- if type(forcestrip)=="function" then
- forcestrip=forcestrip(fullname)
- end
- if forcestrip or luautilities.alwaysstripcode then
+ code=dump(code,strip and luautilities.stripcode or luautilities.alwaysstripcode)
+ if code and code~="" then
register(name)
- return load(dump(code,true)),0
- else
- return code,0
+ io.savedata(lucfile,code)
+ return true,0
end
- elseif luautilities.alwaysstripcode then
- register(name)
- return load(dump(code,true)),0
else
- return code,0
+ report_lua("fatal error %a in file %a",1,luafile)
end
+ else
+ report_lua("fatal error %a in file %a",2,luafile)
end
- function luautilities.strippedloadstring(code,forcestrip,name)
- if forcestrip and luautilities.stripcode or luautilities.alwaysstripcode then
- code=load(code)
- if not code then
- report_lua("fatal error %a in file %a",3,name)
- end
- register(name)
- code=dump(code,true)
- end
- return load(code),0
- end
- function luautilities.compile(luafile,lucfile,cleanup,strip,fallback)
- report_lua("compiling %a into %a",luafile,lucfile)
- os.remove(lucfile)
- local done=stupidcompile(luafile,lucfile,strip~=false)
- if done then
- report_lua("dumping %a into %a stripped",luafile,lucfile)
- if cleanup==true and lfs.isfile(lucfile) and lfs.isfile(luafile) then
- report_lua("removing %a",luafile)
- os.remove(luafile)
- end
- end
- return done
- end
- function luautilities.loadstripped(...)
- local l=load(...)
- if l then
- return load(dump(l,true))
- end
+ return false,0
+end
+function luautilities.loadedluacode(fullname,forcestrip,name)
+ name=name or fullname
+ local code,message
+ if environment.loadpreprocessedfile then
+ code,message=environment.loadpreprocessedfile(fullname)
+ else
+ code,message=loadfile(fullname)
end
-else
- local function register(name,before,after)
- local delta=before-after
- if tracestripping then
- report_lua("bytecodes stripped from %a, # before %s, # after %s, delta %s",name,before,after,delta)
- end
- strippedchunks[#strippedchunks+1]=name
- luautilities.nofstrippedchunks=luautilities.nofstrippedchunks+1
- luautilities.nofstrippedbytes=luautilities.nofstrippedbytes+delta
- return delta
- end
- local strip_code_pc
- if _MAJORVERSION==5 and _MINORVERSION==1 then
- strip_code_pc=function(dump,name)
- local before=#dump
- local version,format,endian,int,size,ins,num=byte(dump,5,11)
- local subint
- if endian==1 then
- subint=function(dump,i,l)
- local val=0
- for n=l,1,-1 do
- val=val*256+byte(dump,i+n-1)
- end
- return val,i+l
- end
- else
- subint=function(dump,i,l)
- local val=0
- for n=1,l,1 do
- val=val*256+byte(dump,i+n-1)
- end
- return val,i+l
- end
- end
- local strip_function
- strip_function=function(dump)
- local count,offset=subint(dump,1,size)
- local stripped,dirty=rep("\0",size),offset+count
- offset=offset+count+int*2+4
- offset=offset+int+subint(dump,offset,int)*ins
- count,offset=subint(dump,offset,int)
- for n=1,count do
- local t
- t,offset=subint(dump,offset,1)
- if t==1 then
- offset=offset+1
- elseif t==4 then
- offset=offset+size+subint(dump,offset,size)
- elseif t==3 then
- offset=offset+num
- end
- end
- count,offset=subint(dump,offset,int)
- stripped=stripped..sub(dump,dirty,offset-1)
- for n=1,count do
- local proto,off=strip_function(sub(dump,offset,-1))
- stripped,offset=stripped..proto,offset+off-1
- end
- offset=offset+subint(dump,offset,int)*int+int
- count,offset=subint(dump,offset,int)
- for n=1,count do
- offset=offset+subint(dump,offset,size)+size+int*2
- end
- count,offset=subint(dump,offset,int)
- for n=1,count do
- offset=offset+subint(dump,offset,size)+size
- end
- stripped=stripped..rep("\0",int*3)
- return stripped,offset
- end
- dump=sub(dump,1,12)..strip_function(sub(dump,13,-1))
- local after=#dump
- local delta=register(name,before,after)
- return dump,delta
- end
+ if code then
+ code()
else
- strip_code_pc=function(dump,name)
- return dump,0
- end
+ report_lua("loading of file %a failed:\n\t%s",fullname,message or "no message")
end
- function luautilities.loadedluacode(fullname,forcestrip,name)
- local code=environment.loadpreprocessedfile and environment.preprocessedloadfile(fullname) or loadfile(fullname)
- if code then
- code()
+ if forcestrip and luautilities.stripcode then
+ if type(forcestrip)=="function" then
+ forcestrip=forcestrip(fullname)
end
- if forcestrip and luautilities.stripcode then
- if type(forcestrip)=="function" then
- forcestrip=forcestrip(fullname)
- end
- if forcestrip then
- local code,n=strip_code_pc(dump(code),name)
- return load(code),n
- elseif luautilities.alwaysstripcode then
- return load(strip_code_pc(dump(code),name))
- else
- return code,0
- end
- elseif luautilities.alwaysstripcode then
- return load(strip_code_pc(dump(code),name))
+ if forcestrip or luautilities.alwaysstripcode then
+ register(name)
+ return load(dump(code,true)),0
else
return code,0
end
+ elseif luautilities.alwaysstripcode then
+ register(name)
+ return load(dump(code,true)),0
+ else
+ return code,0
end
- function luautilities.strippedloadstring(code,forcestrip,name)
- local n=0
- if (forcestrip and luautilities.stripcode) or luautilities.alwaysstripcode then
- code=load(code)
- if not code then
- report_lua("fatal error in file %a",name)
- end
- code,n=strip_code_pc(dump(code),name)
- end
- return load(code),n
+end
+function luautilities.strippedloadstring(code,forcestrip,name)
+ local code,message=load(code)
+ if not code then
+ report_lua("loading of file %a failed:\n\t%s",name,message or "no message")
end
- local function stupidcompile(luafile,lucfile,strip)
- local code=io.loaddata(luafile)
- local n=0
- if code and code~="" then
- code=load(code)
- if not code then
- report_lua("fatal error in file %a",luafile)
- end
- code=dump(code)
- if strip then
- code,n=strip_code_pc(code,luautilities.stripcode or luautilities.alwaysstripcode,luafile)
- end
- if code and code~="" then
- io.savedata(lucfile,code)
- end
- end
- return n
+ if forcestrip and luautilities.stripcode or luautilities.alwaysstripcode then
+ register(name)
+ return load(dump(code,true)),0
+ else
+ return code,0
end
- local luac_normal="texluac -o %q %q"
- local luac_strip="texluac -s -o %q %q"
- function luautilities.compile(luafile,lucfile,cleanup,strip,fallback)
- report_lua("compiling %a into %a",luafile,lucfile)
- os.remove(lucfile)
- local done=false
- if strip~=false then
- strip=true
- end
- if forcestupidcompile then
- fallback=true
- elseif strip then
- done=os.spawn(format(luac_strip,lucfile,luafile))==0
- else
- done=os.spawn(format(luac_normal,lucfile,luafile))==0
- end
- if not done and fallback then
- local n=stupidcompile(luafile,lucfile,strip)
- if n>0 then
- report_lua("%a dumped into %a (%i bytes stripped)",luafile,lucfile,n)
- else
- report_lua("%a dumped into %a (unstripped)",luafile,lucfile)
- end
- cleanup=false
- done=true
- end
- if done and cleanup==true and lfs.isfile(lucfile) and lfs.isfile(luafile) then
+end
+function luautilities.compile(luafile,lucfile,cleanup,strip,fallback)
+ report_lua("compiling %a into %a",luafile,lucfile)
+ os.remove(lucfile)
+ local done=stupidcompile(luafile,lucfile,strip~=false)
+ if done then
+ report_lua("dumping %a into %a stripped",luafile,lucfile)
+ if cleanup==true and lfs.isfile(lucfile) and lfs.isfile(luafile) then
report_lua("removing %a",luafile)
os.remove(luafile)
end
- return done
end
- luautilities.loadstripped=loadstring
+ return done
+end
+function luautilities.loadstripped(...)
+ local l=load(...)
+ if l then
+ return load(dump(l,true))
+ end
end
@@ -7547,7 +8287,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-deb"] = package.loaded["util-deb"] or true
--- original size: 3708, stripped down to: 2568
+-- original size: 3898, stripped down to: 2644
if not modules then modules={} end modules ['util-deb']={
version=1.001,
@@ -7627,20 +8367,22 @@ end
function debugger.disable()
debug.sethook()
end
-function traceback()
- local level=1
+local function showtraceback(rep)
+ local level=2
+ local reporter=rep or report
while true do
- local info=debug.getinfo(level,"Sl")
+ local info=getinfo(level,"Sl")
if not info then
break
elseif info.what=="C" then
- print(format("%3i : C function",level))
+ reporter("%2i : %s",level-1,"C function")
else
- print(format("%3i : [%s]:%d",level,info.short_src,info.currentline))
+ reporter("%2i : %s : %s",level-1,info.short_src,info.currentline)
end
level=level+1
end
end
+debugger.showtraceback=showtraceback
end -- of closure
@@ -7826,7 +8568,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-tpl"] = package.loaded["util-tpl"] or true
--- original size: 5655, stripped down to: 3242
+-- original size: 6251, stripped down to: 3488
if not modules then modules={} end modules ['util-tpl']={
version=1.001,
@@ -7840,8 +8582,8 @@ local templates=utilities.templates
local trace_template=false trackers.register("templates.trace",function(v) trace_template=v end)
local report_template=logs.reporter("template")
local tostring=tostring
-local format,sub=string.format,string.sub
-local P,C,Cs,Carg,lpegmatch=lpeg.P,lpeg.C,lpeg.Cs,lpeg.Carg,lpeg.match
+local format,sub,byte=string.format,string.sub,string.byte
+local P,C,R,Cs,Cc,Carg,lpegmatch,lpegpatterns=lpeg.P,lpeg.C,lpeg.R,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.match,lpeg.patterns
local replacer
local function replacekey(k,t,how,recursive)
local v=t[k]
@@ -7868,10 +8610,13 @@ local sqlescape=lpeg.replacer {
{ "\r\n","\\n" },
{ "\r","\\n" },
}
-local sqlquotedescape=lpeg.Cs(lpeg.Cc("'")*sqlescape*lpeg.Cc("'"))
+local sqlquoted=lpeg.Cs(lpeg.Cc("'")*sqlescape*lpeg.Cc("'"))
+lpegpatterns.sqlescape=sqlescape
+lpegpatterns.sqlquoted=sqlquoted
+local luaescape=lpegpatterns.luaescape
local escapers={
lua=function(s)
- return sub(format("%q",s),2,-2)
+ return lpegmatch(luaescape,s)
end,
sql=function(s)
return lpegmatch(sqlescape,s)
@@ -7882,11 +8627,9 @@ local quotedescapers={
return format("%q",s)
end,
sql=function(s)
- return lpegmatch(sqlquotedescape,s)
+ return lpegmatch(sqlquoted,s)
end,
}
-lpeg.patterns.sqlescape=sqlescape
-lpeg.patterns.sqlescape=sqlquotedescape
local luaescaper=escapers.lua
local quotedluaescaper=quotedescapers.lua
local function replacekeyunquoted(s,t,how,recurse)
@@ -7923,6 +8666,11 @@ local function replace(str,mapping,how,recurse)
end
end
templates.replace=replace
+function templates.replacer(str,how,recurse)
+ return function(mapping)
+ return lpegmatch(replacer,str,1,mapping,how or "lua",recurse or false) or str
+ end
+end
function templates.load(filename,mapping,how,recurse)
local data=io.loaddata(filename) or ""
if mapping and next(mapping) then
@@ -7948,7 +8696,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-env"] = package.loaded["util-env"] or true
--- original size: 8722, stripped down to: 5050
+-- original size: 8814, stripped down to: 5092
if not modules then modules={} end modules ['util-env']={
version=1.001,
@@ -7984,6 +8732,7 @@ local luaengines=allocate {
environment.validengines=validengines
environment.basicengines=basicengines
if not arg then
+ environment.used_as_library=true
elseif luaengines[file.removesuffix(arg[-1])] then
elseif validengines[file.removesuffix(arg[0])] then
if arg[1]=="--luaonly" then
@@ -8084,7 +8833,7 @@ function environment.reconstructcommandline(arg,noquote)
a=resolvers.resolve(a)
a=unquoted(a)
a=gsub(a,'"','\\"')
- if find(a," ") then
+ if find(a," ",1,true) then
result[#result+1]=quoted(a)
else
result[#result+1]=a
@@ -8144,7 +8893,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["luat-env"] = package.loaded["luat-env"] or true
--- original size: 5874, stripped down to: 4184
+-- original size: 6174, stripped down to: 4141
if not modules then modules={} end modules ['luat-env']={
version=1.001,
@@ -8158,12 +8907,13 @@ local trace_locating=false trackers.register("resolvers.locating",function(v) tr
local report_lua=logs.reporter("resolvers","lua")
local luautilities=utilities.lua
local luasuffixes=luautilities.suffixes
+local texgettoks=tex and tex.gettoks
environment=environment or {}
local environment=environment
local mt={
__index=function(_,k)
if k=="version" then
- local version=tex.toks and tex.toks.contextversiontoks
+ local version=texgettoks and texgettoks("contextversiontoks")
if version and version~="" then
rawset(environment,"version",version)
return version
@@ -8171,7 +8921,7 @@ local mt={
return "unknown"
end
elseif k=="kind" then
- local kind=tex.toks and tex.toks.contextkindtoks
+ local kind=texgettoks and texgettoks("contextkindtoks")
if kind and kind~="" then
rawset(environment,"kind",kind)
return kind
@@ -8221,15 +8971,13 @@ function environment.luafilechunk(filename,silent)
filename=file.replacesuffix(filename,"lua")
local fullname=environment.luafile(filename)
if fullname and fullname~="" then
- local data=luautilities.loadedluacode(fullname,strippable,filename)
- if trace_locating then
+ local data=luautilities.loadedluacode(fullname,strippable,filename)
+ if not silent then
report_lua("loading file %a %s",fullname,not data and "failed" or "succeeded")
- elseif not silent then
- texio.write("<",data and "+ " or "- ",fullname,">")
end
return data
else
- if trace_locating then
+ if not silent then
report_lua("unknown file %a",filename)
end
return nil
@@ -8298,7 +9046,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
--- original size: 42495, stripped down to: 26647
+-- original size: 42614, stripped down to: 26694
if not modules then modules={} end modules ['lxml-tab']={
version=1.001,
@@ -8309,6 +9057,7 @@ if not modules then modules={} end modules ['lxml-tab']={
}
local trace_entities=false trackers.register("xml.entities",function(v) trace_entities=v end)
local report_xml=logs and logs.reporter("xml","core") or function(...) print(string.format(...)) end
+if lpeg.setmaxstack then lpeg.setmaxstack(1000) end
xml=xml or {}
local xml=xml
local concat,remove,insert=table.concat,table.remove,table.insert
@@ -8728,7 +9477,6 @@ local publicdoctype=doctypename*somespace*P("PUBLIC")*somespace*value*somespace*
local systemdoctype=doctypename*somespace*P("SYSTEM")*somespace*value*somespace*doctypeset
local simpledoctype=(1-close)^1
local somedoctype=C((somespace*(publicdoctype+systemdoctype+definitiondoctype+simpledoctype)*optionalspace)^0)
-local somedoctype=C((somespace*(publicdoctype+systemdoctype+definitiondoctype+simpledoctype)*optionalspace)^0)
local instruction=(spacing*begininstruction*someinstruction*endinstruction)/function(...) add_special("@pi@",...) end
local comment=(spacing*begincomment*somecomment*endcomment )/function(...) add_special("@cm@",...) end
local cdata=(spacing*begincdata*somecdata*endcdata )/function(...) add_special("@cd@",...) end
@@ -8824,8 +9572,11 @@ local function _xmlconvert_(data,settings)
end
if errorstr and errorstr~="" then
result.error=true
+ else
+ errorstr=nil
end
result.statistics={
+ errormessage=errorstr,
entities={
decimals=dcache,
hexadecimals=hcache,
@@ -9023,23 +9774,25 @@ local function verbose_document(e,handlers)
end
end
local function serialize(e,handlers,...)
- local initialize=handlers.initialize
- local finalize=handlers.finalize
- local functions=handlers.functions
- if initialize then
- local state=initialize(...)
- if not state==true then
- return state
+ if e then
+ local initialize=handlers.initialize
+ local finalize=handlers.finalize
+ local functions=handlers.functions
+ if initialize then
+ local state=initialize(...)
+ if not state==true then
+ return state
+ end
+ end
+ local etg=e.tg
+ if etg then
+ (functions[etg] or functions["@el@"])(e,handlers)
+ else
+ functions["@dc@"](e,handlers)
+ end
+ if finalize then
+ return finalize()
end
- end
- local etg=e.tg
- if etg then
- (functions[etg] or functions["@el@"])(e,handlers)
- else
- functions["@dc@"](e,handlers)
- end
- if finalize then
- return finalize()
end
end
local function xserialize(e,handlers)
@@ -9280,7 +10033,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-lpt"] = package.loaded["lxml-lpt"] or true
--- original size: 48956, stripped down to: 30516
+-- original size: 48030, stripped down to: 30595
if not modules then modules={} end modules ['lxml-lpt']={
version=1.001,
@@ -10261,8 +11014,13 @@ function xml.elements(root,pattern,reverse)
local collected=applylpath(root,pattern)
if not collected then
return dummy
- elseif reverse then
- local c=#collected+1
+ end
+ local n=#collected
+ if n==0 then
+ return dummy
+ end
+ if reverse then
+ local c=n+1
return function()
if c>1 then
c=c-1
@@ -10272,7 +11030,7 @@ function xml.elements(root,pattern,reverse)
end
end
else
- local n,c=#collected,0
+ local c=0
return function()
if c<n then
c=c+1
@@ -10287,8 +11045,13 @@ function xml.collected(root,pattern,reverse)
local collected=applylpath(root,pattern)
if not collected then
return dummy
- elseif reverse then
- local c=#collected+1
+ end
+ local n=#collected
+ if n==0 then
+ return dummy
+ end
+ if reverse then
+ local c=n+1
return function()
if c>1 then
c=c-1
@@ -10296,7 +11059,7 @@ function xml.collected(root,pattern,reverse)
end
end
else
- local n,c=#collected,0
+ local c=0
return function()
if c<n then
c=c+1
@@ -10311,7 +11074,7 @@ function xml.inspect(collection,pattern)
report_lpath("pattern: %s\n\n%s\n",pattern,xml.tostring(e))
end
end
-local function split(e)
+local function split(e)
local dt=e.dt
if dt then
for i=1,#dt do
@@ -11651,7 +12414,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-ini"] = package.loaded["data-ini"] or true
--- original size: 7898, stripped down to: 5501
+-- original size: 7927, stripped down to: 5528
if not modules then modules={} end modules ['data-ini']={
version=1.001,
@@ -11795,7 +12558,7 @@ if not texroot or texroot=="" then
ossetenv('TEXROOT',texroot)
end
environment.texroot=file.collapsepath(texroot)
-if profiler then
+if type(profiler)=="table" and not jit then
directives.register("system.profile",function()
profiler.start("luatex-profile.log")
end)
@@ -11813,7 +12576,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 14654, stripped down to: 9517
+-- original size: 15317, stripped down to: 9723
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -11825,7 +12588,7 @@ if not modules then modules={} end modules ['data-exp']={
local format,find,gmatch,lower,char,sub=string.format,string.find,string.gmatch,string.lower,string.char,string.sub
local concat,sort=table.concat,table.sort
local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
-local Ct,Cs,Cc,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.P,lpeg.C,lpeg.S
+local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
local ostype=os.type
local collapsepath=file.collapsepath
@@ -11833,20 +12596,6 @@ local trace_locating=false trackers.register("resolvers.locating",function(v) tr
local trace_expansions=false trackers.register("resolvers.expansions",function(v) trace_expansions=v end)
local report_expansions=logs.reporter("resolvers","expansions")
local resolvers=resolvers
-local function f_first(a,b)
- local t,n={},0
- for s in gmatch(b,"[^,]+") do
- n=n+1;t[n]=a..s
- end
- return concat(t,",")
-end
-local function f_second(a,b)
- local t,n={},0
- for s in gmatch(a,"[^,]+") do
- n=n+1;t[n]=s..b
- end
- return concat(t,",")
-end
local function f_both(a,b)
local t,n={},0
for sb in gmatch(b,"[^,]+") do
@@ -11856,6 +12605,15 @@ local function f_both(a,b)
end
return concat(t,",")
end
+local comma=P(",")
+local nocomma=(1-comma)^1
+local docomma=comma^1/","
+local before=Cs((nocomma*Carg(1)+docomma)^0)
+local after=Cs((Carg(1)*nocomma+docomma)^0)
+local both=Cs(((C(nocomma)*Carg(1))/function(a,b) return lpegmatch(before,b,1,a) end+docomma)^0)
+local function f_first (a,b) return lpegmatch(after,b,1,a) end
+local function f_second(a,b) return lpegmatch(before,a,1,b) end
+local function f_both (a,b) return lpegmatch(both,b,1,a) end
local left=P("{")
local right=P("}")
local var=P((1-S("{}" ))^0)
@@ -11940,7 +12698,7 @@ function resolvers.cleanpath(str)
report_expansions("no home dir set, ignoring dependent paths")
end
function resolvers.cleanpath(str)
- if not str or find(str,"~") then
+ if not str or find(str,"~",1,true) then
return ""
else
return lpegmatch(cleanup,str)
@@ -12175,7 +12933,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-env"] = package.loaded["data-env"] or true
--- original size: 8762, stripped down to: 6484
+-- original size: 8769, stripped down to: 6490
if not modules then modules={} end modules ['data-env']={
version=1.001,
@@ -12278,7 +13036,7 @@ local relations=allocate {
texmfscripts={
names={ "texmfscript","texmfscripts","script","scripts" },
variable='TEXMFSCRIPTS',
- suffixes={ 'rb','pl','py' },
+ suffixes={ 'lua','rb','pl','py' },
},
lua={
names={ "lua" },
@@ -12443,7 +13201,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-tmp"] = package.loaded["data-tmp"] or true
--- original size: 14615, stripped down to: 11208
+-- original size: 15532, stripped down to: 11648
if not modules then modules={} end modules ['data-tmp']={
version=1.100,
@@ -12657,6 +13415,22 @@ function caches.getfirstreadablefile(filename,...)
end
return caches.setfirstwritablefile(filename,...)
end
+function caches.getfirstreadablefile_TEST_ME_FIRST(filename,...)
+ local fullname,path=caches.setfirstwritablefile(filename,...)
+ if is_readable(fullname) then
+ return fullname,path
+ end
+ local rd=getreadablepaths(...)
+ for i=1,#rd do
+ local path=rd[i]
+ local fullname=file.join(path,filename)
+ if is_readable(fullname) then
+ usedreadables[i]=true
+ return fullname,path
+ end
+ end
+ return fullname,path
+end
function caches.setfirstwritablefile(filename,...)
local wr=getwritablepath(...)
local fullname=file.join(wr,filename)
@@ -12802,7 +13576,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-met"] = package.loaded["data-met"] or true
--- original size: 5137, stripped down to: 4007
+-- original size: 5460, stripped down to: 4014
if not modules then modules={} end modules ['data-met']={
version=1.100,
@@ -12831,7 +13605,7 @@ local function splitmethod(filename)
return filename
end
filename=file.collapsepath(filename,".")
- if not find(filename,"://") then
+ if not find(filename,"://",1,true) then
return { scheme="file",path=filename,original=filename,filename=filename }
end
local specification=url.hashed(filename)
@@ -12921,7 +13695,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61759, stripped down to: 42959
+-- original size: 61824, stripped down to: 42982
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -13152,7 +13926,7 @@ local function identify_configuration_files()
local realname=resolvers.resolve(filename)
if trace_locating then
local fullpath=gsub(resolvers.resolve(collapsepath(filepath)),"//","/")
- local weirdpath=find(fullpath,"/texmf.+/texmf") or not find(fullpath,"/web2c")
+ local weirdpath=find(fullpath,"/texmf.+/texmf") or not find(fullpath,"/web2c",1,true)
report_resolving("looking for %a on %s path %a from specification %a",luacnfname,weirdpath and "weird" or "given",fullpath,filepath)
end
if lfs.isfile(realname) then
@@ -13741,7 +14515,7 @@ local function find_direct(filename,allresults)
end
end
local function find_wildcard(filename,allresults)
- if find(filename,'%*') then
+ if find(filename,'*',1,true) then
if trace_locating then
report_resolving("checking wildcard %a",filename)
end
@@ -13887,7 +14661,7 @@ local function find_intree(filename,filetype,wantedfiles,allresults)
local scheme=url.hasscheme(pathname)
if not scheme or scheme=="file" then
local pname=gsub(pathname,"%.%*$",'')
- if not find(pname,"%*") then
+ if not find(pname,"*",1,true) then
if can_be_dir(pname) then
for k=1,#wantedfiles do
local w=wantedfiles[k]
@@ -14156,7 +14930,7 @@ local function findwildcardfiles(filename,allresults,result)
local path=lower(lpegmatch(makewildcard,dirn) or dirn)
local name=lower(lpegmatch(makewildcard,base) or base)
local files,done=instance.files,false
- if find(name,"%*") then
+ if find(name,"*",1,true) then
local hashes=instance.hashes
for k=1,#hashes do
local hash=hashes[k]
@@ -14175,7 +14949,7 @@ local function findwildcardfiles(filename,allresults,result)
for k=1,#hashes do
local hash=hashes[k]
local hashname,hashtype=hash.name,hash.type
- if doit(path,files[hashname][bname],bname,hashname,hashtype,result,allresults) then done=true end
+ if doit(path,files[hashname][base],base,hashname,hashtype,result,allresults) then done=true end
if done and not allresults then break end
end
end
@@ -14799,7 +15573,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-use"] = package.loaded["data-use"] or true
--- original size: 3913, stripped down to: 2998
+-- original size: 3899, stripped down to: 2984
if not modules then modules={} end modules ['data-use']={
version=1.001,
@@ -14845,7 +15619,7 @@ end
statistics.register("used config file",function() return caches.configfiles() end)
statistics.register("used cache path",function() return caches.usedpaths() end)
function statistics.savefmtstatus(texname,formatbanner,sourcefile)
- local enginebanner=status.list().banner
+ local enginebanner=status.banner
if formatbanner and enginebanner and sourcefile then
local luvname=file.replacesuffix(texname,"luv")
local luvdata={
@@ -14858,7 +15632,7 @@ function statistics.savefmtstatus(texname,formatbanner,sourcefile)
end
end
function statistics.checkfmtstatus(texname)
- local enginebanner=status.list().banner
+ local enginebanner=status.banner
if enginebanner and texname then
local luvname=file.replacesuffix(texname,"luv")
if lfs.isfile(luvname) then
@@ -15199,7 +15973,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-sch"] = package.loaded["data-sch"] or true
--- original size: 6202, stripped down to: 5149
+-- original size: 6213, stripped down to: 5160
if not modules then modules={} end modules ['data-sch']={
version=1.001,
@@ -15242,7 +16016,7 @@ function resolvers.schemes.cleanname(specification)
end
local cached,loaded,reused,thresholds,handlers={},{},{},{},{}
local function runcurl(name,cachename)
- local command="curl --silent --create-dirs --output "..cachename.." "..name
+ local command="curl --silent --insecure --create-dirs --output "..cachename.." "..name
os.spawn(command)
end
local function fetch(specification)
@@ -15482,7 +16256,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-aux"] = package.loaded["data-aux"] or true
--- original size: 2394, stripped down to: 2005
+-- original size: 2431, stripped down to: 1996
if not modules then modules={} end modules ['data-aux']={
version=1.001,
@@ -15496,8 +16270,8 @@ local type,next=type,next
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
local resolvers=resolvers
local report_scripts=logs.reporter("resolvers","scripts")
-function resolvers.updatescript(oldname,newname)
- local scriptpath="scripts/context/lua"
+function resolvers.updatescript(oldname,newname)
+ local scriptpath="context/lua"
newname=file.addsuffix(newname,"lua")
local oldscript=resolvers.cleanpath(oldname)
if trace_locating then
@@ -15682,7 +16456,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 11136, stripped down to: 5549
+-- original size: 11549, stripped down to: 5905
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -15702,6 +16476,9 @@ local function requireswiglib(required,version)
local trace_swiglib=trace_swiglib or package.helpers.trace
local library=loaded[required]
if library==nil then
+ if trace_swiglib then
+ report_swiglib("requiring library %a with version %a",required,version or "any")
+ end
local required_full=gsub(required,"%.","/")
local required_path=pathpart(required_full)
local required_base=nameonly(required_full)
@@ -15808,7 +16585,7 @@ local function requireswiglib(required,version)
if libtype=="function" then
library=library()
else
- report_swiglib("load error: %a returns %a, message %a",opener,libtype,message or "no message")
+ report_swiglib("load error: %a returns %a, message %a, library %a",opener,libtype,(string.gsub(message or "no message","[%s]+$","")),found_library or "no library")
library=false
end
dir.pop()
@@ -15833,6 +16610,7 @@ function require(name,version)
end
end
local swiglibs={}
+local initializer="core"
function swiglib(name,version)
local library=swiglibs[name]
if not library then
@@ -15840,7 +16618,12 @@ function swiglib(name,version)
if trace_swiglib then
report_swiglib("loading %a",name)
end
- library=requireswiglib("swiglib."..name,version)
+ if not find(name,"%."..initializer.."$") then
+ fullname="swiglib."..name.."."..initializer
+ else
+ fullname="swiglib."..name
+ end
+ library=requireswiglib(fullname,version)
swiglibs[name]=library
statistics.stoptiming(swiglibs)
end
@@ -16096,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.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-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 : 670212
--- stripped bytes : 245255
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
@@ -16196,17 +16979,18 @@ local ownlibs = { -- order can be made better
}
+-- c:/data/develop/tex-context/tex/texmf-win64/bin/../../texmf-context/tex/context/base/data-tmf.lua
+-- c:/data/develop/context/sources/data-tmf.lua
+
local ownlist = {
- '.',
- ownpath ,
- ownpath .. "/../sources", -- HH's development path
+ -- '.',
+ -- ownpath ,
+ owntree .. "/../../../../context/sources", -- HH's development path
owntree .. "/../../texmf-local/tex/context/base",
owntree .. "/../../texmf-context/tex/context/base",
- owntree .. "/../../texmf-dist/tex/context/base",
owntree .. "/../../texmf/tex/context/base",
owntree .. "/../../../texmf-local/tex/context/base",
owntree .. "/../../../texmf-context/tex/context/base",
- owntree .. "/../../../texmf-dist/tex/context/base",
owntree .. "/../../../texmf/tex/context/base",
}
@@ -16265,11 +17049,9 @@ end
-- verbosity
-local e_verbose = environment.arguments["verbose"]
+----- e_verbose = environment.arguments["verbose"]
-if e_verbose then
- trackers.enable("resolvers.locating")
-end
+local e_verbose = false
-- some common flags (also passed through environment)
@@ -16916,10 +17698,22 @@ function runners.execute_ctx_script(filename,...)
local scriptbase = match(scriptname,".*mtx%-([^%-]-)%.lua")
if scriptbase then
local data = io.loaddata(scriptname)
- local banner, version = match(data,"[\n\r]logs%.extendbanner%s*%(%s*[\"\']([^\n\r]+)%s*(%d+%.%d+)")
- if banner then
- valid[#valid+1] = { scriptbase, version, banner }
- end
+local application = match(data,"local application.-=.-(%{.-%})")
+if application then
+ application = loadstring("return " .. application)
+ if application then
+ application = application()
+ local banner = application.banner
+ if banner then
+ local description, version = match(banner,"^(.-) ([%d.]+)$")
+ if description then
+ valid[#valid+1] = { scriptbase, version, description }
+ else
+ valid[#valid+1] = { scriptbase, "", banner }
+ end
+ end
+ end
+end
end
end
if #valid > 0 then
@@ -16990,12 +17784,22 @@ environment.initializearguments(before)
instance.lsrmode = environment.argument("lsr") or false
+e_verbose = environment.arguments["verbose"] -- delayed till here (we need the ones before script)
+
+if e_verbose then
+ trackers.enable("resolvers.locating")
+end
+
-- maybe the unset has to go to this level
local is_mkii_stub = runners.registered[file.removesuffix(file.basename(filename))]
local e_argument = environment.argument
+if e_argument("timedlog") then
+ logs.settimedlog()
+end
+
if e_argument("usekpse") or e_argument("forcekpse") or is_mkii_stub then
resolvers.load_tree(e_argument('tree'),true) -- force resolve of TEXMFCNF
@@ -17078,11 +17882,38 @@ else
end
+-- joke .. reminds me of messing with gigi terminals
+
+if e_argument("ansi") then
+
+ local formatters = string.formatters
+
+ logs.setformatters {
+ report_yes = formatters["%-15s | %s"],
+ report_nop = formatters["%-15s |"],
+ subreport_yes = formatters["%-15s | %s | %s"],
+ subreport_nop = formatters["%-15s | %s |"],
+ status_yes = formatters["%-15s : %s\n"],
+ status_nop = formatters["%-15s :\n"],
+ }
+
+ local script = e_argument("script") or e_argument("scripts")
+
+ if type(script) == "string" then
+ logs.writer("]0;"..script.."") -- for Alan to test
+ end
+
+end
+
if e_argument("script") or e_argument("scripts") then
-- run a script by loading it (using libs), pass args
- runners.loadbase()
+ if e_argument("nofiledatabase") then
+ -- handy for mtx-update
+ else
+ runners.loadbase()
+ end
if is_mkii_stub then
ok = runners.execute_script(filename,false,true)
else
@@ -17095,8 +17926,16 @@ elseif e_argument("selfmerge") then
runners.loadbase()
local found = locate_libs()
+
if found then
- utilities.merger.selfmerge(own.name,own.libs,{ found })
+ local mtxrun = resolvers.findfile("mtxrun.lua") -- includes local name
+ if lfs.isfile(mtxrun) then
+ utilities.merger.selfmerge(mtxrun,own.libs,{ found })
+ application.report("runner updated on resolved path: %s",mtxrun)
+ else
+ utilities.merger.selfmerge(own.name,own.libs,{ found })
+ application.report("runner updated on relative path: %s",own.name)
+ end
end
elseif e_argument("selfclean") then
@@ -17104,7 +17943,15 @@ elseif e_argument("selfclean") then
-- remove embedded libraries
runners.loadbase()
- utilities.merger.selfclean(own.name)
+
+ local mtxrun = resolvers.findfile("mtxrun.lua") -- includes local name
+ if lfs.isfile(mtxrun) then
+ utilities.merger.selfclean(mtxrun)
+ application.report("runner cleaned on resolved path: %s",mtxrun)
+ else
+ utilities.merger.selfclean(own.name)
+ application.report("runner cleaned on relative path: %s",own.name)
+ end
elseif e_argument("selfupdate") then
@@ -17346,6 +18193,8 @@ elseif e_argument("version") then
application.version()
+ application.report("source path",environment.ownbin)
+
elseif e_argument("directives") then
directives.show()
@@ -17400,7 +18249,7 @@ end
if e_verbose then
report()
- report("runtime: %0.3f seconds",os.runtime())
+ report("elapsed lua time: %0.3f seconds",os.runtime())
end
if os.type ~= "windows" then
diff --git a/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrunjit b/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrunjit
new file mode 100755
index 00000000000..117105aa5c0
--- /dev/null
+++ b/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrunjit
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+luajittex --luaonly $(dirname $0)/mtxrun "$@"
+
+# luajittex --luaonly ${0%jit} "$@"
diff --git a/Master/bin/alpha-linux/contextjit b/Master/bin/alpha-linux/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/alpha-linux/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/alpha-linux/ctxtools b/Master/bin/alpha-linux/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/alpha-linux/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/alpha-linux/mtxrunjit b/Master/bin/alpha-linux/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/alpha-linux/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/alpha-linux/pstopdf b/Master/bin/alpha-linux/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/alpha-linux/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/amd64-freebsd/contextjit b/Master/bin/amd64-freebsd/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/amd64-freebsd/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/amd64-freebsd/ctxtools b/Master/bin/amd64-freebsd/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/amd64-freebsd/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/amd64-freebsd/mtxrunjit b/Master/bin/amd64-freebsd/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/amd64-freebsd/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/amd64-freebsd/pstopdf b/Master/bin/amd64-freebsd/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/amd64-freebsd/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/amd64-kfreebsd/contextjit b/Master/bin/amd64-kfreebsd/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/amd64-kfreebsd/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/amd64-kfreebsd/ctxtools b/Master/bin/amd64-kfreebsd/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/amd64-kfreebsd/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/amd64-kfreebsd/mtxrunjit b/Master/bin/amd64-kfreebsd/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/amd64-kfreebsd/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/amd64-kfreebsd/pstopdf b/Master/bin/amd64-kfreebsd/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/amd64-kfreebsd/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/amd64-netbsd/contextjit b/Master/bin/amd64-netbsd/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/amd64-netbsd/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/amd64-netbsd/ctxtools b/Master/bin/amd64-netbsd/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/amd64-netbsd/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/amd64-netbsd/mtxrunjit b/Master/bin/amd64-netbsd/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/amd64-netbsd/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/amd64-netbsd/pstopdf b/Master/bin/amd64-netbsd/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/amd64-netbsd/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/armel-linux/contextjit b/Master/bin/armel-linux/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/armel-linux/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/armel-linux/ctxtools b/Master/bin/armel-linux/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/armel-linux/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/armel-linux/mtxrunjit b/Master/bin/armel-linux/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/armel-linux/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/armel-linux/pstopdf b/Master/bin/armel-linux/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/armel-linux/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/armhf-linux/contextjit b/Master/bin/armhf-linux/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/armhf-linux/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/armhf-linux/ctxtools b/Master/bin/armhf-linux/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/armhf-linux/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/armhf-linux/mtxrunjit b/Master/bin/armhf-linux/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/armhf-linux/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/armhf-linux/pstopdf b/Master/bin/armhf-linux/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/armhf-linux/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/contextjit b/Master/bin/i386-cygwin/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/i386-cygwin/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/ctxtools b/Master/bin/i386-cygwin/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/i386-cygwin/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/mtxrunjit b/Master/bin/i386-cygwin/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/i386-cygwin/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/pstopdf b/Master/bin/i386-cygwin/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/i386-cygwin/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/i386-freebsd/contextjit b/Master/bin/i386-freebsd/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/i386-freebsd/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/i386-freebsd/ctxtools b/Master/bin/i386-freebsd/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/i386-freebsd/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/i386-freebsd/mtxrunjit b/Master/bin/i386-freebsd/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/i386-freebsd/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/i386-freebsd/pstopdf b/Master/bin/i386-freebsd/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/i386-freebsd/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/i386-kfreebsd/contextjit b/Master/bin/i386-kfreebsd/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/i386-kfreebsd/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/i386-kfreebsd/ctxtools b/Master/bin/i386-kfreebsd/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/i386-kfreebsd/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/i386-kfreebsd/mtxrunjit b/Master/bin/i386-kfreebsd/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/i386-kfreebsd/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/i386-kfreebsd/pstopdf b/Master/bin/i386-kfreebsd/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/i386-kfreebsd/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/i386-linux/contextjit b/Master/bin/i386-linux/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/i386-linux/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/i386-linux/ctxtools b/Master/bin/i386-linux/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/i386-linux/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/i386-linux/mtxrunjit b/Master/bin/i386-linux/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/i386-linux/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/i386-linux/pstopdf b/Master/bin/i386-linux/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/i386-linux/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/contextjit b/Master/bin/i386-netbsd/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/i386-netbsd/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/ctxtools b/Master/bin/i386-netbsd/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/i386-netbsd/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/mtxrunjit b/Master/bin/i386-netbsd/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/i386-netbsd/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/pstopdf b/Master/bin/i386-netbsd/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/i386-netbsd/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/i386-solaris/contextjit b/Master/bin/i386-solaris/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/i386-solaris/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/i386-solaris/ctxtools b/Master/bin/i386-solaris/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/i386-solaris/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/i386-solaris/mtxrunjit b/Master/bin/i386-solaris/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/i386-solaris/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/i386-solaris/pstopdf b/Master/bin/i386-solaris/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/i386-solaris/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/mipsel-linux/contextjit b/Master/bin/mipsel-linux/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/mipsel-linux/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/mipsel-linux/ctxtools b/Master/bin/mipsel-linux/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/mipsel-linux/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/mipsel-linux/mtxrunjit b/Master/bin/mipsel-linux/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/mipsel-linux/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/mipsel-linux/pstopdf b/Master/bin/mipsel-linux/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/mipsel-linux/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/powerpc-linux/contextjit b/Master/bin/powerpc-linux/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/powerpc-linux/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/powerpc-linux/ctxtools b/Master/bin/powerpc-linux/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/powerpc-linux/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/powerpc-linux/mtxrunjit b/Master/bin/powerpc-linux/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/powerpc-linux/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/powerpc-linux/pstopdf b/Master/bin/powerpc-linux/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/powerpc-linux/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/sparc-solaris/contextjit b/Master/bin/sparc-solaris/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/sparc-solaris/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/sparc-solaris/ctxtools b/Master/bin/sparc-solaris/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/sparc-solaris/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/sparc-solaris/mtxrunjit b/Master/bin/sparc-solaris/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/sparc-solaris/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/sparc-solaris/pstopdf b/Master/bin/sparc-solaris/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/sparc-solaris/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/universal-darwin/contextjit b/Master/bin/universal-darwin/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/universal-darwin/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/universal-darwin/ctxtools b/Master/bin/universal-darwin/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/universal-darwin/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/universal-darwin/mtxrunjit b/Master/bin/universal-darwin/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/universal-darwin/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/universal-darwin/pstopdf b/Master/bin/universal-darwin/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/universal-darwin/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/win32/context.exe b/Master/bin/win32/context.exe
index 1b2d744f5ab..0e7882cf926 100755
--- a/Master/bin/win32/context.exe
+++ b/Master/bin/win32/context.exe
Binary files differ
diff --git a/Master/bin/win32/ctxtools.exe b/Master/bin/win32/ctxtools.exe
deleted file mode 100755
index 1b2d744f5ab..00000000000
--- a/Master/bin/win32/ctxtools.exe
+++ /dev/null
Binary files differ
diff --git a/Master/bin/win32/luatools.exe b/Master/bin/win32/luatools.exe
index 1b2d744f5ab..0e7882cf926 100755
--- a/Master/bin/win32/luatools.exe
+++ b/Master/bin/win32/luatools.exe
Binary files differ
diff --git a/Master/bin/win32/mtxrun.dll b/Master/bin/win32/mtxrun.dll
index 5e547121cef..3c4481c319d 100755
--- a/Master/bin/win32/mtxrun.dll
+++ b/Master/bin/win32/mtxrun.dll
Binary files differ
diff --git a/Master/bin/win32/mtxrun.exe b/Master/bin/win32/mtxrun.exe
index 1b2d744f5ab..0e7882cf926 100755
--- a/Master/bin/win32/mtxrun.exe
+++ b/Master/bin/win32/mtxrun.exe
Binary files differ
diff --git a/Master/bin/win32/mtxrun.lua b/Master/bin/win32/mtxrun.lua
index 7bd96b24711..c3d4111626e 100755
--- a/Master/bin/win32/mtxrun.lua
+++ b/Master/bin/win32/mtxrun.lua
@@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 29808, stripped down to: 16182
+-- original size: 29983, stripped down to: 16202
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -474,7 +474,7 @@ local uppercase=R("AZ")
local underscore=P("_")
local hexdigit=digit+lowercase+uppercase
local cr,lf,crlf=P("\r"),P("\n"),P("\r\n")
-local newline=crlf+S("\r\n")
+local newline=P("\r")*(P("\n")+P(true))+P("\n")
local escaped=P("\\")*anything
local squote=P("'")
local dquote=P('"')
@@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le
patterns.utfbom_16_be=utfbom_16_be
patterns.utfbom_16_le=utfbom_16_le
patterns.utfbom_8=utfbom_8
-patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
-patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
+patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
+patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
patterns.utf8one=R("\000\127")
patterns.utf8two=R("\194\223")*utf8next
patterns.utf8three=R("\224\239")*utf8next*utf8next
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 25455, stripped down to: 16617
+-- original size: 25613, stripped down to: 16617
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.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-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 : 694406
--- stripped bytes : 246345
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/Master/bin/win32/mtxrunjit.exe b/Master/bin/win32/mtxrunjit.exe
new file mode 100755
index 00000000000..0e7882cf926
--- /dev/null
+++ b/Master/bin/win32/mtxrunjit.exe
Binary files differ
diff --git a/Master/bin/win32/pstopdf.exe b/Master/bin/win32/pstopdf.exe
deleted file mode 100755
index 1b2d744f5ab..00000000000
--- a/Master/bin/win32/pstopdf.exe
+++ /dev/null
Binary files differ
diff --git a/Master/bin/win32/texexec.exe b/Master/bin/win32/texexec.exe
index 1b2d744f5ab..0e7882cf926 100755
--- a/Master/bin/win32/texexec.exe
+++ b/Master/bin/win32/texexec.exe
Binary files differ
diff --git a/Master/bin/win32/texmfstart.exe b/Master/bin/win32/texmfstart.exe
index 1b2d744f5ab..0e7882cf926 100755
--- a/Master/bin/win32/texmfstart.exe
+++ b/Master/bin/win32/texmfstart.exe
Binary files differ
diff --git a/Master/bin/x86_64-cygwin/contextjit b/Master/bin/x86_64-cygwin/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/x86_64-cygwin/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/x86_64-cygwin/ctxtools b/Master/bin/x86_64-cygwin/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/x86_64-cygwin/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/x86_64-cygwin/mtxrunjit b/Master/bin/x86_64-cygwin/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/x86_64-cygwin/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/x86_64-cygwin/pstopdf b/Master/bin/x86_64-cygwin/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/x86_64-cygwin/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/x86_64-darwin/contextjit b/Master/bin/x86_64-darwin/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/x86_64-darwin/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/x86_64-darwin/ctxtools b/Master/bin/x86_64-darwin/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/x86_64-darwin/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/x86_64-darwin/mtxrunjit b/Master/bin/x86_64-darwin/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/x86_64-darwin/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/x86_64-darwin/pstopdf b/Master/bin/x86_64-darwin/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/x86_64-darwin/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/contextjit b/Master/bin/x86_64-linux/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/x86_64-linux/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/ctxtools b/Master/bin/x86_64-linux/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/x86_64-linux/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/mtxrunjit b/Master/bin/x86_64-linux/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/x86_64-linux/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/pstopdf b/Master/bin/x86_64-linux/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/x86_64-linux/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/bin/x86_64-solaris/contextjit b/Master/bin/x86_64-solaris/contextjit
new file mode 120000
index 00000000000..ab95aa3d110
--- /dev/null
+++ b/Master/bin/x86_64-solaris/contextjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/contextjit \ No newline at end of file
diff --git a/Master/bin/x86_64-solaris/ctxtools b/Master/bin/x86_64-solaris/ctxtools
deleted file mode 120000
index 66237b28340..00000000000
--- a/Master/bin/x86_64-solaris/ctxtools
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/ctxtools \ No newline at end of file
diff --git a/Master/bin/x86_64-solaris/mtxrunjit b/Master/bin/x86_64-solaris/mtxrunjit
new file mode 120000
index 00000000000..c8c1e9a30bf
--- /dev/null
+++ b/Master/bin/x86_64-solaris/mtxrunjit
@@ -0,0 +1 @@
+../../texmf-dist/scripts/context/stubs/unix/mtxrunjit \ No newline at end of file
diff --git a/Master/bin/x86_64-solaris/pstopdf b/Master/bin/x86_64-solaris/pstopdf
deleted file mode 120000
index 44478ee1dd4..00000000000
--- a/Master/bin/x86_64-solaris/pstopdf
+++ /dev/null
@@ -1 +0,0 @@
-../../texmf-dist/scripts/context/stubs/unix/pstopdf \ No newline at end of file
diff --git a/Master/texmf-dist/context/data/scite/documents/scite-context-readme.pdf b/Master/texmf-dist/context/data/scite/context/documents/scite-context-readme.pdf
index 2bd7d4216fe..2bd7d4216fe 100644
--- a/Master/texmf-dist/context/data/scite/documents/scite-context-readme.pdf
+++ b/Master/texmf-dist/context/data/scite/context/documents/scite-context-readme.pdf
Binary files differ
diff --git a/Master/texmf-dist/context/data/scite/documents/scite-context-readme.tex b/Master/texmf-dist/context/data/scite/context/documents/scite-context-readme.tex
index cbfc00a3342..cbfc00a3342 100644
--- a/Master/texmf-dist/context/data/scite/documents/scite-context-readme.tex
+++ b/Master/texmf-dist/context/data/scite/context/documents/scite-context-readme.tex
diff --git a/Master/texmf-dist/context/data/scite/documents/scite-context-visual.pdf b/Master/texmf-dist/context/data/scite/context/documents/scite-context-visual.pdf
index 69d82eda681..69d82eda681 100644
--- a/Master/texmf-dist/context/data/scite/documents/scite-context-visual.pdf
+++ b/Master/texmf-dist/context/data/scite/context/documents/scite-context-visual.pdf
diff --git a/Master/texmf-dist/context/data/scite/documents/scite-context-visual.png b/Master/texmf-dist/context/data/scite/context/documents/scite-context-visual.png
index 7368a68f141..7368a68f141 100644
--- a/Master/texmf-dist/context/data/scite/documents/scite-context-visual.png
+++ b/Master/texmf-dist/context/data/scite/context/documents/scite-context-visual.png
Binary files differ
diff --git a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-context.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-context.lua
index 721a2e123fb..aeee8590f67 100644
--- a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-context.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-context.lua
@@ -1,4 +1,4 @@
return {
- ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "plussixteen", "plushundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "etexversion", "pdftexversion", "xetexversion", "xetexrevision", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "spaceasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vcentergroupcode", "mathchoicegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "vadjustgroupcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "charifcode", "catifcode", "numifcode", "dimifcode", "oddifcode", "vmodeifcode", "hmodeifcode", "mmodeifcode", "innerifcode", "voidifcode", "hboxifcode", "vboxifcode", "xifcode", "eofifcode", "trueifcode", "falseifcode", "caseifcode", "definedifcode", "csnameifcode", "fontcharifcode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathsupdisplay", "mathsupnormal", "mathsupcramped", "mathsubnormal", "mathsubcombined", "mathaxisheight", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "setupdocument", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordcode", "mathopcode", "mathbincode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctcode", "mathalphacode", "mathinnercode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathboxcode", "mathchoicecode", "mathaccentcode", "mathradicalcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "continueifinputfile", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "breakablethinspace", "nobreakspace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj" },
- ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "startcontextdefinitioncode", "stopcontextdefinitioncode", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "doifelsecommandhandler", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "then", "begcsname", "strippedcsname", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthsargumenttrue", "sixthargumentfalse", "sixtsargumenttrue", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "dontcomplain", "forgetall", "donetrue", "donefalse", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruledvcenter", "ruledmbox", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "normalbaselineskip", "normallineskip", "normallineskiplimit", "availablehsize", "localhsize", "setlocalhsize", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchunicode", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextoptionalcselse", "doiffastoptionalcheckelse", "doifnextbgroupelse", "doifnextbgroupcselse", "doifnextparenthesiselse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifnumber", "doifnotnumber", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "doifassignmentelse", "docheckassignment", "tracingall", "tracingnone", "loggingall", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "everyendpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "obeyspaces", "obeylines", "obeyedspace", "obeyedline", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "wait", "writestatus", "define", "defineexpandable", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "installcorenamespace", "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "dowith", "newconstant", "setnewconstant", "setconstant", "setconstantvalue", "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "newmacro", "setnewmacro", "newfraction", "newsignal", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "permitspacesbetweengroups", "dontpermitspacesbetweengroups", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse", "startnointerference", "stopnointerference", "twodigits", "threedigits", "leftorright", "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "begstrut", "endstrut", "lineheight", "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing", "ordopenspacing", "ordclosespacing", "ordpunctspacing", "ordinnerspacing", "opordspacing", "opopspacing", "opbinspacing", "oprelspacing", "opopenspacing", "opclosespacing", "oppunctspacing", "opinnerspacing", "binordspacing", "binopspacing", "binbinspacing", "binrelspacing", "binopenspacing", "binclosespacing", "binpunctspacing", "bininnerspacing", "relordspacing", "relopspacing", "relbinspacing", "relrelspacing", "relopenspacing", "relclosespacing", "relpunctspacing", "relinnerspacing", "openordspacing", "openopspacing", "openbinspacing", "openrelspacing", "openopenspacing", "openclosespacing", "openpunctspacing", "openinnerspacing", "closeordspacing", "closeopspacing", "closebinspacing", "closerelspacing", "closeopenspacing", "closeclosespacing", "closepunctspacing", "closeinnerspacing", "punctordspacing", "punctopspacing", "punctbinspacing", "punctrelspacing", "punctopenspacing", "punctclosespacing", "punctpunctspacing", "punctinnerspacing", "innerordspacing", "inneropspacing", "innerbinspacing", "innerrelspacing", "inneropenspacing", "innerclosespacing", "innerpunctspacing", "innerinnerspacing", "normalreqno", "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", "uncramped", "cramped", "triggermathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", "triggerdisplaystyle", "triggertextstyle", "triggerscriptstyle", "triggerscriptscriptstyle", "triggeruncrampedstyle", "triggercrampedstyle", "triggersmallstyle", "triggeruncrampedsmallstyle", "triggercrampedsmallstyle", "triggerbigstyle", "triggeruncrampedbigstyle", "triggercrampedbigstyle", "luaexpr", "expdoifelse", "expdoif", "expdoifnot", "expdoifcommonelse", "expdoifinsetelse", "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", "ctxluacode", "luaconditional", "luaexpanded", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", "startctxfunction", "stopctxfunction", "ctxfunction", "startctxfunctiondefinition", "stopctxfunctiondefinition", "carryoverpar", "assumelongusagecs", "Umathbotaccent", "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", "autodirhbox", "autodirvbox", "autodirvtop", "lefttoright", "righttoleft", "synchronizelayoutdirection", "synchronizedisplaydirection", "synchronizeinlinedirection", "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath" },
+ ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "plussixteen", "plushundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "etexversion", "pdftexversion", "xetexversion", "xetexrevision", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "spaceasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vcentergroupcode", "mathchoicegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "vadjustgroupcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "charifcode", "catifcode", "numifcode", "dimifcode", "oddifcode", "vmodeifcode", "hmodeifcode", "mmodeifcode", "innerifcode", "voidifcode", "hboxifcode", "vboxifcode", "xifcode", "eofifcode", "trueifcode", "falseifcode", "caseifcode", "definedifcode", "csnameifcode", "fontcharifcode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathsupdisplay", "mathsupnormal", "mathsupcramped", "mathsubnormal", "mathsubcombined", "mathaxisheight", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "setupdocument", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordcode", "mathopcode", "mathbincode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctcode", "mathalphacode", "mathinnercode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathboxcode", "mathchoicecode", "mathaccentcode", "mathradicalcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "continueifinputfile", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "breakablethinspace", "nobreakspace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", "optionalspace" },
+ ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "startcontextdefinitioncode", "stopcontextdefinitioncode", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "doifelsecommandhandler", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "then", "begcsname", "strippedcsname", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthsargumenttrue", "sixthargumentfalse", "sixtsargumenttrue", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "dontcomplain", "forgetall", "donetrue", "donefalse", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruledvcenter", "ruledmbox", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "normalbaselineskip", "normallineskip", "normallineskiplimit", "availablehsize", "localhsize", "setlocalhsize", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchunicode", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextoptionalcselse", "doiffastoptionalcheckelse", "doifnextbgroupelse", "doifnextbgroupcselse", "doifnextparenthesiselse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifnumber", "doifnotnumber", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "doifassignmentelse", "docheckassignment", "tracingall", "tracingnone", "loggingall", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "everyendpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "obeyspaces", "obeylines", "obeyedspace", "obeyedline", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "wait", "writestatus", "define", "defineexpandable", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "installcorenamespace", "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "dowith", "newconstant", "setnewconstant", "setconstant", "setconstantvalue", "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "newmacro", "setnewmacro", "newfraction", "newsignal", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "permitspacesbetweengroups", "dontpermitspacesbetweengroups", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse", "startnointerference", "stopnointerference", "twodigits", "threedigits", "leftorright", "offinterlineskip", "oninterlineskip", "nointerlineskip", "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "begstrut", "endstrut", "lineheight", "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing", "ordopenspacing", "ordclosespacing", "ordpunctspacing", "ordinnerspacing", "opordspacing", "opopspacing", "opbinspacing", "oprelspacing", "opopenspacing", "opclosespacing", "oppunctspacing", "opinnerspacing", "binordspacing", "binopspacing", "binbinspacing", "binrelspacing", "binopenspacing", "binclosespacing", "binpunctspacing", "bininnerspacing", "relordspacing", "relopspacing", "relbinspacing", "relrelspacing", "relopenspacing", "relclosespacing", "relpunctspacing", "relinnerspacing", "openordspacing", "openopspacing", "openbinspacing", "openrelspacing", "openopenspacing", "openclosespacing", "openpunctspacing", "openinnerspacing", "closeordspacing", "closeopspacing", "closebinspacing", "closerelspacing", "closeopenspacing", "closeclosespacing", "closepunctspacing", "closeinnerspacing", "punctordspacing", "punctopspacing", "punctbinspacing", "punctrelspacing", "punctopenspacing", "punctclosespacing", "punctpunctspacing", "punctinnerspacing", "innerordspacing", "inneropspacing", "innerbinspacing", "innerrelspacing", "inneropenspacing", "innerclosespacing", "innerpunctspacing", "innerinnerspacing", "normalreqno", "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", "uncramped", "cramped", "triggermathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", "triggerdisplaystyle", "triggertextstyle", "triggerscriptstyle", "triggerscriptscriptstyle", "triggeruncrampedstyle", "triggercrampedstyle", "triggersmallstyle", "triggeruncrampedsmallstyle", "triggercrampedsmallstyle", "triggerbigstyle", "triggeruncrampedbigstyle", "triggercrampedbigstyle", "luaexpr", "expdoifelse", "expdoif", "expdoifnot", "expdoifcommonelse", "expdoifinsetelse", "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", "ctxluacode", "luaconditional", "luaexpanded", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", "startctxfunction", "stopctxfunction", "ctxfunction", "startctxfunctiondefinition", "stopctxfunctiondefinition", "carryoverpar", "assumelongusagecs", "Umathbotaccent", "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", "autodirhbox", "autodirvbox", "autodirvtop", "lefttoright", "righttoleft", "synchronizelayoutdirection", "synchronizedisplaydirection", "synchronizeinlinedirection", "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath" },
} \ No newline at end of file
diff --git a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-interfaces.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-interfaces.lua
index b2c09b62a82..b2c09b62a82 100644
--- a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-interfaces.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-interfaces.lua
diff --git a/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua
new file mode 100644
index 00000000000..3db3010d6c1
--- /dev/null
+++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metafun.lua
@@ -0,0 +1,4 @@
+return {
+ ["commands"]={ "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withlinearshading", "withcircularshading", "withfromshadecolor", "withtoshadecolor", "withshading", "shadedinto", "withcircularshade", "withlinearshade", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "withmask", "figure", "register", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "set_linear_vector", "linear_shade", "define_linear_shade", "define_circular_linear_shade", "define_sampled_linear_shade", "set_circular_vector", "circular_shade", "define_circular_shade", "define_circular_linear_shade", "define_sampled_circular_shade", "space", "CRLF", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedpath", "constructedpairs", "punkedfunction", "curvedfunction", "tightfunction", "punkedpath", "curvedpath", "tightpath", "punkedpairs", "curvedpairs", "tightpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "normalfill", "normaldraw", "visualizepaths", "naturalizepaths", "drawboundary", "drawwholepath", "visualizeddraw", "visualizedfill", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "format", "formatted", "startpassingvariable", "stoppassingvariable" },
+ ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "metapostversion", "maxdimensions" },
+} \ No newline at end of file
diff --git a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-metapost.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metapost.lua
index 766ea90da88..d4759854abb 100644
--- a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-metapost.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-metapost.lua
@@ -1,7 +1,7 @@
return {
["commands"]={ "beginfig", "endfig", "beginglyph", "endglyph", "charscale", "rotatedaround", "reflectedabout", "arrowhead", "currentpen", "currentpicture", "cuttings", "defaultfont", "extra_beginfig", "extra_endfig", "ditto", "EOF", "down", "evenly", "fullcircle", "halfcircle", "identity", "in", "left", "origin", "pensquare", "quartercircle", "right", "unitsquare", "up", "withdots", "abs", "bbox", "ceiling", "center", "cutafter", "cutbefore", "dir", "directionpoint", "div", "dotprod", "intersectionpoint", "inverse", "mod", "round", "unitvector", "whatever", "cutdraw", "draw", "drawarrow", "drawdblarrow", "fill", "filldraw", "drawdot", "loggingall", "interact", "tracingall", "tracingnone", "pickup", "undraw", "unfill", "unfilldraw", "buildcycle", "dashpattern", "decr", "dotlabel", "dotlabels", "drawoptions", "incr", "label", "labels", "max", "min", "thelabel", "z", "beginchar", "blacker", "capsule_end", "change_width", "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", "endchar", "extra_beginchar", "extra_endchar", "extra_setup", "font_coding_scheme", "clearxy", "clearit", "clearpen", "shipit", "font_extra_space", "exitunless", "relax", "hide", "gobble", "gobbled", "stop", "blankpicture", "counterclockwise", "tensepath", "takepower", "direction", "softjoin", "makelabel", "rotatedabout", "flex", "superellipse", "erase", "image", "nullpen", "savepen", "clearpen", "penpos", "penlabels", "range", "numtok", "thru", "z", "laboff", "bye", "red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "background", "graypart", "graycolor", "mm", "pt", "dd", "bp", "cm", "pc", "cc", "in", "triplet", "quadruplet" },
["internals"]={ "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", "pen_lft", "pen_rt", "pen_top", "pen_bot" },
- ["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", "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", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "downto", "upto", "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", "greypart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "greycolor", "graycolor", "colormodel", "graypart", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode" },
+ ["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", "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", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "downto", "upto", "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", "greypart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "greycolor", "graycolor", "colormodel", "graypart", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", "runscript" },
["shortcuts"]={ "..", "...", "--", "---", "&" },
["tex"]={ "btex", "etex", "verbatimtex" },
} \ No newline at end of file
diff --git a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-tex.lua b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-tex.lua
index 415b7412834..415b7412834 100644
--- a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-tex.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/data/scite-context-data-tex.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/lexer.lua b/Master/texmf-dist/context/data/scite/context/lexers/lexer.lua
index 9582f6a76b6..9582f6a76b6 100644
--- a/Master/texmf-dist/context/data/scite/lexers/lexer.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/lexer.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-bibtex.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-bibtex.lua
index 88b070e5ee2..88b070e5ee2 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-bibtex.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-bibtex.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cld.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cld.lua
index 3442a195c1b..3442a195c1b 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cld.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cld.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cpp-web.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cpp-web.lua
index daa9221bad0..daa9221bad0 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cpp-web.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cpp-web.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cpp.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cpp.lua
index 31180e6a574..31180e6a574 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-cpp.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-cpp.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-lua-longstring.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua
index 855adbe4ea2..855adbe4ea2 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-lua-longstring.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-lua-longstring.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-lua.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-lua.lua
index c44d586bab5..c44d586bab5 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-lua.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-lua.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-mps.lua
index b87ea83cb53..b87ea83cb53 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-mps.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-mps.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf-object.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf-object.lua
index 1fb95838a9c..1fb95838a9c 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf-object.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf-object.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf-xref.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf-xref.lua
index 7097c41a68d..7097c41a68d 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf-xref.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf-xref.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua
index f8e4e73804e..f8e4e73804e 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-pdf.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-pdf.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-tex-web.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-tex-web.lua
index 5d8859c2649..5d8859c2649 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-tex-web.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-tex-web.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-tex.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-tex.lua
index 0099b968a2d..0099b968a2d 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-tex.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-tex.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-txt.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-txt.lua
index 43eec2c3522..43eec2c3522 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-txt.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-txt.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-web-snippets.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-web-snippets.lua
index 196a545bc0e..196a545bc0e 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-web-snippets.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-web-snippets.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-web.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-web.lua
index 86ae76644d0..86ae76644d0 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-web.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-web.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-cdata.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-cdata.lua
index e6276da0d37..e6276da0d37 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-cdata.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-cdata.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-comment.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-comment.lua
index b5b3fefe07b..b5b3fefe07b 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-comment.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-comment.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-script.lua
index bbb938dc588..bbb938dc588 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml-script.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml-script.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml.lua
index 77c89b1d677..77c89b1d677 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-xml.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer-xml.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer.lua b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer.lua
index 6335af91151..6335af91151 100644
--- a/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/scite-context-lexer.lua
diff --git a/Master/texmf-dist/context/data/scite/lexers/themes/scite-context-theme.lua b/Master/texmf-dist/context/data/scite/context/lexers/themes/scite-context-theme.lua
index b0c63fe3941..b0c63fe3941 100644
--- a/Master/texmf-dist/context/data/scite/lexers/themes/scite-context-theme.lua
+++ b/Master/texmf-dist/context/data/scite/context/lexers/themes/scite-context-theme.lua
diff --git a/Master/texmf-dist/context/data/scite/scite-context-data-context.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-context.properties
index 3cb991efa24..d709dbe51e6 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-data-context.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-context.properties
@@ -63,7 +63,7 @@ lefttorightmark righttoleftmark breakablethinspace nobreakspace narrownobreakspa
zerowidthnobreakspace ideographicspace ideographichalffillspace twoperemspace threeperemspace \
fourperemspace fiveperemspace sixperemspace figurespace punctuationspace \
hairspace zerowidthspace zerowidthnonjoiner zerowidthjoiner zwnj \
-zwj
+zwj optionalspace
keywordclass.context.helpers=\
startsetups stopsetups startxmlsetups stopxmlsetups \
@@ -154,41 +154,42 @@ dosixtupleargument doseventupleargument dosinglegroupempty dodoublegroupempty do
doquadruplegroupempty doquintuplegroupempty permitspacesbetweengroups dontpermitspacesbetweengroups nopdfcompression \
maximumpdfcompression normalpdfcompression modulonumber dividenumber getfirstcharacter \
doiffirstcharelse startnointerference stopnointerference twodigits threedigits \
-leftorright strut setstrut strutbox strutht \
-strutdp strutwd struthtdp begstrut endstrut \
-lineheight ordordspacing ordopspacing ordbinspacing ordrelspacing \
-ordopenspacing ordclosespacing ordpunctspacing ordinnerspacing opordspacing \
-opopspacing opbinspacing oprelspacing opopenspacing opclosespacing \
-oppunctspacing opinnerspacing binordspacing binopspacing binbinspacing \
-binrelspacing binopenspacing binclosespacing binpunctspacing bininnerspacing \
-relordspacing relopspacing relbinspacing relrelspacing relopenspacing \
-relclosespacing relpunctspacing relinnerspacing openordspacing openopspacing \
-openbinspacing openrelspacing openopenspacing openclosespacing openpunctspacing \
-openinnerspacing closeordspacing closeopspacing closebinspacing closerelspacing \
-closeopenspacing closeclosespacing closepunctspacing closeinnerspacing punctordspacing \
-punctopspacing punctbinspacing punctrelspacing punctopenspacing punctclosespacing \
-punctpunctspacing punctinnerspacing innerordspacing inneropspacing innerbinspacing \
-innerrelspacing inneropenspacing innerclosespacing innerpunctspacing innerinnerspacing \
-normalreqno startimath stopimath normalstartimath normalstopimath \
-startdmath stopdmath normalstartdmath normalstopdmath uncramped \
-cramped triggermathstyle mathstylefont mathsmallstylefont mathstyleface \
-mathsmallstyleface mathstylecommand mathpalette mathstylehbox mathstylevbox \
-mathstylevcenter mathstylevcenteredhbox mathstylevcenteredvbox mathtext setmathsmalltextbox \
-setmathtextbox triggerdisplaystyle triggertextstyle triggerscriptstyle triggerscriptscriptstyle \
-triggeruncrampedstyle triggercrampedstyle triggersmallstyle triggeruncrampedsmallstyle triggercrampedsmallstyle \
-triggerbigstyle triggeruncrampedbigstyle triggercrampedbigstyle luaexpr expdoifelse \
-expdoif expdoifnot expdoifcommonelse expdoifinsetelse ctxdirectlua \
-ctxlatelua ctxsprint ctxwrite ctxcommand ctxdirectcommand \
-ctxlatecommand ctxreport ctxlua luacode lateluacode \
-directluacode registerctxluafile ctxloadluafile luaversion luamajorversion \
-luaminorversion ctxluacode luaconditional luaexpanded startluaparameterset \
-stopluaparameterset luaparameterset definenamedlua obeylualines obeyluatokens \
-startluacode stopluacode startlua stoplua startctxfunction \
-stopctxfunction ctxfunction startctxfunctiondefinition stopctxfunctiondefinition carryoverpar \
-assumelongusagecs Umathbotaccent righttolefthbox lefttorighthbox righttoleftvbox \
-lefttorightvbox righttoleftvtop lefttorightvtop rtlhbox ltrhbox \
-rtlvbox ltrvbox rtlvtop ltrvtop autodirhbox \
-autodirvbox autodirvtop lefttoright righttoleft synchronizelayoutdirection \
-synchronizedisplaydirection synchronizeinlinedirection lesshyphens morehyphens nohyphens \
-dohyphens Ucheckedstartdisplaymath Ucheckedstopdisplaymath
+leftorright offinterlineskip oninterlineskip nointerlineskip strut \
+setstrut strutbox strutht strutdp strutwd \
+struthtdp begstrut endstrut lineheight ordordspacing \
+ordopspacing ordbinspacing ordrelspacing ordopenspacing ordclosespacing \
+ordpunctspacing ordinnerspacing opordspacing opopspacing opbinspacing \
+oprelspacing opopenspacing opclosespacing oppunctspacing opinnerspacing \
+binordspacing binopspacing binbinspacing binrelspacing binopenspacing \
+binclosespacing binpunctspacing bininnerspacing relordspacing relopspacing \
+relbinspacing relrelspacing relopenspacing relclosespacing relpunctspacing \
+relinnerspacing openordspacing openopspacing openbinspacing openrelspacing \
+openopenspacing openclosespacing openpunctspacing openinnerspacing closeordspacing \
+closeopspacing closebinspacing closerelspacing closeopenspacing closeclosespacing \
+closepunctspacing closeinnerspacing punctordspacing punctopspacing punctbinspacing \
+punctrelspacing punctopenspacing punctclosespacing punctpunctspacing punctinnerspacing \
+innerordspacing inneropspacing innerbinspacing innerrelspacing inneropenspacing \
+innerclosespacing innerpunctspacing innerinnerspacing normalreqno startimath \
+stopimath normalstartimath normalstopimath startdmath stopdmath \
+normalstartdmath normalstopdmath uncramped cramped triggermathstyle \
+mathstylefont mathsmallstylefont mathstyleface mathsmallstyleface mathstylecommand \
+mathpalette mathstylehbox mathstylevbox mathstylevcenter mathstylevcenteredhbox \
+mathstylevcenteredvbox mathtext setmathsmalltextbox setmathtextbox triggerdisplaystyle \
+triggertextstyle triggerscriptstyle triggerscriptscriptstyle triggeruncrampedstyle triggercrampedstyle \
+triggersmallstyle triggeruncrampedsmallstyle triggercrampedsmallstyle triggerbigstyle triggeruncrampedbigstyle \
+triggercrampedbigstyle luaexpr expdoifelse expdoif expdoifnot \
+expdoifcommonelse expdoifinsetelse ctxdirectlua ctxlatelua ctxsprint \
+ctxwrite ctxcommand ctxdirectcommand ctxlatecommand ctxreport \
+ctxlua luacode lateluacode directluacode registerctxluafile \
+ctxloadluafile luaversion luamajorversion luaminorversion ctxluacode \
+luaconditional luaexpanded startluaparameterset stopluaparameterset luaparameterset \
+definenamedlua obeylualines obeyluatokens startluacode stopluacode \
+startlua stoplua startctxfunction stopctxfunction ctxfunction \
+startctxfunctiondefinition stopctxfunctiondefinition carryoverpar assumelongusagecs Umathbotaccent \
+righttolefthbox lefttorighthbox righttoleftvbox lefttorightvbox righttoleftvtop \
+lefttorightvtop rtlhbox ltrhbox rtlvbox ltrvbox \
+rtlvtop ltrvtop autodirhbox autodirvbox autodirvtop \
+lefttoright righttoleft synchronizelayoutdirection synchronizedisplaydirection synchronizeinlinedirection \
+lesshyphens morehyphens nohyphens dohyphens Ucheckedstartdisplaymath \
+Ucheckedstopdisplaymath
diff --git a/Master/texmf-dist/context/data/scite/scite-context-data-interfaces.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-interfaces.properties
index 9c2ca4623fc..9c2ca4623fc 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-data-interfaces.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-interfaces.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-context-data-metafun.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-metafun.properties
index 9381b4f8dbe..db66f9ec32c 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-data-metafun.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-metafun.properties
@@ -7,7 +7,8 @@ invtan acosh asinh sinh cosh \
paired tripled unitcircle fulldiamond unitdiamond \
fullsquare llcircle lrcircle urcircle ulcircle \
tcircle bcircle lcircle rcircle lltriangle \
-lrtriangle urtriangle ultriangle smoothed cornered \
+lrtriangle urtriangle ultriangle uptriangle downtriangle \
+lefttriangle righttriangle triangle smoothed cornered \
superellipsed randomized squeezed enlonged shortened \
punked curved unspiked simplified blownup \
stretched enlarged leftenlarged topenlarged rightenlarged \
diff --git a/Master/texmf-dist/context/data/scite/scite-context-data-metapost.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-metapost.properties
index 88ace57cafc..afa6e894ad3 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-data-metapost.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-metapost.properties
@@ -91,7 +91,7 @@ graypart dashpart penpart stroked filled \
textual clipped bounded pathpart expandafter \
minute hour outputformat outputtemplate filenametemplate \
fontmapfile fontmapline fontpart fontsize glyph \
-restoreclipcolor troffmode
+restoreclipcolor troffmode runscript
keywordclass.metapost.shortcuts=\
.. ... -- --- \
diff --git a/Master/texmf-dist/context/data/scite/scite-context-data-tex.properties b/Master/texmf-dist/context/data/scite/context/scite-context-data-tex.properties
index d1780794d18..d1780794d18 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-data-tex.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-data-tex.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-context-external.properties b/Master/texmf-dist/context/data/scite/context/scite-context-external.properties
index c7d0c4a17d3..c7d0c4a17d3 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-external.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-external.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-context-internal.properties b/Master/texmf-dist/context/data/scite/context/scite-context-internal.properties
index 038381dc71b..038381dc71b 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-internal.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-internal.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-context-user.properties b/Master/texmf-dist/context/data/scite/context/scite-context-user.properties
index b6fc34282bc..b6fc34282bc 100644
--- a/Master/texmf-dist/context/data/scite/scite-context-user.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context-user.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-context.properties b/Master/texmf-dist/context/data/scite/context/scite-context.properties
index 78850ef0d0e..78850ef0d0e 100644
--- a/Master/texmf-dist/context/data/scite/scite-context.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-context.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-ctx-context.properties b/Master/texmf-dist/context/data/scite/context/scite-ctx-context.properties
index a1d5800e65a..a1d5800e65a 100644
--- a/Master/texmf-dist/context/data/scite/scite-ctx-context.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-ctx-context.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-ctx-example.properties b/Master/texmf-dist/context/data/scite/context/scite-ctx-example.properties
index 78b2f2859c2..78b2f2859c2 100644
--- a/Master/texmf-dist/context/data/scite/scite-ctx-example.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-ctx-example.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-ctx.lua b/Master/texmf-dist/context/data/scite/context/scite-ctx.lua
index 24f5b34b8aa..24f5b34b8aa 100644
--- a/Master/texmf-dist/context/data/scite/scite-ctx.lua
+++ b/Master/texmf-dist/context/data/scite/context/scite-ctx.lua
diff --git a/Master/texmf-dist/context/data/scite/scite-ctx.properties b/Master/texmf-dist/context/data/scite/context/scite-ctx.properties
index 874a381e349..874a381e349 100644
--- a/Master/texmf-dist/context/data/scite/scite-ctx.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-ctx.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-metapost.properties b/Master/texmf-dist/context/data/scite/context/scite-metapost.properties
index fc06dcaa28b..fc06dcaa28b 100644
--- a/Master/texmf-dist/context/data/scite/scite-metapost.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-metapost.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-pragma.properties b/Master/texmf-dist/context/data/scite/context/scite-pragma.properties
index 2dea18bade3..2dea18bade3 100644
--- a/Master/texmf-dist/context/data/scite/scite-pragma.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-pragma.properties
diff --git a/Master/texmf-dist/context/data/scite/scite-tex.properties b/Master/texmf-dist/context/data/scite/context/scite-tex.properties
index 7d271eaf187..7d271eaf187 100644
--- a/Master/texmf-dist/context/data/scite/scite-tex.properties
+++ b/Master/texmf-dist/context/data/scite/context/scite-tex.properties
diff --git a/Master/texmf-dist/context/data/scite/documents/scite-context-visual.tex b/Master/texmf-dist/context/data/scite/documents/scite-context-visual.tex
deleted file mode 100644
index 0a1b8bb71eb..00000000000
--- a/Master/texmf-dist/context/data/scite/documents/scite-context-visual.tex
+++ /dev/null
@@ -1,52 +0,0 @@
-% language=uk
-
-\usemodule[art-01]
-
-\defineframedtext
- [entry]
-
-\starttext
-
-\startchapter[title=Some fancy title]
-
- \startluacode
- local entries = { -- there can be more
- { text = "The third entry!" },
- { text = "The fourth entry!" },
- }
-
- for i=1,#entries do
- context.startentry()
- context(entries[i].text)
- context.stopentry()
- end
- \stopluacode
-
- This is just some text to demonstrate the realtime spellchecker
- in combination with the embedded lua and metapost lexers and
- inline as well as display \ctxlua{context("lua code")}.
-
- Non breakable spaces in for instance 10 mm and quads like here
- are shown as well.
-
- \startlinecorrection
- \startMPcode
- for i=1 upto 100 :
- draw fullcircle scaled (i*mm) ;
- endfor ;
- \stopMPcode
- \stoplinecorrection
-
- \iftrue
- \def\crap{some text} % who cares
- \else
- \def\crap{some crap} % about this
- \fi
-
- \blank[2*big]
-
- \crap
-
-\stopchapter
-
-\stoptext
diff --git a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-metafun.lua b/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-metafun.lua
deleted file mode 100644
index 50b9ecec48a..00000000000
--- a/Master/texmf-dist/context/data/scite/lexers/data/scite-context-data-metafun.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-return {
- ["commands"]={ "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "smoothed", "cornered", "superellipsed", "randomized", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withlinearshading", "withcircularshading", "withfromshadecolor", "withtoshadecolor", "withshading", "shadedinto", "withcircularshade", "withlinearshade", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "withmask", "figure", "register", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "set_linear_vector", "linear_shade", "define_linear_shade", "define_circular_linear_shade", "define_sampled_linear_shade", "set_circular_vector", "circular_shade", "define_circular_shade", "define_circular_linear_shade", "define_sampled_circular_shade", "space", "CRLF", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedpath", "constructedpairs", "punkedfunction", "curvedfunction", "tightfunction", "punkedpath", "curvedpath", "tightpath", "punkedpairs", "curvedpairs", "tightpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "normalfill", "normaldraw", "visualizepaths", "naturalizepaths", "drawboundary", "drawwholepath", "visualizeddraw", "visualizedfill", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "format", "formatted", "startpassingvariable", "stoppassingvariable" },
- ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "metapostversion", "maxdimensions" },
-} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/man/man1/context.man1.pdf b/Master/texmf-dist/doc/man/man1/context.man1.pdf
index 8bdc14430a7..e71bc90dc56 100644
--- a/Master/texmf-dist/doc/man/man1/context.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/context.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/ctxtools.1 b/Master/texmf-dist/doc/man/man1/ctxtools.1
deleted file mode 100644
index 3eb988c9c44..00000000000
--- a/Master/texmf-dist/doc/man/man1/ctxtools.1
+++ /dev/null
@@ -1,75 +0,0 @@
-.TH "ctxtools" "1" "01-01-2014" "version 1.3.5" "CtxTools"
-.SH NAME
-.B ctxtools
-.SH SYNOPSIS
-.B ctxtools [
-.I OPTIONS ...
-.B ] [
-.I FILENAMES
-.B ]
-.SH DESCRIPTION
-.B CtxTools
-.SH OPTIONS
-.TP
-.B --touchcontextfile
-update context version
-.TP
-.B --contextversion
-report context version
-.TP
-.B --jeditinterface
-generate jedit syntax files [--pipe]
-.TP
-.B --bbeditinterface
-generate bbedit syntax files [--pipe]
-.TP
-.B --sciteinterface
-generate scite syntax files [--pipe]
-.TP
-.B --rawinterface
-generate raw syntax files [--pipe]
-.TP
-.B --translateinterface
-generate interface files (xml) [nl de ..]
-.TP
-.B --purgefiles
-remove temporary files [--all --recurse] [basename]
-.TP
-.B --documentation generate documentation [--type=]
-[filename]
-.TP
-.B --filterpages'
-) # no help, hidden temporary feature
-.TP
-.B --dpxmapfiles
-convert pdftex mapfiles to dvipdfmx [--force] [texmfroot]
-.TP
-.B --listentities
-create doctype entity definition from enco-uc.tex
-.TP
-.B --brandfiles
-add context copyright notice [--force]
-.TP
-.B --platformize
-replace line-endings [--recurse --force] [pattern]
-.TP
-.B --dependencies analyze depedencies within context [--save --compact --filter=[macros|filenames] ]
-[filename]
-.TP
-.B --updatecontext
-download latest version and remake formats [--proxy]
-.TP
-.B --disarmutfbom
-remove utf bom [--force]
-.SH AUTHOR
-More information about ConTeXt and the tools that come with it can be found at:
-
-
-.B "maillist:"
-ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
-
-.B "webpage:"
-http://www.pragma-ade.nl / http://tex.aanhet.net
-
-.B "wiki:"
-http://contextgarden.net
diff --git a/Master/texmf-dist/doc/man/man1/ctxtools.man1.pdf b/Master/texmf-dist/doc/man/man1/ctxtools.man1.pdf
deleted file mode 100644
index 7cb54e9cb6a..00000000000
--- a/Master/texmf-dist/doc/man/man1/ctxtools.man1.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/luatools.man1.pdf b/Master/texmf-dist/doc/man/man1/luatools.man1.pdf
index 49376c8fc76..592508b8a17 100644
--- a/Master/texmf-dist/doc/man/man1/luatools.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/luatools.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf
index b815be58ad6..10e12d20151 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf
index e9e941364e3..7a50e34ac8e 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf
index c43d55d90d0..bf5b04713d4 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf
index 95e1a2edfb7..6b4a192ff37 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf
index a4e73798c45..fbc86e91b24 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf
index c33f8d8a0ee..eaccb8957b6 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf
index 0b45ff8e34d..4248e4f2100 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf
index 3a37e2ba683..5f7da87ef44 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf
index 4b4255b6151..028c5bb1580 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf
index 56b872aac7e..92a892fd862 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf
index 119e8a84620..585d1b36f51 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf
index b74b98fbdb9..53b98f96764 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf
index f4f38d79d48..193d77b9ae8 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf
index 9017cb6e3aa..aa19c678493 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf
index 7559db630fc..1fa5399d251 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf
index 43e045050dc..cedef388c28 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-metatex.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf
index 79435aedad2..b77bf0bb5df 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf
index 8efc2f29843..ed45e2492f0 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf
index c1c04b1c860..cd35c1c1fd7 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-patterns.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf
index 7e8125d9905..1c0f06d1a64 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf
index 16c5918971f..77bd5157627 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf
index 770f5b7c8da..77466678c21 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf
index 207309d2608..1c56b5c6e76 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf
index 68df340b735..b0e6ffd9dde 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf
index aceca4e69cc..6632da2be1c 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf
index bf12e3a9b48..a23a9731cb7 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf
index 1dfc4097605..e9eeb96b66f 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf
index 51b6795fb88..7754f94cf8c 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf
index a708c58f84a..b95d331a34d 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf
index 4cc2335d35f..76e386e8b79 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf
index b81d58d8eed..ee82ffa0de5 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf b/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf
index da7f54eee2f..e32a60fe23e 100644
--- a/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf b/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf
index 2ad55582887..8d43f8a2929 100644
--- a/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/pstopdf.1 b/Master/texmf-dist/doc/man/man1/pstopdf.1
deleted file mode 100644
index 9a8e5c6379b..00000000000
--- a/Master/texmf-dist/doc/man/man1/pstopdf.1
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH "pstopdf" "1" "01-01-2014" "version 2.0.1" "PStoPDF"
-.SH NAME
-.B pstopdf
-.SH SYNOPSIS
-.B pstopdf [
-.I OPTIONS ...
-.B ] [
-.I FILENAMES
-.B ]
-.SH DESCRIPTION
-.B PStoPDF
-.SH OPTIONS
-.TP
-.B --request
-handles exa request file
-.TP
-.B --watch
-watch folders for conversions (untested)
-.SH AUTHOR
-More information about ConTeXt and the tools that come with it can be found at:
-
-
-.B "maillist:"
-ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
-
-.B "webpage:"
-http://www.pragma-ade.nl / http://tex.aanhet.net
-
-.B "wiki:"
-http://contextgarden.net
diff --git a/Master/texmf-dist/doc/man/man1/pstopdf.man1.pdf b/Master/texmf-dist/doc/man/man1/pstopdf.man1.pdf
deleted file mode 100644
index 9ef7a64ce2e..00000000000
--- a/Master/texmf-dist/doc/man/man1/pstopdf.man1.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/texexec.man1.pdf b/Master/texmf-dist/doc/man/man1/texexec.man1.pdf
index a75075ecca8..4eb351be790 100644
--- a/Master/texmf-dist/doc/man/man1/texexec.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/texexec.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf b/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf
index c70a63242b9..658d8d9f5a1 100644
--- a/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/metapost/context/base/mp-base.mpiv b/Master/texmf-dist/metapost/context/base/mp-base.mpiv
index 0b655ef479a..94379050bc8 100644
--- a/Master/texmf-dist/metapost/context/base/mp-base.mpiv
+++ b/Master/texmf-dist/metapost/context/base/mp-base.mpiv
@@ -714,10 +714,10 @@ enddef ;
def pen_pickup_ primary q =
currentpen := q ;
- pen_lft :=xpart penoffset down of currentpen ;
- pen_rt :=xpart penoffset up of currentpen ;
- pen_top :=ypart penoffset left of currentpen ;
- pen_bot :=ypart penoffset right of currentpen ;
+ pen_lft := xpart penoffset down of currentpen ;
+ pen_rt := xpart penoffset up of currentpen ;
+ pen_top := ypart penoffset left of currentpen ;
+ pen_bot := ypart penoffset right of currentpen ;
path currentpen_path ;
enddef ;
@@ -733,7 +733,8 @@ vardef savepen =
pen_count_
enddef ;
-def clearpen = currentpen:=nullpen;
+def clearpen =
+ currentpen := nullpen;
pen_lft := pen_rt := pen_top := pen_bot := 0 ;
path currentpen_path ;
enddef ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-form.mpiv b/Master/texmf-dist/metapost/context/base/mp-form.mpiv
index b58792e1a01..88b15e09796 100644
--- a/Master/texmf-dist/metapost/context/base/mp-form.mpiv
+++ b/Master/texmf-dist/metapost/context/base/mp-form.mpiv
@@ -27,4 +27,4 @@ string Fmfont_ ; Fmfont_ := "crap" ;
vardef mfun_format_number(expr fmt, i) =
"\ctxlua{metapost.formatnumber('" & fmt & "'," & if string i : i else : decimal i fi & ")}"
-enddef
+enddef ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-mlib.mpiv b/Master/texmf-dist/metapost/context/base/mp-mlib.mpiv
index 252cd5fd06e..56815028e8f 100644
--- a/Master/texmf-dist/metapost/context/base/mp-mlib.mpiv
+++ b/Master/texmf-dist/metapost/context/base/mp-mlib.mpiv
@@ -783,6 +783,9 @@ enddef ;
% passvariable("boolean",false) ;
% passvariable("path",fullcircle scaled 1cm) ;
+% we could use the new lua interface but there is not that much gain i.e.
+% we still need to serialize
+
vardef mfun_point_to_string(expr p,i) =
decimal xpart (point i of p) & " " &
decimal ypart (point i of p) & " " &
diff --git a/Master/texmf-dist/metapost/context/base/mp-tool.mpiv b/Master/texmf-dist/metapost/context/base/mp-tool.mpiv
index 4ca2ea0f93d..7845467a46c 100644
--- a/Master/texmf-dist/metapost/context/base/mp-tool.mpiv
+++ b/Master/texmf-dist/metapost/context/base/mp-tool.mpiv
@@ -628,6 +628,15 @@ ultriangle := origin -- (0,+.5) -- (-.5,0) -- cycle ;
lltriangle := origin -- (-.5,0) -- (0,-.5) -- cycle ;
lrtriangle := origin -- (0,-.5) -- (+.5,0) -- cycle ;
+path triangle, uptriangle, downtriangle, lefttriangle, righttriangle ;
+
+triangle := (1,0) -- (1,0) rotated 120 -- (1,0) rotated -120 -- cycle ;
+
+uptriangle := triangle rotated 90 ;
+downtriangle := triangle rotated -90 ;
+lefttriangle := triangle rotated 180 ;
+righttriangle := triangle ;
+
path unitdiamond, fulldiamond ;
unitdiamond := (.5,0) -- (1,.5) -- (.5,1) -- (0,.5) -- cycle ;
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-context.lua b/Master/texmf-dist/scripts/context/lua/mtx-context.lua
index b53110bb1a4..37172327140 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-context.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-context.lua
@@ -540,6 +540,7 @@ function scripts.context.run(ctxdata,filename)
local a_profile = getargument("profile")
local a_batchmode = getargument("batchmode")
local a_nonstopmode = getargument("nonstopmode")
+ local a_scollmode = getargument("scrollmode")
local a_once = getargument("once")
local a_synctex = getargument("synctex")
local a_backend = getargument("backend")
@@ -549,7 +550,7 @@ function scripts.context.run(ctxdata,filename)
local a_jithash = getargument("jithash")
local a_texformat = getargument("texformat")
--
- a_batchmode = (a_batchmode and "batchmode") or (a_nonstopmode and "nonstopmode") or nil
+ a_batchmode = (a_batchmode and "batchmode") or (a_nonstopmode and "nonstopmode") or (a_scrollmode and "scrollmode") or nil
a_synctex = check_synctex(a_synctex)
--
for i=1,#filelist do
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-plain.lua b/Master/texmf-dist/scripts/context/lua/mtx-plain.lua
index de13717d396..1076572fcc3 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-plain.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-plain.lua
@@ -103,7 +103,11 @@ function scripts.plain.make(texengine,texformat)
end
function scripts.plain.run(texengine,texformat,filename)
- execute('%s --fmt=%s "%s"',texengine,file.removesuffix(texformat),filename)
+ local t = { }
+ for k, v in next, environment.arguments do
+ t[#t+1] = string.format("--mtx:%s=%s",k,v)
+ end
+ execute('%s --fmt=%s %s "%s"',texengine,file.removesuffix(texformat),table.concat(t," "),filename)
end
function scripts.plain.fonts()
diff --git a/Master/texmf-dist/scripts/context/lua/mtxrun.lua b/Master/texmf-dist/scripts/context/lua/mtxrun.lua
index 8679aefb10d..c3d4111626e 100755
--- a/Master/texmf-dist/scripts/context/lua/mtxrun.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtxrun.lua
@@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 29808, stripped down to: 16182
+-- original size: 29983, stripped down to: 16202
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -474,7 +474,7 @@ local uppercase=R("AZ")
local underscore=P("_")
local hexdigit=digit+lowercase+uppercase
local cr,lf,crlf=P("\r"),P("\n"),P("\r\n")
-local newline=crlf+S("\r\n")
+local newline=P("\r")*(P("\n")+P(true))+P("\n")
local escaped=P("\\")*anything
local squote=P("'")
local dquote=P('"')
@@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le
patterns.utfbom_16_be=utfbom_16_be
patterns.utfbom_16_le=utfbom_16_le
patterns.utfbom_8=utfbom_8
-patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
-patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
+patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
+patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
patterns.utf8one=R("\000\127")
patterns.utf8two=R("\194\223")*utf8next
patterns.utf8three=R("\224\239")*utf8next*utf8next
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 25607, stripped down to: 16617
+-- original size: 25613, stripped down to: 16617
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.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-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 : 694558
--- stripped bytes : 246497
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/Master/texmf-dist/scripts/context/stubs/install/first-setup.bat b/Master/texmf-dist/scripts/context/stubs/install/first-setup.bat
new file mode 100755
index 00000000000..f06ad0e6b79
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/install/first-setup.bat
@@ -0,0 +1,87 @@
+@echo off
+
+setlocal
+
+:fetch
+
+set OWNPATH=%~dp0
+set PATH=%OWNPATH%bin;%PATH%
+set PLATFORM=mswin
+
+set CYGWIN=nontsec
+
+if defined ProgramFiles(x86) (
+ set PLATFORM=win64
+) else (
+ if "%PROCESSOR_ARCHITEW6432%"=="AMD64" set PLATFORM=win64
+)
+
+REM ~ copy /y bin\mtx-update.lua bin\x.lua
+
+if "%PLATFORM%" == "win64" goto update-win64
+
+:update-win32
+
+rsync -av --exclude 'rsync.exe' --exclude 'cygwin1.dll' --exclude 'cygiconv-2.dll' rsync://contextgarden.net/minimals/setup/mswin/bin/ bin
+
+goto update
+
+:update-win64
+
+rsync -av --exclude 'rsync.exe' --exclude 'cygwin1.dll' --exclude 'cygiconv-2.dll' rsync://contextgarden.net/minimals/setup/win64/bin/ bin
+
+goto update
+
+:update
+
+REM ~ copy /y bin\x.lua bin\mtx-update.lua
+
+REM --mingw --nofiledatabase --engine=luatex
+
+mtxrun --script ./bin/mtx-update.lua --update --force --make --engine=all --context=beta --texroot=%OWNPATH%tex %*
+
+echo.
+echo.
+echo When you want to use context, you need to initialize the tree with:
+echo.
+echo %OWNPATH%tex\setuptex.bat %OWNPATH%tex
+echo.
+echo You can associate this command with a shortcut to the cmd prompt.
+echo.
+echo Alternatively you can add %OWNPATH%tex\texmf-%PLATFORM%\bin to your PATH
+echo variable.
+echo.
+echo If you run from an editor you can specify the full path to mtxrun.exe:
+echo.
+echo. %OWNPATH%tex\texmf-%PLATFORM%\bin\mtxrun.exe --autogenerate --script context --autopdf ...
+echo.
+
+:ruby
+
+echo okay > ok.log
+
+ruby -e "File.delete('ok.log')"
+
+if not exist "ok.log" goto end
+
+echo.
+echo The distribution has been downloaded but if you want to run pdfTeX and/or XeTeX you
+echo need to run this script with the following directive:
+echo.
+echo --platform=all
+echo.
+echo You then also need to install Ruby in order to be able to use texexec. After
+echo installing Ruby you can run this script again which will give you the formats
+echo needed, or you can run:
+echo.
+echo texexec --make --pdftex
+echo texexec --make --xetex
+echo.
+
+:okay
+
+del /q ok.log
+
+:end
+
+endlocal
diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua
index 8679aefb10d..c3d4111626e 100644
--- a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua
+++ b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua
@@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 29808, stripped down to: 16182
+-- original size: 29983, stripped down to: 16202
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -474,7 +474,7 @@ local uppercase=R("AZ")
local underscore=P("_")
local hexdigit=digit+lowercase+uppercase
local cr,lf,crlf=P("\r"),P("\n"),P("\r\n")
-local newline=crlf+S("\r\n")
+local newline=P("\r")*(P("\n")+P(true))+P("\n")
local escaped=P("\\")*anything
local squote=P("'")
local dquote=P('"')
@@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le
patterns.utfbom_16_be=utfbom_16_be
patterns.utfbom_16_le=utfbom_16_le
patterns.utfbom_8=utfbom_8
-patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
-patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
+patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
+patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
patterns.utf8one=R("\000\127")
patterns.utf8two=R("\194\223")*utf8next
patterns.utf8three=R("\224\239")*utf8next*utf8next
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 25607, stripped down to: 16617
+-- original size: 25613, stripped down to: 16617
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.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-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 : 694558
--- stripped bytes : 246497
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exe b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exe
new file mode 100755
index 00000000000..0e7882cf926
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrunjit.exe
Binary files differ
diff --git a/Master/texmf-dist/scripts/context/stubs/setup/setuptex b/Master/texmf-dist/scripts/context/stubs/setup/setuptex
new file mode 100644
index 00000000000..d41e3670757
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/setup/setuptex
@@ -0,0 +1,167 @@
+# Example setup file for ConTeXt distribution
+#
+# Author: Hans Hagen
+# Patches: Arthur R. & Mojca M.
+#
+# Usage:
+# . setuptex [texroot]
+#
+# On the first run also execute:
+# mktexlsr
+# texexec --make --alone
+
+#
+# PLATFORM
+#
+
+# we will try to guess the platform first
+# (needs to be kept in sync with first-setup.sh and mtxrun)
+# if yours is missing, let us know
+
+system=`uname -s`
+cpu=`uname -m`
+
+case "$system" in
+ # linux
+ Linux)
+ case "$cpu" in
+ i*86) platform="linux" ;;
+ x86_64|ia64) platform="linux-64" ;;
+ # a little bit of cheating with ppc64 (won't work on Gentoo)
+ ppc|ppc64) platform="linux-ppc" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # Mac OS X
+ Darwin)
+ case "$cpu" in
+ i*86) platform="osx-intel" ;;
+ x86_64) platform="osx-64" ;;
+ ppc*|powerpc|power*|Power*) platform="osx-ppc" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # FreeBSD
+ FreeBSD|freebsd)
+ case "$cpu" in
+ i*86) platform="freebsd" ;;
+ x86_64) platform="freebsd" ;;
+ amd64) platform="freebsd-amd64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # kFreeBSD (Debian)
+ GNU/kFreeBSD)
+ case "$cpu" in
+ i*86) platform="kfreebsd-i386" ;;
+ x86_64|amd64) platform="kfreebsd-amd64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # cygwin
+ CYGWIN)
+ case "$cpu" in
+ i*86) platform="cygwin" ;;
+ x86_64|ia64) platform="cygwin-64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # SunOS/Solaris
+ SunOS)
+ case "$cpu" in
+ sparc) platform="solaris-sparc" ;;
+ i86pc) platform="solaris-intel" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ *) platform="unknown"
+esac
+
+# temporary fix for Snow Leopard
+if test "$platform" = "osx-intel"; then
+ # running Snow Leopard or later
+ if test `uname -r|cut -f1 -d"."` -ge 10 ; then
+ # working on 64-bit hardware
+ if test `sysctl -n hw.cpu64bit_capable` = 1; then
+ platform="osx-64"
+ fi
+ fi
+fi
+
+if test "$platform" = "unknown" ; then
+ echo "Error: your system \"$system $cpu\" is not supported yet."
+ echo "Please report to the ConTeXt mailing-list (ntg-context@ntg.nl)"
+fi
+
+#
+# PATH
+#
+
+# this resolves to path of the setuptex script
+# We use $0 for determine the path to the script, except for:
+# * bash where $0 always is bash; here we use BASH_SOURCE
+# * ksh93 where we use ${.sh.file}
+# Thanks to Vasile Gaburici and Alessandro Perucchi for reporting this
+# * http://www.ntg.nl/pipermail/ntg-context/2008/033953.html
+# * http://www.ntg.nl/pipermail/ntg-context/2012/068658.html
+if [ z"$BASH_SOURCE" != z ]; then
+ SCRIPTPATH="$BASH_SOURCE"
+elif [ z"$KSH_VERSION" != z ]; then
+ SCRIPTPATH="${.sh.file}"
+else
+ SCRIPTPATH="$0"
+fi
+
+OWNPATH=$(cd -P -- "$(dirname -- "$SCRIPTPATH")" && pwd -P)
+
+# but one can also call
+# . setuptex path-to-tree
+
+TEXROOT=""
+# first check if any path has been provided in the argument, and try to use that one
+if [ $# -ne 0 ] ; then
+ # TODO: resolve any errors
+ ARGPATH=$(cd -P -- "$(dirname -- "$1")" && pwd -P) && ARGPATH=$ARGPATH/$(basename -- "$1")
+ if test -f "$ARGPATH/texmf/tex/plain/base/plain.tex" ; then
+ if [ -d "$ARGPATH/texmf-$platform/bin" ]; then
+ TEXROOT="$ARGPATH"
+ else
+ echo "Binaries for platform '$platform' are missing."
+ echo "(There is no folder \"$ARGPATH/texmf-$platform/bin\")"
+ fi
+ else
+ echo "The argument \"$ARGPATH\" is not a valid TEXROOT path."
+ echo "(There is no file \"$ARGPATH/texmf/tex/plain/base/plain.tex\")"
+
+ if [ -f "$OWNPATH/texmf/tex/plain/base/plain.tex" ]; then
+ TEXROOT="$OWNPATH"
+ fi
+ fi
+else
+ if [ -f "$OWNPATH/texmf/tex/plain/base/plain.tex" ]; then
+ if [ -d "$OWNPATH/texmf-$platform/bin" ]; then
+ TEXROOT="$OWNPATH"
+ else
+ echo "Binaries for platform '$platform' are missing."
+ echo "(There is no folder \"$OWNPATH/texmf-$platform/bin\")"
+ fi
+ else
+ echo "\"$OWNPATH\" is not a valid TEXROOT path."
+ echo "(There is no file \"$OWNPATH/texmf/tex/plain/base/plain.tex\")"
+ fi
+fi
+
+if [ "$TEXROOT" != "" ]; then
+ # for Alan Braslau's server :)
+ if [ "x$PS1" != "x" ] ; then
+ echo "Setting \"$TEXROOT\" as ConTeXt root."
+ fi
+
+# ConTeXt binaries have to be added to PATH
+TEXMFOS=$TEXROOT/texmf-$platform
+export PATH=$TEXMFOS/bin:$PATH
+
+# unset variables that won't be used lately
+unset platform cpu system OWNPATH SCRIPTPATH ARGPATH TEXMFOS
+
+# not sure why this would be needed
+# export CTXMINIMAL=yes
+
+else
+ echo "provide a proper tex root (like '. setuptex /something/tex')" ;
+fi
+
diff --git a/Master/texmf-dist/scripts/context/stubs/setup/setuptex.bat b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.bat
new file mode 100755
index 00000000000..b61fd44941e
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.bat
@@ -0,0 +1,70 @@
+@ECHO OFF
+
+REM author: Hans Hagen - PRAGMA ADE - Hasselt NL - www.pragma-ade.com
+
+:userpath
+
+if "%SETUPTEX%"=="done" goto done
+
+if "%~s1"=="" goto selftest
+
+set TEXMFOS=%~s1texmf-mswin-64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~s1\texmf-mswin-64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~s1texmf-win64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~s1\texmf-win64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~s1texmf-mswin
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~s1\texmf-mswin
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~s1texmf-win32
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~s1\texmf-win32
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+:selftest
+
+set TEXMFOS=%~d0%~p0texmf-mswin-64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~d0%~p0\texmf-mswin-64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~d0%~p0texmf-win64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~d0%~p0\texmf-win64
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~d0%~p0texmf-mswin
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~d0%~p0\texmf-mswin
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~d0%~p0texmf-win32
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+set TEXMFOS=%~d0%~p0\texmf-win32
+if exist %TEXMFOS%\bin\mtxrun.exe goto start
+
+:start
+
+set PATH=%TEXMFOS%\bin;%PATH%
+
+:register
+
+set SETUPTEX=done
+set CTXMINIMAL=yes
+
+:done
diff --git a/Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh
new file mode 100644
index 00000000000..c1160675fb4
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/setup/setuptex.csh
@@ -0,0 +1,164 @@
+# Example setup file for ConTeXt distribution
+#
+# Author: Hans Hagen
+# Patches: Arthur R. & Mojca M.
+# (t)csh version: Alan B.
+#
+# Usage :
+# source setuptex.csh [texroot]
+#
+# On the first run also execute:
+# mktexlsr
+# texexec --make --alone
+
+echo "We are considering removing setuptex.csh in case that nobody uses it."
+echo "If you still use this file please drop us some mail at"
+echo " gardeners (at) contextgarden (dot) net"
+echo "If we don't get any response, we will delete it in near future."
+
+#
+# PLATFORM
+#
+
+# we will try to guess the platform first
+# (needs to be kept in sync with first-setup.sh and mtxrun)
+# if yours is missing, let us know
+
+set system=`uname -s`
+set cpu=`uname -m`
+
+switch ( $system )
+ # linux
+ case Linux:
+ switch ( $cpu )
+ case i*86:
+ set platform="linux"
+ breaksw
+ case x86_64:
+ case ia64:
+ set platform="linux-64"
+ breaksw
+ case ppc:
+ case ppc64:
+ set platform="linux-ppc"
+ breaksw
+ default:
+ set platform="unknown"
+ endsw
+ breaksw
+ # Mac OS X
+ case Darwin:
+ switch ( $cpu )
+ case i*86:
+ set platform="osx-intel"
+ breaksw
+ case x86_64:
+ set platform="osx-64"
+ breaksw
+ case ppc*:
+ case powerpc:
+ case power*:
+ case Power*:
+ set platform="osx-ppc"
+ breaksw
+ default:
+ set platform="unknown"
+ endsw
+ breaksw
+ # FreeBSD
+ case FreeBSD:
+ case freebsd:
+ switch ( $cpu )
+ case i*86:
+ set platform="freebsd"
+ breaksw
+ case x86_64:
+ set platform="freebsd"
+ breaksw
+ case amd64:
+ set platform="freebsd-amd64"
+ breaksw
+ default:
+ set platform="unknown"
+ endsw
+ breaksw
+ # cygwin
+ case CYGWIN:
+ switch ( $cpu )
+ case i*86:
+ set platform="cygwin"
+ breaksw
+ case x86_64:
+ case ia64:
+ set platform="cygwin-64"
+ breaksw
+ default:
+ set platform="unknown"
+ endsw
+ breaksw
+ # SunOS/Solaris
+ case SunOS:
+ switch ( $cpu )
+ case sparc:
+ set platform="solaris-sparc"
+ breaksw
+ case i86pc:
+ set platform="solaris-intel"
+ default:
+ set platform="unknown"
+ endsw
+ breaksw
+ # Other
+ default:
+ set platform="unknown"
+endsw
+
+if ( $platform == "unknown" ) then
+ echo Error: your system \"$system $cpu\" is not supported yet.
+ echo Please report to the ConTeXt mailing-list (ntg-context@ntg.nl).
+endif
+
+#
+# PATH
+#
+
+# this resolves to path of the setuptex script
+# We use $0 for determine the path to the script, except for bash and (t)csh where $0
+# always is bash or (t)csh.
+
+# but one can also call
+# . setuptex path-to-tex-tree
+
+# first check if any path has been provided in the argument, and try to use that one
+if ( $# > 0 ) then
+ setenv TEXROOT $1
+else
+ # $_ should be `history -h 1` but doesn't seem to work...
+ set cmd=`history -h 1`
+ if ( $cmd[2]:h == $cmd[2]:t ) then
+ setenv TEXROOT $cwd
+ else
+ setenv TEXROOT $cmd[2]:h
+ endif
+ unset cmd
+endif
+cd $TEXROOT; setenv TEXROOT $cwd; cd -
+
+if ( -f "$TEXROOT/texmf/tex/plain/base/plain.tex" ) then
+ echo Setting \"$TEXROOT\" as TEXROOT.
+else
+ echo \"$TEXROOT\" is not a valid TEXROOT path.
+ echo There is no file \"$TEXROOT/texmf/tex/plain/base/plain.tex\".
+ echo Please provide a proper tex root (like \"source setuptex /path/tex\")
+ unsetenv TEXROOT
+ exit
+endif
+
+unsetenv TEXINPUTS MPINPUTS MFINPUTS
+
+# ConTeXt binaries have to be added to PATH
+setenv TEXMFOS $TEXROOT/texmf-$platform
+setenv PATH $TEXMFOS/bin:$PATH
+# TODO: we could set OSFONTDIR on Mac for example
+
+# setenv CTXMINIMAL yes
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/contextjit b/Master/texmf-dist/scripts/context/stubs/unix/contextjit
new file mode 100755
index 00000000000..5ac1947c78e
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/unix/contextjit
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+luajittex --luaonly $(dirname $0)/mtxrun --script context "$@"
+
+# luajittex --luaonly ${0%contextjit}mtxrun --script context "$@"
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/ctxtools b/Master/texmf-dist/scripts/context/stubs/unix/ctxtools
deleted file mode 100755
index 2e6bd4afaa0..00000000000
--- a/Master/texmf-dist/scripts/context/stubs/unix/ctxtools
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-mtxrun --script ctxtools "$@"
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mptopdf b/Master/texmf-dist/scripts/context/stubs/unix/mptopdf
deleted file mode 100755
index 1473337405a..00000000000
--- a/Master/texmf-dist/scripts/context/stubs/unix/mptopdf
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-mtxrun --script mptopdf "$@"
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun
index 8679aefb10d..c3d4111626e 100755
--- a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun
+++ b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun
@@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 29808, stripped down to: 16182
+-- original size: 29983, stripped down to: 16202
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -474,7 +474,7 @@ local uppercase=R("AZ")
local underscore=P("_")
local hexdigit=digit+lowercase+uppercase
local cr,lf,crlf=P("\r"),P("\n"),P("\r\n")
-local newline=crlf+S("\r\n")
+local newline=P("\r")*(P("\n")+P(true))+P("\n")
local escaped=P("\\")*anything
local squote=P("'")
local dquote=P('"')
@@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le
patterns.utfbom_16_be=utfbom_16_be
patterns.utfbom_16_le=utfbom_16_le
patterns.utfbom_8=utfbom_8
-patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
-patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
+patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
+patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
patterns.utf8one=R("\000\127")
patterns.utf8two=R("\194\223")*utf8next
patterns.utf8three=R("\224\239")*utf8next*utf8next
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 25607, stripped down to: 16617
+-- original size: 25613, stripped down to: 16617
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.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-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 : 694558
--- stripped bytes : 246497
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mtxrunjit b/Master/texmf-dist/scripts/context/stubs/unix/mtxrunjit
new file mode 100755
index 00000000000..117105aa5c0
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/unix/mtxrunjit
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+luajittex --luaonly $(dirname $0)/mtxrun "$@"
+
+# luajittex --luaonly ${0%jit} "$@"
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/pstopdf b/Master/texmf-dist/scripts/context/stubs/unix/pstopdf
deleted file mode 100755
index 116f5f4a32e..00000000000
--- a/Master/texmf-dist/scripts/context/stubs/unix/pstopdf
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-mtxrun --script pstopdf "$@"
diff --git a/Master/texmf-dist/scripts/context/stubs/win64/contextjit.exe b/Master/texmf-dist/scripts/context/stubs/win64/contextjit.exe
new file mode 100755
index 00000000000..93290a6e0a8
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/win64/contextjit.exe
Binary files differ
diff --git a/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua b/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua
index 8679aefb10d..c3d4111626e 100644
--- a/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua
+++ b/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua
@@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 29808, stripped down to: 16182
+-- original size: 29983, stripped down to: 16202
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -474,7 +474,7 @@ local uppercase=R("AZ")
local underscore=P("_")
local hexdigit=digit+lowercase+uppercase
local cr,lf,crlf=P("\r"),P("\n"),P("\r\n")
-local newline=crlf+S("\r\n")
+local newline=P("\r")*(P("\n")+P(true))+P("\n")
local escaped=P("\\")*anything
local squote=P("'")
local dquote=P('"')
@@ -496,8 +496,8 @@ patterns.utfbom_32_le=utfbom_32_le
patterns.utfbom_16_be=utfbom_16_be
patterns.utfbom_16_le=utfbom_16_le
patterns.utfbom_8=utfbom_8
-patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
-patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
+patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
+patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
patterns.utf8one=R("\000\127")
patterns.utf8two=R("\194\223")*utf8next
patterns.utf8three=R("\224\239")*utf8next*utf8next
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -7180,7 +7184,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 25607, stripped down to: 16617
+-- original size: 25613, stripped down to: 16617
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.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-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 : 694558
--- stripped bytes : 246497
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/Master/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exe b/Master/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exe
new file mode 100755
index 00000000000..93290a6e0a8
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/win64/mtxrunjit.exe
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/back-exp.lua b/Master/texmf-dist/tex/context/base/back-exp.lua
index 79538eb728b..44c2cd539b2 100644
--- a/Master/texmf-dist/tex/context/base/back-exp.lua
+++ b/Master/texmf-dist/tex/context/base/back-exp.lua
@@ -2446,3 +2446,4 @@ commands.settagfigure = structurestags.setfigure
commands.settagcombination = structurestags.setcombination
commands.settagtablecell = structurestags.settablecell
commands.settagtabulatecell = structurestags.settabulatecell
+
diff --git a/Master/texmf-dist/tex/context/base/back-ini.lua b/Master/texmf-dist/tex/context/base/back-ini.lua
index e2dabd91e9b..c1f973a0c6f 100644
--- a/Master/texmf-dist/tex/context/base/back-ini.lua
+++ b/Master/texmf-dist/tex/context/base/back-ini.lua
@@ -103,3 +103,9 @@ function codeinjections.gethpos () return 0 end
function codeinjections.getvpos () return 0 end
function codeinjections.hasmatrix() return false end
function codeinjections.getmatrix() return 1, 0, 0, 1, 0, 0 end
+
+-- can best be here
+
+function commands.setrealspaces(v)
+ nodes.tasks.setaction("shipouts","nodes.handlers.accessibility",v == interfaces.variables.yes)
+end
diff --git a/Master/texmf-dist/tex/context/base/back-ini.mkiv b/Master/texmf-dist/tex/context/base/back-ini.mkiv
index de4ba6138e7..c3bc78ae660 100644
--- a/Master/texmf-dist/tex/context/base/back-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/back-ini.mkiv
@@ -154,4 +154,10 @@
\back_job_set_suffix{pdf} % default
+% \setupbackend[space=yes] % replace spacing in (pdf) file
+
+\appendtoks
+ \ctxcommand{setrealspaces("\backendparameter\c!space")}%
+\to \everysetupbackend
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/back-u3d.mkiv b/Master/texmf-dist/tex/context/base/back-u3d.mkiv
index 89d26ee41e8..297dd554579 100644
--- a/Master/texmf-dist/tex/context/base/back-u3d.mkiv
+++ b/Master/texmf-dist/tex/context/base/back-u3d.mkiv
@@ -127,7 +127,7 @@
\startluaparameterset[u3d:myset:display:3]
toolbar = true,
tree = false,
- preview = 'area.png'
+ preview = 'axes.png'
\stopluaparameterset
\startluaparameterset[u3d:myset:display:4]
diff --git a/Master/texmf-dist/tex/context/base/char-ini.lua b/Master/texmf-dist/tex/context/base/char-ini.lua
index d6e8d18a94d..7dc381031fc 100644
--- a/Master/texmf-dist/tex/context/base/char-ini.lua
+++ b/Master/texmf-dist/tex/context/base/char-ini.lua
@@ -459,29 +459,33 @@ local is_mark = allocate ( tohash {
"mn", "ms",
} )
+local is_punctuation = allocate ( tohash {
+ "pc","pd","ps","pe","pi","pf","po",
+} )
+
-- to be redone: store checked characters
-characters.is_character = is_character
-characters.is_letter = is_letter
-characters.is_command = is_command
-characters.is_spacing = is_spacing
-characters.is_mark = is_mark
-
-local mt = { -- yes or no ?
- __index = function(t,k)
- if type(k) == "number" then
- local c = data[k].category
- return c and rawget(t,c)
- else
- -- avoid auto conversion in data.characters lookups
- end
+characters.is_character = is_character
+characters.is_letter = is_letter
+characters.is_command = is_command
+characters.is_spacing = is_spacing
+characters.is_mark = is_mark
+characters.is_punctuation = is_punctuation
+
+local mti = function(t,k)
+ if type(k) == "number" then
+ local c = data[k].category
+ return c and rawget(t,c)
+ else
+ -- avoid auto conversion in data.characters lookups
end
-}
+end
-setmetatableindex(characters.is_character, mt)
-setmetatableindex(characters.is_letter, mt)
-setmetatableindex(characters.is_command, mt)
-setmetatableindex(characters.is_spacing, mt)
+setmetatableindex(characters.is_character, mti)
+setmetatableindex(characters.is_letter, mti)
+setmetatableindex(characters.is_command, mti)
+setmetatableindex(characters.is_spacing, mti)
+setmetatableindex(characters.is_punctuation,mti)
-- todo: also define callers for the above
@@ -776,6 +780,17 @@ function characters.lower (str) return lpegmatch(tolower,str) end
function characters.upper (str) return lpegmatch(toupper,str) end
function characters.shaped(str) return lpegmatch(toshape,str) end
+-- maybe: (twice as fast when much ascii)
+--
+-- local tolower = lpeg.patterns.tolower
+-- local lower = string.lower
+--
+-- local allascii = R("\000\127")^1 * P(-1)
+--
+-- function characters.checkedlower(str)
+-- return lpegmatch(allascii,str) and lower(str) or lpegmatch(tolower,str) or str
+-- end
+
function characters.lettered(str,spacing)
local new, n = { }, 0
if spacing then
diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkiv b/Master/texmf-dist/tex/context/base/cont-new.mkiv
index cf9aa9a870d..e20a7df915f 100644
--- a/Master/texmf-dist/tex/context/base/cont-new.mkiv
+++ b/Master/texmf-dist/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2014.05.05 22:31}
+\newcontextversion{2014.05.18 15:57}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/Master/texmf-dist/tex/context/base/context-version.pdf b/Master/texmf-dist/tex/context/base/context-version.pdf
index b544f56fea8..acc0c1f3671 100644
--- a/Master/texmf-dist/tex/context/base/context-version.pdf
+++ b/Master/texmf-dist/tex/context/base/context-version.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/context.mkiv b/Master/texmf-dist/tex/context/base/context.mkiv
index 9ef439e45d5..abf7d5c140d 100644
--- a/Master/texmf-dist/tex/context/base/context.mkiv
+++ b/Master/texmf-dist/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2014.05.05 22:31}
+\edef\contextversion{2014.05.18 15:57}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/Master/texmf-dist/tex/context/base/data-tex.lua b/Master/texmf-dist/tex/context/base/data-tex.lua
index f5c986d7708..04c5ef469ee 100644
--- a/Master/texmf-dist/tex/context/base/data-tex.lua
+++ b/Master/texmf-dist/tex/context/base/data-tex.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['data-tex'] = {
license = "see context related readme files"
}
-local char = string.char
+local char, find = string.char, string.find
local insert, remove = table.insert, table.remove
local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
@@ -15,10 +15,11 @@ local report_tex = logs.reporter("resolvers","tex")
local resolvers = resolvers
-local sequencers = utilities.sequencers
-local methodhandler = resolvers.methodhandler
-local splitlines = string.splitlines
-local utffiletype = utf.filetype
+local sequencers = utilities.sequencers
+local methodhandler = resolvers.methodhandler
+local splitlines = string.splitlines
+local utffiletype = utf.filetype
+local setmetatableindex = table.setmetatableindex
-- local fileprocessor = nil
-- local lineprocessor = nil
@@ -99,10 +100,11 @@ function helpers.textopener(tag,filename,filehandle,coding)
end
logs.show_open(filename)
insert(inputstack,filename)
- return {
+ local currentline, noflines = 0, noflines
+ local t = {
filename = filename,
noflines = noflines,
- currentline = 0,
+ -- currentline = 0,
close = function()
if trace_locating then
report_tex("%a closer: %a closed",tag,filename)
@@ -113,12 +115,12 @@ function helpers.textopener(tag,filename,filehandle,coding)
end,
reader = function(self)
self = self or t
- local currentline, noflines = self.currentline, self.noflines
+ -- local currentline, noflines = self.currentline, self.noflines
if currentline >= noflines then
return nil
else
currentline = currentline + 1
- self.currentline = currentline
+ -- self.currentline = currentline
local content = lines[currentline]
if not content then
return nil
@@ -137,6 +139,14 @@ function helpers.textopener(tag,filename,filehandle,coding)
end
end
}
+ setmetatableindex(t,function(t,k)
+ if k == "currentline" then
+ return currentline
+ else
+ -- no such key
+ end
+ end)
+ return t
end
function resolvers.findtexfile(filename,filetype)
diff --git a/Master/texmf-dist/tex/context/base/font-con.lua b/Master/texmf-dist/tex/context/base/font-con.lua
index b43961ec62e..aca7055235e 100644
--- a/Master/texmf-dist/tex/context/base/font-con.lua
+++ b/Master/texmf-dist/tex/context/base/font-con.lua
@@ -599,6 +599,7 @@ function constructors.scale(tfmdata,specification)
-- basemode hack (we try to catch missing tounicodes, e.g. needed for ssty in math cambria)
local c = changed[unicode]
if c then
+ local ligatures = character.ligatures -- the original ligatures (as we cannot rely on remapping)
description = descriptions[c] or descriptions[unicode] or character
character = characters[c] or character
index = description.index or c
@@ -610,6 +611,9 @@ function constructors.scale(tfmdata,specification)
touni = tounicode[i] -- nb: index!
end
end
+ if ligatures and not character.ligatures then
+ character.ligatures = ligatures -- the original targets (for now at least.. see libertine smallcaps)
+ end
else
description = descriptions[unicode] or character
index = description.index or unicode
@@ -780,7 +784,7 @@ function constructors.scale(tfmdata,specification)
chr.ligatures = vl -- shared
else
local tt = { }
- for i,l in next, vl do
+ for i, l in next, vl do
tt[i] = l
end
chr.ligatures = tt
@@ -963,7 +967,6 @@ function constructors.finalize(tfmdata)
--
properties.finalized = true
--
- --
return tfmdata
end
diff --git a/Master/texmf-dist/tex/context/base/font-otb.lua b/Master/texmf-dist/tex/context/base/font-otb.lua
index 946d552e48c..2e98d3ecbb9 100644
--- a/Master/texmf-dist/tex/context/base/font-otb.lua
+++ b/Master/texmf-dist/tex/context/base/font-otb.lua
@@ -47,13 +47,14 @@ local function gref(descriptions,n)
return f_unicode(n)
end
elseif n then
- local num, nam = { }, { }
- for i=2,#n do
+ local num, nam, j = { }, { }, 0
+ for i=1,#n do
local ni = n[i]
if tonumber(ni) then -- first is likely a key
+ j = j + 1
local di = descriptions[ni]
- num[i] = f_unicode(ni)
- nam[i] = di and di.name or "-"
+ num[j] = f_unicode(ni)
+ nam[j] = di and di.name or "-"
end
end
return f_unilist(num,nam)
@@ -169,7 +170,8 @@ end
-- pseudo names like hyphen_hyphen to endash so in practice we end
-- up with a bit too many definitions but the overhead is neglectable.
--
--- Todo: if changed[first] or changed[second] then ... end
+-- We can have changed[first] or changed[second] but it quickly becomes
+-- messy if we need to take that into account.
local trace = false
@@ -188,8 +190,8 @@ local function finalize_ligatures(tfmdata,ligatures)
local ligature = ligatures[i]
if ligature then
local unicode, lookupdata = ligature[1], ligature[2]
- if trace then
- trace_ligatures_detail("building % a into %a",lookupdata,unicode)
+ if trace_ligatures_detail then
+ report_prepare("building % a into %a",lookupdata,unicode)
end
local size = #lookupdata
local firstcode = lookupdata[1] -- [2]
@@ -201,8 +203,8 @@ local function finalize_ligatures(tfmdata,ligatures)
local firstdata = characters[firstcode]
if not firstdata then
firstcode = private
- if trace then
- trace_ligatures_detail("defining %a as %a",firstname,firstcode)
+ if trace_ligatures_detail then
+ report_prepare("defining %a as %a",firstname,firstcode)
end
unicodes[firstname] = firstcode
firstdata = { intermediate = true, ligatures = { } }
@@ -225,8 +227,8 @@ local function finalize_ligatures(tfmdata,ligatures)
break
end
end
- if trace then
- trace_ligatures_detail("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target)
+ if trace_ligatures_detail then
+ report_prepare("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target)
end
local firstligs = firstdata.ligatures
if firstligs then
@@ -237,6 +239,8 @@ local function finalize_ligatures(tfmdata,ligatures)
firstcode = target
firstname = secondname
end
+ elseif trace_ligatures_detail then
+ report_prepare("no glyph (%a,%a) for building %a",firstname,firstcode,target)
end
if okay then
ligatures[i] = false
@@ -246,12 +250,14 @@ local function finalize_ligatures(tfmdata,ligatures)
end
alldone = done == 0
end
- if trace then
- for k, v in next, characters do
- if v.ligatures then table.print(v,k) end
+ if trace_ligatures_detail then
+ for k, v in table.sortedhash(characters) do
+ if v.ligatures then
+ table.print(v,k)
+ end
end
end
- tfmdata.resources.private = private
+ resources.private = private
end
end
@@ -487,7 +493,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
end
changed[unicode] = data
elseif lookuptype == "alternate" then
- local replacement = data[alternate]
+ local replacement = data[alternate]
if replacement then
changed[unicode] = replacement
if trace_alternatives then
diff --git a/Master/texmf-dist/tex/context/base/font-otc.lua b/Master/texmf-dist/tex/context/base/font-otc.lua
index 92775270dc3..f7f8e9ce2c1 100644
--- a/Master/texmf-dist/tex/context/base/font-otc.lua
+++ b/Master/texmf-dist/tex/context/base/font-otc.lua
@@ -134,7 +134,7 @@ local function addfeature(data,feature,specifications)
askedfeatures[k] = table.tohash(v)
end
end
- sequences[#sequences+1] = {
+ local sequence = {
chain = 0,
features = { [feature] = askedfeatures },
flags = featureflags,
@@ -143,6 +143,11 @@ local function addfeature(data,feature,specifications)
subtables = st,
type = featuretype,
}
+ if specification.prepend then
+ insert(sequences,1,sequence)
+ else
+ insert(sequences,sequence)
+ end
-- register in metadata (merge as there can be a few)
if not gsubfeatures then
gsubfeatures = { }
@@ -208,6 +213,7 @@ local tlig_specification = {
data = tlig,
order = { "tlig" },
flags = noflags,
+ prepend = true,
}
otf.addfeature("tlig",tlig_specification)
@@ -231,6 +237,7 @@ local trep_specification = {
data = trep,
order = { "trep" },
flags = noflags,
+ prepend = true,
}
otf.addfeature("trep",trep_specification)
diff --git a/Master/texmf-dist/tex/context/base/grph-inc.lua b/Master/texmf-dist/tex/context/base/grph-inc.lua
index 392aa58b12e..d89c52996c7 100644
--- a/Master/texmf-dist/tex/context/base/grph-inc.lua
+++ b/Master/texmf-dist/tex/context/base/grph-inc.lua
@@ -1619,3 +1619,7 @@ end
-- interfacing
commands.setfigurelookuporder = figures.setorder
+
+--
+
+figures.images = images
diff --git a/Master/texmf-dist/tex/context/base/l-lpeg.lua b/Master/texmf-dist/tex/context/base/l-lpeg.lua
index 6feb7089c74..666af210386 100644
--- a/Master/texmf-dist/tex/context/base/l-lpeg.lua
+++ b/Master/texmf-dist/tex/context/base/l-lpeg.lua
@@ -107,7 +107,8 @@ local uppercase = R("AZ")
local underscore = P("_")
local hexdigit = digit + lowercase + uppercase
local cr, lf, crlf = P("\r"), P("\n"), P("\r\n")
-local newline = crlf + S("\r\n") -- cr + lf
+----- newline = crlf + S("\r\n") -- cr + lf
+local newline = P("\r") * (P("\n") + P(true)) + P("\n")
local escaped = P("\\") * anything
local squote = P("'")
local dquote = P('"')
@@ -141,8 +142,8 @@ patterns.utfbom_16_be = utfbom_16_be
patterns.utfbom_16_le = utfbom_16_le
patterns.utfbom_8 = utfbom_8
-patterns.utf_16_be_nl = P("\000\r\000\n") + P("\000\r") + P("\000\n")
-patterns.utf_16_le_nl = P("\r\000\n\000") + P("\r\000") + P("\n\000")
+patterns.utf_16_be_nl = P("\000\r\000\n") + P("\000\r") + P("\000\n") -- P("\000\r") * (P("\000\n") + P(true)) + P("\000\n")
+patterns.utf_16_le_nl = P("\r\000\n\000") + P("\r\000") + P("\n\000") -- P("\r\000") * (P("\n\000") + P(true)) + P("\n\000")
patterns.utf8one = R("\000\127")
patterns.utf8two = R("\194\223") * utf8next
diff --git a/Master/texmf-dist/tex/context/base/lpdf-grp.lua b/Master/texmf-dist/tex/context/base/lpdf-grp.lua
index befe52c7656..b3cc7ce1f5f 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-grp.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-grp.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['lpdf-grp'] = {
license = "see context related readme files"
}
-local format, gsub = string.format, string.gsub
+local formatters, gsub = string.formatters, string.gsub
local concat = table.concat
local round = math.round
@@ -236,7 +236,7 @@ function img.package(image) -- see lpdf-u3d **
local height = boundingbox[4]
local xform = img.scan {
attr = resources(),
- stream = format("%F 0 0 %F 0 0 cm /%s Do",width,height,imagetag),
+ stream = formatters["%F 0 0 %F 0 0 cm /%s Do"](width,height,imagetag),
bbox = { 0, 0, width/factor, height/factor },
}
img.immediatewrite(xform)
diff --git a/Master/texmf-dist/tex/context/base/lpdf-ini.lua b/Master/texmf-dist/tex/context/base/lpdf-ini.lua
index a89b8b8c55a..025f62c4f84 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-ini.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-ini.lua
@@ -254,6 +254,8 @@ local f_key_dictionary = formatters["/%s << % t >>"]
local f_dictionary = formatters["<< % t >>"]
local f_key_array = formatters["/%s [ % t ]"]
local f_array = formatters["[ % t ]"]
+local f_key_number = formatters["/%s %F"]
+local f_tonumber = formatters["%F"]
-- local f_key_value = formatters["/%s %s"]
-- local f_key_dictionary = formatters["/%s <<% t>>"]
@@ -271,6 +273,8 @@ tostring_d = function(t,contentonly,key)
local tv = type(v)
if tv == "string" then
r[rn] = f_key_value(k,toeight(v))
+ elseif tv == "number" then
+ r[rn] = f_key_number(k,v)
elseif tv == "unicode" then
r[rn] = f_key_value(k,tosixteen(v))
elseif tv == "table" then
@@ -309,6 +313,8 @@ tostring_a = function(t,contentonly,key)
local tv = type(v)
if tv == "string" then
r[k] = toeight(v)
+ elseif tv == "number" then
+ r[k] = f_tonumber(v)
elseif tv == "unicode" then
r[k] = tosixteen(v)
elseif tv == "table" then
@@ -339,14 +345,15 @@ tostring_a = function(t,contentonly,key)
end
end
-local tostring_x = function(t) return concat(t," ") end
-local tostring_s = function(t) return toeight(t[1]) end
-local tostring_u = function(t) return tosixteen(t[1]) end
-local tostring_n = function(t) return tostring(t[1]) end -- tostring not needed
-local tostring_c = function(t) return t[1] end -- already prefixed (hashed)
-local tostring_z = function() return "null" end
-local tostring_t = function() return "true" end
-local tostring_f = function() return "false" end
+local tostring_x = function(t) return concat(t," ") end
+local tostring_s = function(t) return toeight(t[1]) end
+local tostring_u = function(t) return tosixteen(t[1]) end
+local tostring_n = function(t) return tostring(t[1]) end -- tostring not needed
+local tostring_n = function(t) return f_tonumber(t[1]) end -- tostring not needed
+local tostring_c = function(t) return t[1] end -- already prefixed (hashed)
+local tostring_z = function() return "null" end
+local tostring_t = function() return "true" end
+local tostring_f = function() return "false" end
local tostring_r = function(t) local n = t[1] return n and n > 0 and (n .. " 0 R") or "NULL" end
local tostring_v = function(t)
diff --git a/Master/texmf-dist/tex/context/base/lpdf-u3d.lua b/Master/texmf-dist/tex/context/base/lpdf-u3d.lua
index f0fca0762f8..c9f4a03691e 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-u3d.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-u3d.lua
@@ -18,7 +18,7 @@ if not modules then modules = { } end modules ['lpdf-u3d'] = {
-- it makes sense to add the same activation code as with swf.
local tonumber = tonumber
-local format, find = string.format, string.find
+local formatters, find = string.formatters, string.find
local cos, sin, sqrt, pi, atan2, abs = math.cos, math.sin, math.sqrt, math.pi, math.atan2, math.abs
local backends, lpdf = backends, lpdf
@@ -428,13 +428,13 @@ local function insert3d(spec) -- width, height, factor, display, controls, label
local preview = checkedkey(param,"preview","string")
if preview then
activationdict.A = pdfconstant("XA")
- local tag = format("%s:%s:%s",label,stream,preview)
+ local tag = formatters["%s:%s:%s"](label,stream,preview)
local ref = stored_pr[tag]
if not ref then
local figure = img.immediatewrite {
filename = preview,
- width = width,
- height = height
+ width = width,
+ height = height
}
ref = figure.objnum
stored_pr[tag] = ref
@@ -461,7 +461,7 @@ local function insert3d(spec) -- width, height, factor, display, controls, label
},
ProcSet = pdfarray { pdfconstant("PDF"), pdfconstant("ImageC") },
}
- local pwd = pdfflushstreamobject(format("q /GS gs %F 0 0 %F 0 0 cm /IM Do Q",factor*width,factor*height),pw)
+ local pwd = pdfflushstreamobject(formatters["q /GS gs %F 0 0 %F 0 0 cm /IM Do Q"](factor*width,factor*height),pw)
annot.AP = pdfdictionary {
N = pdfreference(pwd)
}
diff --git a/Master/texmf-dist/tex/context/base/lxml-ini.mkiv b/Master/texmf-dist/tex/context/base/lxml-ini.mkiv
index 239fe4ac0c3..752e315da5e 100644
--- a/Master/texmf-dist/tex/context/base/lxml-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/lxml-ini.mkiv
@@ -27,77 +27,78 @@
\unprotect % todo \!!bs \!!es where handy (slower)
-\def\ctxlxml #1{\ctxlua{lxml.#1}}
-
-\def\xmlmain #1{\ctxlxml{main("#1")}}
-\def\xmlmatch #1{\ctxlxml{match("#1")}}
-\def\xmlall #1#2{\ctxlxml{all("#1","#2")}}
-\def\xmlatt #1#2{\ctxlxml{att("#1","#2")}}
-\def\xmlattdef #1#2#3{\ctxlxml{att("#1","#2","#3")}}
-\def\xmlchainatt #1#2{\ctxlxml{chainattribute("#1","/","#2")}}
-\def\xmlchainattdef #1#2#3{\ctxlxml{chainattribute("#1","/","#2","#3")}}
-\def\xmlattribute #1#2#3{\ctxlxml{attribute("#1","#2","#3")}}
-\def\xmlattributedef #1#2#3#4{\ctxlxml{attribute("#1","#2","#3","#4")}}
-\def\xmlcommand #1#2#3{\ctxlxml{command("#1","#2","#3")}}
-\def\xmlconcat #1#2#3{\ctxlxml{concat("#1","#2",[[\detokenize{#3}]])}}
-\def\xmlconcatrange#1#2#3#4#5{\ctxlxml{concatrange("#1","#2","#3","#4",[[\detokenize{#5}]])}}
-\def\xmlcount #1#2{\ctxlxml{count("#1","#2")}}
-\def\xmldelete #1#2{\ctxlxml{delete("#1","#2")}}
-\def\xmldirectives #1{\ctxlxml{directives.setup("#1")}}
-\def\xmldirectivesbefore #1{\ctxlxml{directives.before("#1")}}
-\def\xmldirectivesafter #1{\ctxlxml{directives.after("#1")}}
-\def\xmlfilter #1#2{\ctxlxml{filter("#1",\!!bs#2\!!es)}}
-\def\xmlfilterlist #1#2{\ctxlxml{filterlist("#1",\!!bs#2\!!es)}}
-\def\xmlfunction #1#2{\ctxlxml{applyfunction("#1",\!!bs#2\!!es)}}
-\def\xmlfirst #1#2{\ctxlxml{first("#1","#2")}}
-\def\xmlflush #1{\ctxlxml{flush("#1")}}
-\def\xmlflushlinewise #1{\ctxlxml{flushlinewise("#1")}}
-\def\xmlflushspacewise #1{\ctxlxml{flushspacewise("#1")}}
-%def\xmlcontent #1{\ctxlxml{content("#1")}}
-%def\xmlflushstripped #1{\ctxlxml{strip("#1",true)}}
-\def\xmldirect #1{\ctxlxml{direct("#1")}} % in loops, not dt but root
-\def\xmlidx #1#2#3{\ctxlxml{idx("#1","#2",\number#3)}}
-\def\xmlinclude #1#2#3{\ctxlxml{include("#1","#2","#3",true)}}
-\def\xmlsave #1#2{\ctxlxml{save("#1","#2")}}
-\def\xmlindex #1#2#3{\ctxlxml{index("#1","#2",\number#3)}}
-\def\xmlinfo #1{\hbox{\ttxx[\ctxlxml{info("#1")}]}}
-\def\xmlshow #1{\startpacked\ttx\xmlverbatim{#1}\stoppacked}
-\def\xmllast #1#2{\ctxlxml{last("#1","#2")}}
-\def\xmlname #1{\ctxlxml{name("#1")}}
-\def\xmlnamespace #1{\ctxlxml{namespace("#1")}}
-\def\xmlnonspace #1#2{\ctxlxml{nonspace("#1","#2")}}
-\def\xmlraw #1#2{\ctxlxml{raw("#1","#2")}}
-\def\xmlcontext #1#2{\ctxlxml{context("#1","#2")}}
-\def\xmlflushcontext #1{\ctxlxml{context("#1")}}
-\def\xmlsnippet #1#2{\ctxlxml{snippet("#1",#2)}}
-\def\xmlelement #1#2{\ctxlxml{element("#1",#2)}}
-\def\xmlregisterns #1#2{\ctxlua{xml.registerns("#1","#2")}} % document
-\def\xmlremapname #1#2#3#4{\ctxlua{xml.remapname(lxml.id("#1"),"#2","#3","#4")}} % element
-\def\xmlremapnamespace #1#2#3{\ctxlua{xml.renamespace(lxml.id("#1"),"#2","#3")}} % document
-\def\xmlchecknamespace #1#2#3{\ctxlua{xml.checknamespace(lxml.id("#1"),"#2","#3")}} % element
-\def\xmlsetfunction #1#2#3{\ctxlxml{setaction("#1",\!!bs#2\!!es,#3)}}
-\def\xmlsetsetup #1#2#3{\ctxlxml{setsetup("#1",\!!bs#2\!!es,"#3")}}
-\def\xmlstrip #1#2{\ctxlxml{strip("#1","#2")}}
-\def\xmlstripnolines #1#2{\ctxlxml{strip("#1","#2",true)}}
-\def\xmlstripanywhere #1#2{\ctxlxml{strip("#1","#2",true,true)}}
-\def\xmlstripped #1#2{\ctxlxml{stripped("#1","#2")}}
-\def\xmlstrippednolines #1#2{\ctxlxml{stripped("#1","#2",true)}}
-\def\xmltag #1{\ctxlxml{tag("#1")}}
-\def\xmltext #1#2{\ctxlxml{text("#1","#2")}}
-\def\xmlverbatim #1{\ctxlxml{verbatim("#1")}}
-\def\xmldisplayverbatim #1{\ctxlxml{displayverbatim("#1")}}
-\def\xmlinlineverbatim #1{\ctxlxml{inlineverbatim("#1")}}
-
-\def\xmlload #1#2{\ctxlxml{load("#1","#2","\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
-\def\xmlloadbuffer #1#2{\ctxlxml{loadbuffer("#1","#2","\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
-\def\xmlloaddata #1#2{\ctxlxml{loaddata("#1",\!!bs#2\!!es,"\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
-\def\xmlloadregistered #1#2{\ctxlxml{loadregistered("#1","\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
-\def\xmlloaddirectives #1{\ctxlxml{directives.load("any:///#1")}}
-\def\xmlpos #1{\ctxlxml{pos("#1")}}
-
-\def\xmltoparameters #1{\ctxlxml{toparameters("#1")}}
-
-\def\xmltofile #1#2#3{\ctxlxml{tofile("#1","#2","#3")}} % id pattern filename
+\def\ctxlxml #1{\ctxlua{lxml.#1}}
+
+\def\xmlmain #1{\ctxlxml{main("#1")}}
+\def\xmlmatch #1{\ctxlxml{match("#1")}}
+\def\xmlall #1#2{\ctxlxml{all("#1","#2")}}
+\def\xmlatt #1#2{\ctxlxml{att("#1","#2")}}
+\def\xmlattdef #1#2#3{\ctxlxml{att("#1","#2","#3")}}
+\def\xmlchainatt #1#2{\ctxlxml{chainattribute("#1","/","#2")}}
+\def\xmlchainattdef #1#2#3{\ctxlxml{chainattribute("#1","/","#2","#3")}}
+\def\xmlattribute #1#2#3{\ctxlxml{attribute("#1","#2","#3")}}
+\def\xmlattributedef #1#2#3#4{\ctxlxml{attribute("#1","#2","#3","#4")}}
+\def\xmlcommand #1#2#3{\ctxlxml{command("#1","#2","#3")}}
+\def\xmlconcat #1#2#3{\ctxlxml{concat("#1","#2",[[\detokenize{#3}]])}}
+\def\xmlconcatrange #1#2#3#4#5{\ctxlxml{concatrange("#1","#2","#3","#4",[[\detokenize{#5}]])}}
+\def\xmlcount #1#2{\ctxlxml{count("#1","#2")}}
+\def\xmldelete #1#2{\ctxlxml{delete("#1","#2")}}
+\def\xmldirectives #1{\ctxlxml{directives.setup("#1")}}
+\def\xmldirectivesbefore #1{\ctxlxml{directives.before("#1")}}
+\def\xmldirectivesafter #1{\ctxlxml{directives.after("#1")}}
+\def\xmlfilter #1#2{\ctxlxml{filter("#1",\!!bs#2\!!es)}}
+\def\xmlfilterlist #1#2{\ctxlxml{filterlist("#1",\!!bs#2\!!es)}}
+\def\xmlfunction #1#2{\ctxlxml{applyfunction("#1",\!!bs#2\!!es)}}
+\def\xmlfirst #1#2{\ctxlxml{first("#1","#2")}}
+\def\xmlflush #1{\ctxlxml{flush("#1")}}
+\def\xmlflushlinewise #1{\ctxlxml{flushlinewise("#1")}}
+\def\xmlflushspacewise #1{\ctxlxml{flushspacewise("#1")}}
+%def\xmlcontent #1{\ctxlxml{content("#1")}}
+%def\xmlflushstripped #1{\ctxlxml{strip("#1",true)}}
+\def\xmldirect #1{\ctxlxml{direct("#1")}} % in loops, not dt but root
+\def\xmlidx #1#2#3{\ctxlxml{idx("#1","#2",\number#3)}}
+\def\xmlinclude #1#2#3{\ctxlxml{include("#1","#2","#3",true)}}
+\def\xmlincludeoptions#1#2#3#4{\ctxlxml{include("#1","#2","#3","#4")}}
+\def\xmlsave #1#2{\ctxlxml{save("#1","#2")}}
+\def\xmlindex #1#2#3{\ctxlxml{index("#1","#2",\number#3)}}
+\def\xmlinfo #1{\hbox{\ttxx[\ctxlxml{info("#1")}]}}
+\def\xmlshow #1{\startpacked\ttx\xmlverbatim{#1}\stoppacked}
+\def\xmllast #1#2{\ctxlxml{last("#1","#2")}}
+\def\xmlname #1{\ctxlxml{name("#1")}}
+\def\xmlnamespace #1{\ctxlxml{namespace("#1")}}
+\def\xmlnonspace #1#2{\ctxlxml{nonspace("#1","#2")}}
+\def\xmlraw #1#2{\ctxlxml{raw("#1","#2")}}
+\def\xmlcontext #1#2{\ctxlxml{context("#1","#2")}}
+\def\xmlflushcontext #1{\ctxlxml{context("#1")}}
+\def\xmlsnippet #1#2{\ctxlxml{snippet("#1",#2)}}
+\def\xmlelement #1#2{\ctxlxml{element("#1",#2)}}
+\def\xmlregisterns #1#2{\ctxlua{xml.registerns("#1","#2")}} % document
+\def\xmlremapname #1#2#3#4{\ctxlua{xml.remapname(lxml.id("#1"),"#2","#3","#4")}} % element
+\def\xmlremapnamespace #1#2#3{\ctxlua{xml.renamespace(lxml.id("#1"),"#2","#3")}} % document
+\def\xmlchecknamespace #1#2#3{\ctxlua{xml.checknamespace(lxml.id("#1"),"#2","#3")}} % element
+\def\xmlsetfunction #1#2#3{\ctxlxml{setaction("#1",\!!bs#2\!!es,#3)}}
+\def\xmlsetsetup #1#2#3{\ctxlxml{setsetup("#1",\!!bs#2\!!es,"#3")}}
+\def\xmlstrip #1#2{\ctxlxml{strip("#1","#2")}}
+\def\xmlstripnolines #1#2{\ctxlxml{strip("#1","#2",true)}}
+\def\xmlstripanywhere #1#2{\ctxlxml{strip("#1","#2",true,true)}}
+\def\xmlstripped #1#2{\ctxlxml{stripped("#1","#2")}}
+\def\xmlstrippednolines #1#2{\ctxlxml{stripped("#1","#2",true)}}
+\def\xmltag #1{\ctxlxml{tag("#1")}}
+\def\xmltext #1#2{\ctxlxml{text("#1","#2")}}
+\def\xmlverbatim #1{\ctxlxml{verbatim("#1")}}
+\def\xmldisplayverbatim #1{\ctxlxml{displayverbatim("#1")}}
+\def\xmlinlineverbatim #1{\ctxlxml{inlineverbatim("#1")}}
+
+\def\xmlload #1#2{\ctxlxml{load("#1","#2","\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
+\def\xmlloadbuffer #1#2{\ctxlxml{loadbuffer("#1","#2","\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
+\def\xmlloaddata #1#2{\ctxlxml{loaddata("#1",\!!bs#2\!!es,"\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
+\def\xmlloadregistered #1#2{\ctxlxml{loadregistered("#1","\directxmlparameter\c!entities","\directxmlparameter\c!compress")}}
+\def\xmlloaddirectives #1{\ctxlxml{directives.load("any:///#1")}}
+\def\xmlpos #1{\ctxlxml{pos("#1")}}
+
+\def\xmltoparameters #1{\ctxlxml{toparameters("#1")}}
+
+\def\xmltofile #1#2#3{\ctxlxml{tofile("#1","#2","#3")}} % id pattern filename
% kind of special:
@@ -106,12 +107,12 @@
% todo: \xmldoifelseattribute
-\def\xmldoif #1#2{\ctxlxml{doif (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
-\def\xmldoifnot #1#2{\ctxlxml{doifnot (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
-\def\xmldoifelse #1#2{\ctxlxml{doifelse (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
-\def\xmldoiftext #1#2{\ctxlxml{doiftext (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
-\def\xmldoifnottext #1#2{\ctxlxml{doifnottext (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
-\def\xmldoifelsetext #1#2{\ctxlxml{doifelsetext(\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
+\def\xmldoif #1#2{\ctxlxml{doif (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
+\def\xmldoifnot #1#2{\ctxlxml{doifnot (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
+\def\xmldoifelse #1#2{\ctxlxml{doifelse (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
+\def\xmldoiftext #1#2{\ctxlxml{doiftext (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
+\def\xmldoifnottext #1#2{\ctxlxml{doifnottext (\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
+\def\xmldoifelsetext #1#2{\ctxlxml{doifelsetext(\!!bs#1\!!es,\!!bs#2\!!es)}} % expandable
%def\xmldoifelseempty #1#2{\ctxlxml{doifelseempty("#1","#2")}} % #2, "*" or "" == self not yet implemented
%def\xmldoifelseselfempty #1{\ctxlxml{doifelseempty("#1")}}
diff --git a/Master/texmf-dist/tex/context/base/lxml-tex.lua b/Master/texmf-dist/tex/context/base/lxml-tex.lua
index 0503c511c45..0c58a47cc9f 100644
--- a/Master/texmf-dist/tex/context/base/lxml-tex.lua
+++ b/Master/texmf-dist/tex/context/base/lxml-tex.lua
@@ -38,9 +38,11 @@ local xmlapplylpath = xml.applylpath
local xmlunprivatized, xmlprivatetoken, xmlprivatecodes = xml.unprivatized, xml.privatetoken, xml.privatecodes
local xmlstripelement = xml.stripelement
-local variables = (interfaces and interfaces.variables) or { }
+local variables = interfaces and interfaces.variables or { }
-local insertbeforevalue, insertaftervalue = utilities.tables.insertbeforevalue, utilities.tables.insertaftervalue
+local settings_to_hash = utilities.parsers.settings_to_hash
+local insertbeforevalue = utilities.tables.insertbeforevalue
+local insertaftervalue = utilities.tables.insertaftervalue
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
@@ -352,7 +354,7 @@ end
function lxml.checkindex(name)
local root = getid(name)
- return (root and root.index) or 0
+ return root and root.index or 0
end
function lxml.withindex(name,n,command) -- will change as name is always there now
@@ -434,16 +436,74 @@ function lxml.register(id,xmltable,filename)
return xmltable
end
-function lxml.include(id,pattern,attribute,recurse)
+-- function lxml.include(id,pattern,attribute,recurse,resolve)
+-- starttiming(xml)
+-- local root = getid(id)
+-- xml.include(root,pattern,attribute,recurse,function(filename)
+-- if filename then
+-- -- preprocessing
+-- filename = commands.preparedfile(filename)
+-- -- some protection
+-- if file.dirname(filename) == "" and root.filename then
+-- local dn = file.dirname(root.filename)
+-- if dn ~= "" then
+-- filename = file.join(dn,filename)
+-- end
+-- end
+-- if trace_loading then
+-- report_lxml("including file %a",filename)
+-- end
+-- -- handy if we have a flattened structure
+-- if resolve then
+-- filename = resolvers.resolve(filename) or filename
+-- end
+-- -- todo: check variants and provide
+-- noffiles, nofconverted = noffiles + 1, nofconverted + 1
+-- return resolvers.loadtexfile(filename) or ""
+-- else
+-- return ""
+-- end
+-- end)
+-- stoptiming(xml)
+-- end
+
+-- recurse prepare rootpath resolve basename
+
+local options_true = { "recurse", "prepare", "rootpath" }
+local options_nil = { "prepare", "rootpath" }
+
+function lxml.include(id,pattern,attribute,options)
starttiming(xml)
local root = getid(id)
- xml.include(root,pattern,attribute,recurse,function(filename)
+ if options == true then
+ -- downward compatible
+ options = options_true
+ elseif not options then
+ -- downward compatible
+ options = options_nil
+ else
+ options = settings_to_hash(options) or { }
+ end
+ xml.include(root,pattern,attribute,options.recurse,function(filename)
if filename then
- filename = commands.preparedfile(filename)
- if file.dirname(filename) == "" and root.filename then
- local dn = file.dirname(root.filename)
- if dn ~= "" then
- filename = file.join(dn,filename)
+ -- preprocessing
+ if options.prepare then
+ filename = commands.preparedfile(filename)
+ end
+ -- handy if we have a flattened structure
+ if options.basename then
+ filename = file.basename(filename)
+ end
+ if options.resolve then
+ filename = resolvers.resolve(filename) or filename
+ end
+ -- some protection
+ if options.rootpath then
+ if file.dirname(filename) == "" and root.filename then
+ local dn = file.dirname(root.filename)
+ if dn ~= "" then
+ filename = file.join(dn,filename)
+ end
end
end
if trace_loading then
@@ -1125,7 +1185,9 @@ local function command(collected,cmd,otherwise)
lxml.addindex(name,false,true)
ix = e.ix
end
- if wildcard then
+ if not ix then
+ report_lxml("no valid node index for element %a in command %s",name,cmd)
+ elseif wildcard then
contextsprint(ctxcatcodes,"\\xmlw{",(gsub(cmd,"%*",e.tg)),"}{",name,"::",ix,"}")
else
contextsprint(ctxcatcodes,"\\xmlw{",cmd,"}{",name,"::",ix,"}")
diff --git a/Master/texmf-dist/tex/context/base/m-pipemode.mkiv b/Master/texmf-dist/tex/context/base/m-pipemode.mkiv
new file mode 100644
index 00000000000..e96394c431e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-pipemode.mkiv
@@ -0,0 +1,7 @@
+% For Mojca: context --global m-pipemode.mkiv
+
+\disabledirectives[system.errorcontext]
+
+\starttext
+
+\let\stoptext\relax
diff --git a/Master/texmf-dist/tex/context/base/math-frc.mkiv b/Master/texmf-dist/tex/context/base/math-frc.mkiv
index f4f3f2b84a1..7032c665b08 100644
--- a/Master/texmf-dist/tex/context/base/math-frc.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-frc.mkiv
@@ -106,12 +106,57 @@
\c!rulethickness=.25\exheight,
\c!left=0x2E,
\c!right=0x2E,
+ \c!topdistance=,
+ \c!bottomdistance=,
\c!rule=\v!auto]
\appendtoks
\setuevalue{\currentmathfraction}{\math_frac{\currentmathfraction}}%
\to \everydefinemathfraction
+% Sometimes users want control over the distances:
+
+\let\math_fraction_set_distance\relax
+
+\appendtoks
+ \math_fraction_set_distance
+\to \everymathematics
+
+\unexpanded\def\math_fraction_set_distance_top
+ {\Umathfractionnumup \displaystyle\m_math_fraction_distance_top
+ \relax}
+
+\unexpanded\def\math_fraction_set_distance_bot
+ {\Umathfractiondenomdown\displaystyle\m_math_fraction_distance_bot
+ \relax}
+
+\unexpanded\def\math_fraction_set_distance_all
+ {\Umathfractionnumup \displaystyle\m_math_fraction_distance_top
+ \Umathfractiondenomdown\displaystyle\m_math_fraction_distance_bot
+ \relax}
+
+\appendtoks
+ \ifx\currentmathfraction\empty
+ \edef\m_math_fraction_distance_top{\mathfractionparameter\c!topdistance}%
+ \edef\m_math_fraction_distance_bot{\mathfractionparameter\c!bottomdistance}%
+ \ifx\m_math_fraction_distance_top\empty
+ \ifx\m_math_fraction_distance_bot\empty
+ \let\math_fraction_set_distance\relax
+ \else
+ \let\math_fraction_set_distance\math_fraction_set_distance_bot
+ \fi
+ \else
+ \ifx\m_math_fraction_distance_bot\empty
+ \let\math_fraction_set_distance\math_fraction_set_distance_top
+ \else
+ \let\math_fraction_set_distance\math_fraction_set_distance_all
+ \fi
+ \fi
+ \fi
+\to \everysetupmathfraction
+
+% So far for control.
+
\newdimen\d_math_fraction_margin
\unexpanded\def\math_frac#1%
diff --git a/Master/texmf-dist/tex/context/base/math-ini.mkiv b/Master/texmf-dist/tex/context/base/math-ini.mkiv
index dcd2a5c3343..adf252d9526 100644
--- a/Master/texmf-dist/tex/context/base/math-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-ini.mkiv
@@ -230,6 +230,12 @@
\ifdefined\mr \else \let\mr\relax \fi
\ifdefined\mb \else \let\mb\relax \fi
+% 1: $\setmathattribute{ss}{bf}3$
+% 2: $\setmathattribute{ss}{bf}\setmathfontstylealterternate{bf}3$
+% 3: $\setmathattribute{ss}{bf}\setmathfontstyle{bf}3$
+% 4: $\setmathattribute{ss}{bf}\setmathfontstyle{bf}\setmathfontstylealterternate{bf}3$
+% 5: $e=mc^2 \quad \mb e=mc^2$
+
\prependtoks
\mathdefault
\to \everymathematics
diff --git a/Master/texmf-dist/tex/context/base/math-map.lua b/Master/texmf-dist/tex/context/base/math-map.lua
index 2ebcdfc8696..f2a588fc7de 100644
--- a/Master/texmf-dist/tex/context/base/math-map.lua
+++ b/Master/texmf-dist/tex/context/base/math-map.lua
@@ -44,8 +44,8 @@ local registerotffeature = otffeatures.register
local setmetatableindex = table.setmetatableindex
-local texgetattribute = tex.getattribute
-local texsetattribute = tex.setattribute
+local texgetattribute = tex.getattribute
+local texsetattribute = tex.setattribute
local trace_greek = false trackers.register("math.greek", function(v) trace_greek = v end)
local report_remapping = logs.reporter("mathematics","remapping")
@@ -59,7 +59,52 @@ local mathematics = mathematics
-- diagnostics and quick and dirty alphabet tracing (s-mat-10.mkiv) as we deal with
-- it otherwise.
-mathematics.gaps = {
+-- todo: allocate
+
+mathematics.styles = allocate { "regular", "sansserif", "monospaced", "fraktur", "script", "blackboard" }
+mathematics.alternatives = allocate { "normal", "bold", "italic", "bolditalic" }
+mathematics.sets = allocate { "ucletters", "lcletters", "digits", "ucgreek", "lcgreek", "symbols" }
+
+mathematics.charactersets = allocate {
+ ucletters = {
+ 0x00041, 0x00042, 0x00043, 0x00044, 0x00045,
+ 0x00046, 0x00047, 0x00048, 0x00049, 0x0004A,
+ 0x0004B, 0x0004C, 0x0004D, 0x0004E, 0x0004F,
+ 0x00050, 0x00051, 0x00052, 0x00053, 0x00054,
+ 0x00055, 0x00056, 0x00057, 0x00058, 0x00059,
+ 0x0005A,
+ },
+ lcletters = {
+ 0x00061, 0x00062, 0x00063, 0x00064, 0x00065,
+ 0x00066, 0x00067, 0x00068, 0x00069, 0x0006A,
+ 0x0006B, 0x0006C, 0x0006D, 0x0006E, 0x0006F,
+ 0x00070, 0x00071, 0x00072, 0x00073, 0x00074,
+ 0x00075, 0x00076, 0x00077, 0x00078, 0x00079,
+ 0x0007A,
+ },
+ digits = {
+ 0x00030, 0x00031, 0x00032, 0x00033, 0x00034,
+ 0x00035, 0x00036, 0x00037, 0x00038, 0x00039,
+ },
+ ucgreek = {
+ 0x0391, 0x0392, 0x0393, 0x0394, 0x0395,
+ 0x0396, 0x0397, 0x0398, 0x0399, 0x039A,
+ 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5,
+ 0x03A6, 0x03A7, 0x03A8, 0x03A9
+ },
+ lcgreek = {
+ 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5,
+ 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA,
+ 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+ 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4,
+ 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9,
+ 0x03D1, 0x03D5, 0x03D6, 0x03F0, 0x03F1,
+ 0x03F4, 0x03F5
+ },
+}
+
+mathematics.gaps = allocate {
[0x1D455] = 0x0210E, -- ℎ h
[0x1D49D] = 0x0212C, -- ℬ script B
[0x1D4A0] = 0x02130, -- ℰ script E
@@ -112,9 +157,10 @@ registerotffeature {
-- following approach permits easier remapping of a-a, A-Z and 0-9 to
-- fallbacks; symbols is currently mostly greek
-local function todigit(n) local t = { } for i=0, 9 do t[0x00030+i] = n+i end return t end
-local function toupper(n) local t = { } for i=0,25 do t[0x00041+i] = n+i end return t end
-local function tolower(n) local t = { } for i=0,25 do t[0x00061+i] = n+i end return t end
+local function todigit (n) local t = { } for i=0, 9 do t[0x00030+i] = n+i end return t end
+local function toupper (n) local t = { } for i=0,25 do t[0x00041+i] = n+i end return t end
+local function tolower (n) local t = { } for i=0,25 do t[0x00061+i] = n+i end return t end
+local function tovector(t) return t end
local regular_tf = {
digits = todigit(0x00030),
@@ -143,7 +189,7 @@ local regular_tf = {
}
local regular_it = {
- digits = regular_tf.digits,
+ digits = tovector(regular_tf.digits),
ucletters = toupper(0x1D434),
lcletters = { -- H
[0x00061]=0x1D44E, [0x00062]=0x1D44F, [0x00063]=0x1D450, [0x00064]=0x1D451, [0x00065]=0x1D452,
@@ -202,7 +248,7 @@ local regular_bf= {
}
local regular_bi = {
- digits = regular_bf.digits,
+ digits = tovector(regular_bf.digits),
ucletters = toupper(0x1D468),
lcletters = tolower(0x1D482),
ucgreek = {
@@ -238,18 +284,18 @@ local sansserif_tf = {
digits = todigit(0x1D7E2),
ucletters = toupper(0x1D5A0),
lcletters = tolower(0x1D5BA),
- lcgreek = regular_tf.lcgreek,
- ucgreek = regular_tf.ucgreek,
- symbols = regular_tf.symbols,
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
}
local sansserif_it = {
- digits = regular_tf.digits,
+ digits = tovector(regular_tf.digits),
ucletters = toupper(0x1D608),
lcletters = tolower(0x1D622),
- lcgreek = regular_tf.lcgreek,
- ucgreek = regular_tf.ucgreek,
- symbols = regular_tf.symbols,
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
}
local sansserif_bf = {
@@ -279,7 +325,7 @@ local sansserif_bf = {
}
local sansserif_bi = {
- digits = sansserif_bf.digits,
+ digits = tovector(sansserif_bf.digits),
ucletters = toupper(0x1D63C),
lcletters = tolower(0x1D656),
ucgreek = {
@@ -315,16 +361,20 @@ local monospaced_tf = {
digits = todigit(0x1D7F6),
ucletters = toupper(0x1D670),
lcletters = tolower(0x1D68A),
- lcgreek = sansserif_tf.lcgreek,
- ucgreek = sansserif_tf.ucgreek,
- symbols = sansserif_tf.symbols,
+ lcgreek = tovector(sansserif_tf.lcgreek),
+ ucgreek = tovector(sansserif_tf.ucgreek),
+ symbols = tovector(sansserif_tf.symbols),
}
+local monospaced_it = tovector(sansserif_it)
+local monospaced_bf = tovector(sansserif_bf)
+local monospaced_bi = tovector(sansserif_bi)
+
local monospaced = {
tf = monospaced_tf,
- it = sansserif_tf,
- bf = sansserif_tf,
- bi = sansserif_bf,
+ it = monospaced_tf,
+ bf = monospaced_tf,
+ bi = monospaced_bf,
}
local blackboard_tf = {
@@ -362,7 +412,7 @@ local blackboard = {
}
local fraktur_tf= {
- digits = regular_tf.digits,
+ digits = tovector(regular_tf.digits),
ucletters = { -- C H I R Z
[0x00041]=0x1D504, [0x00042]=0x1D505, [0x00043]=0x0212D, [0x00044]=0x1D507, [0x00045]=0x1D508,
[0x00046]=0x1D509, [0x00047]=0x1D50A, [0x00048]=0x0210C, [0x00049]=0x02111, [0x0004A]=0x1D50D,
@@ -372,18 +422,18 @@ local fraktur_tf= {
[0x0005A]=0x02128,
},
lcletters = tolower(0x1D51E),
- lcgreek = regular_tf.lcgreek,
- ucgreek = regular_tf.ucgreek,
- symbols = regular_tf.symbols,
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
}
local fraktur_bf = {
- digits = regular_bf.digits,
+ digits = tovector(regular_bf.digits),
ucletters = toupper(0x1D56C),
lcletters = tolower(0x1D586),
- lcgreek = regular_bf.lcgreek,
- ucgreek = regular_bf.ucgreek,
- symbols = regular_bf.symbols,
+ lcgreek = tovector(regular_bf.lcgreek),
+ ucgreek = tovector(regular_bf.ucgreek),
+ symbols = tovector(regular_bf.symbols),
}
local fraktur = { -- ok
@@ -394,7 +444,7 @@ local fraktur = { -- ok
}
local script_tf = {
- digits = regular_tf.digits,
+ digits = tovector(regular_tf.digits),
ucletters = { -- B E F H I L M R -- P 2118
[0x00041]=0x1D49C, [0x00042]=0x0212C, [0x00043]=0x1D49E, [0x00044]=0x1D49F, [0x00045]=0x02130,
[0x00046]=0x02131, [0x00047]=0x1D4A2, [0x00048]=0x0210B, [0x00049]=0x02110, [0x0004A]=0x1D4A5,
@@ -411,18 +461,18 @@ local script_tf = {
[0x00075]=0x1D4CA, [0x00076]=0x1D4CB, [0x00077]=0x1D4CC, [0x00078]=0x1D4CD, [0x00079]=0x1D4CE,
[0x0007A]=0x1D4CF,
},
- lcgreek = regular_tf.lcgreek,
- ucgreek = regular_tf.ucgreek,
- symbols = regular_tf.symbols,
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
}
local script_bf = {
- digits = regular_bf.digits,
+ digits = tovector(regular_bf.digits),
ucletters = toupper(0x1D4D0),
lcletters = tolower(0x1D4EA),
- lcgreek = regular_bf.lcgreek,
- ucgreek = regular_bf.ucgreek,
- symbols = regular_bf.symbols,
+ lcgreek = tovector(regular_bf.lcgreek),
+ ucgreek = tovector(regular_bf.ucgreek),
+ symbols = tovector(regular_bf.symbols),
}
local script = {
@@ -441,82 +491,83 @@ local alphabets = allocate {
script = script,
}
-mathematics.alphabets = alphabets
+alphabets.tt = tovector(monospaced)
+alphabets.ss = tovector(sansserif)
+alphabets.rm = tovector(regular)
+alphabets.bb = tovector(blackboard)
+alphabets.fr = tovector(fraktur)
+alphabets.sr = tovector(script)
-local boldmap = { }
-
--- ["blackboard"] = { ["bf"] = { ["digits"] = {
-
-local function remap(tf,bf)
- for _, alphabet in next, alphabets do
- local tfdata = alphabet[tf]
- local bfdata = alphabet[bf]
- if tfdata then
- for k, tfd in next, tfdata do
- if type(tfd) == "table" then
- local bfd = bfdata[k]
- if bfd then
- for n, u in next, tfd do
- local bn = bfd[n]
- if bn then
- boldmap[u] = bn
- end
- end
- end
- end
- end
- end
- end
-end
+monospaced.normal = tovector(monospaced_tf)
+monospaced.italic = tovector(monospaced_it)
+monospaced.bold = tovector(monospaced_bf)
+monospaced.bolditalic = tovector(monospaced_bi)
+
+sansserif.normal = tovector(sansserif_tf)
+sansserif.italic = tovector(sansserif_it)
+sansserif.bold = tovector(sansserif_bf)
+sansserif.bolditalic = tovector(sansserif_bi)
+
+regular.normal = tovector(regular_tf)
+regular.italic = tovector(regular_it)
+regular.bold = tovector(regular_bf)
+regular.bolditalic = tovector(regular_bi)
+
+alphabets.serif = tovector(regular)
+alphabets.type = tovector(monospaced)
+alphabets.teletype = tovector(monospaced)
-remap("tf","bf")
-remap("it","bi")
+mathematics.alphabets = alphabets
+
+local mathremap = allocate { }
+mathematics.mapremap = mathremap
-mathematics.boldmap = boldmap
+local boldmap = allocate { }
+mathematics.boldmap = boldmap
-local mathremap = allocate { }
+-- all math (a bit of redundancy here)
for alphabet, styles in next, alphabets do -- per 9/6/2011 we also have attr for missing
for style, data in next, styles do
-- let's keep the long names (for tracing)
local n = #mathremap + 1
- data.attribute = n
- data.alphabet = alphabet
- data.style = style
- mathremap[n] = data
+ local d = {
+ attribute = n,
+ alphabet = alphabet,
+ style = style,
+ }
+ styles[style] = d
+ setmetatableindex(d,data) -- we could use a alphadata table
+ mathremap[n] = d
end
end
-mathematics.mapremap = mathremap
-
--- beware, these are shared tables (no problem since they're not
--- in unicode)
-
-alphabets.tt = monospaced
-alphabets.ss = sansserif
-alphabets.rm = regular
-alphabets.bb = blackboard
-alphabets.fr = fraktur
-alphabets.sr = script
-
-alphabets.serif = regular
-alphabets.type = monospaced
-alphabets.teletype = monospaced
-
-regular.normal = regular_tf
-regular.italic = regular_it
-regular.bold = regular_bf
-regular.bolditalic = regular_bi
+-- bold math
+
+local function remapbold(tf,bf)
+ local styles = mathematics.styles
+ local sets = mathematics.sets
+ for i=1,#styles do
+ for j=1,#sets do
+ local one = styles[i]
+ local two = sets[j]
+ local a = alphabets[one]
+ local tf = a[tf][two]
+ local bf = a[bf][two]
+ if tf and bf then
+ for k, v in next, tf do
+ boldmap[v] = bf[k]
+ end
+ end
+ end
+ end
+end
-sansserif.normal = sansserif_tf
-sansserif.italic = sansserif_it
-sansserif.bold = sansserif_bf
-sansserif.bolditalic = sansserif_bi
+remapbold("tf","bf")
+remapbold("it","bi")
-monospaced.normal = monospaced_tf
-monospaced.italic = monospaced_it
-monospaced.bold = monospaced_bf
-monospaced.bolditalic = monospaced_bi
+-- table.save("e:/tmp/a.lua",alphabets)
+-- table.save("e:/tmp/b.lua",boldmap)
function mathematics.tostyle(attribute)
local r = mathremap[attribute]
diff --git a/Master/texmf-dist/tex/context/base/math-noa.lua b/Master/texmf-dist/tex/context/base/math-noa.lua
index a7f0fcf55e6..3a0af01cc9e 100644
--- a/Master/texmf-dist/tex/context/base/math-noa.lua
+++ b/Master/texmf-dist/tex/context/base/math-noa.lua
@@ -251,40 +251,6 @@ local familymap = { [0] =
"pseudobold",
}
--- families[math_char] = function(pointer)
--- if getfield(pointer,"fam") == 0 then
--- local a = getattr(pointer,a_mathfamily)
--- if a and a > 0 then
--- setattr(pointer,a_mathfamily,0)
--- if a > 5 then
--- local char = getchar(pointer)
--- local bold = boldmap[char]
--- local newa = a - 3
--- if bold then
--- setattr(pointer,a_exportstatus,char)
--- setfield(pointer,"char",bold)
--- if trace_families then
--- report_families("replacing %C by bold %C, family %s with remap %s becomes %s with remap %s",char,bold,a,familymap[a],newa,familymap[newa])
--- end
--- else
--- if trace_families then
--- report_families("no bold replacement for %C, family %s with remap %s becomes %s with remap %s",char,a,familymap[a],newa,familymap[newa])
--- end
--- end
--- setfield(pointer,"fam",newa)
--- else
--- if trace_families then
--- local char = getchar(pointer)
--- report_families("family of %C becomes %s with remap %s",char,a,familymap[a])
--- end
--- setfield(pointer,"fam",a)
--- end
--- else
--- -- pointer.fam = 0
--- end
--- end
--- end
-
families[math_char] = function(pointer)
if getfield(pointer,"fam") == 0 then
local a = getattr(pointer,a_mathfamily)
diff --git a/Master/texmf-dist/tex/context/base/meta-ini.mkiv b/Master/texmf-dist/tex/context/base/meta-ini.mkiv
index 281143e40b0..555deca2cbf 100644
--- a/Master/texmf-dist/tex/context/base/meta-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/meta-ini.mkiv
@@ -220,6 +220,7 @@
\defineMPinstance[metafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
\defineMPinstance[extrafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
\defineMPinstance[doublefun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!double]
+\defineMPinstance[binaryfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!binary]
\defineMPinstance[decimalfun][\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!decimal]
\defineMPinstance[mprun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
\defineMPinstance[metapost] [\s!format=mpost]
diff --git a/Master/texmf-dist/tex/context/base/mlib-lua.lua b/Master/texmf-dist/tex/context/base/mlib-lua.lua
index 9c7a2e43a42..e3a3ba5d8db 100644
--- a/Master/texmf-dist/tex/context/base/mlib-lua.lua
+++ b/Master/texmf-dist/tex/context/base/mlib-lua.lua
@@ -8,6 +8,8 @@ if not modules then modules = { } end modules ['mlib-pdf'] = {
-- This is very preliminary code!
+-- maybe we need mplib.model, but how with instances
+
local type, tostring, select, loadstring = type, tostring, select, loadstring
local formatters = string.formatters
local find, gsub = string.find, string.gsub
@@ -51,14 +53,25 @@ function mp._f_()
end
end
-local f_pair = formatters["(%s,%s)"]
-local f_triplet = formatters["(%s,%s,%s)"]
-local f_quadruple = formatters["(%s,%s,%s,%s)"]
+local f_numeric = formatters["%.16f"]
+local f_pair = formatters["(%.16f,%.16f)"]
+local f_triplet = formatters["(%.16f,%.16f,%.16f)"]
+local f_quadruple = formatters["(%.16f,%.16f,%.16f,%.16f)"]
function mp.print(...)
for i=1,select("#",...) do
- n = n + 1
- buffer[n] = tostring((select(i,...)))
+ local value = select(i,...)
+ if value then
+ n = n + 1
+ local t = type(value)
+ if t == "number" then
+ buffer[n] = f_numeric(value)
+ elseif t == "string" then
+ buffer[n] = value
+ else
+ buffer[n] = tostring(value)
+ end
+ end
end
end
@@ -113,14 +126,23 @@ end
local f_code = formatters["%s return mp._f_()"]
-function metapost.runscript(code)
- local f = loadstring(f_code(code))
- if f then
- return tostring(f())
- else
- return ""
- end
-end
+-- function metapost.runscript(code)
+-- local f = loadstring(f_code(code))
+-- if f then
+-- local result = f()
+-- if result then
+-- local t = type(result)
+-- if t == "number" then
+-- return f_numeric(result)
+-- elseif t == "string" then
+-- return result
+-- else
+-- return tostring(result)
+-- end
+-- end
+-- end
+-- return ""
+-- end
local cache, n = { }, 0 -- todo: when > n then reset cache or make weak
@@ -128,29 +150,34 @@ function metapost.runscript(code)
if trace_enabled and trace_luarun then
report_luarun("code: %s",code)
end
+ local f
if n > 100 then
cache = nil -- forget about caching
- local f = loadstring(f_code(code))
- if f then
- return tostring(f())
- else
- return ""
- end
+ f = loadstring(f_code(code))
else
- local f = cache[code]
- if f then
- return tostring(f())
- else
+ f = cache[code]
+ if not f then
f = loadstring(f_code(code))
if f then
n = n + 1
cache[code] = f
- return tostring(f())
+ end
+ end
+ end
+ if f then
+ local result = f()
+ if result then
+ local t = type(result)
+ if t == "number" then
+ return f_numeric(result)
+ elseif t == "string" then
+ return result
else
- return ""
+ return tostring(result)
end
end
end
+ return ""
end
-- function metapost.initializescriptrunner(mpx)
diff --git a/Master/texmf-dist/tex/context/base/mult-de.mkii b/Master/texmf-dist/tex/context/base/mult-de.mkii
index 0c4dae5b6f0..9e7ecd93071 100644
--- a/Master/texmf-dist/tex/context/base/mult-de.mkii
+++ b/Master/texmf-dist/tex/context/base/mult-de.mkii
@@ -701,6 +701,7 @@
\setinterfaceconstant{file}{datei}
\setinterfaceconstant{filtercommand}{filtercommand}
\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{finalpubsep}{finalpubsep}
\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{firstpage}{ersteseite}
\setinterfaceconstant{focus}{focus}
diff --git a/Master/texmf-dist/tex/context/base/mult-def.lua b/Master/texmf-dist/tex/context/base/mult-def.lua
index fc2b932c249..bd8b361851e 100644
--- a/Master/texmf-dist/tex/context/base/mult-def.lua
+++ b/Master/texmf-dist/tex/context/base/mult-def.lua
@@ -6643,6 +6643,9 @@ return {
["lastpubsep"]={
["en"]="lastpubsep",
},
+ ["finalpubsep"]={
+ ["en"]="finalpubsep",
+ },
["refcommand"]={
["en"]="refcommand",
},
diff --git a/Master/texmf-dist/tex/context/base/mult-def.mkiv b/Master/texmf-dist/tex/context/base/mult-def.mkiv
index 35b2127106d..321f06154a8 100644
--- a/Master/texmf-dist/tex/context/base/mult-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/mult-def.mkiv
@@ -97,6 +97,9 @@
\def\s!double {double}
\def\s!decimal {decimal}
+\def\s!binary {binary}
+
+\def\s!internal {internal}
\def\s!current {current}
diff --git a/Master/texmf-dist/tex/context/base/mult-en.mkii b/Master/texmf-dist/tex/context/base/mult-en.mkii
index 00861c3be98..bf72af384c7 100644
--- a/Master/texmf-dist/tex/context/base/mult-en.mkii
+++ b/Master/texmf-dist/tex/context/base/mult-en.mkii
@@ -701,6 +701,7 @@
\setinterfaceconstant{file}{file}
\setinterfaceconstant{filtercommand}{filtercommand}
\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{finalpubsep}{finalpubsep}
\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{firstpage}{firstpage}
\setinterfaceconstant{focus}{focus}
diff --git a/Master/texmf-dist/tex/context/base/mult-fr.mkii b/Master/texmf-dist/tex/context/base/mult-fr.mkii
index 9afe371c2b8..e1129848fec 100644
--- a/Master/texmf-dist/tex/context/base/mult-fr.mkii
+++ b/Master/texmf-dist/tex/context/base/mult-fr.mkii
@@ -701,6 +701,7 @@
\setinterfaceconstant{file}{fichier}
\setinterfaceconstant{filtercommand}{filtercommand}
\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{finalpubsep}{finalpubsep}
\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{firstpage}{premierepage}
\setinterfaceconstant{focus}{focus}
diff --git a/Master/texmf-dist/tex/context/base/mult-fun.lua b/Master/texmf-dist/tex/context/base/mult-fun.lua
index 0f5bd8ace7d..846a50ddf3d 100644
--- a/Master/texmf-dist/tex/context/base/mult-fun.lua
+++ b/Master/texmf-dist/tex/context/base/mult-fun.lua
@@ -24,6 +24,7 @@ return {
"llcircle", "lrcircle", "urcircle", "ulcircle",
"tcircle", "bcircle", "lcircle", "rcircle",
"lltriangle", "lrtriangle", "urtriangle", "ultriangle",
+ "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle",
"smoothed", "cornered", "superellipsed", "randomized", "squeezed", "enlonged", "shortened",
"punked", "curved", "unspiked", "simplified", "blownup", "stretched",
"enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged",
diff --git a/Master/texmf-dist/tex/context/base/mult-it.mkii b/Master/texmf-dist/tex/context/base/mult-it.mkii
index 802cb840cd3..5646a212e21 100644
--- a/Master/texmf-dist/tex/context/base/mult-it.mkii
+++ b/Master/texmf-dist/tex/context/base/mult-it.mkii
@@ -701,6 +701,7 @@
\setinterfaceconstant{file}{file}
\setinterfaceconstant{filtercommand}{filtercommand}
\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{finalpubsep}{finalpubsep}
\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{firstpage}{primapagina}
\setinterfaceconstant{focus}{focus}
diff --git a/Master/texmf-dist/tex/context/base/mult-low.lua b/Master/texmf-dist/tex/context/base/mult-low.lua
index f41104986f7..dda4e5aadb4 100644
--- a/Master/texmf-dist/tex/context/base/mult-low.lua
+++ b/Master/texmf-dist/tex/context/base/mult-low.lua
@@ -126,6 +126,7 @@ return {
"twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace",
"figurespace", "punctuationspace", "hairspace",
"zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj",
+ "optionalspace",
},
["helpers"] = {
--
@@ -307,6 +308,8 @@ return {
--
"leftorright",
--
+ "offinterlineskip", "oninterlineskip", "nointerlineskip",
+ --
"strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "begstrut", "endstrut", "lineheight",
--
"ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing",
diff --git a/Master/texmf-dist/tex/context/base/mult-mps.lua b/Master/texmf-dist/tex/context/base/mult-mps.lua
index 104b9d42ef0..717536fbf91 100644
--- a/Master/texmf-dist/tex/context/base/mult-mps.lua
+++ b/Master/texmf-dist/tex/context/base/mult-mps.lua
@@ -60,6 +60,8 @@ return {
"expandafter",
"minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline",
"fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode",
+ --
+ "runscript",
},
commands = {
"beginfig", "endfig",
diff --git a/Master/texmf-dist/tex/context/base/mult-nl.mkii b/Master/texmf-dist/tex/context/base/mult-nl.mkii
index 015f58ff15c..aa376c39a1e 100644
--- a/Master/texmf-dist/tex/context/base/mult-nl.mkii
+++ b/Master/texmf-dist/tex/context/base/mult-nl.mkii
@@ -701,6 +701,7 @@
\setinterfaceconstant{file}{file}
\setinterfaceconstant{filtercommand}{filtercommand}
\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{finalpubsep}{finalpubsep}
\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{firstpage}{eerstepagina}
\setinterfaceconstant{focus}{focus}
diff --git a/Master/texmf-dist/tex/context/base/mult-pe.mkii b/Master/texmf-dist/tex/context/base/mult-pe.mkii
index 999b16cf5e0..16871bb6260 100644
--- a/Master/texmf-dist/tex/context/base/mult-pe.mkii
+++ b/Master/texmf-dist/tex/context/base/mult-pe.mkii
@@ -701,6 +701,7 @@
\setinterfaceconstant{file}{پرونده}
\setinterfaceconstant{filtercommand}{filtercommand}
\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{finalpubsep}{finalpubsep}
\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{firstpage}{صفحه‌اول}
\setinterfaceconstant{focus}{تمرکز}
diff --git a/Master/texmf-dist/tex/context/base/mult-ro.mkii b/Master/texmf-dist/tex/context/base/mult-ro.mkii
index f577eabda1f..d01822944da 100644
--- a/Master/texmf-dist/tex/context/base/mult-ro.mkii
+++ b/Master/texmf-dist/tex/context/base/mult-ro.mkii
@@ -701,6 +701,7 @@
\setinterfaceconstant{file}{fisier}
\setinterfaceconstant{filtercommand}{filtercommand}
\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{finalpubsep}{finalpubsep}
\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{firstpage}{primapagina}
\setinterfaceconstant{focus}{focus}
diff --git a/Master/texmf-dist/tex/context/base/node-acc.lua b/Master/texmf-dist/tex/context/base/node-acc.lua
index 59fa031bf70..e684aeb7b88 100644
--- a/Master/texmf-dist/tex/context/base/node-acc.lua
+++ b/Master/texmf-dist/tex/context/base/node-acc.lua
@@ -31,7 +31,7 @@ local copy_node = nuts.copy
local free_nodelist = nuts.flush_list
local insert_after = nuts.insert_after
-local new_gluespec = nuts.pool.gluespec -- temp hack
+local new_gluespec = nuts.pool.gluespec -- temp hack
local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
@@ -41,7 +41,8 @@ local vlist_code = nodecodes.vlist
local a_characters = attributes.private("characters")
-local threshold = 65536
+local threshold = 65536 -- not used
+local nofreplaced = 0
-- todo: nbsp etc
-- todo: collapse kerns
@@ -83,6 +84,7 @@ local function injectspaces(head)
end
setattr(s,a_characters,0)
setattr(n,a_characters,0)
+ nofreplaced = nofreplaced + 1
end
-- end
elseif id == hlist_code or id == vlist_code then
@@ -113,6 +115,12 @@ nodes.handlers.accessibility = function(head)
return tonode(head), done
end
+statistics.register("inserted spaces in output",function()
+ if nofreplaced > 0 then
+ return nofreplaced
+ end
+end)
+
-- todo:
-- local a_hyphenated = attributes.private('hyphenated')
diff --git a/Master/texmf-dist/tex/context/base/node-typ.lua b/Master/texmf-dist/tex/context/base/node-typ.lua
index 4c33e31991d..f1aacf25a86 100644
--- a/Master/texmf-dist/tex/context/base/node-typ.lua
+++ b/Master/texmf-dist/tex/context/base/node-typ.lua
@@ -46,7 +46,7 @@ local function tonodes(str,fontid,spacing,templateglyph) -- quick and dirty
if spacing then
s, p, m = spacing, 0, 0
else
- s, p, m = fp.space, fp.space_stretch, fp,space_shrink
+ s, p, m = fp.space, fp.space_stretch, fp.space_shrink
end
local spacedone = false
for c in utfvalues(str) do
diff --git a/Master/texmf-dist/tex/context/base/pack-mrl.mkiv b/Master/texmf-dist/tex/context/base/pack-mrl.mkiv
index 3e81a4d6944..c0097cb5fa5 100644
--- a/Master/texmf-dist/tex/context/base/pack-mrl.mkiv
+++ b/Master/texmf-dist/tex/context/base/pack-mrl.mkiv
@@ -614,7 +614,7 @@
\fi
\doifelse{\directtextrulesparameter\c!depthcorrection}\v!on\pack_textrule_correct_depth_yes\pack_textrule_correct_depth_nop
\nointerlineskip
- \dontleavehmode\vbox
+ \noindent\vbox % was \dontleavehmode
{\color[\directtextrulesparameter\c!rulecolor]
{\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
{\pack_textrule_with_text{#1}}%
diff --git a/Master/texmf-dist/tex/context/base/page-lin.mkiv b/Master/texmf-dist/tex/context/base/page-lin.mkiv
deleted file mode 100644
index 0f8b7839810..00000000000
--- a/Master/texmf-dist/tex/context/base/page-lin.mkiv
+++ /dev/null
@@ -1,557 +0,0 @@
-%D \module
-%D [ file=page-lin,
-%D version=2007.11.29,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Line Numbering,
-%D author=Hans Hagen,
-%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.
-
-% generic or not ... maybe not bother too much and simplify to mkiv only
-% get rid of \mk* (left over from experimental times)
-%
-% to be redone (was experiment) .. can be hooked into margin code
-
-\writestatus{loading}{ConTeXt Core Macros / Line Numbering}
-
-\unprotect
-
-% todo: save settings
-%
-% low level interface
-%
-% we should use normal counters but then we need to sync settings
-
-% some line
-%
-% \startlocallinenumbering
-% some source code 1\par
-% some source code 2\par
-% some source code 3\par
-% \stoplocallinenumbering
-%
-% some line
-
-\registerctxluafile{page-lin}{1.001}
-
-\definesystemattribute[linenumber] [public]
-\definesystemattribute[linereference][public]
-
-\appendtoksonce
- \attribute\linenumberattribute\attributeunsetvalue
-\to \everyforgetall
-
-\newcount \linenumber % not used
-\newbox \b_page_lines_scratch
-\newcount \c_page_lines_reference
-\newconstant\c_page_lines_nesting
-
-\newconditional\tracelinenumbering
-
-% id nr shift width leftskip dir
-
-\installcorenamespace{linenumberinginstance}
-
-\let\makelinenumber\gobblesevenarguments % used at lua end
-
-\newconditional\page_postprocessors_needed_box
-
-\unexpanded\def\page_postprocessors_linenumbers_page #1{\page_lines_add_numbers_to_box{#1}\plusone \plusone \zerocount}
-\unexpanded\def\page_postprocessors_linenumbers_box #1{\page_lines_add_numbers_to_box{#1}\plusone \plusone \zerocount}
-\unexpanded\def\page_postprocessors_linenumbers_deepbox#1{\page_lines_add_numbers_to_box{#1}\plusone \plusone \plusone }
-\unexpanded\def\page_postprocessors_linenumbers_column #1{\page_lines_add_numbers_to_box{#1}\currentcolumn\nofcolumns\zerocount}
-
-\def\page_lines_parameters_regular
- {continue = "\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi",
- start = \number\linenumberingparameter\c!start,
- step = \number\linenumberingparameter\c!step,
- method = "\linenumberingparameter\c!method",
- tag = "\currentlinenumbering"}
-
-\def\page_lines_parameters_update
- {continue = "\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi"}
-
-\def\page_lines_start_define
- {\setxvalue{\??linenumberinginstance\currentlinenumbering}{\ctxcommand{registerlinenumbering({\page_lines_parameters_regular})}}}
-
-\def\page_lines_start_update
- {\ctxcommand{setuplinenumbering(\csname\??linenumberinginstance\currentlinenumbering\endcsname,{\page_lines_parameters_update})}}
-
-\def\page_lines_setup
- {\ifcsname \??linenumberinginstance\currentlinenumbering\endcsname
- \ctxcommand{setuplinenumbering(\csname\??linenumberinginstance\currentlinenumbering\endcsname,{\page_lines_parameters_regular})}%
- \fi}
-
-% we could make this a bit more efficient by putting the end reference
-% in the same table as the start one but why make things complex ...
-
-\let\dofinishlinereference\dofinishfullreference % at lua end
-
-\unexpanded\def\page_lines_some_reference#1#2#3%
- {\dontleavehmode\begingroup
- \global\advance\c_page_lines_reference\plusone
- \attribute\linereferenceattribute\c_page_lines_reference
- #3%
- % for the moment we use a simple system i.e. no prefixes etc .. todo: store as number
- \normalexpanded{\strc_references_set_named_reference{line}{#2}{conversion=\linenumberingparameter\c!conversion}{\the\c_page_lines_reference}}% kind labels userdata text
- \endgroup}
-
-\def\page_lines_reference_start#1{\page_lines_some_reference{#1}{lr:b:#1}{}\ignorespaces}
-\def\page_lines_reference_stop #1{\removeunwantedspaces\page_lines_some_reference{#1}{lr:e:#1}{}}
-
-% \def\mklinestartreference#1[#2]{\in{#1}[lr:b:#2]} % not interfaced/ not used
-% \def\mklinestopreference #1[#2]{\in{#1}[lr:e:#2]} % not interfaced/ not used
-
-\newif\ifnumberinglines % will change
-\newif\iftypesettinglines % will change
-
-\installcorenamespace{linenumbering}
-
-\installcommandhandler \??linenumbering {linenumbering} \??linenumbering
-
-\setnewconstant\c_page_lines_mode \plusone % 0=continue, 1=restart
-\setnewconstant\c_page_lines_location \plusone % 0=middle, 1=left, 2=right, 3=inner, 4=outer, 5=text, 6=begin, 7=end
-\setnewconstant\c_page_lines_alignment\plusfive % 0=middle, 1=left, 2=right, 5=auto
-
-\newdimen\d_page_lines_width
-\newdimen\d_page_lines_distance
-
-\newevery \beforeeverylinenumbering \relax
-\newevery \aftereverylinenumbering \relax
-\newevery \everylinenumber \relax
-
-\appendtoks
- \page_lines_setup
-\to \everysetuplinenumbering
-
-\appendtoks
- \page_lines_start_define
-\to \everydefinelinenumbering
-
-\setuplinenumbering
- [\c!conversion=\v!numbers,
- \c!start=1,
- \c!step=1,
- \c!method=\v!first,
- \c!continue=\v!no,
- \c!location=\v!left,
- \c!style=,
- \c!color=,
- \c!width=2\emwidth,
- \c!left=,
- \c!right=,
- \c!command=,
- \c!distance=\zeropoint,
- \c!align=\v!auto]
-
-\definelinenumbering
- []
-
-% no intermediate changes in values, define a class, otherwise each range
-% would need a number
-
-% todo: text
-
-\installcorenamespace{linennumberinglocation}
-\installcorenamespace{linennumberingalternative}
-
-\expandafter\let\csname\??linennumberinglocation\v!middle \endcsname \zerocount
-\expandafter\let\csname\??linennumberinglocation\v!left \endcsname \plusone
-\expandafter\let\csname\??linennumberinglocation\v!margin \endcsname \plusone
-\expandafter\let\csname\??linennumberinglocation\v!inmargin \endcsname \plusone
-\expandafter\let\csname\??linennumberinglocation\v!inleft \endcsname \plusone
-\expandafter\let\csname\??linennumberinglocation\v!right \endcsname \plustwo
-\expandafter\let\csname\??linennumberinglocation\v!inright \endcsname \plustwo
-\expandafter\let\csname\??linennumberinglocation\v!inner \endcsname \plusthree
-\expandafter\let\csname\??linennumberinglocation\v!outer \endcsname \plusfour
-\expandafter\let\csname\??linennumberinglocation\v!text \endcsname \plusfive
-\expandafter\let\csname\??linennumberinglocation\v!begin \endcsname \plussix
-\expandafter\let\csname\??linennumberinglocation\v!end \endcsname \plusseven
-
-\expandafter\let\csname\??linennumberingalternative\v!middle \endcsname \zerocount
-\expandafter\let\csname\??linennumberingalternative\v!right \endcsname \plusone
-\expandafter\let\csname\??linennumberingalternative\v!flushleft \endcsname \plusone
-\expandafter\let\csname\??linennumberingalternative\v!left \endcsname \plustwo
-\expandafter\let\csname\??linennumberingalternative\v!flushright\endcsname \plustwo
-\expandafter\let\csname\??linennumberingalternative\v!auto \endcsname \plusfive
-
-% \startlinenumbering[<startvalue>|continue|settings|name]
-% \startlinenumbering[name][<startvalue>|continue|settings]
-
-\unexpanded\def\startlinenumbering
- {\dodoubleempty\page_lines_start}
-
-\def\page_lines_start % we stay downward compatible
- {\begingroup
- \ifsecondargument
- \expandafter\page_lines_start_two
- \else\iffirstargument
- \doubleexpandafter\page_lines_start_one
- \else
- \doubleexpandafter\page_lines_start_zero
- \fi\fi}
-
-\def\page_lines_start_zero[#1][#2]%
- {\edef\m_argument{\linenumberingparameter\c!continue}%
- \ifx\m_argument\v!continue
- \c_page_lines_mode\zerocount
- \else
- \c_page_lines_mode\plusone
- \fi
- \page_lines_start_followup}
-
-\def\page_lines_start_one[#1][#2]% [continue|<number>|settings] % historic
- {\edef\m_argument{#1}%
- \ifx\m_argument\v!continue
- \c_page_lines_mode\zerocount
- \let\currentlinenumbering\empty
- \else
- \c_page_lines_mode\plusone
- \ifx\m_argument\v!empty
- \let\currentlinenumbering\empty
- \else
- \doifassignmentelse{#1}
- {\let\currentlinenumbering\empty
- \setupcurrentlinenumbering[#1]}
- {\doifnumberelse\m_argument
- {\let\currentlinenumbering\empty
- \letlinenumberingparameter\c!start\m_argument}
- {\let\currentlinenumbering\m_argument}}%
- \fi
- \edef\p_continue{\linenumberingparameter\c!continue}%
- \ifx\p_continue\v!yes
- \c_page_lines_mode\zerocount
- \fi
- \fi
- \page_lines_start_followup}
-
-\def\page_lines_start_two[#1][#2]% [tag][continue|<number>|settings]
- {\edef\currentlinenumbering{#1}%
- \edef\m_argument{#2}%
- \ifx\m_argument\v!continue
- \c_page_lines_mode\zerocount
- \else
- \c_page_lines_mode\plusone
- \ifx\m_argument\v!empty \else
- \doifassignmentelse{#2}
- {\setupcurrentlinenumbering[#2]}
- {\doifnumber\m_argument
- {\letlinenumberingparameter\c!start\m_argument}}%
- \fi
- \edef\p_continue{\linenumberingparameter\c!continue}%
- \ifx\p_continue\v!yes
- \c_page_lines_mode\zerocount
- \fi
- \fi
- \page_lines_start_followup}
-
-\def\page_lines_start_followup
- {\numberinglinestrue
- \the\beforeeverylinenumbering
- \globallet\page_postprocessors_page \page_postprocessors_linenumbers_page
- \globallet\page_postprocessors_column\page_postprocessors_linenumbers_column
- \global\settrue\page_postprocessors_needed_box % see core-rul.mkiv
- \ifcase\c_page_lines_mode\relax
- \page_lines_start_update % continue
- \or
- \page_lines_start_define % only when assignment
- \fi
- \attribute\linenumberattribute\getvalue{\??linenumberinginstance\currentlinenumbering}\relax}
-
-\unexpanded\def\stoplinenumbering
- {\attribute\linenumberattribute\attributeunsetvalue
- \the\aftereverylinenumbering
- \endgroup}
-
-% number placement .. will change into (the new) margin code
-
-\def\page_lines_number_inner_indeed{\doifoddpageelse\page_lines_number_left_indeed\page_lines_number_right_indeed}
-\def\page_lines_number_outer_indeed{\doifoddpageelse\page_lines_number_right_indeed\page_lines_number_left_indeed}
-
-\def\page_lines_number_left
- {\ifcase\c_page_lines_location
- \expandafter\page_lines_number_left_indeed
- \or
- \expandafter\page_lines_number_left_indeed
- \or
- \expandafter\page_lines_number_left_indeed
- \or
- \expandafter\page_lines_number_inner_indeed
- \or
- \expandafter\page_lines_number_outer_indeed
- \or
- \expandafter\page_lines_number_text_indeed
- \or
- \expandafter\page_lines_number_begin_indeed
- \or
- \expandafter\page_lines_number_end_indeed
- \fi}
-
-\def\page_lines_number_right
- {\ifcase\c_page_lines_location
- \expandafter\page_lines_number_right_indeed
- \or
- \expandafter\page_lines_number_right_indeed
- \or
- \expandafter\page_lines_number_right_indeed
- \or
- \expandafter\page_lines_number_outer_indeed
- \or
- \expandafter\page_lines_number_inner_indeed
- \or
- \expandafter\page_lines_number_text_indeed
- \or
- \expandafter\page_lines_number_end_indeed
- \or
- \expandafter\page_lines_number_begin_indeed
- \fi}
-
-\newconditional\c_page_lines_fake_number
-\newconstant \b_page_lines_number
-\newconstant \c_page_lines_column
-\newconstant \c_page_lines_last_column
-
-\def\page_lines_add_numbers_to_box#1#2#3#4% box col max nesting
- {\bgroup
- \b_page_lines_number #1\relax
- \c_page_lines_column #2\relax
- \c_page_lines_last_column#3\relax
- \c_page_lines_nesting #4\relax
- \fullrestoreglobalbodyfont
- \let\makelinenumber\page_lines_make_number % used at lua end
- \setbox\b_page_lines_scratch\vbox
- {\forgetall
- \offinterlineskip
- \ctxcommand{linenumbersstageone(\number\b_page_lines_number,\ifcase\c_page_lines_nesting false\else true\fi)}}%
- \ctxcommand{linenumbersstagetwo(\number\b_page_lines_number,\number\b_page_lines_scratch)}% can move to lua code
- \egroup}
-
-\let\page_lines_make_number_indeed\relax
-
-\def\page_lines_make_number#1#2%
- {\edef\currentlinenumbering{#1}%
- \ifcase#2\relax
- \settrue \c_page_lines_fake_number
- \else
- \setfalse\c_page_lines_fake_number
- \fi
- \c_page_lines_location \executeifdefined{\??linennumberinglocation \linenumberingparameter\c!location}\plusone \relax % left
- \c_page_lines_alignment\executeifdefined{\??linennumberingalternative\linenumberingparameter\c!align }\plusfive\relax % auto
- \ifcase\c_page_lines_last_column\relax
- \settrue \c_page_lines_fake_number
- \or
- % one column
- \ifcase\c_page_lines_location
- \settrue \c_page_lines_fake_number
- \let\page_lines_make_number_indeed\page_lines_number_fake_indeed
- \or
- \let\page_lines_make_number_indeed\page_lines_number_left
- \or
- \let\page_lines_make_number_indeed\page_lines_number_right
- \or % inner
- \let\page_lines_make_number_indeed\page_lines_number_inner_indeed
- \or % outer
- \let\page_lines_make_number_indeed\page_lines_number_outer_indeed
- \or % text
- \let\page_lines_make_number_indeed\page_lines_number_text_indeed
- \or
- \let\page_lines_make_number_indeed\page_lines_number_begin_indeed
- \or
- \let\page_lines_make_number_indeed\page_lines_number_end_indeed
- \fi
- \else\ifcase\c_page_lines_column\relax
- \settrue \c_page_lines_fake_number
- \or
- \let\page_lines_make_number_indeed\page_lines_number_left
- \ifcase\c_page_lines_location\or
- \c_page_lines_location\plusone
- \or
- \c_page_lines_location\plustwo
- \else
- \c_page_lines_location\plusone
- \or
- \c_page_lines_location\plusone
- \or
- \c_page_lines_location\plusone
- \or
- \c_page_lines_location\plusone % todo
- \or
- \c_page_lines_location\plusone % todo
- \fi
- \else
- \let\page_lines_make_number_indeed\page_lines_number_right
- \ifcase\c_page_lines_location\or
- \c_page_lines_location\plustwo
- \or
- \c_page_lines_location\plusone
- \or
- \c_page_lines_location\plustwo
- \or
- \c_page_lines_location\plustwo
- \or
- \c_page_lines_location\plustwo % todo
- \or
- \c_page_lines_location\plustwo % todo
- \fi
- \fi\fi
- \page_lines_make_number_indeed{#1}}
-
-\let\page_lines_number_fake_indeed\gobblesixarguments % needs checking
-
-\def\page_lines_number_text_indeed#1#2#3#4#5#6% beware, one needs so compensate for this in the \hsize
- {\hbox{\page_lines_number_construct{#1}{2}{#2}{#5}\hskip#3\scaledpoint}}
-
-\def\page_lines_number_left_indeed#1#2#3#4#5#6%
- {\naturalhbox to \zeropoint
- {\ifcase\istltdir#6\else \hskip-#4\scaledpoint \fi
- \llap{\page_lines_number_construct{#1}{2}{#2}{#5}\kern#3\scaledpoint}}}
-
-\def\page_lines_number_right_indeed#1#2#3#4#5#6%
- {\naturalhbox to \zeropoint
- {\ifcase\istltdir#6\else \hskip-#4\scaledpoint \fi
- \rlap{\hskip\dimexpr#4\scaledpoint+#3\scaledpoint\relax\page_lines_number_construct{#1}{1}{#2}{#5}}}}
-
-\def\page_lines_number_begin_indeed#1#2#3#4#5#6%
- {\ifcase\istltdir#6\relax
- \c_page_lines_location\plusone
- \expandafter\page_lines_number_left_indeed
- \else
- \c_page_lines_location\plustwo
- \expandafter\page_lines_number_left_indeed
- \fi{#1}{#2}{#3}{#4}{#5}{#6}}
-
-\def\page_lines_number_end_indeed#1#2#3#4#5#6%
- {\ifcase\istltdir#6\relax
- \c_page_lines_location\plustwo
- \expandafter\page_lines_number_left_indeed
- \else
- \c_page_lines_location\plusone
- \expandafter\page_lines_number_left_indeed
- \fi{#1}{#2}{#3}{#4}{#5}{#6}}
-
-\def\page_lines_number_construct#1#2#3#4% tag 1=left|2=right linenumber leftskip
- {\begingroup
- \def\currentlinenumbering{#1}%
- \def\linenumber{#3}% unsafe
- \doifelse{\linenumberingparameter\c!width}\v!margin
- {\d_page_lines_width\leftmarginwidth}
- {\d_page_lines_width\linenumberingparameter\c!width}%
- \d_page_lines_distance\linenumberingparameter\c!distance\relax
- \ifcase#2\relax\or\hskip\d_page_lines_distance\fi\relax
- \ifnum\c_page_lines_location=\plusfive
- \scratchdimen\dimexpr#4\scaledpoint-\d_page_lines_distance\relax
- \c_page_lines_location\plusone
- \else
- \scratchdimen\zeropoint
- \fi
- \ifcase\c_page_lines_alignment
- \c_page_lines_location\zerocount % middle
- \or
- \c_page_lines_location\plusone % left
- \or
- \c_page_lines_location\plustwo % right
- \fi
- \ifconditional\tracelinenumbering\ruledhbox\else\hbox\fi to \d_page_lines_width
- {\ifcase\c_page_lines_location
- \hss % middle
- \or
- % left
- \or
- \hss % right
- \or
- \doifoddpageelse\relax\hss % inner
- \or
- \doifoddpageelse\hss\relax % outer
- \fi
- \ifconditional\c_page_lines_fake_number
- % we need to reserve space
- \else
- \uselinenumberingstyleandcolor\c!style\c!color
- \linenumberingparameter\c!command
- {\linenumberingparameter\c!left
- \convertnumber{\linenumberingparameter\c!conversion}{#3}%
- \linenumberingparameter\c!right}%
- \fi
- \ifcase\c_page_lines_location
- \hss % middle
- \or
- \hss % left
- \or
- % right
- \or
- \doifoddpageelse\hss\relax % inner
- \or
- \doifoddpageelse\relax\hss % outer
- \fi}%
- \ifcase#2\relax
- \hskip-\scratchdimen
- \or
- \hskip-\scratchdimen
- \or
- \hskip\dimexpr\d_page_lines_distance-\scratchdimen\relax
- \fi
- \relax
- \the\everylinenumber
- \endgroup}
-
-% referencing
-
-\unexpanded\def\someline [#1]{\page_lines_reference_start{#1}\page_lines_reference_stop{#1}} % was just a def
-\unexpanded\def\startline[#1]{\page_lines_reference_start{#1}}
-\unexpanded\def\stopline [#1]{\page_lines_reference_stop {#1}}
-
-\def\page_lines_reference_show_start#1%
- {\ifconditional\tracelinenumbering
- \setbox\scratchbox\hbox{\llap
- {\vrule\s!width\onepoint\s!depth\strutdp\s!height.8\strutht\raise.85\strutht\hbox{\llap{\tt\txx#1}}}}%
- \smashbox\scratchbox
- \box\scratchbox
- \fi}
-
-\def\page_lines_reference_show_stop#1%
- {\ifconditional\tracelinenumbering
- \setbox\scratchbox\hbox{\rlap
- {\raise.85\strutht\hbox{\rlap{\tt\txx#1}}\vrule\s!width\onepoint\s!depth\strutdp\s!height.8\strutht}}%
- \smashbox\scratchbox
- \box\scratchbox
- \fi}
-
-\def\page_lines_reference_start#1{\page_lines_some_reference{#1}{lr:b:#1}{\page_lines_reference_show_start{#1}}\ignorespaces}
-\def\page_lines_reference_stop #1{\removeunwantedspaces\page_lines_some_reference{#1}{lr:e:#1}{\page_lines_reference_show_stop{#1}}}
-
-% eventually we will do this in lua
-
-\def\currentreferencelinenumber{\ctxcommand{filterreference("linenumber")}}
-
-\let\m_page_lines_from\empty
-\let\m_page_lines_to \empty
-
-\unexpanded\def\doifelsesamelinereference#1#2#3%
- {\doifreferencefoundelse{lr:b:#1}
- {\edef\m_page_lines_from{\currentreferencelinenumber}%
- \doifreferencefoundelse{lr:e:#1}
- {\edef\m_page_lines_to{\currentreferencelinenumber}%
- %[\m_page_lines_from,\m_page_lines_to]
- \ifx\m_page_lines_from\m_page_lines_to#2\else#3\fi}
- {#2}}
- {#2}}
-
-\unexpanded\def\inline#1[#2]%
- {\doifelsenothing{#1}
- {\doifelsesamelinereference{#2}
- {\in{\leftlabeltext\v!line}{\rightlabeltext\v!line}[lr:b:#2]}
- {\in{\leftlabeltext\v!lines}{}[lr:b:#2]--\in{}{\rightlabeltext\v!lines}[lr:e:#2]}}
- {\doifelsesamelinereference{#2}
- {\in{#1}[lr:b:#2]}
- {\in{#1}[lr:b:#2]--\in[lr:e:#2]}}}
-
-\unexpanded\def\inlinerange[#1]%
- {\doifelsesamelinereference{#1}
- {\in[lr:b:#1]}
- {\in[lr:b:#1]\endash\in[lr:e:#1]}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-mix.mkiv b/Master/texmf-dist/tex/context/base/page-mix.mkiv
index 41897f6ddc7..57de14b88b4 100644
--- a/Master/texmf-dist/tex/context/base/page-mix.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-mix.mkiv
@@ -29,6 +29,7 @@
% wide floats
% move floats
% offsets (inner ones, so we change the hsize ... needed with backgrounds
+% when no content we currently loose the page
% luatex buglet:
%
@@ -208,7 +209,7 @@
\fi
\global\setbox\b_page_mix_preceding\vbox
{\page_otr_command_flush_top_insertions
- \ifdim\ht\b_page_mix_preceding=\zeropoint \else
+ \ifdim\htdp\b_page_mix_preceding=\zeropoint \else
\writestatus\m!columns{preceding error}%
\unvbox\b_page_mix_preceding
\fi
diff --git a/Master/texmf-dist/tex/context/base/publ-dat.lua b/Master/texmf-dist/tex/context/base/publ-dat.lua
index b463064ca53..5e255029a48 100644
--- a/Master/texmf-dist/tex/context/base/publ-dat.lua
+++ b/Master/texmf-dist/tex/context/base/publ-dat.lua
@@ -24,8 +24,9 @@ end
local chardata = characters.data
local lowercase = characters.lower
-local lower, gsub, concat = string.lower, string.gsub, table.concat
-local next, type = next, type
+local lower, gsub, find = string.lower, string.gsub, string.find
+local concat = table.concat
+local next, type, rawget = next, type, rawget
local utfchar = utf.char
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local textoutf = characters and characters.tex.toutf
@@ -73,6 +74,42 @@ local defaultshortcuts = {
dec = "12",
}
+local l_splitter = lpeg.tsplitat("+")
+local d_splitter = lpeg.splitat ("+")
+
+function publications.parenttag(dataset,tag)
+ if find(tag,"%+") then
+ local tags = lpegmatch(l_splitter,tag)
+ local parent = tags[1]
+ local luadata = datasets[dataset].luadata
+ local first = luadata[parent]
+ if first then
+ local combined = first.combined
+ if not combined then
+ combined = { }
+ first.combined = combined
+ end
+ -- add new ones but only once
+ for i=2,#tags do
+ local tag = tags[i]
+ for j=1,#combined do
+ if combined[j] == tag then
+ tag = false
+ end
+ end
+ if tag then
+ local entry = luadata[tag]
+ if entry then
+ combined[#combined+1] = tag
+ end
+ end
+ end
+ return parent
+ end
+ end
+ return tag
+end
+
function publications.new(name)
publicationsstats.nofdatasets = publicationsstats.nofdatasets + 1
local dataset = {
@@ -95,6 +132,9 @@ function publications.new(name)
userdata = false,
},
}
+ -- we delay details till we need it (maybe we just delay the
+ -- individual fields but that is tricky as there can be some
+ -- depedencies)
setmetatableindex(dataset,function(t,k)
-- will become a plugin
if k == "details" and publications.enhance then
@@ -150,7 +190,7 @@ local filter_2 = Cs(
)
-- Currently we expand shortcuts and for large ones (like the acknowledgements
--- in tugboat.bib this is not that efficient. However, eventually strings get
+-- in tugboat.bib) this is not that efficient. However, eventually strings get
-- hashed again.
local function do_shortcut(key,value,dataset)
diff --git a/Master/texmf-dist/tex/context/base/publ-imp-cite.mkiv b/Master/texmf-dist/tex/context/base/publ-imp-cite.mkiv
index d64c2132cee..0f0c69fa70c 100644
--- a/Master/texmf-dist/tex/context/base/publ-imp-cite.mkiv
+++ b/Master/texmf-dist/tex/context/base/publ-imp-cite.mkiv
@@ -11,64 +11,217 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\startsetups btx:cite:author
- \btxcitevariant{author}
-\stopsetups
+\unprotect
-\startsetups btx:cite:authoryear
- \btxcitevariant{authoryear}
-\stopsetups
+% The null case:
-\startsetups btx:cite:authoryears
- \btxcitevariant{authoryears}
+\startsetups \s!btx:\s!cite:none
+ % dummy
\stopsetups
-% \startsetups btx:cite:authornum
-% \btxcitevariant{author}
-% \btxcitevariantparameter\c!inbetween
-% \btxcitevariant{num}
-% \stopsetups
+% This saves keying:
-\startsetups btx:cite:authornum
- \btxcitevariant{authornum}
+\startsetups \s!btx:\s!cite:common:normal
+ \ifx\currentbtxsecond\empty
+ \currentbtxfirst
+ \else
+ \currentbtxfirst
+ \btxcitevariantparameter\v!inbetween
+ \currentbtxsecond
+ \fi
\stopsetups
-\startsetups btx:cite:year
- \btxcitevariant{year}
+\startsetups \s!btx:\s!cite:common:range
+ \ifx\currentbtxsecond\empty
+ \currentbtxfirst
+ \else
+ \currentbtxfirst
+ \btxcitevariantparameter\c!range
+ \currentbtxsecond
+ \fi
\stopsetups
-\startsetups btx:cite:short
- \btxcitevariant{short}
+\startsetups \s!btx:\s!cite:concat
+ \ifcase\currentbtxconcat \or \or
+ \btxcitevariantparameter\c!pubsep
+ \or
+ \btxcitevariantparameter\c!finalpubsep
+ \or
+ \btxcitevariantparameter\c!lastpubsep
+ \fi
\stopsetups
-\startsetups btx:cite:serial
- \btxcitevariant{serial}
+% \startsetups \s!btx:\s!cite:render:normal
+% \directsetup{\s!btx:\s!cite:concat}
+% \ifconditional\btxinteractive
+% \goto {
+% \directsetup{\s!btx:\s!cite:common:normal}
+% } [
+% \s!internal(\currentbtxinternal)
+% ]
+% \else
+% \directsetup{\s!btx:\s!cite:common:normal}
+% \fi
+% \stopsetups
+%
+% more efficient:
+
+\startsetups \s!btx:\s!cite:render:normal
+ \directsetup{\s!btx:\s!cite:concat}
+ \ifconditional\btxinteractive
+ \goto {
+ \ifx\currentbtxsecond\empty
+ \currentbtxfirst
+ \else
+ \currentbtxfirst
+ \btxcitevariantparameter\v!inbetween
+ \currentbtxsecond
+ \fi
+ } [
+ \s!internal(\currentbtxinternal)
+ ]
+ \else
+ \ifx\currentbtxsecond\empty
+ \currentbtxfirst
+ \else
+ \currentbtxfirst
+ \btxcitevariantparameter\v!inbetween
+ \currentbtxsecond
+ \fi
+ \fi
\stopsetups
-\startsetups btx:cite:key
- \currentbtxtag % \btxcitevariant{tag}
+% \startsetups \s!btx:\s!cite:render:range
+% \directsetup{\s!btx:\s!cite:concat}
+% \ifconditional\btxinteractive
+% \goto {
+% \directsetup{\s!btx:\s!cite:common:range}
+% } [
+% \s!internal(\currentbtxinternal)
+% ]
+% \else
+% \directsetup{\s!btx:\s!cite:common:range}
+% \fi
+% \stopsetups
+%
+% more efficient:
+
+\startsetups \s!btx:\s!cite:render:range
+ \directsetup{\s!btx:\s!cite:concat}
+ \ifconditional\btxinteractive
+ \goto {
+ \ifx\currentbtxsecond\empty
+ \currentbtxfirst
+ \else
+ \currentbtxfirst
+ \btxcitevariantparameter\c!range
+ \currentbtxsecond
+ \fi
+ } [
+ \s!internal(\currentbtxinternal)
+ ]
+ \else
+ \ifx\currentbtxsecond\empty
+ \currentbtxfirst
+ \else
+ \currentbtxfirst
+ \btxcitevariantparameter\c!range
+ \currentbtxsecond
+ \fi
+ \fi
\stopsetups
-\startsetups btx:cite:doi
- todo: \btxcitevariant{doi}
+\startsetups \s!btx:\s!cite:render:variant
+ \directsetup{\s!btx:\s!cite:concat}
+ \ifconditional\btxinteractive
+ \goto {
+ \directsetup{\s!btx:\s!cite:render:\currentbtxcitevariant}
+ } [
+ \s!internal(\currentbtxinternal)
+ ]
+ \else
+ \directsetup{\s!btx:\s!cite:render:\currentbtxcitevariant}
+ \fi
\stopsetups
-\startsetups btx:cite:url
- todo: \btxcitevariant{url}
+% author lists: can be less
+
+\startsetups \s!btx:\s!cite:common:author
+ \ifx\currentbtxcitevariant\v!normal
+ \currentbtxfirst
+ \else
+ \currentbtxciteauthor
+ \fi
\stopsetups
-\startsetups btx:cite:type
- \btxcitevariant{category}
+\startsetups \s!btx:\s!cite:render:author
+ \directsetup{\s!btx:\s!cite:common:author}
+\stopsetups
+\startsetups \s!btx:\s!cite:render:authoryear
+ \directsetup{\s!btx:\s!cite:common:author}
+\stopsetups
+\startsetups \s!btx:\s!cite:render:authoryears
+ \directsetup{\s!btx:\s!cite:common:author}
+\stopsetups
+\startsetups \s!btx:\s!cite:render:authornum
+ \directsetup{\s!btx:\s!cite:common:author}
\stopsetups
-\startsetups btx:cite:page
- \btxcitevariant{page}
+\startsetups \s!btx:\s!cite:author:num
+ \directsetup{\s!btx:\s!cite:render:range}
+\stopsetups
+\startsetups \s!btx:\s!cite:author:year
+ \directsetup{\s!btx:\s!cite:render:range}
+\stopsetups
+\startsetups \s!btx:\s!cite:author:years
+ \directsetup{\s!btx:\s!cite:render:range}
\stopsetups
-\startsetups btx:cite:none
- % dummy
+\startsetups \s!btx:\s!cite:author
+ \directsetup{\s!btx:\s!cite:render:variant}
+\stopsetups
+\startsetups \s!btx:\s!cite:authoryear
+ \directsetup{\s!btx:\s!cite:render:variant}
+\stopsetups
+\startsetups \s!btx:\s!cite:authoryears
+ \directsetup{\s!btx:\s!cite:render:variant}
+\stopsetups
+\startsetups \s!btx:\s!cite:authornum
+ \directsetup{\s!btx:\s!cite:render:variant}
\stopsetups
-\startsetups btx:cite:num
- \btxcitevariant{num}
+\startsetups \s!btx:\s!cite:year
+ \directsetup{\s!btx:\s!cite:render:range}
+\stopsetups
+\startsetups \s!btx:\s!cite:short
+ \directsetup{\s!btx:\s!cite:render:normal}
+\stopsetups
+\startsetups \s!btx:\s!cite:serial
+ \directsetup{\s!btx:\s!cite:render:range}
+\stopsetups
+\startsetups \s!btx:\s!cite:tag
+ \directsetup{\s!btx:\s!cite:render:normal}
+\stopsetups
+\startsetups \s!btx:\s!cite:key
+ \directsetup{\s!btx:\s!cite:render:normal}
\stopsetups
+\startsetups \s!btx:\s!cite:doi
+ \directsetup{\s!btx:\s!cite:render:normal}
+\stopsetups
+\startsetups \s!btx:\s!cite:url
+ \directsetup{\s!btx:\s!cite:render:normal}
+\stopsetups
+\startsetups \s!btx:\s!cite:category
+ \directsetup{\s!btx:\s!cite:render:normal}
+\stopsetups
+\startsetups \s!btx:\s!cite:type
+ \directsetup{\s!btx:\s!cite:render:normal}
+\stopsetups
+\startsetups \s!btx:\s!cite:num
+ \directsetup{\s!btx:\s!cite:render:range}
+\stopsetups
+\startsetups \s!btx:\s!cite:page
+ \directsetup{\s!btx:\s!cite:render:normal}
+\stopsetups
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/publ-ini.lua b/Master/texmf-dist/tex/context/base/publ-ini.lua
index e25c57e297d..d713f552cb5 100644
--- a/Master/texmf-dist/tex/context/base/publ-ini.lua
+++ b/Master/texmf-dist/tex/context/base/publ-ini.lua
@@ -6,10 +6,12 @@ if not modules then modules = { } end modules ['publ-ini'] = {
license = "see context related readme files"
}
--- for the moment here
+-- we could store the destinations in the user list entries
+
+-- will move:
local lpegmatch = lpeg.match
-local P, C, Ct, Cs = lpeg.P, lpeg.C, lpeg.Ct, lpeg.Cs
+local P, R, C, Ct, Cs = lpeg.P, lpeg.R, lpeg.C, lpeg.Ct, lpeg.Cs
local lpegmatch = lpeg.match
local pattern = Cs((1 - P(1) * P(-1))^0 * (P(".")/"" + P(1)))
@@ -41,19 +43,26 @@ end
-- use: for rest in gmatch(reference,"[^, ]+") do
-local next, rawget, type = next, rawget, type
+local next, rawget, type, tostring, tonumber = next, rawget, type, tostring, tonumber
local match, gmatch, format, gsub = string.match, string.gmatch, string.format, string.gsub
-local concat, sort = table.concat, table.sort
+local concat, sort, tohash = table.concat, table.sort, table.tohash
local utfsub = utf.sub
local formatters = string.formatters
local allocate = utilities.storage.allocate
local settings_to_array, settings_to_set = utilities.parsers.settings_to_array, utilities.parsers.settings_to_set
local sortedkeys, sortedhash = table.sortedkeys, table.sortedhash
+local setmetatableindex = table.setmetatableindex
local lpegmatch = lpeg.match
local P, C, Ct = lpeg.P, lpeg.C, lpeg.Ct
-local report = logs.reporter("publications")
-local trace = false trackers.register("publications", function(v) trace = v end)
+local report = logs.reporter("publications")
+local report_cite = logs.reporter("publications","cite")
+local report_reference = logs.reporter("publications","reference")
+
+local trace = false trackers.register("publications", function(v) trace = v end)
+local trace_cite = false trackers.register("publications.cite", function(v) trace_cite = v end)
+local trace_missing = false trackers.register("publications.cite.missing", function(v) trace_missing = v end)
+local trace_references = false trackers.register("publications.cite.references", function(v) trace_references = v end)
local datasets = publications.datasets
@@ -70,7 +79,7 @@ local v_left = variables.left
local v_right = variables.right
local v_middle = variables.middle
local v_inbetween = variables.inbetween
-
+local v_yes = variables.yes
local v_short = variables.short
local v_cite = variables.cite
local v_default = variables.default
@@ -91,6 +100,8 @@ local sortcomparer = sorters.comparers.basic -- (a,b)
local sortstripper = sorters.strip
local sortsplitter = sorters.splitters.utf
+local settings_to_array = utilities.parsers.settings_to_array
+
local context = context
local ctx_btxlistparameter = context.btxlistparameter
@@ -105,8 +116,20 @@ local ctx_gobbleoneargument = context.gobbleoneargument
local ctx_btxdirectlink = context.btxdirectlink
local ctx_btxhandlelistentry = context.btxhandlelistentry
local ctx_btxchecklistentry = context.btxchecklistentry
-local ctx_dodirectfullreference = context.dodirectfullreference
+local ctx_btxchecklistcombi = context.btxchecklistcombi
+----- ctx_dodirectfullreference = context.dodirectfullreference
+local ctx_btxsetreference = context.btxsetreference
local ctx_directsetup = context.directsetup
+local ctx_btxmissing = context.btxmissing
+
+local ctx_btxsettag = context.btxsettag
+local ctx_btxcitesetup = context.btxcitesetup
+local ctx_btxsetfirst = context.btxsetfirst
+local ctx_btxsetsecond = context.btxsetsecond
+local ctx_btxsetinternal = context.btxsetinternal
+local ctx_btxsetconcat = context.btxsetconcat
+local ctx_btxstartsubcite = context.btxstartsubcite
+local ctx_btxstopsubcite = context.btxstopsubcite
statistics.register("publications load time", function()
local publicationsstats = publications.statistics
@@ -249,6 +272,197 @@ if not publications.authors then
initializer() -- for now, runtime loaded
end
+local usedentries = { }
+local initialized = false
+
+-- {
+-- ["metadata"]=1,
+-- ["references"]={
+-- ["block"]="bodypart",
+-- ["internal"]=2,
+-- ["realpage"]=1,
+-- ["section"]=0,
+-- },
+-- ["userdata"]={
+-- ["btxref"]="Cleveland1985",
+-- ["btxset"]="standard",
+-- },
+-- },
+
+setmetatableindex(usedentries,function(t,k)
+ if not initialized then
+ usedentries = { }
+ local internals = structures.references.internals
+ for i=1,#internals do
+ local entry = internals[i]
+ local metadata = entry.metadata
+ if metadata.kind == "full" then
+ local userdata = entry.userdata
+ if userdata then
+ local set = userdata.btxset
+ if set then
+ local tag = userdata.btxref
+ local s = usedentries[set]
+ if s then
+ local u = s[tag]
+ if u then
+ u[#u+1] = entry
+ else
+ u = { entry }
+ s[tag] = u
+ end
+ else
+ usedentries[set] = { [tag] = { entry } }
+ end
+ end
+ end
+ end
+ end
+ return usedentries[k]
+ end
+end)
+
+-- local subsets = nil
+-- local block = tex.count.btxblock
+-- local collected = references.collected
+-- local prefix = nil -- todo: dataset ?
+-- if prefix and prefix ~= "" then
+-- subsets = { collected[prefix] or collected[""] }
+-- else
+-- local components = references.productdata.components
+-- local subset = collected[""]
+-- if subset then
+-- subsets = { subset }
+-- else
+-- subsets = { }
+-- end
+-- for i=1,#components do
+-- local subset = collected[components[i]]
+-- if subset then
+-- subsets[#subsets+1] = subset
+-- end
+-- end
+-- end
+-- if #subsets == 0 then
+-- subsets = { collected[""] }
+-- end
+-- local list = type(reference) == "string" and settings_to_array(reference) or reference
+-- local todo = table.tohash(list)
+-- if #subsets > 0 then
+-- local result, nofresult, done = { }, 0, { }
+-- for i=1,#subsets do
+-- local subset = subsets[i]
+-- for i=1,#list do
+-- local rest = list[i]
+-- local blk, tag, found = block, nil, nil
+-- if block then
+-- tag = f_destination(dataset,blk,rest)
+-- found = subset[tag]
+-- if not found then
+-- for i=block-1,1,-1 do
+-- tag = f_destination(dataset,i,rest)
+-- found = subset[tag]
+-- if found then
+-- blk = i
+-- break
+-- end
+-- end
+-- end
+-- end
+-- if not found then
+-- blk = "*"
+-- tag = f_destination(dataset,blk,rest)
+-- found = subset[tag]
+-- end
+-- if found then
+-- local entries = found.entries
+-- if entries then
+-- local current = tonumber(entries.text) -- todo: no ranges when no tonumber
+-- if current and not done[current] then
+-- nofresult = nofresult + 1
+-- result[nofresult] = { blk, rest, current, found.references.internal }
+-- done[current] = true
+-- end
+-- end
+-- end
+-- end
+-- end
+
+local reported = { }
+
+local function findallused(dataset,reference,block,section)
+ local tags = settings_to_array(reference)
+ local todo = { }
+ local okay = { } -- only if mark
+ local set = usedentries[dataset]
+ local valid = datasets[dataset].luadata
+ if set then
+ for i=1,#tags do
+ local tag = tags[i]
+ if valid[tag] then
+ local entry = set[tag]
+ if entry then
+ -- only once in a list
+ if #entry == 1 then
+ entry = entry[1]
+ else
+ -- find best match (todo)
+ entry = entry[1] -- for now
+ end
+ okay[#okay+1] = entry
+ end
+ todo[tag] = true
+ elseif not reported[tag] then
+ reported[tag] = true
+ report_cite("non-existent entry %a in %a",tag,dataset)
+ end
+ end
+ else
+ for i=1,#tags do
+ local tag = tags[i]
+ if valid[tag] then
+ todo[tag] = true
+ elseif not reported[tag] then
+ reported[tag] = true
+ report_cite("non-existent entry %a in %a",tag,dataset)
+ end
+ end
+ end
+ return okay, todo, tags
+end
+
+local function flushcollected(flush,nofcollected)
+ if nofcollected > 0 then
+ flush(1,1)
+ if nofcollected > 2 then
+ for i=2,nofcollected-1 do
+ flush(i,2)
+ end
+ flush(nofcollected,3)
+ elseif nofcollected > 1 then
+ flush(nofcollected,4)
+ end
+ end
+end
+
+local function markcite(dataset,tag)
+ if trace_cite then
+ report_cite("mark, dataset: %s, tag: %s",dataset,tag)
+ end
+ ctx_btxdomarkcitation(dataset,tag)
+end
+
+local function flushmarked(dataset,list,todo)
+ if todo then
+ for i=1,#list do
+ local tag = list[i]
+ if todo[tag] then
+ markcite(dataset,tag)
+ end
+ end
+ end
+end
+
-- basic access
local function getfield(dataset,tag,name)
@@ -344,10 +558,10 @@ function publications.enhance(dataset) -- for the moment split runs (maybe publi
if type(tags) == "table" then
sort(tags)
for i=1,#tags do
--- details[tags[i]].short = short .. numbertochar(i)
-local detail = details[tags[i]]
-detail.short = short
-detail.suffix = numbertochar(i)
+ -- details[tags[i]].short = short .. numbertochar(i)
+ local detail = details[tags[i]]
+ detail.short = short
+ detail.suffix = numbertochar(i)
end
else
details[tags].short = short
@@ -402,9 +616,9 @@ end
-- rendering of fields (maybe multiple manipulators)
-local manipulation = utilities.parsers.manipulation
-local manipulators = utilities.parsers.manipulators
-
+-- local manipulation = utilities.parsers.manipulation
+-- local manipulators = utilities.parsers.manipulators
+--
-- local function checked(field)
-- local m, f = lpegmatch(manipulation,field)
-- if m then
@@ -415,6 +629,7 @@ local manipulators = utilities.parsers.manipulators
-- end
local manipulation = Ct((C((1-P("->"))^1) * P("->"))^1) * C(P(1)^0)
+local manipulators = utilities.parsers.manipulators
local function checked(field)
local m, f = lpegmatch(manipulation,field)
@@ -443,7 +658,6 @@ function commands.btxflush(name,tag,field)
local manipulator, field = checked(field)
local value = fields[field]
if type(value) == "string" then
- -- context(manipulator and manipulator(value) or value)
context(manipulator and manipulated(manipulator,value) or value)
return
end
@@ -451,7 +665,6 @@ function commands.btxflush(name,tag,field)
if details then
local value = details[field]
if type(value) == "string" then
- -- context(manipulator and manipulator(value) or value)
context(manipulator and manipulated(manipulator,value) or value)
return
end
@@ -473,7 +686,6 @@ function commands.btxdetail(name,tag,field)
local manipulator, field = checked(field)
local value = details[field]
if type(value) == "string" then
- -- context(manipulator and manipulator(value) or value)
context(manipulator and manipulated(manipulator,value) or value)
else
report("unknown detail %a of tag %a in dataset %a",field,tag,name)
@@ -494,7 +706,6 @@ function commands.btxfield(name,tag,field)
local manipulator, field = checked(field)
local value = fields[field]
if type(value) == "string" then
- -- context(manipulator and manipulator(value) or value)
context(manipulator and manipulated(manipulator,value) or value)
else
report("unknown field %a of tag %a in dataset %a",field,tag,name)
@@ -550,44 +761,6 @@ end
-- -- alternative approach: keep data at the tex end
-function publications.listconcat(t)
- local n = #t
- if n > 0 then
- context(t[1])
- if n > 1 then
- if n > 2 then
- for i=2,n-1 do
- ctx_btxlistparameter("sep")
- context(t[i])
- end
- ctx_btxlistparameter("finalsep")
- else
- ctx_btxlistparameter("lastsep")
- end
- context(t[n])
- end
- end
-end
-
-function publications.citeconcat(t)
- local n = #t
- if n > 0 then
- context(t[1])
- if n > 1 then
- if n > 2 then
- for i=2,n-1 do
- ctx_btxcitevariantparameter("sep")
- context(t[i])
- end
- ctx_btxcitevariantparameter("finalsep")
- else
- ctx_btxcitevariantparameter("lastsep")
- end
- context(t[n])
- end
- end
-end
-
function publications.singularorplural(singular,plural)
if lastconcatsize and lastconcatsize > 1 then
context(plural)
@@ -596,106 +769,6 @@ function publications.singularorplural(singular,plural)
end
end
--- function commands.makebibauthorlist(settings) -- ?
--- if not settings then
--- return
--- end
--- local dataset = datasets[settings.dataset]
--- if not dataset or dataset == "" then
--- return
--- end
--- local tag = settings.tag
--- if not tag or tag == "" then
--- return
--- end
--- local asked = settings_to_array(tag)
--- if #asked == 0 then
--- return
--- end
--- local compress = settings.compress
--- local interaction = settings.interactionn == v_start
--- local limit = tonumber(settings.limit)
--- local found = { }
--- local hash = { }
--- local total = 0
--- local luadata = dataset.luadata
--- for i=1,#asked do
--- local tag = asked[i]
--- local data = luadata[tag]
--- if data then
--- local author = data.a or "Xxxxxxxxxx"
--- local year = data.y or "0000"
--- if not compress or not hash[author] then
--- local t = {
--- author = author,
--- name = name, -- first
--- year = { [year] = name },
--- }
--- total = total + 1
--- found[total] = t
--- hash[author] = t
--- else
--- hash[author].year[year] = name
--- end
--- end
--- end
--- for i=1,total do
--- local data = found[i]
--- local author = data.author
--- local year = table.keys(data.year)
--- table.sort(year)
--- if interaction then
--- for i=1,#year do
--- year[i] = formatters["\\bibmaybeinteractive{%s}{%s}"](data.year[year[i]],year[i])
--- end
--- end
--- ctx_setvalue("currentbibyear",concat(year,","))
--- if author == "" then
--- ctx_setvalue("currentbibauthor","")
--- else -- needs checking
--- local authors = settings_to_array(author) -- {{}{}},{{}{}}
--- local nofauthors = #authors
--- if nofauthors == 1 then
--- if interaction then
--- author = formatters["\\bibmaybeinteractive{%s}{%s}"](data.name,author)
--- end
--- ctx_setvalue("currentbibauthor",author)
--- else
--- limit = limit or nofauthors
--- if interaction then
--- for i=1,#authors do
--- authors[i] = formatters["\\bibmaybeinteractive{%s}{%s}"](data.name,authors[i])
--- end
--- end
--- if limit == 1 then
--- ctx_setvalue("currentbibauthor",authors[1] .. "\\bibalternative{otherstext}")
--- elseif limit == 2 and nofauthors == 2 then
--- ctx_setvalue("currentbibauthor",concat(authors,"\\bibalternative{andtext}"))
--- else
--- for i=1,limit-1 do
--- authors[i] = authors[i] .. "\\bibalternative{namesep}"
--- end
--- if limit < nofauthors then
--- authors[limit+1] = "\\bibalternative{otherstext}"
--- ctx_setvalue("currentbibauthor",concat(authors,"",1,limit+1))
--- else
--- authors[limit-1] = authors[limit-1] .. "\\bibalternative{andtext}"
--- ctx_setvalue("currentbibauthor",concat(authors))
--- end
--- end
--- end
--- end
--- -- the following use: currentbibauthor and currentbibyear
--- if i == 1 then
--- context.ixfirstcommand()
--- elseif i == total then
--- context.ixlastcommand()
--- else
--- context.ixsecondcommand()
--- end
--- end
--- end
-
local patterns = { "publ-imp-%s.mkiv", "publ-imp-%s.tex" }
local function failure(name)
@@ -731,7 +804,7 @@ local sections = structures.sections
local renderings = { } --- per dataset
-table.setmetatableindex(renderings,function(t,k)
+setmetatableindex(renderings,function(t,k)
local v = {
list = { },
done = { },
@@ -788,8 +861,6 @@ local function validkeyword(dataset,tag,keyword)
end
local kw = dt.keyword
if kw then
--- inspect(keyword)
--- inspect(kw)
for k in next, keyword do
if kw[k] then
return true
@@ -804,12 +875,10 @@ function lists.collectentries(specification)
return
end
local rendering = renderings[dataset]
--- specification.names = "btx"
local method = rendering.method
if method == v_none then
return
end
--- method=v_local --------------------
local result = structures.lists.filter(specification)
--
local keyword = specification.keyword
@@ -948,16 +1017,32 @@ function lists.flushentries(dataset,sortvariant)
list = sort(dataset,rendering,list) or list
end
for i=1,#list do
- ctx_setvalue("currentbtxindex",i)
- ctx_btxhandlelistentry(list[i][1]) -- we can pass i here too ... more efficient to avoid the setvalue
- end
+-- ctx_setvalue("currentbtxindex",i) -- todo: helper
+-- -- todo: also flush combinations
+-- ctx_btxhandlelistentry(list[i][1]) -- we can pass i here too ... more efficient to avoid the setvalue
+ local tag = list[i][1]
+ local entry = datasets[dataset].luadata[tag]
+ if entry then
+ ctx_setvalue("currentbtxindex",i) -- todo: helper
+ local combined = entry.combined
+ if combined then
+ ctx_setvalue("currentbtxcombis",concat(combined,","))
+ else
+ ctx_setvalue("currentbtxcombis","")
+ end
+ ctx_btxhandlelistentry(tag) -- pas i instead
+ end
+ end
end
function lists.fetchentries(dataset)
local list = renderings[dataset].list
for i=1,#list do
- ctx_setvalue("currentbtxindex",i)
- ctx_btxchecklistentry(list[i][1])
+ local tag = list[i][1]
+ local entry = datasets[dataset].luadata[tag]
+ if entry then
+ ctx_btxchecklistentry(tag) -- integrate doifalreadyplaced here
+ end
end
end
@@ -987,158 +1072,38 @@ local function compare(a,b)
return aa and bb and aa < bb
end
--- maybe hash subsets
--- how efficient is this? old leftovers?
-
-- rendering ?
+-- todo: nicer refs
+
local f_reference = formatters["r:%s:%s:%s"] -- dataset, instance (block), tag
local f_destination = formatters["d:%s:%s:%s"] -- dataset, instance (block), tag
-
-function lists.resolve(dataset,reference) -- maybe already feed it split
- -- needs checking (the prefix in relation to components)
- local subsets = nil
- local block = tex.count.btxblock
- local collected = references.collected
- local prefix = nil -- todo: dataset ?
- if prefix and prefix ~= "" then
- subsets = { collected[prefix] or collected[""] }
- else
- local components = references.productdata.components
- local subset = collected[""]
- if subset then
- subsets = { subset }
- else
- subsets = { }
- end
- for i=1,#components do
- local subset = collected[components[i]]
- if subset then
- subsets[#subsets+1] = subset
- end
- end
- end
--- inspect(subsets)
- if #subsets > 0 then
- local result, nofresult, done = { }, 0, { }
- for i=1,#subsets do
- local subset = subsets[i]
- for rest in gmatch(reference,"[^, ]+") do
- local blk, tag, found = block, nil, nil
- if block then
- tag = f_destination(dataset,blk,rest)
- found = subset[tag]
- if not found then
- for i=block-1,1,-1 do
- tag = f_destination(dataset,blk,rest)
--- tag = i .. ":" .. rest
- found = subset[tag]
- if found then
- blk = i
- break
- end
- end
- end
- end
- if not found then
- blk = "*"
- tag = f_destination(dataset,blk,rest)
- found = subset[tag]
- end
- if found then
- local current = tonumber(found.entries and found.entries.text) -- tonumber needed
- if current and not done[current] then
- nofresult = nofresult + 1
- result[nofresult] = { blk, rest, current }
- done[current] = true
- end
- end
- end
- end
- local first, last, firsti, lasti, firstr, lastr
- local collected, nofcollected = { }, 0
- for i=1,nofresult do
- local r = result[i]
- local current = r[3]
- if not first then
- first, last, firsti, lasti, firstr, lastr = current, current, i, i, r, r
- elseif current == last + 1 then
- last, lasti, lastr = current, i, r
- else
- if last > first + 1 then
- nofcollected = nofcollected + 1
- collected[nofcollected] = { firstr, lastr }
- else
- nofcollected = nofcollected + 1
- collected[nofcollected] = firstr
- if last > first then
- nofcollected = nofcollected + 1
- collected[nofcollected] = lastr
- end
- end
- first, last, firsti, lasti, firstr, lastr = current, current, i, i, r, r
- end
- end
- if first and last then
- if last > first + 1 then
- nofcollected = nofcollected + 1
- collected[nofcollected] = { firstr, lastr }
- else
- nofcollected = nofcollected + 1
- collected[nofcollected] = firstr
- if last > first then
- nofcollected = nofcollected + 1
- collected[nofcollected] = lastr
- end
- end
- end
- if nofcollected > 0 then
--- inspect(reference)
--- inspect(result)
--- inspect(collected)
- for i=1,nofcollected do
- local c = collected[i]
- if i == nofcollected then
- ctx_btxlistvariantparameter("lastpubsep")
- elseif i > 1 then
- ctx_btxlistvariantparameter("pubsep")
- end
- if #c == 3 then -- a range (3 is first or last)
- ctx_btxdirectlink(f_reference(dataset,c[1],c[2]),c[3])
- else
- local f, l = c[2], c[2]
- ctx_btxdirectlink(f_reference(dataset,f[1],f[2]),f[3])
- context.endash() -- to do
- ctx_btxdirectlink(f_reference(dataset,l[4],l[5]),l[6])
- end
- end
- else
- context("[btx error 1]")
- end
- else
- context("[btx error 2]")
- end
-end
+local f_listentry = formatters["d:%s:%s:%s"] -- dataset, instance (block), tag
+local f_internal = formatters["internal(%s)"] -- dataset, instance (block), tag
local done = { }
function commands.btxreference(dataset,block,tag,data)
- local ref = f_reference(dataset,block,tag)
+ local ref = f_reference(dataset,block,tag) -- we just need a unique key
if not done[ref] then
+ if trace_references then
+ report_reference("link: %s",ref)
+ end
done[ref] = true
--- context("<%s>",data)
- ctx_dodirectfullreference(ref,data)
+ ctx_btxsetreference(dataset,tag,ref,data)
end
end
local done = { }
function commands.btxdestination(dataset,block,tag,data)
- local ref = f_destination(dataset,block,tag)
+ local ref = f_destination(dataset,block,tag) -- we just need a unique key
if not done[ref] then
+ if trace_references then
+ report_reference("link: %s",ref)
+ end
done[ref] = true
--- context("<<%s>>",data)
- ctx_dodirectfullreference(ref,data)
+ ctx_btxsetreference(dataset,tag,ref,data)
end
end
@@ -1184,11 +1149,48 @@ local function sortedtags(dataset,list,sorttype)
end
end
--- todo: standard : current
+-- if sorttype and sorttype ~= "" then
+-- tags = sortedtags(dataset,tags,sorttype)
+-- end
local prefixsplitter = lpeg.splitat("::")
-function commands.btxhandlecite(dataset,tag,mark,variant,sorttype,setup) -- variant for tracing
+function commands.btxhandlecite(specification)
+ local tag = specification.reference
+ if not tag or tag == "" then
+ return
+ end
+ --
+ local dataset = specification.dataset or ""
+ local mark = specification.markentry ~= false
+ local variant = specification.variant or "num"
+ local sorttype = specification.sorttype
+ local compress = specification.compress == v_yes
+ --
+ local prefix, rest = lpegmatch(prefixsplitter,tag)
+ if rest then
+ dataset = prefix
+ else
+ rest = tag
+ end
+ local action = citevariants[variant] -- there is always fallback on default
+ if trace_cite then
+ report_cite("inject, dataset: %s, tag: %s, variant: %s, compressed",dataset or "-",rest,variant)
+ end
+ ctx_setvalue("currentbtxdataset",dataset)
+ action(dataset,rest,mark,compress,variant)
+end
+
+function commands.btxhandlenocite(specification)
+ local mark = specification.markentry ~= false
+ if not mark then
+ return
+ end
+ local tag = specification.reference
+ if not tag or tag == "" then
+ return
+ end
+ local dataset = specification.dataset or ""
local prefix, rest = lpegmatch(prefixsplitter,tag)
if rest then
dataset = prefix
@@ -1197,190 +1199,551 @@ function commands.btxhandlecite(dataset,tag,mark,variant,sorttype,setup) -- vari
end
ctx_setvalue("currentbtxdataset",dataset)
local tags = settings_to_array(rest)
- if #tags > 0 then
- if sorttype and sorttype ~= "" then
- tags = sortedtags(dataset,tags,sorttype)
+ if trace_cite then
+ report_cite("mark, dataset: %s, tags: % | t",dataset or "-",tags)
+ end
+ for i=1,#tags do
+ markcite(dataset,tags[i])
+ end
+end
+
+-- function commands.btxcitevariant(dataset,block,tags,variant) -- uses? specification ?
+-- local action = citevariants[variant]
+-- if action then
+-- action(dataset,tags,variant)
+-- end
+-- end
+
+-- sorter
+
+local keysorter = function(a,b) return a.sortkey < b.sortkey end
+
+local function compresslist(source)
+ for i=1,#source do
+ if type(source[i].sortkey) ~= "number" then
+ return source
end
- ctx_btxcitevariantparameter(v_left)
- for i=1,#tags do
- local tag = tags[i]
- ctx_setvalue("currentbtxtag",tag)
- if i > 1 then
- ctx_btxcitevariantparameter(v_middle)
- end
- if mark ~= false then
- ctx_btxdomarkcitation(dataset,tag)
+ end
+ local first, last, firstr, lastr
+ local target, noftarget, tags = { }, 0, { }
+ sort(source,keysorter)
+ local function flushrange()
+ noftarget = noftarget + 1
+ if last > first + 1 then
+ target[noftarget] = {
+ first = firstr,
+ last = lastr,
+ tags = tags,
+ }
+ else
+ target[noftarget] = firstr
+ if last > first then
+ noftarget = noftarget + 1
+ target[noftarget] = lastr
end
- ctx_directsetup(setup) -- cite can become alternative
end
- ctx_btxcitevariantparameter(v_right)
- else
- -- error
+ tags = { }
end
+ for i=1,#source do
+ local entry = source[i]
+ local current = entry.sortkey
+ if not first then
+ first, last, firstr, lastr = current, current, entry, entry
+ elseif current == last + 1 then
+ last, lastr = current, entry
+ else
+ flushrange()
+ first, last, firstr, lastr = current, current, entry, entry
+ end
+ tags[#tags+1] = entry.tag
+ end
+ if first and last then
+ flushrange()
+ end
+ return target
end
-function commands.btxhandlenocite(dataset,tag,mark)
- if mark ~= false then
- local prefix, rest = lpegmatch(prefixsplitter,tag)
- if rest then
- dataset = prefix
+-- local source = {
+-- { tag = "one", internal = 1, value = "foo", page = 1 },
+-- { tag = "two", internal = 2, value = "bar", page = 2 },
+-- { tag = "three", internal = 3, value = "gnu", page = 3 },
+-- }
+--
+-- local target = compresslist(source)
+
+local numberonly = R("09")^1 / tonumber + P(1)^0
+local f_missing = formatters["<%s>"]
+
+-- maybe also sparse (e.g. pages)
+
+local function processcite(dataset,reference,mark,compress,setup,getter,setter,compressor)
+ reference = publications.parenttag(dataset,reference)
+ local found, todo, list = findallused(dataset,reference)
+ if found and setup then
+ local source = { }
+ local badkey = false
+ for i=1,#found do
+ local entry = found[i]
+ local tag = entry.userdata.btxref
+ local internal = entry.references.internal
+ local data = getter(dataset,tag,entry,internal)
+ if compress and not compressor then
+ local sortkey = data.sortkey
+ if sortkey then
+ local key = lpegmatch(numberonly,sortkey)
+ if key then
+ data.sortkey = key
+ else
+ badkey = true
+ end
+ else
+ badkey = true
+ end
+ end
+ source[i] = data
+ end
+ if compress and not badkey then
+ local target = (compressor or compresslist)(source)
+ local function flush(i,state)
+ local entry = target[i]
+ local first = entry.first
+ if first then
+ local tags = entry.tags
+ if mark then
+ for i=1,#tags do
+ local tag = tags[i]
+ markcite(dataset,tag)
+ todo[tag] = false
+ end
+ end
+ ctx_btxsettag(tags[1])
+ local internal = first.internal
+ if internal then
+ ctx_btxsetinternal(internal)
+ end
+ if not setter(first,entry.last) then
+ ctx_btxsetfirst(f_missing(first.tag))
+ end
+ else
+ local tag = entry.tag
+ if mark then
+ markcite(dataset,tag)
+ todo[tag] = false
+ end
+ ctx_btxsettag(tag)
+ local internal = entry.internal
+ if internal then
+ ctx_btxsetinternal(internal)
+ end
+ if not setter(entry) then
+ ctx_btxsetfirst(f_missing(entry.tag))
+ end
+ end
+ ctx_btxsetconcat(state)
+ ctx_btxcitesetup(setup)
+ end
+ flushcollected(flush,#target)
else
- rest = tag
+ local function flush(i,state)
+ local entry = source[i]
+ local tag = entry.tag
+ if mark then
+ markcite(dataset,tag)
+ todo[tag] = false
+ end
+ ctx_btxsettag(tag)
+ local internal = entry.internal
+ if internal then
+ ctx_btxsetinternal(internal)
+ end
+ ctx_btxsetconcat(state)
+ if not setter(entry) then
+ ctx_btxsetfirst(f_missing(entry.tag))
+ end
+ ctx_btxcitesetup(setup)
+ end
+ flushcollected(flush,#source)
end
- ctx_setvalue("currentbtxdataset",dataset)
- local tags = settings_to_array(rest)
- for i=1,#tags do
- ctx_btxdomarkcitation(dataset,tags[i])
+ end
+ if mark then
+ flushmarked(dataset,list,todo)
+ end
+end
+
+local function simplegetter(first,last,field)
+ local value = first[field]
+ if value then
+ ctx_btxsetfirst(value)
+ if last then
+ ctx_btxsetsecond(last[field])
end
+ return true
end
end
-function commands.btxcitevariant(dataset,block,tags,variant)
- local action = citevariants[variant] or citevariants.default
- if action then
- action(dataset,tags,variant)
+local setters = setmetatableindex({},function(t,k)
+ local v = function(dataset,tag,entry,internal)
+ local value = getfield(dataset,tag,k)
+ return {
+ tag = tag,
+ internal = internal,
+ [k] = value,
+ sortkey = value,
+ }
+ end
+ t[k] = v
+ return v
+end)
+
+local getters = setmetatableindex({},function(t,k)
+ local v = function(first,last)
+ return simplegetter(first,last,k)
+ end
+ t[k] = v
+ return v
+end)
+
+-- default
+
+setmetatableindex(citevariants,function(t,k)
+ local v = t.default
+ t[k] = v
+ return v
+end)
+
+function citevariants.default(dataset,reference,mark,compress,variant,setup)
+ processcite(dataset,reference,mark,compress,setup or variant,setters[variant],getters[variant])
+end
+
+-- short
+
+local function setter(dataset,tag,entry,internal)
+ return {
+ tag = tag,
+ internal = internal,
+ short = getfield(dataset,tag,"short"),
+ suffix = getfield(dataset,tag,"suffix"),
+ }
+end
+
+local function getter(first,last) -- last not used
+ local short = first.short
+ if short then
+ local suffix = first.suffix
+ if suffix then
+ ctx_btxsetfirst(short .. suffix)
+ else
+ ctx_btxsetfirst(short)
+ end
+ return true
end
end
-function citevariants.default(dataset,tags,variant)
- local content = getfield(dataset,tags,variant)
- if content then
- context(content)
+function citevariants.short(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,false,"short",setter,getter)
+end
+
+-- pages (no compress)
+
+local function setter(dataset,tag,entry,internal)
+ return {
+ tag = tag,
+ internal = internal,
+ pages = getdetail(dataset,tag,"pages"),
+ }
+end
+
+local function getter(first,last)
+ local pages = first.pages
+ if pages then
+ if type(pages) == "table" then
+ ctx_btxsetfirst(pages[1])
+ ctx_btxsetsecond(pages[2])
+ else
+ ctx_btxsetfirst(pages)
+ end
+ return true
end
end
+function citevariants.page(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"page",setter,getter)
+end
+
+-- num
+
+local function setter(dataset,tag,entry,internal)
+ local text = entry.entries.text
+ return {
+ tag = tag,
+ internal = internal,
+ num = text,
+ sortkey = text,
+ }
+end
+
+local function getter(first,last)
+ return simplegetter(first,last,"num")
+end
+
+function citevariants.num(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"num",setter,getter)
+end
+
+-- year
+
+local function setter(dataset,tag,entry,internal)
+ local year = getfield(dataset,tag,"year")
+ return {
+ tag = tag,
+ internal = internal,
+ year = year,
+ sortkey = year,
+ }
+end
+
+local function getter(first,last)
+ return simplegetter(first,last,"year")
+end
+
+function citevariants.year(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"year",setter,getter)
+end
+
+-- index | serial
+
+local function setter(dataset,tag,entry,internal)
+ local index = getfield(dataset,tag,"index")
+ return {
+ tag = tag,
+ internal = internal,
+ index = index,
+ sortkey = index,
+ }
+end
+
+local function getter(first,last)
+ return simplegetter(first,last,"index")
+end
+
+function citevariants.index(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"index",setter,getter)
+end
+
+function citevariants.serial(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"serial",setter,getter)
+end
+
+-- category | type
+
+local function setter(dataset,tag,entry,internal)
+ return {
+ tag = tag,
+ internal = internal,
+ category = getfield(dataset,tag,"category"),
+ }
+end
+
+local function getter(first,last)
+ return simplegetter(first,last,"category")
+end
+
+function citevariants.category(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"category",setter,getter)
+end
+
+function citevariants.type(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"type",setter,getter)
+end
+
+-- key | tag
+
+local function setter(dataset,tag,entry,internal)
+ return {
+ tag = tag,
+ internal = internal,
+ }
+end
+
+local function getter(first,last)
+ ctx_btxsetfirst(first.tag)
+ return true
+end
+
+function citevariants.key(dataset,reference,mark,compress) return
+ processcite(dataset,reference,mark,compress,"key",setter,getter)
+end
+
+function citevariants.tag(dataset,reference,mark,compress) return
+ processcite(dataset,reference,mark,compress,"tag",setter,getter)
+end
+
+-- author
+
+local function setter(dataset,tag,entry,internal)
+ return {
+ tag = tag,
+ internal = internal,
+ author = getfield(dataset,tag,"author"),
+ }
+end
+
+local function getter(first,last)
+ ctx_btxsetfirst(first.author) -- todo: formatted
+ return true
+end
+
+function citevariants.author(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,false,"author",setter,getter)
+end
+
-- todo : sort
-- todo : choose between publications or commands namespace
-- todo : use details.author
-- todo : sort details.author
+-- (name, name and name) .. how names? how sorted?
+-- todo: we loop at the tex end .. why not here
+-- \cite[{hh,afo},kvm]
-local function collectauthoryears(dataset,tags)
- local luadata = datasets[dataset].luadata
- local list = settings_to_array(tags)
- local found = { }
+-- common
+
+local function authorcompressor(found,key)
local result = { }
- local order = { }
- for i=1,#list do
- local tag = list[i]
- local entry = luadata[tag]
- if entry then
- local year = entry.year
- local author = entry.author
- if author and year then
- local a = found[author]
- if not a then
- a = { }
- found[author] = a
- order[#order+1] = author
- end
- local y = a[year]
- if not y then
- y = { }
- a[year] = y
- end
- y[#y+1] = tag
- end
+ local entries = { }
+ for i=1,#found do
+ local entry = found[i]
+ local author = entry.author
+ local aentries = entries[author]
+ -- will be just entry but for tracing ...
+ entry = { internal = entry.internal, author = author, [key] = entry[key], sortkey = entry.sortkey }
+ if aentries then
+ aentries[#aentries+1] = entry
+ else
+ entries[author] = { entry }
end
end
- -- found = { author = { year_1 = { e1, e2, e3 } } }
- for i=1,#order do
- local author = order[i]
- local years = found[author]
- local yrs = { }
- for year, entries in next, years do
- if subyears then
- -- -- add letters to all entries of an author and if so shouldn't
- -- -- we tag all years of an author as soon as we do this?
- -- if #entries > 1 then
- -- for i=1,#years do
- -- local entry = years[i]
- -- -- years[i] = year .. string.char(i + string.byte("0") - 1)
- -- end
- -- end
- else
- yrs[#yrs+1] = year
+ for i=1,#found do
+ local entry = found[i]
+ local author = entry.author
+ local aentries = entries[author]
+ if not aentries then
+ result[#result+1] = entry
+ elseif aentries == true then
+ -- already done
+ else
+ result[#result+1] = entry
+ entry.entries = aentries
+ entries[author] = true
+ end
+ end
+ -- todo: add letters (should we then tag all?)
+ return result
+end
+
+local function authorconcat(target,key,setup)
+ local function flush(i,state)
+ local entry = target[i]
+ local first = entry.first
+ if first then
+ local internal = first.internal
+ if internal then
+ ctx_btxsetinternal(internal)
end
+ ctx_btxsetfirst(first[key] or f_missing(first.tag))
+ ctx_btxsetsecond(entry.last[key])
+ else
+ local internal = entry.internal
+ if internal then
+ ctx_btxsetinternal(internal)
+ end
+ ctx_btxsetfirst(entry[key] or f_missing(entry.tag))
end
- result[i] = { author = author, years = yrs }
+ ctx_btxsetconcat(state)
+ ctx_btxcitesetup(setup)
end
- return result, order
+ ctx_btxstartsubcite(setup)
+ flushcollected(flush,#target)
+ ctx_btxstopsubcite()
end
--- (name, name and name) .. how names? how sorted?
--- todo: we loop at the tex end .. why not here
--- \cite[{hh,afo},kvm]
+local function authorsingle(entry,key,setup)
+ ctx_btxstartsubcite(setup)
+ ctx_btxsetfirst(entry[key] or f_missing(entry.tag))
+ ctx_btxcitesetup(setup)
+ ctx_btxstopsubcite()
+end
--- maybe we will move this tex anyway
+local function authorgetter(first,last,key,setup) -- only first
+ ctx_btxsetfirst(first.author) -- todo: reformat
+ local entries = first.entries
+ if entries then
+ local c = compresslist(entries)
+ ctx_btxsetsecond(function() authorconcat(c,key,setup) end)
+ else
+ ctx_btxsetsecond(function() authorsingle(first,key,setup) end)
+ end
+ return true
+end
-function citevariants.author(dataset,tags)
- local result, order = collectauthoryears(dataset,tags,method,what) -- we can have a collectauthors
- publications.citeconcat(order)
+-- authornum
+
+local function setter(dataset,tag,entry,internal)
+ local text = entry.entries.text
+ return {
+ tag = tag,
+ internal = internal,
+ author = getfield(dataset,tag,"author"),
+ num = text,
+ sortkey = text and lpegmatch(numberonly,text)
+ }
end
-local function authorandyear(dataset,tags,formatter)
- local result, order = collectauthoryears(dataset,tags,method,what) -- we can have a collectauthors
- for i=1,#result do
- local r = result[i]
- order[i] = formatter(r.author,r.years) -- reuse order
- end
- publications.citeconcat(order)
+local function getter(first,last)
+ authorgetter(first,last,"num","author:num")
+ return true
end
-function citevariants.authoryear(dataset,tags)
- authorandyear(dataset,tags,formatters["%s (%, t)"])
+local function compressor(found)
+ return authorcompressor(found,"num")
end
-function citevariants.authoryears(dataset,tags)
- authorandyear(dataset,tags,formatters["%s, %, t"])
+function citevariants.authornum(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"authornum",setter,getter,compressor)
end
-function citevariants.authornum(dataset,tags)
- local result, order = collectauthoryears(dataset,tags,method,what) -- we can have a collectauthors
- publications.citeconcat(order)
- ctx_btxcitevariantparameter(v_inbetween)
- lists.resolve(dataset,tags) -- left/right ?
+-- authoryear | authoryears
+
+local function setter(dataset,tag,entry,internal)
+ local year = getfield(dataset,tag,"year")
+ return {
+ tag = tag,
+ internal = internal,
+ author = getfield(dataset,tag,"author"),
+ year = year,
+ sortkey = year and lpegmatch(numberonly,year)
+ }
end
--- function citevariants.short(dataset,tags)
--- local short = getdetail(dataset,tags,"short")
--- if short then
--- context(short)
--- end
--- end
+local function getter(first,last)
+ authorgetter(first,last,"year","author:year")
+ return true
+end
-function citevariants.short(dataset,tags)
- local short = getdetail(dataset,tags,"short")
- local suffix = getdetail(dataset,tags,"suffix")
- if suffix then
- context(short .. suffix)
- elseif short then
- context(short)
- end
+local function compressor(found)
+ return authorcompressor(found,"year")
end
-function citevariants.page(dataset,tags)
- local pages = getdetail(dataset,tags,"pages")
- if not pages then
- -- nothing
- elseif type(pages) == "table" then
- context(pages[1])
- ctx_btxcitevariantparameter(v_inbetween)
- context(pages[2])
- else
- context(pages)
- end
+function citevariants.authoryear(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"authoryear",setter,getter,compressor)
end
-function citevariants.num(dataset,tags)
--- ctx_btxdirectlink(f_destination(dataset,block,tags),listindex) -- not okay yet
- lists.resolve(dataset,tags)
+local function getter(first,last)
+ authorgetter(first,last,"year","author:years")
+ return true
end
-function citevariants.serial(dataset,tags) -- the traditional fieldname is "serial" and not "index"
- local index = getfield(dataset,tags,"index")
- if index then
- context(index)
- end
+function citevariants.authoryears(dataset,reference,mark,compress)
+ processcite(dataset,reference,mark,compress,"authoryears",setter,getter,compressor)
end
-- List variants
@@ -1388,41 +1751,30 @@ end
local listvariants = { }
publications.listvariants = listvariants
--- function commands.btxhandlelist(dataset,block,tag,variant,setup)
--- if sorttype and sorttype ~= "" then
--- tags = sortedtags(dataset,tags,sorttype)
--- end
--- ctx_setvalue("currentbtxtag",tag)
--- ctx_btxlistvariantparameter(v_left)
--- ctx_directsetup(setup)
--- ctx_btxlistvariantparameter(v_right)
--- end
-
-function commands.btxlistvariant(dataset,block,tags,variant,listindex)
+function commands.btxlistvariant(dataset,block,tag,variant,listindex)
local action = listvariants[variant] or listvariants.default
if action then
- action(dataset,block,tags,variant,tonumber(listindex) or 0)
+ action(dataset,block,tag,variant,tonumber(listindex) or 0)
end
end
-function listvariants.default(dataset,block,tags,variant)
+function listvariants.default(dataset,block,tag,variant)
context("?")
end
-function listvariants.num(dataset,block,tags,variant,listindex)
- ctx_btxdirectlink(f_destination(dataset,block,tags),listindex) -- not okay yet
+function listvariants.num(dataset,block,tag,variant,listindex)
+ local lst = f_listentry(dataset,block,tag)
+ local ref = f_reference(dataset,block,tag)
+ if trace_references then
+ report_reference("list: %s",lst)
+ end
+ -- todo
+ ctx_btxdirectlink(ref,listindex) -- a goto
end
--- function listvariants.short(dataset,block,tags,variant,listindex)
--- local short = getdetail(dataset,tags,variant,variant)
--- if short then
--- context(short)
--- end
--- end
-
-function listvariants.short(dataset,block,tags,variant,listindex)
- local short = getdetail(dataset,tags,"short","short")
- local suffix = getdetail(dataset,tags,"suffix","suffix")
+function listvariants.short(dataset,block,tag,variant,listindex)
+ local short = getdetail(dataset,tag,"short","short")
+ local suffix = getdetail(dataset,tag,"suffix","suffix")
if suffix then
context(short .. suffix)
elseif short then
diff --git a/Master/texmf-dist/tex/context/base/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/publ-ini.mkiv
index adbf8f7fcf0..68e185f2375 100644
--- a/Master/texmf-dist/tex/context/base/publ-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/publ-ini.mkiv
@@ -15,6 +15,7 @@
% todo: \v!cite => \s!cite
% todo: interface with (ml)bibtex (export -> call -> import)
% todo: check if 'all' etc are ok ... either use list or use other criterium
+% todo: \the\everysetupbtxciteplacement probably too often
% \definecolor[btx:field] [darkred]
% \definecolor[btx:crossref][darkblue]
@@ -44,7 +45,10 @@
\unprotect
-\def\s!btx{btx}
+\startcontextdefinitioncode
+
+\def\s!btx {btx}
+\def\s!cite {cite}
\def\v!btxlist{btxlist}
% a dedicated construction mechanism
@@ -346,12 +350,34 @@
\fi
\to \everydefinebtxrendering
+% \unexpanded\def\btx_entry_inject
+% {\begingroup
+% \edef\currentbtxcategory{\btxfield{category}}%
+% \ignorespaces
+% \directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
+% \removeunwantedspaces
+% \endgroup}
+
+\let\currentbtxcombis\empty % goes into the setups
+
\unexpanded\def\btx_entry_inject
{\begingroup
\edef\currentbtxcategory{\btxfield{category}}%
\ignorespaces
\directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
\removeunwantedspaces
+ \ifx\currentbtxcombis\empty \else
+ ;\space % todo .. parameter .. what is a good name .. problem: what if ends with .
+ \processcommacommand[\currentbtxcombis]\btx_entry_inject_combi
+ \fi
+ \endgroup}
+
+\def\btx_entry_inject_combi#1%
+ {\begingroup
+ \def\currentbtxtag{#1}%
+ \ignorespaces
+ \directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
+ \removeunwantedspaces
\endgroup}
\unexpanded\def\completebtxrendering{\dodoubleempty\publ_place_list_complete}
@@ -428,7 +454,8 @@
keyword = "\btxrenderingparameter\c!keyword",
}}%
% next we analyze the width
- \ifx\btx_reference_inject_indeed\relax \else
+ \ifx\btx_reference_inject_indeed\relax
+ \else
\edef\p_width{\btxrenderingparameter\c!width}%
\ifx\p_width\v!auto
\scratchcounter\btxcounter
@@ -484,6 +511,13 @@
\fi
\endgroup}
+\unexpanded\def\btxchecklistcombi#1% called at the lua end
+ {\begingroup
+ \edef\currentbtxtag{#1}%
+ ; % todo
+ \publ_check_list_entry
+ \endgroup}
+
\unexpanded\def\publ_check_list_entry
{\global\advance\btxcounter\plusone
% todo, switch to font
@@ -549,6 +583,13 @@
\unexpanded\def\btxflushauthorinverted {\btx_flush_author{inverted}} % #1
\unexpanded\def\btxflushauthorinvertedshort{\btx_flush_author{invertedshort}} % #1
+\unexpanded\def\currentbtxciteauthor % always author
+ {\ctxcommand{btxauthor("\currentbtxdataset","\currentbtxtag","author",{
+ combiner = "\btxcitevariantparameter\c!author",
+ etallimit = \number\btxcitevariantparameter\c!etallimit,
+ etaldisplay = \number\btxcitevariantparameter\c!etaldisplay,
+ })}}
+
% \btxflushauthor{author}
% \btxflushauthor{artauthor}
% \btxflushauthor{editor}
@@ -558,38 +599,44 @@
% \btxflushauthor[inverted]{author}
% \btxflushauthor[invertedshort]{author}
-% Interaction
+% Interaction: only list
\newconditional\btxinteractive
-\unexpanded\def\btxdoifelseinteraction
- {\iflocation
- \edef\p_interaction{\btxcitevariantparameter\c!interaction}%
- \ifx\p_interaction\v!stop
- \doubleexpandafter\secondoftwoarguments
- \else
- \doubleexpandafter\firstoftwoarguments
- \fi
- \else
- \expandafter\secondoftwoarguments
- \fi}
+\unexpanded\def\btxdoifelseinteraction{\secondoftwoarguments}
\appendtoks
\iflocation
\edef\p_interaction{\btxlistvariantparameter\c!interaction}%
\ifx\p_interaction\v!stop
- \let\doifelsebtxinteractionelse\secondoftwoarguments
+ \let\btxdoifelseinteraction\secondoftwoarguments
\setfalse\btxinteractive
\else
- \let\doifelsebtxinteractionelse\firstoftwoarguments
+ \let\btxdoifelseinteraction\firstoftwoarguments
\settrue\btxinteractive
\fi
\else
- \let\doifelsebtxinteractionelse\secondoftwoarguments
+ \let\btxdoifelseinteraction\secondoftwoarguments
\setfalse\btxinteractive
\fi
\to \everysetupbtxlistplacement
+\appendtoks
+ \iflocation
+ \edef\p_interaction{\btxcitevariantparameter\c!interaction}%
+ \ifx\p_interaction\v!stop
+ \let\btxdoifelseinteraction\secondoftwoarguments
+ \setfalse\btxinteractive
+ \else
+ \let\btxdoifelseinteraction\firstoftwoarguments
+ \settrue\btxinteractive
+ \fi
+ \else
+ \let\btxdoifelseinteraction\secondoftwoarguments
+ \setfalse\btxinteractive
+ \fi
+\to \everysetupbtxciteplacement
+
% bib -> btx
\unexpanded\def\btxgotolink#1[#2]{\doifreferencefoundelse{\bibrefprefix#2}{\goto{#1}[\bibrefprefix#2]}{#1}}
@@ -651,15 +698,21 @@
% \iftrialtypesetting \else
% \processcommacommand[\currentbtxtag]{\publ_cite_indeed\currentbtxrendering}%
% \fi}
+%
+% \def\publ_cite_indeed#1#2%
+% {\expanded{\writedatatolist[btx][btxset=#1,btxref=#2]}}
-\def\publ_cite_indeed#1#2%
- {\expanded{\writedatatolist[btx][btxset=#1,btxref=#2]}}
-
-\def\btxdomarkcitation#1#2% called from lua end
- {\iftrialtypesetting \else
- \writedatatolist[btx][btxset=#1,btxref=#2]% \c!location=\v!here
+\unexpanded\def\btxdomarkcitation % called from lua end
+ {\iftrialtypesetting
+ \expandafter\gobbletwoarguments
+ \else
+ \expandafter\publ_cite_mark_citation
\fi}
+\def\publ_cite_mark_citation#1#2% called from lua end
+ {\dontleavehmode
+ \writedatatolist[btx][btxset=#1,btxref=#2]} % \c!location=\v!here
+
%D \macros{cite,nocite,citation,nocitation,usecitation}
%D
%D The inline \type {\cite} command creates a (often) short reference to a publication
@@ -687,6 +740,7 @@
{\letinteractionparameter\c!style\empty
\edef\currentbtxcitevariant{\btxcitevariantparameter\c!alternative}%
\edef\currentbtxcitetag{#1}%
+ \the\everysetupbtxciteplacement
\publ_cite_variant
\endgroup}
@@ -695,21 +749,31 @@
\unexpanded\def\publ_cite_tags_options[#1]%
{\strictdoifnextoptionalelse{\publ_cite_tags_options_indeed{#1}}{\publ_cite_tags_indeed{#1}}}
+% \unexpanded\def\publ_cite_tags_options_indeed#1[#2]%
+% {\edef\currentbtxcitetag{#2}%
+% \doifassignmentelse{#1}
+% {\publ_cite_tags_settings_indeed{#1}}
+% {\publ_cite_tags_variants_indeed{#1}}}
+
\unexpanded\def\publ_cite_tags_options_indeed#1[#2]%
{\edef\currentbtxcitetag{#2}%
- \doifassignmentelse{#1}
- {\publ_cite_tags_settings_indeed{#1}}
- {\publ_cite_tags_variants_indeed{#1}}}
+ \doifassignmentelse{#1}\publ_cite_tags_settings_indeed\publ_cite_tags_variants_indeed{#1}}
\def\publ_cite_tags_settings_indeed#1%
{\letinteractionparameter\c!style\empty
%\letinteractionparameter\c!color\empty
- \getdummyparameters[\c!alternative=,\c!extras=,#1]%
+ \letdummyparameter\c!before \empty
+ \letdummyparameter\c!after \empty
+ \letdummyparameter\c!extras \empty
+ \letdummyparameter\c!alternative\empty
+ \getdummyparameters[#1]%
\edef\p_alternative{\dummyparameter\c!alternative}%
- \ifx\p_alternative\empty \else
+ \ifx\p_alternative\empty
+ \edef\currentbtxcitevariant{\btxcitevariantparameter\c!alternative}%
+ \else
\let\currentbtxcitevariant\p_alternative
\fi
- \setupcurrentbtxcitevariantparameters[#1]%
+ \setupcurrentbtxcitevariant[#1]%
\edef\p_extras{\dummyparameter\c!extras}%
\ifx\p_extras\empty \else
\edef\p_right{\btxcitevariantparameter\c!right}%
@@ -717,45 +781,53 @@
\setexpandedbtxcitevariantparameter\p_right{\p_extras\p_right}%
\fi
\fi
+ \edef\p_before{\dummyparameter\c!before}%
+ \edef\p_after {\dummyparameter\c!after}%
+ \ifx\p_before\empty \else
+ \p_before
+ \space
+ \fi
\publ_cite_variant
+ \ifx\p_after\empty \else
+ \optionalspace
+ \p_after
+ \fi
\endgroup}
\def\publ_cite_tags_variants_indeed#1%
{\letinteractionparameter\c!style\empty
\edef\currentbtxcitevariant{#1}%
+ \the\everysetupbtxciteplacement
\publ_cite_variant
\endgroup}
\newconditional\btxcitecompress
\def\publ_cite_variant
- {\edef\p_compress{\btxcitevariantparameter\c!compress}%
- % \ifx\p_compress\v!no
- % \setfalse\btxcitecompress
- % \else
- % \settrue\btxcitecompress
- % \fi
- \begingroup
+ {\begingroup
\settrue\c_publ_cite_write
\publ_cite_handle_variant_indeed[\currentbtxcitetag]}
\unexpanded\def\publ_cite_handle_variant#1%
{\begingroup
- \the\everysetupbtxciteplacement
\edef\currentbtxcitevariant{#1}%
+ \the\everysetupbtxciteplacement
\dosingleargument\publ_cite_handle_variant_indeed}
\def\publ_cite_handle_variant_indeed[#1]%
{\usebtxcitevariantstyleandcolor\c!style\c!color
\letbtxcitevariantparameter\c!alternative\currentbtxcitevariant
- \ctxcommand{btxhandlecite(%
- "\currentbtxdataset",%
- "#1",%
- \iftrialtypesetting false\else true\fi,%
- "\currentbtxcitevariant",%
- "\btxcitevariantparameter\c!sorttype",%
- "\btxcitevariantparameter\c!setups"%
- )}%
+ \btxcitevariantparameter\v!left
+ \ctxcommand{btxhandlecite{%
+ dataset = "\currentbtxdataset",%
+ reference = "#1",%
+ markentry = \iftrialtypesetting false\else true\fi,%
+ variant = "\currentbtxcitevariant",%
+ sorttype = "\btxcitevariantparameter\c!sorttype",%
+ compress = "\btxcitevariantparameter\c!compress",%
+ author = "\btxcitevariantparameter\c!author",%
+ }}%
+ \btxcitevariantparameter\v!right
\endgroup}
\unexpanded\def\btxcitation
@@ -775,9 +847,16 @@
\unexpanded\def\publ_cite_no[#1]%
{\iftrialtypesetting \else
- \ctxcommand{btxhandlenocite("\currentbtxdataset","#1",true)}%
+ \ctxcommand{btxhandlecite{%
+ dataset = "\currentbtxdataset",%
+ reference = "#1",%
+ markentry = \iftrialtypesetting false\else true\fi,%
+ }}%
\fi}
+\unexpanded\def\btxmissing#1%
+ {{\tttf<#1>}}
+
%D Compatibility:
\let\cite \btxcite
@@ -788,8 +867,42 @@
%D Cite helpers:
-\unexpanded\def\btxcitevariant#1%
- {\ctxcommand{btxcitevariant("\currentbtxdataset","\currentbtxblock","\currentbtxtag","#1")}}
+\newconstant\currentbtxconcat
+
+% \unexpanded\def\btxcitevariant#1%
+% {\ctxcommand{btxcitevariant("\currentbtxdataset","\currentbtxblock","\currentbtxtag","#1")}}
+
+\unexpanded\def\btxcitereset
+ {\let\currentbtxfirst \empty
+ \let\currentbtxsecond \empty
+ \let\currentbtxinternal\empty
+ \let\currentbtxtag \empty
+ \setconstant\currentbtxconcat\zerocount}
+
+\btxcitereset
+
+\unexpanded\def\btxcitesetup#1%
+ {\directsetup{btx:cite:#1}%
+ \btxcitereset}
+
+\unexpanded\def\btxsetfirst {\def\currentbtxfirst}
+\unexpanded\def\btxsetsecond {\def\currentbtxsecond}
+\unexpanded\def\btxsettag {\def\currentbtxtag}
+\unexpanded\def\btxsetinternal{\def\currentbtxinternal}
+\unexpanded\def\btxsetconcat#1{\setconstant\currentbtxconcat#1\relax}
+
+\unexpanded\def\btxsetreference#1#2% #3#4%
+ {\strc_references_direct_full_user{btxset="#1",btxref="#2"}}
+
+\unexpanded\def\btxstartsubcite#1%
+ {\bgroup
+ \btxcitereset
+ \def\currentbtxcitevariant{#1}%
+ \btxcitevariantparameter\c!left}
+
+\unexpanded\def\btxstopsubcite
+ {\btxcitevariantparameter\c!right
+ \egroup}
%D List helpers:
@@ -816,6 +929,8 @@
\loadbtxdefinitionfile[\btxrenderingparameter\c!alternative]
\to \everysetupbtxrendering
+\stopcontextdefinitioncode
+
%D Defaults:
\setupbtxrendering
@@ -842,9 +957,12 @@
\c!otherstext={ et al.},
\c!pubsep={, },
\c!lastpubsep={ and },
+ \c!finalpubsep={ and },
\c!compress=\v!no,
\c!inbetween={ },
+ \c!range=\endash,
\c!left=,
+ \c!middle=,
\c!right=]
\definebtxcitevariant
@@ -855,6 +973,11 @@
\c!right={)}]
\definebtxcitevariant
+ [authornum]
+ [author]
+ [\c!inbetween={ }]
+
+\definebtxcitevariant
[authoryear]
[\c!compress=\v!yes,
\c!inbetween={, },
@@ -867,62 +990,90 @@
[authoryear]
\definebtxcitevariant
+ [author:num]
[authornum]
- [author]
[\c!left={[},
\c!right={]}]
\definebtxcitevariant
+ [author:year]
+ [authoryear]
+ [\c!left={(},
+ \c!right={)}]
+
+\definebtxcitevariant
+ [author:years]
+ [authoryears]
+ [\c!left=,
+ \c!right=]
+
+\definebtxcitevariant
[year]
[\c!left={(},
+ \c!middle={, }, % is middle used?
\c!right={)}]
\definebtxcitevariant
- [key]
+ [tag]
[\c!left={[},
+ \c!middle={, },
\c!right={]}]
\definebtxcitevariant
+ [key]
+ [tag]
+
+\definebtxcitevariant
[serial]
[\c!left={[},
+ \c!middle={, },
\c!right={]}]
\definebtxcitevariant
[page]
[\c!left={[},
+ \c!middle={, },
\c!right={]}]
\definebtxcitevariant
[short]
[\c!left={[},
+ \c!middle={, },
\c!right={]}]
\definebtxcitevariant
- [type]
+ [category]
[\c!left={[},
+ \c!middle={, },
\c!right={]}]
\definebtxcitevariant
+ [type]
+ [category]
+
+\definebtxcitevariant
[doi]
[\c!left={[},
+ \c!middle={, },
\c!right={]}]
\definebtxcitevariant
[url]
[\c!left={[},
+ \c!middle={, },
\c!right={]}]
\definebtxcitevariant
[page]
[\c!left=,
- \c!right=,
- \c!inbetween=\endash]
+ \c!middle={, },
+ \c!right=]
\definebtxcitevariant
[num]
[\c!compress=\v!yes,
- \c!inbetween={--},
\c!left={[},
+ \c!middle={, },
\c!right={]}]
\setupbtxlistvariant
@@ -953,6 +1104,11 @@
[artauthor]
[author]
+\setupbtxcitevariant
+ [\c!author =\btxlistvariantparameter\c!author,
+ \c!etallimit =\btxlistvariantparameter\c!etallimit,
+ \c!etaldisplay =\btxlistvariantparameter\c!etaldisplay]
+
% Do we want these in the format? Loading them delayed is somewhat messy.
\loadbtxdefinitionfile[apa]
diff --git a/Master/texmf-dist/tex/context/base/s-math-coverage.lua b/Master/texmf-dist/tex/context/base/s-math-coverage.lua
index 5f1c7cc5a17..56880f76db0 100644
--- a/Master/texmf-dist/tex/context/base/s-math-coverage.lua
+++ b/Master/texmf-dist/tex/context/base/s-math-coverage.lua
@@ -6,76 +6,37 @@ if not modules then modules = { } end modules ['s-math-coverage'] = {
license = "see context related readme files"
}
-moduledata.math = moduledata.math or { }
-moduledata.math.coverage = moduledata.math.coverage or { }
-
local utfchar, utfbyte = utf.char, utf.byte
local formatters, lower = string.formatters, string.lower
local concat = table.concat
-local context = context
-local NC, NR, HL = context.NC, context.NR, context.HL
-local char, getglyph, bold = context.char, context.getglyph, context.bold
+moduledata.math = moduledata.math or { }
+moduledata.math.coverage = moduledata.math.coverage or { }
-local ucgreek = {
- 0x0391, 0x0392, 0x0393, 0x0394, 0x0395,
- 0x0396, 0x0397, 0x0398, 0x0399, 0x039A,
- 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5,
- 0x03A6, 0x03A7, 0x03A8, 0x03A9
-}
+local context = context
-local lcgreek = {
- 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5,
- 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA,
- 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
- 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4,
- 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9,
- 0x03D1, 0x03D5, 0x03D6, 0x03F0, 0x03F1,
- 0x03F4, 0x03F5
-}
+local ctx_NC = context.NC
+local ctx_NR = context.NR
+local ctx_HL = context.HL
-local ucletters = {
- 0x00041, 0x00042, 0x00043, 0x00044, 0x00045,
- 0x00046, 0x00047, 0x00048, 0x00049, 0x0004A,
- 0x0004B, 0x0004C, 0x0004D, 0x0004E, 0x0004F,
- 0x00050, 0x00051, 0x00052, 0x00053, 0x00054,
- 0x00055, 0x00056, 0x00057, 0x00058, 0x00059,
- 0x0005A,
-}
+local ctx_rawmathematics = context.formatted.rawmathematics
+local ctx_mathematics = context.formatted.mathematics
+local ctx_startimath = context.startimath
+local ctx_stopimath = context.stopimath
+local ctx_setmathattribute = context.setmathattribute
+local ctx_underbar = context.underbar
+local ctx_getglyph = context.getglyph
-local lcletters = {
- 0x00061, 0x00062, 0x00063, 0x00064, 0x00065,
- 0x00066, 0x00067, 0x00068, 0x00069, 0x0006A,
- 0x0006B, 0x0006C, 0x0006D, 0x0006E, 0x0006F,
- 0x00070, 0x00071, 0x00072, 0x00073, 0x00074,
- 0x00075, 0x00076, 0x00077, 0x00078, 0x00079,
- 0x0007A,
-}
+local styles = mathematics.styles
+local alternatives = mathematics.alternatives
+local charactersets = mathematics.charactersets
-local digits = {
- 0x00030, 0x00031, 0x00032, 0x00033, 0x00034,
- 0x00035, 0x00036, 0x00037, 0x00038, 0x00039,
-}
-
-local styles = {
- "regular", "sansserif", "monospaced", "fraktur", "script", "blackboard"
-}
+local getboth = mathematics.getboth
+local remapalphabets = mathematics.remapalphabets
-local alternatives = {
- "normal", "bold", "italic", "bolditalic"
-}
-
-local alphabets = {
- ucletters, lcletters, ucgreek, lcgreek, digits,
-}
-
-local getboth = mathematics.getboth
-local remapalphabets = mathematics.remapalphabets
-
-local chardata = characters.data
-local superscripts = characters.superscripts
-local subscripts = characters.subscripts
+local chardata = characters.data
+local superscripts = characters.superscripts
+local subscripts = characters.subscripts
context.writestatus("math coverage","underline: not remapped")
@@ -85,37 +46,37 @@ function moduledata.math.coverage.showalphabets()
local style = styles[i]
for i=1,#alternatives do
local alternative = alternatives[i]
- for i=1,#alphabets do
- local alphabet = alphabets[i]
- NC()
+ for i=1,#charactersets do
+ local alphabet = charactersets[i]
+ ctx_NC()
if i == 1 then
context("%s %s",style,alternative)
end
- NC()
- context.startimath()
- context.setmathattribute(style,alternative)
+ ctx_NC()
+ ctx_startimath()
+ ctx_setmathattribute(style,alternative)
for i=1,#alphabet do
local letter = alphabet[i]
local id = getboth(style,alternative)
local unicode = remapalphabets(letter,id)
if not unicode then
- context.underbar(utfchar(letter))
+ ctx_underbar(utfchar(letter))
elseif unicode == letter then
context(utfchar(unicode))
else
context(utfchar(unicode))
end
end
- context.stopimath()
- NC()
+ ctx_stopimath()
+ ctx_NC()
local first = alphabet[1]
local last = alphabet[#alphabet]
local id = getboth(style,alternative)
local f_unicode = remapalphabets(first,id) or utfbyte(first)
local l_unicode = remapalphabets(last,id) or utfbyte(last)
context("%05X - %05X",f_unicode,l_unicode)
- NC()
- NR()
+ ctx_NC()
+ ctx_NR()
end
end
end
@@ -126,15 +87,15 @@ function moduledata.math.coverage.showcharacters()
context.startmixedcolumns()
context.setupalign { "nothyphenated" }
context.starttabulate { "|T|i2|Tpl|" }
- for u, d in table.sortedpairs(chardata) do
+ for u, d in table.sortedhash(chardata) do
local mathclass = d.mathclass
local mathspec = d.mathspec
if mathclass or mathspec then
- NC()
+ ctx_NC()
context("%05X",u)
- NC()
- getglyph("MathRoman",u)
- NC()
+ ctx_NC()
+ ctx_getglyph("MathRoman",u)
+ ctx_NC()
if mathspec then
local t = { }
for i=1,#mathspec do
@@ -145,8 +106,8 @@ function moduledata.math.coverage.showcharacters()
else
context(mathclass)
end
- NC()
- NR()
+ ctx_NC()
+ ctx_NR()
end
end
context.stoptabulate()
@@ -157,26 +118,33 @@ end
function moduledata.math.coverage.showscripts()
context.starttabulate { "|cT|c|cT|c|c|c|l|" }
- for k, v in table.sortedpairs(table.merged(superscripts,subscripts)) do
+ for k, v in table.sortedhash(table.merged(superscripts,subscripts)) do
local ck = utfchar(k)
local cv = utfchar(v)
local ss = superscripts[k] and "^" or "_"
- NC()
- context("%05X",k)
- NC()
- context(ck)
- NC()
- context("%05X",v)
- NC()
- context(cv)
- NC()
- context.formatted.rawmathematics("x%s = x%s%s",ck,ss,cv)
- NC()
- context.formatted.mathematics("x%s = x%s%s",ck,ss,cv)
- NC()
- context(lower(chardata[k].description))
- NC()
- NR()
+ ctx_NC() context("%05X",k)
+ ctx_NC() context(ck)
+ ctx_NC() context("%05X",v)
+ ctx_NC() context(cv)
+ ctx_NC() ctx_rawmathematics("x%s = x%s%s",ck,ss,cv)
+ ctx_NC() ctx_mathematics("x%s = x%s%s",ck,ss,cv)
+ ctx_NC() context(lower(chardata[k].description))
+ ctx_NC() ctx_NR()
+ end
+ context.stoptabulate()
+end
+
+-- Handy too.
+
+function moduledata.math.coverage.showbold()
+ context.starttabulate { "|lT|cm|lT|cm|lT|" }
+ for k, v in table.sortedhash(mathematics.boldmap) do
+ ctx_NC() context("%U",k)
+ ctx_NC() context("%c",k)
+ ctx_NC() context("%U",v)
+ ctx_NC() context("%c",v)
+ ctx_NC() context(chardata[k].description)
+ ctx_NC() ctx_NR()
end
context.stoptabulate()
end
diff --git a/Master/texmf-dist/tex/context/base/s-math-coverage.mkiv b/Master/texmf-dist/tex/context/base/s-math-coverage.mkiv
index d68ffe58751..9f084b2841c 100644
--- a/Master/texmf-dist/tex/context/base/s-math-coverage.mkiv
+++ b/Master/texmf-dist/tex/context/base/s-math-coverage.mkiv
@@ -18,6 +18,7 @@
\installmodulecommandluasingle \showmathalphabets {moduledata.math.coverage.showalphabets}
\installmodulecommandluasingle \showmathcharacters {moduledata.math.coverage.showcharacters}
\installmodulecommandluasingle \showmathscripts {moduledata.math.coverage.showscripts}
+\installmodulecommandluasingle \showmathbold {moduledata.math.coverage.showbold}
\stopmodule
@@ -30,5 +31,6 @@
\showmathalphabets \page
\showmathcharacters \page
\showmathscripts \page
+ \showmathbold \page
\stoptext
diff --git a/Master/texmf-dist/tex/context/base/spac-chr.lua b/Master/texmf-dist/tex/context/base/spac-chr.lua
index 1abba350ad8..5b3a15478ce 100644
--- a/Master/texmf-dist/tex/context/base/spac-chr.lua
+++ b/Master/texmf-dist/tex/context/base/spac-chr.lua
@@ -39,6 +39,7 @@ local setattr = nuts.setattr
local getfont = nuts.getfont
local getchar = nuts.getchar
+local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
local remove_node = nuts.remove
local copy_node_list = nuts.copy_list
@@ -58,6 +59,7 @@ local glue_code = nodecodes.glue
local space_skip_code = skipcodes["spaceskip"]
local chardata = characters.data
+local is_punctuation = characters.is_punctuation
local typesetters = typesetters
@@ -162,6 +164,18 @@ local methods = {
-- The next one uses an attribute assigned to the character but still we
-- don't have the 'local' value.
+ [0x001F] = function(head,current)
+ local next = getnext(current)
+ if next and getid(next) == glyph_code then
+ local char = getchar(next)
+ head, current = remove_node(head,current,true)
+ if not is_punctuation[char] then
+ local p = fontparameters[getfont(next)]
+ head, current = insert_node_before(head,current,new_glue(p.space,p.space_stretch,p.space_shrink))
+ end
+ end
+ end,
+
[0x00A0] = function(head,current) -- nbsp
local next = getnext(current)
if next and getid(next) == glyph_code then
diff --git a/Master/texmf-dist/tex/context/base/spac-chr.mkiv b/Master/texmf-dist/tex/context/base/spac-chr.mkiv
index 54a25be34a8..f9dc6e16b5f 100644
--- a/Master/texmf-dist/tex/context/base/spac-chr.mkiv
+++ b/Master/texmf-dist/tex/context/base/spac-chr.mkiv
@@ -78,6 +78,8 @@
\let\zwnj\zerowidthnonjoiner
\let\zwj \zerowidthjoiner
+\chardef\optionalspace"1F % will be space unless before punctuation
+
% Shortcuts:
% unexpanded as otherwise we need to intercept / cleanup a lot
diff --git a/Master/texmf-dist/tex/context/base/status-files.pdf b/Master/texmf-dist/tex/context/base/status-files.pdf
index a4381c06d75..7efcee99719 100644
--- a/Master/texmf-dist/tex/context/base/status-files.pdf
+++ b/Master/texmf-dist/tex/context/base/status-files.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/status-lua.pdf b/Master/texmf-dist/tex/context/base/status-lua.pdf
index ad8475aedaa..ea3539ae7c5 100644
--- a/Master/texmf-dist/tex/context/base/status-lua.pdf
+++ b/Master/texmf-dist/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/strc-ref.lua b/Master/texmf-dist/tex/context/base/strc-ref.lua
index 0c8bb6e53e8..3f2c0608d2a 100644
--- a/Master/texmf-dist/tex/context/base/strc-ref.lua
+++ b/Master/texmf-dist/tex/context/base/strc-ref.lua
@@ -158,7 +158,7 @@ local function initializer() -- can we use a tobesaved as metatable for collecte
local r = data.references
local i = r.internal
if i then
- internals[i] = c
+ internals[i] = data
usedinternals[i] = r.used
end
end
diff --git a/Master/texmf-dist/tex/context/base/strc-ref.mkvi b/Master/texmf-dist/tex/context/base/strc-ref.mkvi
index 76d79b80221..359bb4a76ca 100644
--- a/Master/texmf-dist/tex/context/base/strc-ref.mkvi
+++ b/Master/texmf-dist/tex/context/base/strc-ref.mkvi
@@ -263,10 +263,11 @@
\lastdestinationattribute\attributeunsetvalue
\fi}
-\unexpanded\def\strc_references_direct_full#labels#text%
+\unexpanded\def\strc_references_direct_full_user#user#labels#text%
{\ifreferencing
\strc_references_start_destination_nodes
-\setnextinternalreference
+ \setnextinternalreference
+ \edef\m_strc_references_user{#user}%
\ctxcommand{setreferenceattribute("\s!full", "\referenceprefix","#labels",
{
references = {
@@ -280,6 +281,11 @@
entries = {
text = \!!bs#text\!!es
},
+ \ifx\m_strc_references_user\empty \else
+ userdata = {
+ \m_strc_references_user
+ }
+ \fi
},"\interactionparameter\c!focus")
}%
\strc_references_stop_destination_nodes
@@ -297,7 +303,10 @@
\prewordbreak % new
\fi}
-\let\dodirectfullreference\strc_references_direct_full % for at lua end
+\unexpanded\def\strc_references_direct_full
+ {\strc_references_direct_full_user\empty}
+
+\let\dodirectfullreference\strc_references_direct_full % for at lua end (no longer)
\def\strc_references_set_page_only_destination_box_attribute#cs#labels%
{\strc_references_set_page_only_destination_attribute{#labels}%
diff --git a/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv b/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
index 3734e564768..a7a7ae50bc7 100644
--- a/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
@@ -1255,12 +1255,29 @@
\fi
\dostoptagged} % right spot
+% \def\tabl_ntb_cell_finalize
+% {\doifnotinset\localwidth{\v!fit,\v!broad}% user set
+% {\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
+% \ifdim\localwidth>\scratchdimen
+% \tabl_ntb_set_aut\c_tabl_ntb_col{\the\dimexpr\localwidth}%
+% \fi}}
+
\def\tabl_ntb_cell_finalize
- {\doifnotinset\localwidth{\v!fit,\v!broad}% user set
- {\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
- \ifdim\localwidth>\scratchdimen
- \tabl_ntb_set_aut\c_tabl_ntb_col{\the\dimexpr\localwidth}%
- \fi}}
+ {\ifx\localwidth\v!fit
+ % nothing
+ \else\ifx\localwidth\v!broad
+ % nothing
+ \else\ifx\localwidth\empty
+ % nothing (safeguard)
+ \else
+ \tabl_ntb_cell_finalize_indeed
+ \fi\fi\fi}
+
+\def\tabl_ntb_cell_finalize_indeed
+ {\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
+ \ifdim\localwidth>\scratchdimen
+ \tabl_ntb_set_aut\c_tabl_ntb_col{\the\dimexpr\localwidth}%
+ \fi}
\def\tabl_ntb_table_stop
{\setbox\scratchbox\hbox
diff --git a/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv b/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv
index d4d22af9716..c25d61741f4 100644
--- a/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv
@@ -1066,6 +1066,9 @@
\def\tabl_tabulate_insert_content
{\tabl_tabulate_insert_head
+ \ifcase\c_tabl_tabulate_repeathead \else
+ \tabulatenoalign{\penalty\zerocount}% added 7/5/2014 WS mail
+ \fi
\tabl_tabulate_insert_body
\tabl_tabulate_insert_foot
\tabl_tabulate_remove_funny_line}
diff --git a/Master/texmf-dist/tex/context/base/trac-deb.lua b/Master/texmf-dist/tex/context/base/trac-deb.lua
index af4f7c643a0..d52399bcf1f 100644
--- a/Master/texmf-dist/tex/context/base/trac-deb.lua
+++ b/Master/texmf-dist/tex/context/base/trac-deb.lua
@@ -130,7 +130,10 @@ function tracers.showlines(filename,linenumber,offset,luaerrorline)
local stop = "\\stopluacode"
local n = linenumber
for i=n,1,-1 do
- if find(lines[i],start) then
+ local line = lines[i]
+ if not line then
+ break
+ elseif find(line,start) then
n = i + luaerrorline - 1
if n <= linenumber then
linenumber = n
@@ -209,7 +212,7 @@ function tracers.printerror(specification)
report_nl()
if luaerrorline then
report("error on line %s in file %s:\n\n%s",linenumber,filename,lastluaerror)
--- report("error on line %s in file %s:\n\n%s",linenumber,filename,lasttexerror)
+ -- report("error on line %s in file %s:\n\n%s",linenumber,filename,lasttexerror)
else
report("error on line %s in file %s: %s",linenumber,filename,lasttexerror)
if tex.show_context then
diff --git a/Master/texmf-dist/tex/context/base/trac-log.lua b/Master/texmf-dist/tex/context/base/trac-log.lua
index 45cc550d491..72f271d9c3c 100644
--- a/Master/texmf-dist/tex/context/base/trac-log.lua
+++ b/Master/texmf-dist/tex/context/base/trac-log.lua
@@ -17,7 +17,7 @@ if not modules then modules = { } end modules ['trac-log'] = {
-- local texio_write_nl = texio.write_nl
-- local texio_write = texio.write
-- local io_write = io.write
-
+--
-- local write_nl = function(target,...)
-- if not io_write then
-- io_write = io.write
@@ -37,7 +37,7 @@ if not modules then modules = { } end modules ['trac-log'] = {
-- io_write(target,...)
-- end
-- end
-
+--
-- local write = function(target,...)
-- if not io_write then
-- io_write = io.write
@@ -54,7 +54,7 @@ if not modules then modules = { } end modules ['trac-log'] = {
-- io_write(target,...)
-- end
-- end
-
+--
-- texio.write = write
-- texio.write_nl = write_nl
--
diff --git a/Master/texmf-dist/tex/context/base/type-imp-cambria.mkiv b/Master/texmf-dist/tex/context/base/type-imp-cambria.mkiv
index 91288b6d0ac..9bfa2ee5c49 100644
--- a/Master/texmf-dist/tex/context/base/type-imp-cambria.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-imp-cambria.mkiv
@@ -11,6 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D We use Dejavu as it covers wider range of monospaced glyphs.
+
+\loadtypescriptfile[dejavu]
+
\starttypescriptcollection[cambria]
% microsoft: cambria.ttc cambriab.ttf cambriai.ttf cambriaz.ttf
@@ -60,13 +64,13 @@
\starttypescript [cambria,cambria-m,cambria-a]
% any
\definetypeface [cambria] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
- \definetypeface [cambria] [\s!tt] [\s!mono] [modern] [\s!default]
+ \definetypeface [cambria] [\s!tt] [\s!mono] [dejavu] [\s!default]
\definetypeface [cambria] [\s!mm] [\s!math] [\typescriptone] [\s!default]
\stoptypescript
\starttypescript [cambria-x,cambria-y]
% test x
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [cambria] [\s!default]
- \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
\definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default]
\stoptypescript
diff --git a/Master/texmf-dist/tex/context/base/type-imp-lato.mkiv b/Master/texmf-dist/tex/context/base/type-imp-lato.mkiv
new file mode 100644
index 00000000000..8fb8647fceb
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-imp-lato.mkiv
@@ -0,0 +1,56 @@
+%D \module
+%D [ file=type-imp-lato,
+%D version=2014.05.02,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Lato fonts,
+%D author=Hans Hagen,
+%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.
+
+% hai : hair / lta : italic
+% lig : light / lta : italic
+% reg : regular / lta : italic
+% bol : bold / lta : italic
+% bla : black / lta : italic
+
+\loadtypescriptfile[dejavu]
+\loadtypescriptfile[xits]
+
+\starttypescriptcollection[lato]
+
+ \starttypescript [\s!sans] [lato] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:lato-reg] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:lato-bol] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:lato-reglta] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:lato-bollta] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [lato-light] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:lato-lig] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:lato-reg] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:lato-liglta] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:lato-reglta] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [lato-dark] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:lato-bol] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:lato-bla] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:lato-bollta] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:lato-blalta] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript[lato,lato-light,lato-dark]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [xits] [\s!default] [\s!rscale=1.2]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/util-str.lua b/Master/texmf-dist/tex/context/base/util-str.lua
index 52c48badda8..5609cdf255d 100644
--- a/Master/texmf-dist/tex/context/base/util-str.lua
+++ b/Master/texmf-dist/tex/context/base/util-str.lua
@@ -284,6 +284,7 @@ end
-- octal %...o number
-- string %...s string number
-- float %...f number
+-- checked float %...F number
-- exponential %...e number
-- exponential %...E number
-- autofloat %...g number
@@ -526,7 +527,11 @@ end
local format_F = function(f)
n = n + 1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f == "" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g = function(f)
diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.lua b/Master/texmf-dist/tex/context/base/x-asciimath.lua
index 992c37eaebd..87f04b5ff7d 100644
--- a/Master/texmf-dist/tex/context/base/x-asciimath.lua
+++ b/Master/texmf-dist/tex/context/base/x-asciimath.lua
@@ -268,5 +268,7 @@ parser = Cs { "main",
}
-asciimath.reserved = reserved
-asciimath.convert = converted
+asciimath.reserved = reserved
+asciimath.convert = converted
+
+commands.convert = converted
diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.mkiv b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
index b555115ffc3..fd385671a50 100644
--- a/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
@@ -64,7 +64,8 @@
\writestatus{asciimath}{beware, this is an experimental (m4all only) module}
-\unexpanded\def\asciimath#1{\ctxmoduleasciimath{convert(\!!bs\detokenize{#1}\!!es,true)}}
+%unexpanded\def\asciimath#1{\ctxmoduleasciimath{convert(\!!bs\detokenize{#1}\!!es,true)}}
+\unexpanded\def\asciimath#1{\ctxcommand{convert(\!!bs\detokenize\expandafter{\normalexpanded{#1}}\!!es,true)}}
\protect
@@ -82,6 +83,7 @@
\asciimath{int_0^1 f(x)dx}
\asciimath{int^1_0 f(x)dx}
\asciimath{a//b}
+\asciimath{a//\alpha}
\asciimath{(a/b)/(d/c)}
\asciimath{((a*b))/(d/c)}
\asciimath{[[a,b],[c,d]]((n),(k))}
diff --git a/Master/texmf-dist/tex/context/base/x-mathml.lua b/Master/texmf-dist/tex/context/base/x-mathml.lua
index baf839ad8ae..15739eec76e 100644
--- a/Master/texmf-dist/tex/context/base/x-mathml.lua
+++ b/Master/texmf-dist/tex/context/base/x-mathml.lua
@@ -758,7 +758,7 @@ function mathml.mtable(root)
local framespacing = at.framespacing or "0pt"
local framespacing = at.framespacing or "-\\ruledlinewidth" -- make this an option
- context.bTABLE { frame = frametypes[frame or "none"] or "off", offset = framespacing }
+ context.bTABLE { frame = frametypes[frame or "none"] or "off", offset = framespacing, background = "" } -- todo: use xtables and definextable
for e in lxml.collected(root,"/(mml:mtr|mml:mlabeledtr)") do
context.bTR()
local at = e.at
diff --git a/Master/texmf-dist/tex/context/fonts/lm-math.lfg b/Master/texmf-dist/tex/context/fonts/lm-math.lfg
index 87c37cd78d9..b8c99697955 100644
--- a/Master/texmf-dist/tex/context/fonts/lm-math.lfg
+++ b/Master/texmf-dist/tex/context/fonts/lm-math.lfg
@@ -231,7 +231,7 @@ local seventeen = {
return {
name = "lm-math",
version = "1.00",
- comment = "Goodies that complement latin modern math.",
+ comment = "Goodies that complement latin modern math (virtual).",
author = "Hans Hagen",
copyright = "ConTeXt development team",
mathematics = {
diff --git a/Master/texmf-dist/tex/context/fonts/lm.lfg b/Master/texmf-dist/tex/context/fonts/lm.lfg
index 8d761471848..546d18defae 100644
--- a/Master/texmf-dist/tex/context/fonts/lm.lfg
+++ b/Master/texmf-dist/tex/context/fonts/lm.lfg
@@ -34,8 +34,19 @@ return {
[0x2213] = { -- ∓
yoffset = -100,
},
- }
- }
+ },
+ },
+-- parameters = {
+-- FractionNumeratorDisplayStyleShiftUp = function(value,target,original)
+-- local o = original.mathparameters.FractionNumeratorDisplayStyleShiftUp
+-- if o > 675 then
+-- o = 600
+-- else
+-- -- probably tuned
+-- end
+-- return o * target.parameters.factor
+-- end,
+-- }
},
filenames = {
["latinmodern-math-regular.otf"] = {
diff --git a/Master/texmf-dist/tex/context/interface/keys-cs.xml b/Master/texmf-dist/tex/context/interface/keys-cs.xml
index 0a0b9b9a639..7053ceed751 100644
--- a/Master/texmf-dist/tex/context/interface/keys-cs.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-cs.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='soubor'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='prvnistranka'/>
<cd:constant name='focus' value='zaostreni'/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-de.xml b/Master/texmf-dist/tex/context/interface/keys-de.xml
index 28b21b915d6..7164db6e30b 100644
--- a/Master/texmf-dist/tex/context/interface/keys-de.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-de.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='datei'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='ersteseite'/>
<cd:constant name='focus' value='focus'/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-en.xml b/Master/texmf-dist/tex/context/interface/keys-en.xml
index da433cdeec4..354b86d65fd 100644
--- a/Master/texmf-dist/tex/context/interface/keys-en.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-en.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='file'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='firstpage'/>
<cd:constant name='focus' value='focus'/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-fr.xml b/Master/texmf-dist/tex/context/interface/keys-fr.xml
index 6a8eaa9c557..0e4f9e51671 100644
--- a/Master/texmf-dist/tex/context/interface/keys-fr.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-fr.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='fichier'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='premierepage'/>
<cd:constant name='focus' value='focus'/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-it.xml b/Master/texmf-dist/tex/context/interface/keys-it.xml
index c7c9963189d..afc33eb225d 100644
--- a/Master/texmf-dist/tex/context/interface/keys-it.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-it.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='file'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='primapagina'/>
<cd:constant name='focus' value='focus'/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-nl.xml b/Master/texmf-dist/tex/context/interface/keys-nl.xml
index c87088a094e..9abfe5d7a90 100644
--- a/Master/texmf-dist/tex/context/interface/keys-nl.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-nl.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='file'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='eerstepagina'/>
<cd:constant name='focus' value='focus'/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-pe.xml b/Master/texmf-dist/tex/context/interface/keys-pe.xml
index 8e4d412d50a..517c41ed0d8 100644
--- a/Master/texmf-dist/tex/context/interface/keys-pe.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-pe.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='پرونده'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='صفحه‌اول'/>
<cd:constant name='focus' value='تمرکز'/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-ro.xml b/Master/texmf-dist/tex/context/interface/keys-ro.xml
index f9ef01b9fdf..b7f5b2e1904 100644
--- a/Master/texmf-dist/tex/context/interface/keys-ro.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-ro.xml
@@ -707,6 +707,7 @@
<cd:constant name='file' value='fisier'/>
<cd:constant name='filtercommand' value='filtercommand'/>
<cd:constant name='finalnamesep' value='finalnamesep'/>
+ <cd:constant name='finalpubsep' value='finalpubsep'/>
<cd:constant name='firstnamesep' value='firstnamesep'/>
<cd:constant name='firstpage' value='primapagina'/>
<cd:constant name='focus' value='focus'/>
diff --git a/Master/texmf-dist/tex/context/patterns/word-xx.lua b/Master/texmf-dist/tex/context/patterns/word-xx.lua
new file mode 100644
index 00000000000..f8b38fe755b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/patterns/word-xx.lua
@@ -0,0 +1,14 @@
+return {
+ ["comment"]="test",
+ ["copyright"]="not relevant",
+ ["language"]="xx",
+ ["lists"]={
+ {
+-- ["data"]="we thrive information in thick worlds because of our marvelous and everyday capacity to select edit single out structure highlight group pair merge harmonize synthesize focus organize condense reduce boil down choose categorize catalog classify list abstract scan look into idealize isolate discriminate distinguish screen pigeonhole pick over sort integrate blend inspect filter lump skip smooth chunk average approximate cluster aggregate outline summarize itemize review dip into flip through browse glance into leaf through skim refine enumerate glean synopsize winnow the wheat from the chaff and separate the sheep from the goats",
+ ["data"]="abstract aggregate and approximate average because blend boil browse capacity catalog categorize chaff choose chunk classify cluster condense dip discriminate distinguish down edit enumerate everyday filter flip focus from glance glean goats group harmonize highlight idealize in information inspect integrate into isolate itemize leaf list look lump marvelous merge of organize our out outline over pair pick pigeonhole reduce refine review scan screen select separate sheep single skim skip smooth sort structure summarize synopsize synthesize the thick thrive through to we wheat winnow worlds",
+ },
+ },
+ ["timestamp"]="2013-05-20 14:15:21",
+ ["version"]="1.00",
+}
+
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua
index a304ab6aaa0..c19a49af39f 100644
--- a/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua
+++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-gen.lua
@@ -353,3 +353,16 @@ end
function table.setmetatableindex(t,f)
setmetatable(t,{ __index = f })
end
+
+-- helper for plain:
+
+arguments = { }
+
+if arg then
+ for i=1,#arg do
+ local k, v = string.match(arg[i],"^%-%-([^=]+)=?(.-)$")
+ if k and v then
+ arguments[k] = v
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua
index e20c3a03b54..2e1c6a46674 100644
--- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua
+++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-enc.lua
@@ -11,9 +11,10 @@ if context then
os.exit()
end
-local fonts = fonts
-fonts.encodings = { }
-fonts.encodings.agl = { }
+local fonts = fonts
+fonts.encodings = { }
+fonts.encodings.agl = { }
+fonts.encodings.known = { }
setmetatable(fonts.encodings.agl, { __index = function(t,k)
if k == "unicodes" then
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua
index 60083ae2fa0..4dfefd65644 100644
--- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 05/05/14 22:31:19
+-- merge date : 05/18/14 15:57:13
do -- begin closure to overcome local limits and interference
@@ -125,7 +125,7 @@ local uppercase=R("AZ")
local underscore=P("_")
local hexdigit=digit+lowercase+uppercase
local cr,lf,crlf=P("\r"),P("\n"),P("\r\n")
-local newline=crlf+S("\r\n")
+local newline=P("\r")*(P("\n")+P(true))+P("\n")
local escaped=P("\\")*anything
local squote=P("'")
local dquote=P('"')
@@ -147,8 +147,8 @@ patterns.utfbom_32_le=utfbom_32_le
patterns.utfbom_16_be=utfbom_16_be
patterns.utfbom_16_le=utfbom_16_le
patterns.utfbom_8=utfbom_8
-patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
-patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
+patterns.utf_16_be_nl=P("\000\r\000\n")+P("\000\r")+P("\000\n")
+patterns.utf_16_le_nl=P("\r\000\n\000")+P("\r\000")+P("\n\000")
patterns.utf8one=R("\000\127")
patterns.utf8two=R("\194\223")*utf8next
patterns.utf8three=R("\224\239")*utf8next*utf8next
@@ -2853,7 +2853,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -3460,6 +3464,15 @@ end
function table.setmetatableindex(t,f)
setmetatable(t,{ __index=f })
end
+arguments={}
+if arg then
+ for i=1,#arg do
+ local k,v=string.match(arg[i],"^%-%-([^=]+)=?(.-)$")
+ if k and v then
+ arguments[k]=v
+ end
+ end
+end
end -- closure
@@ -4170,6 +4183,7 @@ function constructors.scale(tfmdata,specification)
if changed then
local c=changed[unicode]
if c then
+ local ligatures=character.ligatures
description=descriptions[c] or descriptions[unicode] or character
character=characters[c] or character
index=description.index or c
@@ -4181,6 +4195,9 @@ function constructors.scale(tfmdata,specification)
touni=tounicode[i]
end
end
+ if ligatures and not character.ligatures then
+ character.ligatures=ligatures
+ end
else
description=descriptions[unicode] or character
index=description.index or unicode
@@ -4858,6 +4875,7 @@ end
local fonts=fonts
fonts.encodings={}
fonts.encodings.agl={}
+fonts.encodings.known={}
setmetatable(fonts.encodings.agl,{ __index=function(t,k)
if k=="unicodes" then
texio.write(" <loading (extended) adobe glyph list>")
@@ -8542,13 +8560,14 @@ local function gref(descriptions,n)
return f_unicode(n)
end
elseif n then
- local num,nam={},{}
- for i=2,#n do
+ local num,nam,j={},{},0
+ for i=1,#n do
local ni=n[i]
if tonumber(ni) then
+ j=j+1
local di=descriptions[ni]
- num[i]=f_unicode(ni)
- nam[i]=di and di.name or "-"
+ num[j]=f_unicode(ni)
+ nam[j]=di and di.name or "-"
end
end
return f_unilist(num,nam)
@@ -8631,8 +8650,8 @@ local function finalize_ligatures(tfmdata,ligatures)
local ligature=ligatures[i]
if ligature then
local unicode,lookupdata=ligature[1],ligature[2]
- if trace then
- trace_ligatures_detail("building % a into %a",lookupdata,unicode)
+ if trace_ligatures_detail then
+ report_prepare("building % a into %a",lookupdata,unicode)
end
local size=#lookupdata
local firstcode=lookupdata[1]
@@ -8644,8 +8663,8 @@ local function finalize_ligatures(tfmdata,ligatures)
local firstdata=characters[firstcode]
if not firstdata then
firstcode=private
- if trace then
- trace_ligatures_detail("defining %a as %a",firstname,firstcode)
+ if trace_ligatures_detail then
+ report_prepare("defining %a as %a",firstname,firstcode)
end
unicodes[firstname]=firstcode
firstdata={ intermediate=true,ligatures={} }
@@ -8668,8 +8687,8 @@ local function finalize_ligatures(tfmdata,ligatures)
break
end
end
- if trace then
- trace_ligatures_detail("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target)
+ if trace_ligatures_detail then
+ report_prepare("codes (%a,%a) + (%a,%a) -> %a",firstname,firstcode,secondname,secondcode,target)
end
local firstligs=firstdata.ligatures
if firstligs then
@@ -8680,6 +8699,8 @@ local function finalize_ligatures(tfmdata,ligatures)
firstcode=target
firstname=secondname
end
+ elseif trace_ligatures_detail then
+ report_prepare("no glyph (%a,%a) for building %a",firstname,firstcode,target)
end
if okay then
ligatures[i]=false
@@ -8689,12 +8710,14 @@ local function finalize_ligatures(tfmdata,ligatures)
end
alldone=done==0
end
- if trace then
- for k,v in next,characters do
- if v.ligatures then table.print(v,k) end
+ if trace_ligatures_detail then
+ for k,v in table.sortedhash(characters) do
+ if v.ligatures then
+ table.print(v,k)
+ end
end
end
- tfmdata.resources.private=private
+ resources.private=private
end
end
local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplist)
@@ -8913,7 +8936,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
end
changed[unicode]=data
elseif lookuptype=="alternate" then
- local replacement=data[alternate]
+ local replacement=data[alternate]
if replacement then
changed[unicode]=replacement
if trace_alternatives then
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex b/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex
index ab304b97486..604b4a1f8d9 100644
--- a/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex
+++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-math.tex
@@ -19,15 +19,6 @@
% a bunch of fonts:
-\font\tenrm = file:lmroman10-regular.otf:+liga;+kern;+tlig;+trep at 10pt
-\font\sevenrm = file:lmroman7-regular.otf:+liga;+kern;+tlig;+trep at 7pt
-\font\fiverm = file:lmroman5-regular.otf:+liga;+kern;+tlig;+trep at 5pt
-
-\font\tentt = file:lmmono10-regular.otf at 10pt
-\font\tensl = file:lmromanslant10-regular.otf:+liga;+kern;+tlig;+trep at 10pt
-\font\tenit = file:lmroman10-italic.otf:+liga;+kern;+tlig;+trep at 10pt
-\font\tenbi = file:lmroman10-bolditalic.otf:+liga;+kern;+tlig;+trep at 10pt
-
\let \teni = \relax
\let \seveni = \relax
\let \fivei = \relax
@@ -35,19 +26,58 @@
\let \sevensy = \relax
\let \fivesy = \relax
\let \tenex = \relax
-\let \tenbf = \relax
\let \sevenbf = \relax
\let \fivebf = \relax
-\tenrm
+\def\latinmodern
+ {\font\tenrm = file:lmroman10-regular.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\sevenrm = file:lmroman7-regular.otf:+liga;+kern;+tlig;+trep at 7pt
+ \font\fiverm = file:lmroman5-regular.otf:+liga;+kern;+tlig;+trep at 5pt
+ %
+ \font\tentt = file:lmmono10-regular.otf at 10pt
+ \font\tensl = file:lmromanslant10-regular.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\tenit = file:lmroman10-italic.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\tenbf = file:lmroman10-bold.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\tenbi = file:lmroman10-bolditalic.otf:+liga;+kern;+tlig;+trep at 10pt
+ %
+ \font\mathfonttextupright = file:latinmodern-math.otf:ssty=0;fixmath=yes at 10pt
+ \font\mathfontscriptupright = file:latinmodern-math.otf:ssty=1;fixmath=yes at 7pt
+ \font\mathfontscriptscriptupright = file:latinmodern-math.otf:ssty=2;fixmath=yes at 5pt
+ %
+ \textfont 0 = \mathfonttextupright
+ \scriptfont 0 = \mathfontscriptupright
+ \scriptscriptfont 0 = \mathfontscriptscriptupright
+ %
+ \tenrm}
-\font\mathfonttextupright = file:latinmodern-math.otf:ssty=0;fixmath=yes at 10pt
-\font\mathfontscriptupright = file:latinmodern-math.otf:ssty=1;fixmath=yes at 7pt
-\font\mathfontscriptscriptupright = file:latinmodern-math.otf:ssty=2;fixmath=yes at 5pt
+\def\lucidabright
+ {\font\tenrm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\sevenrm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 7pt
+ \font\fiverm = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 5pt
+ %
+ \font\tentt = file:lucidabrightot.otf at 10pt
+ \font\tenit = file:lucidabrightot.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\tenit = file:lucidabrightot-italic.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\tenbf = file:lucidabrightot-demi.otf:+liga;+kern;+tlig;+trep at 10pt
+ \font\tenbi = file:lucidabrightot-demiitalic.otf:+liga;+kern;+tlig;+trep at 10pt
+ %
+ \font\mathfonttextupright = file:lucidabrightmathot.otf:ssty=0;fixmath=yes at 10pt
+ \font\mathfontscriptupright = file:lucidabrightmathot.otf:ssty=1;fixmath=yes at 7pt
+ \font\mathfontscriptscriptupright = file:lucidabrightmathot.otf:ssty=2;fixmath=yes at 5pt
+ %
+ \textfont 0 = \mathfonttextupright
+ \scriptfont 0 = \mathfontscriptupright
+ \scriptscriptfont 0 = \mathfontscriptscriptupright
+ %
+ \tenrm}
-\textfont 0 = \mathfonttextupright
-\scriptfont 0 = \mathfontscriptupright
-\scriptscriptfont 0 = \mathfontscriptscriptupright
+\directlua {
+ if arguments["mtx:lucidabright"] then
+ tex.print("\string\\lucidabright")
+ else
+ tex.print("\string\\latinmodern")
+ end
+}
\newtoks\everymathrm
\newtoks\everymathmit
@@ -58,12 +88,12 @@
\newtoks\everymathbi
\newtoks\everymathtt
-\def\rm{\fam0\relax\the\everymathmrm\relax\tenrm\relax}
-\def\it{\fam0\relax\the\everymathit \relax\tenit\relax}
-\def\sl{\fam0\relax\the\everymathsl \relax\tensl\relax}
-\def\bf{\fam0\relax\the\everymathbf \relax\tenbf\relax}
-\def\bi{\fam0\relax\the\everymathbi \relax\tenbi\relax}
-\def\tt{\fam0\relax\the\everymathtt \relax\tentt\relax}
+\def\rm{\fam0\relax\the\everymathrm\relax\tenrm\relax}
+\def\it{\fam0\relax\the\everymathit\relax\tenit\relax}
+\def\sl{\fam0\relax\the\everymathsl\relax\tensl\relax}
+\def\bf{\fam0\relax\the\everymathbf\relax\tenbf\relax}
+\def\bi{\fam0\relax\the\everymathbi\relax\tenbi\relax}
+\def\tt{\fam0\relax\the\everymathtt\relax\tentt\relax}
\let\mit \relax % use names or \Uchar or define a vector
\let\cal \relax % idem, i'm not in the mood for this now
@@ -1799,7 +1829,8 @@
% a few definitions:
-\def\sqrt{\Uroot "0 "221A }
+\def\sqrt {\Uroot "0 "221A{}}
+\def\root#1\of{\Uroot "0 "221A{#1}}
% \skewchar\teni='177 \skewchar\seveni='177 \skewchar\fivei='177
% \skewchar\tensy='60 \skewchar\sevensy='60 \skewchar\fivesy='60
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex b/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex
index fbf8ce3cf2c..b822af66875 100644
--- a/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex
+++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-test.tex
@@ -84,4 +84,30 @@ $$\sqrt {2} { { {1} \over { {1} \over {x} } } } $$
\cows Hello World!
+% math test
+
+\latinmodern
+
+\def\sqrt{\Uroot "0 "221A{}}
+
+\def\root#1\of{\Uroot "0 "221A{#1}}
+
+Inline $\sqrt{x}{1.2}$ math. % same for $\root n of x$
+
+$\root3\of x$
+
+$\sin{x}$
+
+\lucidabright
+
+\def\sqrt{\Uroot "0 "221A{}}
+
+\def\root#1\of{\Uroot "0 "221A{#1}}
+
+Inline $\sqrt{x}{1.2}$ math. % same for $\root n of x$
+
+$\root3\of x$
+
+$\sin{x}$
+
\end
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index c5de6c99c7b..ff76d7a4784 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -5086,16 +5086,16 @@ sub POSTcontext {
# clean up files Hans wants in his distribution but are confusing or
# problematic in TeX Live.
&SYSTEM ("$MV colors tex/context/colors");
+ &SYSTEM ("$RM -f context/data/texworks/configuration/smart-quotes-modes.txt~");
&SYSTEM ("$RM -rf fonts/truetype/hoekwater/lm/");# lmtypewriter10-regular.ttf
&SYSTEM ("$RM -rf fonts/data/tests/"); # texmfhome.otf
- &SYSTEM ("$RM -rf web2c/"); # context*cnf*, texlive2011cnf.lua
+ &SYSTEM ("$RM -rf web2c/"); # context*cnf*, texlive*cnf.lua
&SYSTEM ("find -name koeiel\* -o -name jmn | xargs rm -rf");
# remove mptopdf files, since they are in a separate package.
chomp (my @mptopdf_files = `tlpfiles mptopdf | sed 's,[^/]*/,,'`);
&SYSTEM ("$RM -f @mptopdf_files ");
&SYSTEM ("$RM doc/context/scripts/mkii/mptopdf.man");
- &SYSTEM ("$RM scripts/context/stubs/mswin/mptopdf.exe");
print "still POST$package - user-level executables\n";
# executables go in both the Master bin dir and the
@@ -5107,8 +5107,8 @@ sub POSTcontext {
my $pkg_subdir = "stubs/unix"; # where hans keeps them
&xchdir ("$DEST/scripts/$package/$pkg_subdir");
my @exec = ();
- for my $exec (qw(context ctxtools luatools
- mtxrun pstopdf texexec texmfstart)) {
+ for my $exec (qw(context contextjit luatools
+ mtxrun mtxrunjit texexec texmfstart)) {
&SYSTEM ("chmod a+x $exec");
&bindirs_symlink ($exec);
&build_scripts_copy ($exec, $pkg_subdir);
diff --git a/Master/tlpkg/tlpsrc/context.tlpsrc b/Master/tlpkg/tlpsrc/context.tlpsrc
index 43d42ad1930..7406be2a960 100644
--- a/Master/tlpkg/tlpsrc/context.tlpsrc
+++ b/Master/tlpkg/tlpsrc/context.tlpsrc
@@ -57,19 +57,17 @@ srcpattern +!d texmf-dist/source/context/third
#
docpattern +!d texmf-dist/doc/generic/tex-virtual-academy-pl/context
docpattern +!d texmf-dist/doc/context/third
-docpattern +f texmf-dist/doc/man/man1/ctxtools.*
docpattern +f texmf-dist/doc/man/man1/luatools.*
-docpattern +f texmf-dist/doc/man/man1/pstopdf.*
docpattern +f texmf-dist/doc/man/man1/texexec.*
docpattern +f texmf-dist/doc/man/man1/texmfstart.*
docpattern +f texmf-dist/doc/man/man1/mtx-*
docpattern +f texmf-dist/doc/man/man1/mtxrun.*
#
binpattern f bin/${ARCH}/context
-binpattern f bin/${ARCH}/ctxtools
+binpattern f bin/${ARCH}/contextjit
binpattern f bin/${ARCH}/luatools
binpattern f bin/${ARCH}/mtxrun
-binpattern f bin/${ARCH}/pstopdf
+binpattern f bin/${ARCH}/mtxrunjit
binpattern f bin/${ARCH}/texexec
binpattern f bin/${ARCH}/texmfstart
binpattern f/win32 bin/win32/mtxrun.lua