On 26 May 2013 07:14, Dan Allen <[email protected]> wrote: > Good catch! This is due to an incorrect regular expression for matching > callout lists. > > The delimiter regex in the list definition matches 0 or more numbers in > front of a greater than sign: > > [listdef-callout] > posattrs=style > delimiter=^<?(?P<index>\d*>) +(?P<text>.+)$ > type=callout > tags=callout > style=arabic > > But in the asciidoc.py script, the regular expression expects there to be > at least one number: > > if re.match(r'^\d+[\.>]$', index): > style = 'arabic' > > The asterisk in the listdef-callout delimiter regexp should be changed to > a plus. > > delimiter=^<?(?P<index>\d+>) +(?P<text>.+)$ > > Can you file an issue in the AsciiDoc issue tracker? >
That should do as a temporary fix until Stuart sees it, but I think the actual problem is the code. The docs say <n> n> or > is legal, the delimiter regex does that ok. The code regex won't recognise a leading < or missing digits so it should be fixed. @Stuart suggest at approx line 2860 r'^(<?\d*>|\d+\.)$' Cheers Lex > > -Dan > > > > On Sat, May 25, 2013 at 11:13 AM, Tong Sun <[email protected]> wrote: > >> Hi, >> >> I get this weird "asciidoc: FAILED: unexpected error" today from my long >> document. >> >> Took me quit some time playing trial-and-error to find where >> that unexpected error coming from, because it comes from the place that I >> least expected -- it looks perfectly fine to me. >> >> Here it is, trimmed down to the very least to show the problem: >> >> >> - - - >8 - - - >8 - - - >8 - - - >8 - - - >8 - - - >> >> == test >> >> > So I found the glimpse dsc file at + >> > >> ftp://ftp.cstone.net/debian/pool/non-free/g/glimpse/glimpse_4.18.5-1.dsc >> >> >> Something else >> - - - >8 - - - >8 - - - >8 - - - >8 - - - >8 - - - >> >> $ asciidoc $test.adoc >> asciidoc: FAILED: 2341.tmpf.2549.adoc: line 3: unexpected error: >> asciidoc: ------------------------------------------------------------ >> Traceback (most recent call last): >> File "/usr/bin/asciidoc", line 6015, in asciidoc >> document.translate(has_header) # Generate the output. >> File "/usr/bin/asciidoc", line 1662, in translate >> Section.translate() >> File "/usr/bin/asciidoc", line 2306, in translate >> Section.translate_body() >> File "/usr/bin/asciidoc", line 2314, in translate_body >> next.translate() >> File "/usr/bin/asciidoc", line 2934, in translate >> attrs['style'] = self.calc_style(self.index) >> File "/usr/bin/asciidoc", line 2867, in calc_style >> assert False >> AssertionError >> asciidoc: ------------------------------------------------------------ >> >> So what's the problem? >> >> Thanks >> >> PS, my asciidoc: >> >> $ apt-cache policy asciidoc >> asciidoc: >> Installed: 8.6.7-1 >> Candidate: 8.6.7-1 >> Version table: >> *** 8.6.7-1 0 >> 500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64 >> Packages >> 100 /var/lib/dpkg/status >> >> -- >> You received this message because you are subscribed to the Google Groups >> "asciidoc" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/asciidoc?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Dan Allen | http://google.com/profiles/dan.j.allen > > -- > You received this message because you are subscribed to the Google Groups > "asciidoc" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/asciidoc?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "asciidoc" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/asciidoc?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
