added experimental .this pragma
This commit is contained in:
parent
6d2fd0c9f1
commit
1afdefcbe9
9 changed files with 192 additions and 117 deletions
|
|
@ -46,7 +46,7 @@ const
|
|||
wBreakpoint, wWatchPoint, wPassl, wPassc, wDeadCodeElim, wDeprecated,
|
||||
wFloatchecks, wInfChecks, wNanChecks, wPragma, wEmit, wUnroll,
|
||||
wLinearScanEnd, wPatterns, wEffects, wNoForward, wComputedGoto,
|
||||
wInjectStmt, wDeprecated, wExperimental}
|
||||
wInjectStmt, wDeprecated, wExperimental, wThis}
|
||||
lambdaPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl,
|
||||
wNosideeffect, wSideeffect, wNoreturn, wDynlib, wHeader,
|
||||
wDeprecated, wExtern, wThread, wImportCpp, wImportObjC, wAsmNoStackFrame,
|
||||
|
|
@ -875,6 +875,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int,
|
|||
c.module.flags.incl sfExperimental
|
||||
else:
|
||||
localError(it.info, "'experimental' pragma only valid as toplevel statement")
|
||||
of wThis:
|
||||
if it.kind == nkExprColonExpr:
|
||||
c.selfName = considerQuotedIdent(it[1])
|
||||
else:
|
||||
c.selfName = getIdent("self")
|
||||
of wNoRewrite:
|
||||
noVal(it)
|
||||
of wBase:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue