[Grace-core] Parsing ambiguity

James Noble kjx at ecs.vuw.ac.nz
Tue Jul 1 00:12:54 PDT 2014


On 1/07/2014, at 19:08 pm, Marco Servetto <marco.servetto at gmail.com> wrote:

> so, is grace syntax space sensitive? in what way?

an horrible way.

Like Java and C++, in practice we use ad-hoc rules to distinguish "<" and ">" as operators or as angle brackets around generics.

We're also space sensitive regarding indentation of course, in particular when writing
 foo(x)
 bar(y)
vs
 foo(x)
   bar(y)

my grammar currently accepts these (or not)
but I don't give any assurances about what the parse is..

> testProgramOn "run(a < B, C > 1)" wrongly "009tim-a"
> testProgramOn "a < B, C > 1" wrongly "009tim-b"
> testProgramOn "a<B,C>(1)" correctly "009tim-c"
> testProgramOn "run(a < B, C >(1))" correctly "009tim-d"

J


More information about the Grace-core mailing list