soartech / jsoar

Pure Java implementation of the Soar cognitive architecture.
http://soartech.github.com/jsoar/
BSD 3-Clause "New" or "Revised" License
53 stars 19 forks source link

default interpreter doesn't like ;# on last line of rule #93

Closed marinier closed 11 years ago

marinier commented 11 years ago

This rule works fine in csoar and the jsoar tcl interpreter, but throws an exception in jsoar with the default interpreter:

sp {test (state ^superstate nil) --> ( ^test true)} ;# a comment

Note that the ; is required for this to be valid tcl. The exception is:

SEVERE: unknown:1: Expected sp body, got [sp, test (state ^superstate nil) --> ( ^test true), ;#, a, comment] org.jsoar.kernel.SoarException: unknown:1: Expected sp body, got [sp, test (state ^superstate nil) --> ( ^test true), ;#, a, comment] at org.jsoar.kernel.commands.SpCommand.execute(SpCommand.java:35) at org.jsoar.util.commands.DefaultInterpreter.executeParsedCommand(DefaultInterpreter.java:203) at org.jsoar.util.commands.DefaultInterpreter.eval(DefaultInterpreter.java:192) at org.jsoar.util.commands.DefaultInterpreter.evalAndClose(DefaultInterpreter.java:163) at org.jsoar.util.commands.DefaultInterpreter.eval(DefaultInterpreter.java:108) at org.jsoar.debugger.ProductionEditView$7.call(ProductionEditView.java:204) at org.jsoar.debugger.ProductionEditView$7.call(ProductionEditView.java:1) at org.jsoar.runtime.ThreadedAgent$6.run(ThreadedAgent.java:476) at org.jsoar.runtime.ThreadedAgent$AgentThread.run(ThreadedAgent.java:584)

cnewton commented 11 years ago

The default interpreter was missing support for semicolons in general.

Fixed this, and some other semicolon bugs, in 9ef28ba (in semicolon-patch branch).