diff options
Diffstat (limited to 'src/parse.cpp')
-rw-r--r-- | src/parse.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parse.cpp b/src/parse.cpp index 420a8ea..43fb681 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -49,7 +49,7 @@ eat_char(Cursor& cur, istream& in, const char character) THROW_IF(c != character, cur, (format("expected `%1%'") % character).str()); } -static AST* +static const AST* read_string(Cursor& cur, istream& in) { Cursor loc = cur; @@ -83,10 +83,10 @@ read_line_comment(Cursor& cur, istream& in) while (read_char(cur, in) != '\n') {} } -static AST* +static const AST* read_list(PEnv& penv, Cursor& cur, istream& in) { - List<ATuple, AST> list; + List<ATuple, const AST> list; eat_char(cur, in, '('); while (true) { @@ -101,7 +101,7 @@ read_list(PEnv& penv, Cursor& cur, istream& in) assert(false); } -static AST* +static const AST* read_special(Cursor& cur, istream& in) { eat_char(cur, in, '#'); @@ -120,7 +120,7 @@ read_special(Cursor& cur, istream& in) assert(false); } -static AST* +static const AST* read_number(Cursor& cur, istream& in) { Cursor loc = cur; @@ -139,7 +139,7 @@ read_number(Cursor& cur, istream& in) return new ALiteral<float>(T_FLOAT, strtod(str.c_str(), NULL), loc); } -static AST* +static const AST* read_symbol(PEnv& penv, Cursor& cur, istream& in) { string str; @@ -155,7 +155,7 @@ read_symbol(PEnv& penv, Cursor& cur, istream& in) } /// Read an expression from @a in -AST* +const AST* read_expression(PEnv& penv, Cursor& cur, istream& in) { while (!cin.eof()) { @@ -175,7 +175,7 @@ read_expression(PEnv& penv, Cursor& cur, istream& in) throw Error(cur, "unexpected `)'"); case '#': { - AST* ret = read_special(cur, in); + const AST* ret = read_special(cur, in); if (ret) return ret; break; |