+string ProgramParser::format_error(const std::string &message)
+{
+ string location = format("%s:%d: ", source_name, current_line);
+ return location+message;
+}
+
+string ProgramParser::format_syntax_error(const std::string &expected)
+{
+ return format_error(format("Syntax error at '%s': expected %s", last_token, expected));
+}
+