diff options
author | Andreas Rumpf <andreas@andreas-desktop> | 2009-11-16 08:38:31 +0100 |
---|---|---|
committer | Andreas Rumpf <andreas@andreas-desktop> | 2009-11-16 08:38:31 +0100 |
commit | 3710309d39f65718ab5990d53a977acb241432a9 (patch) | |
tree | 572893ca9aa111e3356a3892a4ba6729c12c6c65 /nim | |
parent | 281609c358b139d55461af842ce29f39f01b2441 (diff) | |
download | Nim-3710309d39f65718ab5990d53a977acb241432a9.tar.gz |
nimrod compiles again
Diffstat (limited to 'nim')
-rwxr-xr-x | nim/pbraces.pas | 9 | ||||
-rwxr-xr-x | nim/transf.pas | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/nim/pbraces.pas b/nim/pbraces.pas index 2e10c50f2..d1cb84096 100755 --- a/nim/pbraces.pas +++ b/nim/pbraces.pas @@ -1376,9 +1376,9 @@ begin // type alias: end; - tkEnum: - tkObject: - tkTuple: + tkEnum: begin end; + tkObject: begin end; + tkTuple: begin end; else break; end end @@ -1401,7 +1401,8 @@ begin tkTemplate: result := parseRoutine(p, nkTemplateDef); tkConverter: result := parseRoutine(p, nkConverterDef); tkType, tkEnum, tkObject, tkTuple: - result := parseTypeAlias(p, nkTypeSection, parseTypeDef); + result := nil; + //result := parseTypeAlias(p, nkTypeSection, parseTypeDef); tkConst: result := parseConstSection(p); tkWhen: result := parseIfOrWhen(p, nkWhenStmt); tkVar: result := parseSection(p, nkVarSection, parseVariable); diff --git a/nim/transf.pas b/nim/transf.pas index 192d76a84..a0f07d51d 100755 --- a/nim/transf.pas +++ b/nim/transf.pas @@ -916,6 +916,12 @@ begin result := transformAddrDeref(c, n, nkAddr, nkHiddenAddr); nkHiddenStdConv, nkHiddenSubConv, nkConv: result := transformConv(c, n); + nkDiscardStmt: begin + for i := 0 to sonsLen(n)-1 do + result.sons[i] := transform(c, n.sons[i]); + if isConstExpr(result.sons[0]) then + result := newNode(nkCommentStmt) + end; nkCommentStmt, nkTemplateDef: exit; nkConstSection: exit; // do not replace ``const c = 3`` with ``const 3 = 3`` else begin |