Closed GoogleCodeExporter closed 8 years ago
Simpler test case:
sp {rule1
(state <s> ^superstate nil)
-->
# (<s> ^arst 1)}
}
If commented out close brace is removed, the rule sources successfully.
Original comment by joseph...@gmail.com
on 13 Sep 2011 at 8:33
Note that, for tcl compatibility, comments are treated as no-op commands, and
thus parens must match in them.
See:
http://wiki.tcl.tk/1669
Note that tcl compatibility is very important for SoarTech.
Original comment by marin...@gmail.com
on 13 Sep 2011 at 8:35
This is expected behavior. It is required for tcl compatibility.
Original comment by marin...@gmail.com
on 13 Sep 2011 at 8:37
I understand that the # inside the rule body should be treated as a literal
character and the first } should still close the body of the rule. That's fine.
But that still doesn't explain why a rule like
sp {rule
(state <s> ^a 1)
-->
#(<s> ^b 1)}
doesn't parse correctly. What I'd expect is that the CLI parser will take 'rule
(state <s> ^a 1) --> # (<s> ^b 1)' (ignoring some whitespace) to be the first
argument to sp and hence the rule body, and then for the kernel rule parser to
strip out everything from the hash to the end, resulting in a valid rule with
an empty RHS. Currently sourcing this rule results in an "Expected ( to begin
RHS action" error.
Original comment by joseph...@gmail.com
on 13 Sep 2011 at 9:59
As Bob said, this is expected behavior.
Joseph: please move the parser bug into a new issue.
Original comment by justinn...@gmail.com
on 13 Sep 2011 at 10:02
Original issue reported on code.google.com by
justinn...@gmail.com
on 13 Sep 2011 at 8:02