diff options
-rw-r--r-- | compiler/renderer.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 75c19a163..53e16edd2 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -811,8 +811,8 @@ proc gident(g: var TSrcGen, n: PNode) = var t: TTokType var s = atom(g, n) - if (s[0] in lexer.SymChars): - if (n.kind == nkIdent): + if s.len > 0 and s[0] in lexer.SymChars: + if n.kind == nkIdent: if (n.ident.id < ord(tokKeywordLow) - ord(tkSymbol)) or (n.ident.id > ord(tokKeywordHigh) - ord(tkSymbol)): t = tkSymbol |