Commit Graph

672 Commits

Author SHA1 Message Date
marco
c67f8f2a28 --- Merging r32845 into '.':
A    tests/webtbs/tw29321.pp
U    compiler/pexpr.pas
--- Recording mergeinfo for merge of r32845 into '.':
 U   .

# revisions: 32845

git-svn-id: branches/fixes_3_0@33862 -
2016-05-31 07:23:52 +00:00
marco
e17f99ed84 --- Recording mergeinfo for merge of r31987 into '.':
U   .
--- Merging r32990 into '.':
A    tests/webtbs/tw29372.pp
U    compiler/ncgcal.pas
--- Recording mergeinfo for merge of r32990 into '.':
 U   .
--- Merging r33054 into '.':
U    compiler/symdef.pas
--- Recording mergeinfo for merge of r33054 into '.':
 G   .
--- Merging r33110 into '.':
A    tests/webtbs/tw29609.pp
U    compiler/pexpr.pas
--- Recording mergeinfo for merge of r33110 into '.':
 G   .
--- Merging r33211 into '.':
U    compiler/htypechk.pas
A    tests/webtbs/tw29792.pp
--- Recording mergeinfo for merge of r33211 into '.':
 G   .
--- Merging r33214 into '.':
A    tests/webtbs/tw29745.pp
G    compiler/symdef.pas
--- Recording mergeinfo for merge of r33214 into '.':
 G   .

# revisions: 31987,32990,33054,33110,33211,33214

git-svn-id: branches/fixes_3_0@33416 -
2016-04-03 11:04:10 +00:00
Jonas Maebe
c7b40a6436 --- Merging r31191 into '.':
A    tests/webtbs/tw28475.pp
U    compiler/ncnv.pas
--- Merging r31193 into '.':
U    compiler/optcse.pas
A    tests/webtbs/tw27210.pp
--- Merging r31263 into '.':
U    compiler/options.pas
--- Merging r31335 into '.':
U    compiler/dbgdwarf.pas
--- Merging r31466 into '.':
U    compiler/arm/narmset.pas
--- Merging r31488 into '.':
U    rtl/inc/astrings.inc
--- Merging r31572 into '.':
U    compiler/arm/aasmcpu.pas
--- Merging r31608 into '.':
U    compiler/x86/nx86cal.pas
--- Merging r31680 into '.':
U    packages/chm/src/chmcmd.lpr
--- Merging r31851 into '.':
U    rtl/jvm/math.inc
--- Merging r31956 into '.':
U    tests/tbs/tb0320.pp
--- Merging r31976 into '.':
U    rtl/linux/x86_64/cprt0.as
--- Merging r31980 into '.':
U    compiler/systems/t_linux.pas
--- Merging r32043 into '.':
U    compiler/cclasses.pas
--- Merging r32066 into '.':
G    rtl/inc/astrings.inc
A    tests/webtbs/tw28850.pp
--- Merging r32168 into '.':
U    rtl/unix/cthreads.pp
--- Merging r32244 into '.':
U    packages/fpmkunit/src/fpmkunit.pp
--- Merging r32259 into '.':
U    compiler/x86/agx86int.pas
--- Merging r32338 into '.':
G    compiler/ncnv.pas
--- Merging r32342 into '.':
G    compiler/ncnv.pas
--- Merging r32368 into '.':
A    tests/webtbs/tw29040.pp
U    compiler/x86/rax86int.pas
--- Merging r32399 into '.':
U    packages/fcl-res/src/machodefaulttarget.inc
--- Merging r32410 into '.':
U    compiler/ncgset.pas
--- Merging r32454 into '.':
U    compiler/jvm/pjvm.pas
U    tests/test/jvm/testall.bat
A    tests/test/jvm/tprocvaranon.pp
U    tests/test/jvm/testall.sh
--- Merging r32517 into '.':
U    compiler/nutils.pas
U    compiler/pexpr.pas
A    tests/webtbs/tw29030.pp
--- Merging r32527 into '.':
U    rtl/linux/powerpc64/gprt0.as
U    rtl/linux/powerpc64/cprt0.as
--- Merging r32528 into '.':
U    rtl/linux/powerpc64/prt0.as
--- Merging r32549 into '.':
U    compiler/jvm/njvmcon.pas
U    compiler/jvm/njvmcnv.pascd ..
--- Merging r32584 into '.':
U    compiler/utils/ppuutils/ppudump.pp
--- Merging r32599 into '.':
U    compiler/paramgr.pas

git-svn-id: branches/fixes_3_0@32671 -
2015-12-16 15:28:03 +00:00
Jonas Maebe
e0ca083cce --- Merging r30038 into '.':
U    compiler/ncgvmt.pas
--- Merging r30217 into '.':
U    compiler/comprsrc.pas
--- Merging r30261 into '.':
A    tests/webtbs/tw27691.pp
U    compiler/pmodules.pas
--- Merging r30265 into '.':
U    compiler/fmodule.pas
G    compiler/pmodules.pas
--- Merging r30272 into '.':
A    tests/webtbs/tw27517.pp
U    compiler/pexpr.pas
--- Merging r30427 into '.':
U    compiler/x86/cpubase.pas
--- Merging r30465 into '.':
U    compiler/utils/ppuutils/ppudump.pp
--- Merging r30487 into '.':
U    rtl/inc/cgenstr.inc
--- Merging r30502 into '.':
U    compiler/x86/nx86inl.pas
U    compiler/arm/narminl.pas
U    compiler/ppcgen/ngppcinl.pas
A    tests/webtbs/tw27811.pp
--- Merging r30656 into '.':
U    compiler/psub.pas
--- Merging r30765 into '.':
U    compiler/arm/narmcnv.pas
U    compiler/sparc/ncpucnv.pas
U    compiler/m68k/n68kcnv.pas
U    compiler/mips/ncpucnv.pas
U    compiler/ppcgen/ngppccnv.pas
   C compiler/aarch64/ncpucnv.pas
A    tests/webtbs/tw28007.pp

git-svn-id: branches/fixes_3_0@32665 -
2015-12-14 12:36:29 +00:00
joost
dc9c883dda --- Merging (from foreign repository) r31847 into '.':
U    compiler/pexpr.pas

# revisions: 31847

git-svn-id: branches/fixes_3_0@31962 -
2015-10-06 15:23:41 +00:00
Jonas Maebe
654cda7387 --- Merging r30164 into '.':
U    compiler/powerpc/cgcpu.pas
U    compiler/powerpc/cpubase.pas
U    compiler/powerpc64/cgcpu.pas
U    compiler/ncgutil.pas
U    compiler/ppcgen/hlcgppc.pas
A    tests/webtbs/tw27634.pp
--- Merging r30169 into '.':
U    compiler/pdecobj.pas
A    tests/test/tobjc43.pp
--- Merging r30177 into '.':
U    compiler/pexpr.pas
A    tests/test/tmacfunret2.pp
--- Merging r30178 into '.':
U    compiler/options.pas
--- Merging r30204 into '.':
U    compiler/i8086/cpupara.pas
--- Merging r30208 into '.':
U    compiler/powerpc64/cpubase.pas
U    compiler/powerpc64/itcpugas.pas
--- Merging r30209 into '.':
U    rtl/linux/si_intf.inc
--- Merging r30219 into '.':
U    compiler/powerpc64/cpupara.pas

# revisions: 30164,30169,30177,30178,30204,30208,30209,30219

git-svn-id: branches/fixes_3_0@30252 -
2015-03-17 17:07:00 +00:00
svenbarth
9611c3df52 Fix for Mantis #25606.
pexpr.pas, postfixoperators:
  * try_type_helper: also allow type helpers for block type bt_const

+ added test

git-svn-id: trunk@29176 -
2014-11-28 22:06:10 +00:00
Jonas Maebe
ff583bde6c * made setstring() a compiler intrinsic so it can set the compile-time
code page of ansistrings (mantis #26735)

git-svn-id: trunk@28813 -
2014-10-12 20:27:06 +00:00
svenbarth
a7a9440692 Add a new warning message that is generated if an instance of an abstract class is created. This message is disabled by default, but can be switched on by using {$warn 4122 on} or {$warn 4122 error}.
Please note that this warning won't be triggered if an instance of that class is created using a class variable of that class type as the compiler can not know the type contained in the variable at compile time (see also the added test).

+ msg/errore.msg: added disabled message which informs about the instantiation of an abstract class
* pexpr.pas, do_member_read: generate the message if we have a constructor call for an abstract class using a loadvmtaddrnode (thus the type name is used and not a class variable)

* msg{idx,txt}.inc: updated

+ added test

git-svn-id: trunk@28127 -
2014-07-01 20:41:05 +00:00
Károly Balogh
195dbc15fa + second try on warning fix
git-svn-id: trunk@28015 -
2014-06-20 13:36:57 +00:00
Károly Balogh
00b55e100c + try to fix the warnings introduced in r27947, so the compiler builds with -Sew
git-svn-id: trunk@28014 -
2014-06-20 13:10:07 +00:00
Jonas Maebe
9450407ed5 * when taking the address of a method1 that is specified by subscripting
the result of a objtype.method2 call, ensure that we call method2 with
    objtype as methdpointer rather than the self node of the current routine
    (mantis #24844)

git-svn-id: trunk@27977 -
2014-06-15 17:26:12 +00:00
svenbarth
c6496f8ec5 Fix for Mantis #26278.
pbase.pas:
  + add an overload for identifier_not_found for which the file position can be supplied
pexpr.pas, factor_read_id:
  * store the file position before reading the identiifer token
  * use the new identiifer_not_found overload to explicitely set the file position
  * set the file position of the created node

git-svn-id: trunk@27947 -
2014-06-13 21:36:55 +00:00
svenbarth
b9a59c33f4 Fix for Mantis #25915.
* ptype.pas, id_type:
    generate the "identifier not found" message only if the identifier was really not found and not when the identifier is a non-type
* pexpr.pas, statement_syssym: 
    don't generate the "type id expected" error message for Default() anymore; this is already handled by single_type

+ added test (though this again will not help much as output is not parsed...)

git-svn-id: trunk@27464 -
2014-04-04 15:48:06 +00:00
Jonas Maebe
d452686c39 * moved pbestrealtype from symdef to symcpu
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
Jonas Maebe
b57c95043f + support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual
   o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
     class
   o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
     class from the base classes, and initialises the c*def/c*sym classes with
     them. This is done so that the llvm target will be able to derive from
     the tcpu*def/sym classes without umpteen ifdefs, and it also means that
     the WPO can devirtualise everything because the c* variables are only
     initialised with one class type
   o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
     calls

git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
Jonas Maebe
9c4505045b * fixed formatting
git-svn-id: trunk@26607 -
2014-01-28 20:14:10 +00:00
florian
e841027a48 * fixes handling of typed files in iso mode
git-svn-id: trunk@26436 -
2014-01-12 20:17:48 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
svenbarth
798bb91e90 Extract tdef.is_related plus its overrides in tobjectdef, trecorddef and tstringdef into a new function def_is_related in unit defcmp.
defcmp.pas:
  + add new function "def_is_related" which combines the "is_related" overloads of "tobjectdef", "trecorddef" and "tstringdef" (it returns "false" for other def types which is what "tdef.is_related" did)
  * compare_defs_ext & compatible_childmethod_resultdef: change call from "x.is_related" to "def_is_related(x,...)"
symtype.pas, tdef:
  - remove "is_related" method
symdef.pas:
  - remove "is_related" in "tobjectdef", "trecorddef" and "tstringdef"
  * tobjectdef.needs_inittable: for checking whether a Corba interface somehow inherits from a IInterface don't use "is_related" anymore (we want to avoid the dependency after all), but mimic the necessary functionality of "def_is_related"
htypechk.pas, nadd.pas, ncal.pas, ncnv.pas, ngtcon.pas, nld.pas, optvirt.pas, pdecobj.pas, pdecvar.pas, pexpr.pas, pgenutil.pas:
  * change call from "x.is_related" to "def_is_related(x,...)"
symtable.pas
  + use unit defcmp
  * change call from "x.is_related" to "def_is_related(x,...)"
jvm/njvmcnv.pas, jvm/njvmflw.pas:
  * change call from "x.is_related" to "def_is_related(x,...)"

git-svn-id: trunk@25847 -
2013-10-25 19:44:27 +00:00
svenbarth
e8edbd29c0 Fix for Mantis #24687.
pgenutil.pas:
  + add new function could_be_generic which checks whether a given symbol name could be a generic (which is determined using the genericdummysyms list for the current module)
pexpr.pas:
  * factor: only do a typecheck pass (postfixoperators does one as well) if the found node can not be a generic type
  * sub_expr: do a typecheck pass if it isn't a specialization

+ added test

git-svn-id: trunk@25579 -
2013-09-26 10:21:11 +00:00
svenbarth
9d48bc0baf Implement cross unit type overloading of generics. This fixes the regression introduced with revision 25498.
symtable.pas:
  + add new tsymbol_search_flag type which can be passed to various searchsym* routines
  + add support to not call "addsymref"
  + add new searchsym_with_flags function that calls searchsym_maybe_with_symoption
  * adjust searchsym_maybe_with_symoption, searchsym_in_class & searchsym_in_helper to use new flag type instead of Boolean arguments
  * adjust searchsym & searchsym_with_symoption which call the modified functions
nutils.pas, handle_staticfield_access:
  * adjust searchsym_in_class call
pexpr.pas, handle_factor_typenode, postfixoperators, factor:
  * adjust searchsym_in_helper and searchsym_in_class calls
pinline.pas, new_function:
  * adjust searchsym_in_class call
scanner.pas, try_consume_nestedsym:
  * adjust searchsym_in_class call
fmodule.pas, tmodule:
  + add genericdummysyms field which is a TFPHashObjectList that contains TFPObjectList instances per generic dummy that in turn contains tgenericdummysyms instances
pgenutil.pas:
  + add function split_generic_name to split a generic name into non-generic name and count value of type parameters
  + add function resolve_generic_dummysym which tries to use the new genericdummysyms field to find the real symbol of a dummy sym
  * generate_specialization: adjust searchsym_in_class call
  * specialization_init/specialization_done: save/restore genericdummysyms of module
symdef.pas, tdefawaresymtablestack:
  + add new intermediate method pushcommon which is used by both push and pushafter
  + add new intermediate method remove_helpers_and_generics (which calls remove_generics and remove_helpers if necessary)
  * rename removehelpers to remove_helpers
  * rename addhelpers to add_helpers_and_generics and extend it to correctly fill current_module.genericdummysyms
  * call remove_helpers_and_generics from pop instead of remove_helpers
ptype.pas, single_type, read_named_type.expr_type, read_named_type:
  * try to resolve symbols with sp_generic_dummy with resolve_generic_dummysym

+ added test

git-svn-id: trunk@25519 -
2013-09-18 14:28:46 +00:00
paul
0d8ad2a932 compiler: don't treat TRUE and FALSE as keywords. They are predefined constants from this moment. This change is compatible with other pascal compilers. Fixes issue #0025030
git-svn-id: trunk@25497 -
2013-09-16 09:11:17 +00:00
paul
93f1ba4493 compiler: don't allow to access an enum members through the enum member. It should be only possible throught the enum type name. Fixes issue #0025029
git-svn-id: trunk@25493 -
2013-09-16 02:48:52 +00:00
paul
038b7746fb compiler: implement preprocessor expressions (fixes mantis #0010671)
- move operator_levels to topens.pas - it is used from 2 units now
  - implement pexpr like sub_expr for preprocessor expressions
  - implement +,-,*,/ expressions for the moment
  * move OR, AND, IN implemenetation to the new logic

git-svn-id: trunk@25465 -
2013-09-12 08:35:24 +00:00
paul
4fd0245120 compiler: fix indentation
git-svn-id: trunk@25421 -
2013-09-05 06:29:06 +00:00
florian
bca6dafbc5 * mark the current procedure if it has a non local exit, not the targetted one
git-svn-id: trunk@25288 -
2013-08-18 18:55:53 +00:00
paul
dc95ba5b07 compiler: handle other places where we check current_procdef for self node
git-svn-id: trunk@25281 -
2013-08-18 13:09:32 +00:00
paul
4b76782691 compiler: fix property access from a nested routine of the static class method and extend a test
git-svn-id: trunk@25280 -
2013-08-18 12:36:04 +00:00
paul
5c33644e5c compiler: fix calling class methods from a nested routine of a static class method (mantis #0024865)
git-svn-id: trunk@25274 -
2013-08-17 04:44:19 +00:00
paul
89e154bc10 compiler: if method has no self node then load it as a usual identifier (issue #0024871)
git-svn-id: trunk@25273 -
2013-08-17 02:54:55 +00:00
Jonas Maebe
fb8fb29574 * record/use the code page of string constants typecasted to an ansistring
type with a non-default code page
   TODO: ensure that string constants typecasted to ansistring become
     ansistrings rather than typeless string constants

git-svn-id: trunk@25207 -
2013-08-02 13:23:32 +00:00
nickysn
7edabc64e6 * rm support for Mem without segment on i8086
git-svn-id: trunk@24780 -
2013-06-02 16:20:26 +00:00
nickysn
dd0d2d6bf5 * fixed the spurious compiler warnings and added proper rangechecking when using Mem[] on i8086
git-svn-id: trunk@24779 -
2013-06-02 15:18:05 +00:00
nickysn
5b503f42c7 + implemented Mem/MemW/MemL[] for i8086
git-svn-id: trunk@24665 -
2013-05-31 13:31:45 +00:00
florian
0e41df598e * merge i8086 branch by Nikolay Nikolov
git-svn-id: trunk@24324 -
2013-04-25 20:23:51 +00:00
marco
8b411a549c * functionname without () is a recursive call in Miso. Mantis #24309, though
that remains open for the documentation.

git-svn-id: trunk@24303 -
2013-04-22 17:45:14 +00:00
florian
fef7832790 * enable absolute for i8086-msdos
git-svn-id: branches/i8086@24054 -
2013-03-29 15:13:29 +00:00
svenbarth
344571cb4e Added support for type helpers. In non Delphi modes they use "type helper" and in mode Delphi they use "record helper". They can also be used on constants.
symconst.pas:
  + extend "thelpertype" by "ht_type" which tells the code in "pdecobj.parse_extended_type" that a type helper declaration has been parsed
node.pas:
  + add a constant which identifies all constant node types
ptype.pas:
  + read_named_type: add a parameter "hadtypetoken" to tell the code whether a "type" token had been parsed before
  + read_named_type: if an identifier "helper" is parsed we need to check whether "hadtypetoken" is true and the modeswitch "m_class" is set, but the "m_delphi" one is not; in that case we have a "type helper" declaration
pgenutil.pas, generate_specialization:
  * adjust call to read_named_type
pdecl.pas, types_dec:
  * adjust call to read_named_type

pdecobj.pas:
  * parse_extended_type: extend for correct handling of primitive types (includes Delphi compatible handling as well) and reject types that are explicitly not allowed
  * method_dec: require "static" for class methods in type helpers
  * method_doc: allow constructors for type helpers as well
paramgr.pas, tparamanager:
  * set_common_funcretloc_info: handle type helper constructors like record constructors
  * handle_common_ret_in_param: the "self" value of a type helper constructor is also returned in a parameter
pexpr.pas:
  + add a function to postfixoperators which tries to find and apply a type helper for a given type
  * postfixoperators: try to apply type helpers for ordinal constants
  * postfixoperators: use the correct string type for string constants
  * postfixoperators: try to apply type helpers for enum constants
  * postfixoperators: try to apply type helpers for arrays
  * postfixoperators: try to apply type helpers for Variant
  * postfixoperators: try to apply type helpers for pointer types
  * postfixoperators: try to apply type helpers for other types
  * factor: check postfixoperators after _REALNUMBER, _CCHAR, _CWCHAR, _TRUE and _FALSE
  * factor: also check postfixoperators if a _POINT follows a _NIL

symdef.pas, tdefawaresymtablestack.addhelpers:
  * use "generate_objectpascal_helper_key" to generate the key
symtable.pas:
  + add function to generate the key value for the map of extended types using the extended def
  * adjust "search_last_objectpascal_helper" and "search_objectpascal_helper" to handle primitive types as well
  * use the new "generate_objectpascal_helper_key" function to generate the key

pparautl.pas:
  * insert_self_and_vmt_para: don't insert the $vmt symbol for record or type helpers (ToDo: check whether class helpers really need the symbol as well)
  * insert_self_and_vmt_para: pass "self" as var parameter for type helpers as well
psub.pas, generate_bodyentry_block: 
  * also allow type helpers for constructor methods
ncal.pas, tcallnode.gen_self_tree:
  * also use a temp variable for type helper constructors
ncgcal.pas, tcgcallnode.secondcallparan:
  * allow Pointers to be passed as address param if it is the Self value of a type helper extending a pointer type
  * correctly handle the location in case of type helper constructors

+ add tests

git-svn-id: trunk@23580 -
2013-02-06 09:49:35 +00:00
paul
5d74e0578a compiler: remove unused variables and unneeded assignments
git-svn-id: trunk@23467 -
2013-01-21 01:24:36 +00:00
paul
4d79a44e4c compiler: don't create loadvmtaddrnode for record references, they have no VMT (fixes bug #23130)
git-svn-id: trunk@23417 -
2013-01-17 07:30:00 +00:00
svenbarth
b5827ce363 Move the handling of "misstyled" floating point constants like "2." or "2.e10" from the scanner to the parser. This way type helpers calls for integer constants can be parsed correctly in the future.
Note: the error messages for incorrect "misstyled" floating point numbers (e.g. "2e10foo") have changed because of this.

scanner.pas, tscannerfile.readtoken:
  instead of tokenizing "2.", "2.e10", "2.e+10" and "2.e-10" as "_REALNUMBER" tokenize them as "_INTCONST _POINT", "_INTCONST _POINT _ID", "_INTCONST _POINT _ID _PLUS _INTCONST" "_INTCONST _POINT _ID _PLUS _INTCONST"; tokenizing of normal floating constants is not changed

pexpr.pas:
  factor: 
    * extract the code for creating a new constant floating point from "factor" into a new function "real_const_node_from_pattern"
    + allow the parsing of postfixoperators for integer constants if a "." is encountered
  + postfixoperators: check for a "misstyled" floating point number if an ordinal const (not an enum and not a boolean) is encountered (the code is already partially prepared for type helper support)
  
+ Added tests

git-svn-id: trunk@23356 -
2013-01-10 16:23:00 +00:00
florian
b43b4bb455 + pseudo procedure aligned: tells the compiler to assume that the given parameter is naturally aligned, counterpart of unaligned
git-svn-id: trunk@23310 -
2013-01-04 19:13:24 +00:00
florian
fce9e953b4 + nested exit support
git-svn-id: trunk@23309 -
2013-01-04 19:09:04 +00:00
florian
288820715d * don't crash in case a symbol is not found in type/var/const section
git-svn-id: trunk@23264 -
2012-12-31 20:24:55 +00:00
florian
728c074bd6 * accept with statements with generic variables having a generic parameter type, resolves #21329
git-svn-id: trunk@23243 -
2012-12-28 19:48:33 +00:00
svenbarth
4adb36e8da Add support for generic type constraints. They are currently only useful to stop specialization of a generic. The parsing of a generic is still too lax and needs to be changed in the future...
symconst.pas:
  + extend "tdefoptions" by a "df_genconstraint" which will be used to mark dummy defs that should mainly satisfy the compiler's type checking without to much changes
symsym.pas:
  + add a class "tgenericconstraintdata" which will hold information about the constraints associated with a specific generic type parameter (designed for future extensions)
  + extend "ttypesym" by a reference to a "tgenericconstraintdata" which is written to the ppu only if needed
symtype.pas:
  + add a pointer to "tderef" as this is needed for the ppu reading/writing code for the "tgenericconstraintdata"
pdecl.pas, types_dec:
  + call "parse_generic_parameters" so that constraints are allowed
pgenutil.pas:
  + extend "generate_specialization" by a "parsedpos" to give in the file position of the first parsed parameter (needed for correct error locations when checking the constraints)
  + add an overloaded call of "generate_specialization" to differentiate between the use cases "first parameter parsed by generate_specialization" and "first parameter parsed by other code"; this also allows to write the "fillchar" for the "parampos" parameter only once ( => otherwise a warning is triggered => error in compilation)
  + extend the "parse_generic_specialization_types" by a "poslist" parameter which will contain the positions of all parsed type parameters (can only be used in the case that all parameters are parsed)
  * move the original code of "parse_generic_specialization_types" to a new procedure "parse_generic_specialization_types_internal" which take an additional "parsedpos" parameter which will be added to the "poslist" before all others; "parse_generic_specialization_types" calls this new procedure with a dummy argument (which won't be used)
  + extend "parse_generic_parameters" by the parsing of generic constraints which constructs correct defs for the parameters and fills in the new "tgenericconstraintdata" object for each parameter (note: the "constructor" constraint is only parsed for Delphi compatibility and basically means the same as a "class" constraint... (it's a relict of Delphi.NET))
  * adjust "insert_generic_parameter_types" as specializations and generics can no longer be differed by whether the type parameters are of type "undefineddef"
pdecsub.pas, parse_proc_head, consume_generic_interface:
  * adjust call to "generate_specialization"
  + add a new function "check_generic_constraints" which is used from within "generate_specialization" to ensure that the given specialization parameters are compatible with the constraints of the generic parameters
ptype.pas:
  * single_type: adjust call to "generate_specialization"
  * read_named_type, expr_type: adjust call to "generate_specialization"
  + write_persistent_type_info: don't write typeinfo for constraints
pexpr.pas, sub_expr:
  * adjust call to "generate_specialization"
* adjusted ppudump, because of added "tdefoptions.df_genconstraint" value

+ added tests for generic constraints
* modified test for class helper inside a generic which extends a class type parameter
+ added test for record helper inside a generic which extends a record type parameter

git-svn-id: trunk@23158 -
2012-12-16 13:44:58 +00:00
Jonas Maebe
5929ec5592 * turned getpropaccesslist, add_parameters and add_index_parameter into
methods of tpropertysym (refactoring)
  * turned code to copy the contents of a property into another one
    into a method of tpropertysym (refactoring)

git-svn-id: trunk@22955 -
2012-11-08 20:17:48 +00:00
florian
bc4a8ac63e + constant postfixoperator_tokens
+ check for postfix operators after string contants, resolves #23136

git-svn-id: trunk@22929 -
2012-11-04 19:21:19 +00:00
Jonas Maebe
1822c46d8a * don't crash when parsing exit(xxx) in a constructor (mantis #23110)
git-svn-id: trunk@22795 -
2012-10-21 13:43:03 +00:00