diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-07-20 15:07:34 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-07-20 15:07:34 +0000 |
commit | 82405a574b82f1ecd1cb45d18196fc6f0fbd5b4a (patch) | |
tree | 9de6ec4386ca249557b6c4ed9c8682024e524eb7 | |
parent | 811b9e822aacb3b9f4d12f7f0191200c647d07e6 (diff) | |
download | fpc-genfunc.tar.gz |
* parsing of generic functions worksgenfunc
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/genfunc@11420 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/pdecsub.pas | 18 | ||||
-rw-r--r-- | compiler/psub.pas | 1 |
2 files changed, 14 insertions, 5 deletions
diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index b261988154..cf263c0ad9 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -925,7 +925,7 @@ implementation isclassmethod, old_parse_generic, isgeneric, - popclass : boolean; + popextrasymtable : boolean; old_block_type : tblock_type; begin locationstr:=''; @@ -964,18 +964,26 @@ implementation old_parse_generic:=parse_generic; inc(testcurobject); { Add ObjectSymtable to be able to find generic type definitions } - popclass:=false; + popextrasymtable:=false; if assigned(pd._class) and (pd.parast.symtablelevel=normal_function_level) and (symtablestack.top.symtabletype<>ObjectSymtable) then begin symtablestack.push(pd._class.symtable); - popclass:=true; + popextrasymtable:=true; parse_generic:=(df_generic in pd._class.defoptions); + end + { generic function? } + else if (df_genericbase in pd.defoptions) then + begin + symtablestack.push(pd.parast); + popextrasymtable:=true; + parse_generic:=true; end; + single_type(pd.returndef,false); - if popclass then - symtablestack.pop(pd._class.symtable); + if popextrasymtable then + symtablestack.pop(symtablestack.top); dec(testcurobject); parse_generic:=old_parse_generic; diff --git a/compiler/psub.pas b/compiler/psub.pas index bc062e3b9e..20fb08c0ea 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -1746,6 +1746,7 @@ implementation end; _GENERIC: read_proc; + _SPECIALIZE: else break; end; |