From 54021471e40d2cc2ff8f178192ba83873e7f43e0 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 19 Jun 2011 16:22:39 +0200 Subject: nicer error messages for used keywords as identifiers --- compiler/parser.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/parser.nim') diff --git a/compiler/parser.nim b/compiler/parser.nim index 677aa57ba..42dc0b64b 100755 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -69,7 +69,7 @@ proc parMessage(p: TParser, msg: TMsgKind, arg: string = "") = lexMessage(p.lex, msg, arg) proc parMessage(p: TParser, msg: TMsgKind, tok: TToken) = - lexMessage(p.lex, msg, tokToStr(tok)) + lexMessage(p.lex, msg, prettyTok(tok)) proc skipComment(p: var TParser, node: PNode) = if p.tok.tokType == tkComment: @@ -92,11 +92,11 @@ proc optInd(p: var TParser, n: PNode) = proc expectIdentOrKeyw(p: TParser) = if p.tok.tokType != tkSymbol and not isKeyword(p.tok.tokType): - lexMessage(p.lex, errIdentifierExpected, tokToStr(p.tok)) + lexMessage(p.lex, errIdentifierExpected, prettyTok(p.tok)) proc ExpectIdent(p: TParser) = if p.tok.tokType != tkSymbol: - lexMessage(p.lex, errIdentifierExpected, tokToStr(p.tok)) + lexMessage(p.lex, errIdentifierExpected, prettyTok(p.tok)) proc Eat(p: var TParser, TokType: TTokType) = if p.tok.TokType == TokType: getTok(p) -- cgit 1.4.1-2-gfad0