xogeny / denada-go

A Golang implementation of Denada
32 stars 4 forks source link

Refactor rule handling to allow multiple matches #5

Closed xogeny closed 10 years ago

xogeny commented 10 years ago

It should be possible to define multiple patterns that match the same rule, e.g.,

var _ = "$_" "variable*";
var _ "variable*";

This raises an issue about which cardinality to use (not sure what the answer should be...perhaps they should all be identical?). Of course, this can be kind of worked around with something like:

var _ = "$_" "variableWithAssignment*";
var _ "variable*";

But this doesn't work if you want a singleton (see previous note about matching cardinality).