projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for #453 (Menu frame lingers)
[supertux.git]
/
src
/
lisp
/
parser.cpp
diff --git
a/src/lisp/parser.cpp
b/src/lisp/parser.cpp
index
c59535f
..
4f7697c
100644
(file)
--- a/
src/lisp/parser.cpp
+++ b/
src/lisp/parser.cpp
@@
-66,9
+66,8
@@
static std::string dirname(const std::string& filename)
const Lisp*
Parser::parse(const std::string& filename)
{
const Lisp*
Parser::parse(const std::string& filename)
{
- Unison::VFS::istream in(filename);
- //IFileStreambuf ins(filename);
- //std::istream in(&ins);
+ IFileStreambuf ins(filename);
+ std::istream in(&ins);
if(!in.good()) {
std::stringstream msg;
if(!in.good()) {
std::stringstream msg;
@@
-108,7
+107,7
@@
Parser::parse_error(const char* msg) const
{
std::stringstream emsg;
emsg << "Parse Error at '" << filename << "' line " << lexer->getLineNumber()
{
std::stringstream emsg;
emsg << "Parse Error at '" << filename << "' line " << lexer->getLineNumber()
-
<< ": " << msg;
+ << ": " << msg;
throw std::runtime_error(emsg.str());
}
throw std::runtime_error(emsg.str());
}
@@
-118,7
+117,7
@@
Parser::read()
Lisp* result;
switch(token) {
case Lexer::TOKEN_EOF: {
Lisp* result;
switch(token) {
case Lexer::TOKEN_EOF: {
-
parse_error("Unexpected EOF.");
+ parse_error("Unexpected EOF.");
}
case Lexer::TOKEN_CLOSE_PAREN: {
parse_error("Unexpected ')'.");
}
case Lexer::TOKEN_CLOSE_PAREN: {
parse_error("Unexpected ')'.");
@@
-138,7
+137,7
@@
Parser::read()
// evaluate translation function (_ str) in place here
token = lexer->getNextToken();
if(token != Lexer::TOKEN_STRING)
// evaluate translation function (_ str) in place here
token = lexer->getNextToken();
if(token != Lexer::TOKEN_STRING)
-
parse_error("Expected string after '(_'");
+ parse_error("Expected string after '(_'");
result = new(obst) Lisp(Lisp::TYPE_STRING);
if(dictionary) {
result = new(obst) Lisp(Lisp::TYPE_STRING);
if(dictionary) {
@@
-152,7
+151,7
@@
Parser::read()
}
token = lexer->getNextToken();
if(token != Lexer::TOKEN_CLOSE_PAREN)
}
token = lexer->getNextToken();
if(token != Lexer::TOKEN_CLOSE_PAREN)
-
parse_error("Expected ')' after '(_ string'");
+ parse_error("Expected ')' after '(_ string'");
break;
}
break;
}