Invenzzia »

IMPORTANT ANNOUNCEMENT

Due to the uncertain status of the Flyspray project, lack of new releases and moving the code repository to Github, we decided to shutdown this issue tracker by the end of January 2011. From that date, the bugs should be reported directly in Github project repositories.

List of repositories:

Open Power Template 2.x family

PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!

Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
Tasklist

FS#59 - Opt_CompilerLocked_Exception on template syntax error

Attached to Project: Open Power Template
Opened by Damian Nowak (Nowaker) - Saturday, 28 February 2009, 09:29 GMT-8
Last edited by Zyx (Zyx) - Sunday, 22 March 2009, 01:43 GMT-8
Task Type Bug Report
Category Compiler
Status Closed
Assigned To Zyx (Zyx)
Operating System OS-independent
Severity Low
Priority Normal
Reported Version 2.0-beta2
Due in Version 2.0-beta3
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

<h2><a parse:href="{$entry::link">{$entry::name}</a></h2>

Notice that the attribute has got one curly brace. This syntax error throws an inappropriate expection: Opt_CompilerLocked_Exception.

Full source:

<?xml version="1.0" encoding="UTF-8"?>
<opt:root>

<h2><a parse:href="{$entry::link">{$entry::name}</a></h2>

<!-- {u:$entry::content} -->

{u:$content}

<ul>
<li>
<a parse:href="$entry::link">czytaj całość</a>
</li>
<li>
<a parse:href="$dictionary::link">przeszukaj bazę wiedzy</a>
</li>
</ul>

</opt:root>
This task depends upon

Closed by  Zyx (Zyx)
Sunday, 22 March 2009, 01:43 GMT-8
Reason for closing:  Fixed
Additional comments about closing:  Fixed in rev. 66.
Comment by Zyx (Zyx) - Friday, 13 March 2009, 00:23 GMT-8
I haven't managed to reproduce the bug. My test script gives a valid exception:

~~~~
Unexpected token: OP_CURLY_BRACKET ({) in expression {$entry::link

Opt_Expression_Exception
~~~~

Opt_CompilerLocked_Exception is thrown in only one place in the script - at the attept to compile two templates at the same time with the same compiler instance.

~~~~
// We cannot compile two templates at the same time
if(!is_null($this->_template))
{
throw new Opt_CompilerLocked_Exception($filename, $this->_template);
}
~~~~

The problem may lie in the fact that an exception was generated earlier by the compiler and did not reset the compiler state properly. As I noticed, this was possible, because the very variable `$this->_template` was not unset during the compiler exception handling. So, your problem was not caused directly by the invalid syntax in the template, but rather by this or the next template compilation.

Loading...