we could actually make this even more general:

syntax A ::= "string"
syntax A ::= Token{regex}

If we wanted to get really crazy, even something like:

syntax A ::= "string"
syntax A ::= `regex`
syntax B ::= "string terminal" NonTerminal `regex terminal `

The semantics would be that if a terminal is all by itself in a production,
the terminal is captured and put in a token, otherwise it's discarded.

Just a thought.
On Mar 7, 2014 2:02 PM, "Andrei Stefanescu" <notifications@github.com>
wrote:

> In
> src/javasources/KTool/src/org/kframework/backend/java/indexing/KLabelIndex.java:
>
> >      @Override
> >      public boolean isUnifiable(Index index) {
> > -        return index instanceof TopIndex || equals(index);
> > +        return index instanceof TopIndex
> > +                || equals(index)
> > +                || (index instanceof TokenIndex &&
> > +                        kLabel.sorts().contains(((TokenIndex) index).sort()));
>
> I think
> syntax Name ::= "$h"
> should actually
> syntax Name ::= Token{$h}``
> We should probably have a check in compile for this.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/kframework/k/pull/270/files#r10402277>
> .
>