
Unfortunately there appears to be exactly one place you can do this, and it turns out to be inside inferTypes (because you need to know the type of c completely, and you can't type-infer x until you know if it's a tag or a variable). It's definitely nicer than doing it in the parser, though. I've also started adding "-- AMBIGUITY" comments in the parser.
13 lines
107 B
Plaintext
13 lines
107 B
Plaintext
PROTOCOL FOO
|
|
CASE
|
|
x
|
|
:
|
|
PROC P ()
|
|
INT x:
|
|
SEQ
|
|
CHAN INT c:
|
|
c ! x
|
|
CHAN FOO c:
|
|
c ! x
|
|
:
|