MantisBT - Core Inform
View Issue Details
0000305Core InformReleasing, bibliographic data, cBlorbpublic2010-09-26 10:502010-10-28 00:30
adam 
graham 
normalmildalways
closedfixed 
x86Mac OS X10.6
6E72 
6F95 
(mild) Compiler accepts invalid code
0000305: Inconsistency in handling misformatted text-with-substitutions when releasing along with the source text
If you have a doubled open-bracket around substituted text in a say statement, the source parser (and the section parser in the OS X IDE) treat the substitution as closing with the close quotations (although the substituted text does not display correctly)...but the release-as-a-web-page parser, although it displays the source as if the quotation were closed, nevertheless treats it as open (presumably still inside the subtitution) for purposes of calculating subsequent headings.

Thus headings beneath the error do not appear as actual headings in the source text, and you end up with this from the below source text (there should be a Volume 4, or alternatively the compiler should choke because the substitution is incorrectly specified):

"Break The Web Formatter" by Adam Thornton
Release along with a website and the source text.
Volume One - "Muahahaha"
Volume Two - "Lorem Ipsum"
Volume Three - "Evil Bug"
"Break The Web Formatter" by Adam Thornton

Release along with a website and the source text.

Volume One - "Muahahaha"

Brown study is a room. "Study. Brown. No way out." Instead of doing anything other than looking in Brown Study, say "[lorem ipsum]";

Volume Two - "Lorem Ipsum"

To say lorem ipsum:
say "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

To say padding1:
say "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"

Volume Three - "Evil Bug"

To say lorem ipsum incorrectly:
say "[[Lorem ipsum]"

To say padding2:
say "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"

Volume Four - "Made Manifest"

To say padding3:
say "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
I don't know how minimal it really is, but the source needs to be large enough that the web-page-source-text-releaser code decides it needs to be on multiple pages. The broken substitution is "To say lorem ipsum incorrectly."
No tags attached.
Issue History
2010-09-26 10:50adamNew Issue
2010-09-26 13:55jmcgrewEffect(cosmetic) Index is created incorrectly => (mild) Compiler accepts invalid code
2010-09-26 13:55jmcgrewSeveritycosmetic => mild
2010-09-26 13:55jmcgrewStatusnew => acknowledged
2010-09-28 09:31EmacsUserNote Added: 0000608
2010-09-28 09:31EmacsUserStatusacknowledged => confirmed
2010-09-29 08:31grahamNote Added: 0000627
2010-09-29 08:31grahamStatusconfirmed => resolved
2010-09-29 08:31grahamResolutionopen => fixed
2010-09-29 08:31grahamAssigned To => graham
2010-10-25 21:14jmcgrewFixed in Version => 6F95
2010-10-28 00:30jmcgrewStatusresolved => closed

Notes
(0000608)
EmacsUser   
2010-09-28 09:31   
Confirmed.

I guess there needs to be some ruling on how nested or mismatched square brackets are supposed to be handled, or whether the behavior is defined at all. Another inconsistency in the same vein:

- - - -
There is a room.
When play begins:
say "[foo [the player] bar]".
- - - -

literally prints ``[foo [the player] bar]''. But the Mac IDE formats ``foo'' and ``the player'' as if they are in a substitution, ``bar'' as if it is literal text. That could be the same bug---the compiler accepts malformed substitutions---or it could be different---square brackets not forming a substitution are treated differently by the IDE and the compiler.
(0000627)
graham   
2010-09-29 08:31   
It is now illegal to write text with nested, or mismatched, [ and ]; problem messages are generated which explain this, and explain how to get the literal characters if needed. That makes the actual symptoms here moot.