make-doc-pro: Need help with strange parse behavior
[1/4] from: robert:muench:robertmuench at: 15-Nov-2001 21:10
Hi, I'm stucked with a parse problem. You will need two files:
http://www.robertmuench.de/make-doc-pro-work.r and
http://www.robertmuecnh.de/test2.txt
Just start make-doc-pro-work.r and load test2.txt
You will see a tracing output of the parser and you get a generated HTML file.
Here is the trace output and the problem is marked with #:
- top
- parastart
- paragraph
- paragraph_newline
title Bla
- top
- top
sect1 Test
parastart none
- top
- top
- top
bold Bold text
- top
- top
table-in none
parastart none
- top
- top
bold Experttest
- top
- parastart
- paragraph
# para Advanced
# newcell none
- paragraph
- paragraph_newline
para Used
paraend none
- top
table-out none
- top
- top
- parastart
- paragraph
Unknown TAG found: title
The problematic code is line 249 in combination with 256. Line 249 calls the
rule in line 266, which should result in para: "" Now parsing continues with
line 250 and tries to match some markup-characters. Parsing should hit line 256
and be able to parse |. As para is empty emit will not do anything. Next, as we
are intable mode emit newcell none will be executed. Than parsing will continue
with line 249, than line 266, which can now parse Advanced into para. Parsing
continues etc.
As you can see the problem is that parse switches some rules here. First the
text Advanced is emitted and than the new cell, which is triggerd by |.
You can create an other strange behaviour if you remove |End from the input
file. In this case a paragraph_newline shows up BEFORE the Advanced text is
emitted.
I hope this is not that complicated ;-)) that you can follow where the problem
is. Any idea what's up? Robert
[2/4] from: robert:muench:robertmuench at: 19-Nov-2001 19:38
> -----Original Message-----
> From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]On Behalf Of
<<quoted lines omitted: 3>>
> Subject: [REBOL] make-doc-pro: Need help with strange parse behavior
> Hi, I'm stucked with a parse problem.
Hi, even no one might be interested but I found the bug. This was a hard one!
The problem was that I use the | character as a delimiter to trigger some
functionality for tables. But I have to check the | character in some other rule
to find out if the normal text ends with this character.
Example you can write:
mycell|mycell|
I need to know where the text ends. The problme was, that the rule where I made
the check consumed the | character(!!!) and I initally thought the problem was
in some other rule... I fixed this by repositioning the input stream -1.
That's it. Now make-doc-pro works and release 1.0.1 is mostly done and will be
released this week. Robert
[3/4] from: greggirwin:mindspring at: 19-Nov-2001 12:18
Hi Robert,
Thanks for posting that info! Good to know.
--Gregg
[4/4] from: brett:codeconscious at: 20-Nov-2001 13:38
> Hi, even no one might be interested but I found the bug. This was a hard
one!
Great Robert. I tried but the complexity of the script overwealmed me :)
Brett.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted