![]() |
Generator loop misses last line?? |
Post Reply
|
| Author | |||
Angelo
Member
Joined: 03.Oct.2008 Location: The Netherlands Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: Generator loop misses last line??Posted: 12.Oct.2009 at 18:07 |
||
|
Just ran into something I've never seen before, so it's likely my mistake, but somehow I don't see what's wrong here.
I am creating a simple E-R like DSL for a tutorial, a generator to generate SQL code from it. The language contains Entities, and each entity has Attributes, which I travers in the following loop in the code generator.
What I don't get is why the last line in this loop is skipped for the last Attribute in the list.
It's not a conditional, and I can't spot a typ-o... Who has seen this before, or sees my error? The resulting code for one example entity is like this (there should be a comma and an newline between NOT NULL and PRIMARY KEY at the bottom, in the spot indicated by the bold blue X:
Edited by Angelo - 12.Oct.2009 at 18:13 |
|||
![]() |
|||
jpt
MetaCase
Joined: 25.Mar.2008 Points: 253 |
Post Options
Thanks(0)
Quote Reply
Posted: 12.Oct.2009 at 20:28 |
||
|
Replace dowhile with do and then it should work.
In MERL, dowhile clause is a variant of do that skips the generation process once the last item is handled, in your case ','; newline;
|
|||
![]() |
|||
Angelo
Member
Joined: 03.Oct.2008 Location: The Netherlands Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 12.Oct.2009 at 23:49 |
||
|
Now how could I miss that, after so long....
Thanks Juha Pekka, guess I was looking in at the bottom of the statement for too long to see the problem at the top. Edited by Angelo - 12.Oct.2009 at 23:50 |
|||
![]() |
|||
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |