[pure-lang-svn] SF.net SVN: pure-lang:[522] pure/trunk/lexer.ll
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-17 18:20:17
|
Revision: 522 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=522&view=rev Author: agraef Date: 2008-08-17 18:20:28 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Bugfix in lexer initialization. Modified Paths: -------------- pure/trunk/lexer.ll Modified: pure/trunk/lexer.ll =================================================================== --- pure/trunk/lexer.ll 2008-08-17 12:57:39 UTC (rev 521) +++ pure/trunk/lexer.ll 2008-08-17 18:20:28 UTC (rev 522) @@ -884,18 +884,21 @@ interpreter::lex_begin(const string& fname) { yy_flex_debug = (verbose&verbosity::lexer) != 0 && !source_s; + FILE *fp; if (source_s) - yyin = 0; + fp = 0; else if (source.empty()) - yyin = stdin; - else if (!(yyin = fopen(fname.c_str(), "r"))) + fp = stdin; + else if (!(fp = fopen(fname.c_str(), "r"))) //error("cannot open '" + source + "'"); perror(source.c_str()); - if (source_s || yyin) { + if (source_s || fp) { + yyin = fp; yypush_buffer_state(yy_create_buffer(yyin, YY_BUF_SIZE)); BEGIN(INITIAL); - } - return source_s || yyin; + return true; + } else + return false; } void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |