diff options
author | Araq <rumpf_a@web.de> | 2011-08-09 01:40:12 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-08-09 01:40:12 +0200 |
commit | 7000cf51b7c53808624dd7202c4213b84aacf708 (patch) | |
tree | f19810b24639f978f52dc7a02a569c952b4e9eff /compiler | |
parent | 12f22ba68a4c12042f2e72febdda32ff84b63307 (diff) | |
download | Nim-7000cf51b7c53808624dd7202c4213b84aacf708.tar.gz |
modifyable results for generics; teventemitter works
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/pragmas.nim | 21 | ||||
-rwxr-xr-x | compiler/seminst.nim | 3 |
2 files changed, 14 insertions, 10 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 014f431c4..ec97dd1d2 100755 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -18,7 +18,7 @@ const FirstCallConv* = wNimcall LastCallConv* = wNoconv -const +const procPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, wMagic, wNosideEffect, wSideEffect, wNoreturn, wDynLib, wHeader, wCompilerProc, wPure, wProcVar, wDeprecated, wVarargs, wCompileTime, wMerge, @@ -26,9 +26,11 @@ const converterPragmas* = procPragmas methodPragmas* = procPragmas macroPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, - wMagic, wNosideEffect, wCompilerProc, wDeprecated, wExtern} + wMagic, wNosideEffect, wCompilerProc, wDeprecated, wExtern, + wImportcpp, wImportobjc} iteratorPragmas* = {FirstCallConv..LastCallConv, wNosideEffect, wSideEffect, - wImportc, wExportc, wNodecl, wMagic, wDeprecated, wBorrow, wExtern} + wImportc, wExportc, wNodecl, wMagic, wDeprecated, wBorrow, wExtern, + wImportcpp, wImportobjc} stmtPragmas* = {wChecks, wObjChecks, wFieldChecks, wRangechecks, wBoundchecks, wOverflowchecks, wNilchecks, wAssertions, wWarnings, wHints, wLinedir, wStacktrace, wLinetrace, wOptimization, wHint, wWarning, wError, wFatal, @@ -37,14 +39,17 @@ const wInfChecks, wNanChecks, wPragma, wEmit, wUnroll, wLinearScanEnd} lambdaPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, wNosideEffect, wSideEffect, wNoreturn, wDynLib, wHeader, wPure, - wDeprecated, wExtern, wThread} + wDeprecated, wExtern, wThread, wImportcpp, wImportobjc} typePragmas* = {wImportc, wExportc, wDeprecated, wMagic, wAcyclic, wNodecl, - wPure, wHeader, wCompilerProc, wFinal, wSize, wExtern, wShallow} - fieldPragmas* = {wImportc, wExportc, wDeprecated, wExtern} + wPure, wHeader, wCompilerProc, wFinal, wSize, wExtern, wShallow, + wImportcpp, wImportobjc} + fieldPragmas* = {wImportc, wExportc, wDeprecated, wExtern, + wImportcpp, wImportobjc} varPragmas* = {wImportc, wExportc, wVolatile, wRegister, wThreadVar, wNodecl, - wMagic, wHeader, wDeprecated, wCompilerProc, wDynLib, wExtern} + wMagic, wHeader, wDeprecated, wCompilerProc, wDynLib, wExtern, + wImportcpp, wImportobjc} constPragmas* = {wImportc, wExportc, wHeader, wDeprecated, wMagic, wNodecl, - wExtern} + wExtern, wImportcpp, wImportobjc} procTypePragmas* = {FirstCallConv..LastCallConv, wVarargs, wNosideEffect, wThread} diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 9feac18d2..87f988ed9 100755 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -121,10 +121,9 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, instantiateGenericParamList(c, n.sons[genericParamsPos], pt, entry) n.sons[genericParamsPos] = ast.emptyNode # semantic checking for the parameters: - if n.sons[paramsPos].kind != nkEmpty: + if n.sons[paramsPos].kind != nkEmpty: removeDefaultParamValues(n.sons[ParamsPos]) semParamList(c, n.sons[ParamsPos], nil, result) - #echo "generated this return type: ", renderTree(n.sons[ParamsPos]) addParams(c, result.typ.n) else: result.typ = newTypeS(tyProc, c) |