diff options
author | Adrian Thurston <thurston@complang.org> | 2007-04-29 03:50:47 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2007-04-29 03:50:47 +0000 |
commit | 40a0ec58dec7120aceed67a487c53b8c28b2741e (patch) | |
tree | b64362571b6991bd7aa6725f352efd5492750676 /ragel/rlparse.kl | |
parent | fa4d8daacbf13234e82298bd3ff3762b88f740ea (diff) | |
download | ragel-40a0ec58dec7120aceed67a487c53b8c28b2741e.tar.gz |
In the variable statement changed the name "curstate" to "cs" (the default
name used for the current state) and implemented the other names as their
defaults. Now all variables (p, pe, cs, top, stack, act, tokstart, tokend) can
be renamed.
Diffstat (limited to 'ragel/rlparse.kl')
-rw-r--r-- | ragel/rlparse.kl | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ragel/rlparse.kl b/ragel/rlparse.kl index 29dd1c20..d6c2c023 100644 --- a/ragel/rlparse.kl +++ b/ragel/rlparse.kl @@ -186,11 +186,9 @@ access_spec: variable_spec: KW_Variable opt_whitespace TK_Word inline_expr ';' final { /* FIXME: Need to implement the rest of this. */ - if ( strcmp( $3->data, "curstate" ) == 0 ) - pd->curStateExpr = $4->inlineList; - else { - error($3->loc) << "sorry, unimplementd" << endl; - } + bool wasSet = pd->setVariable( $3->data, $4->inlineList ); + if ( !wasSet ) + error($3->loc) << "bad variable name" << endl; }; opt_whitespace: opt_whitespace IL_WhiteSpace; |