Rename currentExprSkipIdentValidation -> skipIdentValidation
This commit is contained in:
parent
8962a85152
commit
98beef2997
2 changed files with 5 additions and 5 deletions
|
|
@ -45,14 +45,14 @@ proc getExprIdent*(gState: State, identName: string, kind = nskConst, parent = "
|
||||||
##
|
##
|
||||||
## Returns PNode(nkNone) if the identifier is blank
|
## Returns PNode(nkNone) if the identifier is blank
|
||||||
result = newNode(nkNone)
|
result = newNode(nkNone)
|
||||||
if gState.currentExprSkipIdentValidation or identName notin gState.skippedSyms:
|
if gState.skipIdentValidation or identName notin gState.skippedSyms:
|
||||||
var ident = identName
|
var ident = identName
|
||||||
if ident != "_":
|
if ident != "_":
|
||||||
# Process the identifier through cPlugin
|
# Process the identifier through cPlugin
|
||||||
ident = gState.getIdentifier(ident, kind, parent)
|
ident = gState.getIdentifier(ident, kind, parent)
|
||||||
if kind == nskType:
|
if kind == nskType:
|
||||||
result = gState.getIdent(ident)
|
result = gState.getIdent(ident)
|
||||||
elif gState.currentExprSkipIdentValidation or ident.nBl and ident in gState.constIdentifiers:
|
elif gState.skipIdentValidation or ident.nBl and ident in gState.constIdentifiers:
|
||||||
if gState.currentTyCastName.nBl:
|
if gState.currentTyCastName.nBl:
|
||||||
ident = ident & "." & gState.currentTyCastName
|
ident = ident & "." & gState.currentTyCastName
|
||||||
result = gState.getIdent(ident)
|
result = gState.getIdent(ident)
|
||||||
|
|
@ -611,7 +611,7 @@ proc parseCExpression*(gState: State, code: string, name = "", skipIdentValidati
|
||||||
## Convert the C string to a nim PNode tree
|
## Convert the C string to a nim PNode tree
|
||||||
gState.currentExpr = code
|
gState.currentExpr = code
|
||||||
gState.currentTyCastName = name
|
gState.currentTyCastName = name
|
||||||
gState.currentExprSkipIdentValidation = skipIdentValidation
|
gState.skipIdentValidation = skipIdentValidation
|
||||||
|
|
||||||
withCodeAst(gState.currentExpr, gState.mode):
|
withCodeAst(gState.currentExpr, gState.mode):
|
||||||
result = gState.parseCExpression(root)
|
result = gState.parseCExpression(root)
|
||||||
|
|
@ -619,4 +619,4 @@ proc parseCExpression*(gState: State, code: string, name = "", skipIdentValidati
|
||||||
# Clear the state
|
# Clear the state
|
||||||
gState.currentExpr = ""
|
gState.currentExpr = ""
|
||||||
gState.currentTyCastName = ""
|
gState.currentTyCastName = ""
|
||||||
gState.currentExprSkipIdentValidation = false
|
gState.skipIdentValidation = false
|
||||||
|
|
@ -116,7 +116,7 @@ type
|
||||||
currentExpr*, currentTyCastName*: string
|
currentExpr*, currentTyCastName*: string
|
||||||
# Controls whether or not the current expression
|
# Controls whether or not the current expression
|
||||||
# should validate idents against currently defined idents
|
# should validate idents against currently defined idents
|
||||||
currentExprSkipIdentValidation*: bool
|
skipIdentValidation*: bool
|
||||||
|
|
||||||
# Legacy AST fields, remove when ast2 becomes default
|
# Legacy AST fields, remove when ast2 becomes default
|
||||||
constStr*, enumStr*, procStr*, typeStr*: string
|
constStr*, enumStr*, procStr*, typeStr*: string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue