diff --git a/lex.ll b/lex.ll index 96c19d1d..026b1b48 100644 --- a/lex.ll +++ b/lex.ll @@ -704,7 +704,7 @@ lEscapeChar(char *str, char *pChar, SourcePos *pos) str = tail - 1; break; default: - Error(*pos, "Bad character escape sequence: '%s'\n.", str); + Error(*pos, "Bad character escape sequence: '%s'.", str); break; } } diff --git a/stmt.cpp b/stmt.cpp index e2b533f3..0c8ed0c8 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -2281,26 +2281,22 @@ GotoStmt::EmitCode(FunctionEmitContext *ctx) const { llvm::BasicBlock *bb = ctx->GetLabeledBasicBlock(label); if (bb == NULL) { - /* Label wasn't found. Emit an error */ - Error(identifierPos, - "No label named \"%s\" found in current function.", - label.c_str()); - - /* Look for suggestions that are close */ + /* Label wasn't found. Look for suggestions that are close */ std::vector labels = ctx->GetLabels(); std::vector matches = MatchStrings(label, labels); + std::string match_output; if (! matches.empty()) { /* Print up to 5 matches. Don't want to spew too much */ - std::string match_output("Did you mean\n"); + match_output += "\nDid you mean:"; for (unsigned int i=0; i