Rename exprparser main proc

This commit is contained in:
Joey Yakimowich-Payne 2020-04-19 19:48:48 -06:00
commit da2e698bd0
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ proc getPtrType*(str: string): string =
str
proc getLit*(nimState: NimState, str: string, expression = false): PNode =
result = nimState.codeToNode(str)
result = nimState.parseCExpression(str)
proc getOverrideOrSkip(gState: State, node: TSNode, origname: string, kind: NimSymKind): PNode =
# Check if symbol `origname` of `kind` and `origname` has any cOverride defined
@ -1386,7 +1386,7 @@ proc addEnum(gState: State, node: TSNode) =
if en.len > 1 and en[1].getName() in gEnumVals:
# Explicit value
fval = "(" & $gState.codeToNode(gState.getNodeVal(en[1]), name) & ")." & name
fval = "(" & $gState.parseCExpression(gState.getNodeVal(en[1]), name) & ")." & name
# Cannot use newConstDef() since parseString(fval) adds backticks to and/or
gState.constSection.add gState.parseString(&"const {fname}* = {fval}")[0][0]

View file

@ -482,7 +482,7 @@ proc processTSNode(exprParser: ExprParser, node: TSNode, typeofNode: var PNode):
techo "NODE RESULT: ", result
proc codeToNode*(state: NimState, code: string, name = ""): PNode =
proc parseCExpression*(state: NimState, code: string, name = ""): PNode =
## Convert the C string to a nim PNode tree
result = newNode(nkNone)
# This is used for keeping track of the type of the first