MkIV "isolated expression" with \(start|stop|use)staticMPfigure
With the attached test file, which uses MPinclusions for a staticMPfigure, I get an "Isolated expression". I think it's a parser bug somewhere, because deleting almost any word in the file removes the error. The file itself looks a bit crazy. It is a minimal example generated by a program to help with debugging. The program randomly deletes a word in the file, then tests whether the error still happens. If yes, it deletes another word. If no, it restores the word, and tries again by choosing another word to delete. That process reduced the file from 4KB to 2KB. Here's the relevant piece of the transcript. The same error happens at live.contextgarden.net (so I don't think it's a Debian-specific issue). ! terminal: >> r_ladder ! Isolated expression. <to be read again> ; <*> r_ladder; ; . system > tex > error on line 73 in file test-mpfigures.tex: terminal: >> r_ladder ! Isolated expression. <to be read again> ; <*> r_ladder; ; ... 63 64 \startMPinclusions 65 def r_ladder := draw unitsquare; enddef; 66 \stopMPinclusions 67 68 \startstaticMPfigure{resistiveladder} 69 r_ladder; 70 \stopstaticMPfigure 71 72 \usestaticMPfigure[resistiveladder] 73 >> 74 \stoptext 75 <inserted text> ...0;;]===], [===[;;]===], false)} \meta_process_graphic ...!!es , \MPaskedfigure )}} \egroup \placeMPgraphic \m... \meta_handle_reusable_graphic ...cess_graphic {#3} }\setxvalue {\??mpgraphic ... \meta_use_graphic ...aphic \currentMPgraphicname } \empty \meta_end_graphic_g... <to be read again> \fi \dodoubleemptyonespaced #1#2->#1[{#2}][] ... l.73 And the start of the output, showing the version information: mtx-context | run 1: luatex --fmt="/var/lib/texmf/luatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/cont-en" --lua="/var/lib/texmf/luatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/cont-en.lui" --backend="pdf" "./test-mpfigures.tex" \stoptext This is LuaTeX, Version beta-0.70.2-2012070301 (TeX Live 2012/Debian) \write18 enabled. (test-mpfigures.tex ConTeXt ver: 2012.05.30 11:26 MKIV fmt: 2013.4.11 int: english/english system > cont-new.mkiv loaded If you can think of further tests to run, I'll be happy to try them. -- -Sanjoy
On 4/14/2013 12:37 PM, Sanjoy Mahajan wrote:
63 64 \startMPinclusions 65 def r_ladder := draw unitsquare; enddef;
wrong mp: no := but = ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
65 def r_ladder := draw unitsquare; enddef;
wrong mp: no := but =
Oh, you're right. Though why does it work most of the time, but fails depending on the exact surrounding .tex text (outside of the MP code)? Maybe related: mpost never noticed my syntax error before. That function defn has used the := syntax for about 3 years (the vcs tells me that I put in that function in March, 2010). With my mpost today, it also works. Here's a minimal .mp file that worked (using MetaPost version 1.504): def r_ladder := draw unitsquare scaled 1cm enddef; beginfig(1) r_ladder; endfig; end
On 4/14/2013 2:36 PM, Sanjoy Mahajan wrote:
65 def r_ladder := draw unitsquare; enddef;
wrong mp: no := but =
Oh, you're right. Though why does it work most of the time, but fails depending on the exact surrounding .tex text (outside of the MP code)?
Maybe related: mpost never noticed my syntax error before. That function defn has used the := syntax for about 3 years (the vcs tells me that I put in that function in March, 2010).
With my mpost today, it also works. Here's a minimal .mp file that worked (using MetaPost version 1.504):
def r_ladder := draw unitsquare scaled 1cm enddef;
beginfig(1) r_ladder; endfig; end
hm, interesting, i wonder what the difference is in = and := in such a def Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Sanjoy Mahajan