From 86184ae0b6fadc4c784f7a87fb5fa8be5dc8a47c Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sun, 19 Apr 2020 19:23:41 -0600 Subject: [PATCH] Update some comments --- nimterop/exprparser.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nimterop/exprparser.nim b/nimterop/exprparser.nim index 833d83e..1849996 100644 --- a/nimterop/exprparser.nim +++ b/nimterop/exprparser.nim @@ -74,7 +74,9 @@ template withCodeAst(exprParser: ExprParser, body: untyped): untyped = tree.tsTreeDelete() proc parseChar(charStr: string): uint8 {.inline.} = - + ## Parses a character literal out of a string. This is needed + ## because treesitter gives unescaped characters when parsing + ## strings. if charStr.len == 1: return charStr[0].uint8 @@ -119,6 +121,7 @@ proc parseChar(charStr: string): uint8 {.inline.} = result = uint8.high proc getCharLit(charStr: string): PNode {.inline.} = + ## Convert a character string into a proper Nim char lit node result = newNode(nkCharLit) result.intVal = parseChar(charStr).int64