summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-01-04 23:30:24 -0700
committerMike Buland <eichlan@xagasoft.com>2012-01-04 23:30:24 -0700
commitef56ac3105dbd72cc5989edef9bbbb3fedfe6449 (patch)
treeff4e3f346f69bf3f6d05c3cee839d4e39302efd1 /src
parentccc0661a64b6acc0dd9708b1ab32a72e0a016e9c (diff)
downloadstage-ef56ac3105dbd72cc5989edef9bbbb3fedfe6449.tar.gz
stage-ef56ac3105dbd72cc5989edef9bbbb3fedfe6449.tar.bz2
stage-ef56ac3105dbd72cc5989edef9bbbb3fedfe6449.tar.xz
stage-ef56ac3105dbd72cc5989edef9bbbb3fedfe6449.zip
Demo is being reworked. Fixed comment handling.
Diffstat (limited to 'src')
-rw-r--r--src/options.cpp2
-rw-r--r--src/parser.l12
2 files changed, 10 insertions, 4 deletions
diff --git a/src/options.cpp b/src/options.cpp
index 23a98a8..f5fb127 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -25,10 +25,12 @@ void Options::parse( int argc, char *argv[] )
25 " - Simple, Textual, Adventure Game Environment"); 25 " - Simple, Textual, Adventure Game Environment");
26 opt.addHelpBanner("usage: " + Bu::String(argv[0]) + 26 opt.addHelpBanner("usage: " + Bu::String(argv[0]) +
27 " [options] <filename>\n"); 27 " [options] <filename>\n");
28
28 opt.addOption( Bu::slot( this, &Options::version ), "version", 29 opt.addOption( Bu::slot( this, &Options::version ), "version",
29 "Show full version info." ); 30 "Show full version info." );
30 opt.addOption( Bu::slot( this, &Options::builtins ), "builtins", 31 opt.addOption( Bu::slot( this, &Options::builtins ), "builtins",
31 "List available builtins." ); 32 "List available builtins." );
33
32 opt.addHelpOption('h', "help"); 34 opt.addHelpOption('h', "help");
33 opt.setNonOption( Bu::slot( this, &Options::nonOption ) ); 35 opt.setNonOption( Bu::slot( this, &Options::nonOption ) );
34 opt.parse( argc, argv ); 36 opt.parse( argc, argv );
diff --git a/src/parser.l b/src/parser.l
index e0bc340..7957c53 100644
--- a/src/parser.l
+++ b/src/parser.l
@@ -55,14 +55,15 @@ false { yylval->bValue = false; return tokBool; }
55null { return tokNull; } 55null { return tokNull; }
56 56
57"<<" { BEGIN( sitname ); } 57"<<" { BEGIN( sitname ); }
58<sitname>[- a-zA-Z0-9]+ { yylval->sValue = new Bu::String( yytext ); return tokSituationName; } 58<sitname>[-_ a-zA-Z0-9]+ { yylval->sValue = new Bu::String( yytext ); return tokSituationName; }
59<sitname>">>" { BEGIN( INITIAL ); } 59<sitname>">>" { BEGIN( INITIAL ); }
60<sitname>. REJECT; 60<sitname>. REJECT;
61 61
62"//"[^\n]* {} 62"//"[^\n]*\n? {}
63 63
64"/\*" { BEGIN( comment ); } 64"/*" { BEGIN( comment ); }
65<comment>"\*/" { BEGIN( INITIAL ); } 65<comment>"*/" { BEGIN( INITIAL ); }
66<comment>[\n\r] {}
66<comment>. {} 67<comment>. {}
67 68
68[a-zA-Z_][a-zA-Z0-9_]* { yylval->sValue = new Bu::String( yytext ); return tokIdent; } 69[a-zA-Z_][a-zA-Z0-9_]* { yylval->sValue = new Bu::String( yytext ); return tokIdent; }
@@ -112,4 +113,7 @@ null { return tokNull; }
112 yylloc->first_line = yylloc->last_line; 113 yylloc->first_line = yylloc->last_line;
113} 114}
114 115
116\r { }
117. { throw Bu::ExceptionBase("Invalid character found '%s'", yytext ); }
118
115%% 119%%