~psmay/+junk/mskp-parser.dev

« back to all changes in this revision

Viewing changes to input3.txt

  • Committer: Peter S. May
  • Date: 2011-01-11 23:09:05 UTC
  • Revision ID: pmay@pmay-desktop-20110111230905-1pyqe39krwgq1q5f
* input3.txt
        Added tests for tag defaulting/promotion behavior (i.e. if a list generated by a block contains exactly one element which is itself a list, the latter is promoted to replace the former).

* Mskp.g
        Elements that support promotion now generate a spread tag "(u)" (for "upgrade"). The tag name contains parens so that it is not possible to generate using other syntax.

* MskpWalkerDebug.g
        Now no list gets special behavior if empty.
        All lists produce a List tree where the List token is assigned "(...)".
        A new walker needs to be produced that processes promotion such that e.g. ^(Tag["(u)"] ^(List ^(List A B C))) is transformed to ^(List A B C).

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
        ab::(x y);
190
190
};
191
191
 
 
192
test-tag-upgrade{
 
193
        // The mechanism
 
194
        start {A B; (C D); [E F]; G H} end;
 
195
        // should be semantically the same as
 
196
        start (A B) (C D) [E F] (G H) end;
 
197
};
 
198
 
 
199
test-single-block-upgrade{
 
200
        // The mechanism
 
201
        start {{{[A B]}}} end;
 
202
        // should be semantically the same as
 
203
        start [A B] end;
 
204
};
 
205