textmapper icon indicating copy to clipboard operation
textmapper copied to clipboard

set() can now reference other named token sets

Open superbobry opened this issue 2 years ago • 0 comments

I originally wanted this feature to use new syntax, e.g.

%generate foo = set('a' | 'b');
%generate bar = foo | set('c');
%generate boo = foo & set('c');

so that

  • an identifier in set() is always a terminal/nonterminal;
  • identifier outside of set is always another named token set.

However, that turned out to be a bigger change than what I was hoping for. So, this commit allows identifiers in set() to reference both terminals/nonterminals and other named token sets. Rewriting the above example,

%generate foo = set('a' | 'b');
%generate bar = set(foo | 'c');
%generate boo = set(bar & 'c');

superbobry avatar Nov 24 '23 13:11 superbobry