Tcl is using PGE's optable support to parse its expressions. Trying to
run tcl's equivalent of Test.pm, I realized that the expressions can
have horizontal whitespace in them, so I'm trying to modify
languages/tcl/src/grammar/expr/expression.pg to handle this, to no
avail.


There's a TODO test in t/cmd_expr.t, but here's a command line example.

$ ../../parrot tcl.pbc -e "puts [expr {(!
> 0)}]"

(Note that the parentheses are necessary to trigger the misparse)

A naive conversion of the <ws> rule to \s* instead of \h* breaks the
parsing of the most of the test suite  (but allows this snippet to
work.

This makes me think that the right approach might be to have two
grammars, one for the language, one for the expressions, and then
override the <ws> rule in the one just for the expression. Is this
possible?

Or, hopefully, is there a simple solution I'm missing?

This is a blocker (hopefully one of the last ones) for getting partcl
to natively run tcl's test suite.

-- 
Will "Coke" Coleda
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to