based on the Grisu1 algorithm. This corrects several precision issues
with the previous code used to perform such conversions (patch by
Max Nazhalov, mantis #25241)
o adaptation of several tests to deal with the better precision of these
routines compared to the previous version
Please don't remove the real2str.inc file yet, it's still used by the
JVM target for now
git-svn-id: trunk@25888 -
defcmp.pas, objectdef_is_related:
* use "equal_defs" instead of "=", as the former also handles equivalence of specializations
+ added test
git-svn-id: trunk@25848 -
compiler/scanner.pas, tscannerfile.readtoken:
* after trying to read a _INTCONST check whether a valid first character for an identifier follows and give a syntax error if that is not the case
+ added test
git-svn-id: trunk@25835 -
compiler/pdecobj.pas, object_dec:
* since revision 25518 the global symtable of the current module is no longer popped and pushed again so that the defaware symtablestack can add the helper; thus we need to do this not only for static symtables, but for global ones as well
* adjusted comment to reflect current situation
git-svn-id: trunk@25834 -
* don't allow to apply the same hint directive twice
* change parser_e_proc_dir_not_allowed to more generic variant parser_e_dir_not_allowed - they are similar and 'procedure' prefix does not give more information about the error.
* maybe_parse_hint_directives() uses procdef settings for initial values
+ add tests
git-svn-id: trunk@25720 -
symdef.pas:
* tobjectdef.find_implemented_interface: use equal_defs to ensure that equal specializations of interfaces are found as well
* getparaencoding: use globals.CP_NONE instead of just CP_NONE, because defcmp contains a cp_none enum as well.
+ added test
git-svn-id: trunk@25609 -
m68k/cgcpu.pas, tcg68k.g_flags2reg:
* don't sign extend the flag value which was stored to the register, but instead do a "AND 1" on it to reduce it to 1 bit; afterall Booleans in Pascal are either 0 or 1 and not 0 or $FF
+ added test
git-svn-id: trunk@25598 -
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 -
pgenutil.pas, generate_specialization:
* use "is_generic" instead of "df_generic in defoptions" as nested non generic types will have that flag set as well and thus would be acceptable for the "<...>" notation although no generic version of it exists
ptype.pas, single_type:
* check for nested types after doing a specialization
+ added tests (one for now working case and one for now forbidden case)
git-svn-id: trunk@25578 -
cclasses.pas:
+ TFPHashList & TFPHashObjectList: add WhileEachCall methods that walk the list like ForEachCall does, but uses a while-loop instead of a for-loop
psub.pas, generate_specialization_procs:
* use WhileEachCall instead of ForEachCall as new defs can be added during the specialization that need to be specialized as well
+ added test
git-svn-id: trunk@25577 -
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 -
1. It allows to use comparative operators in some unusual cases (issue #25004).
2. Regular type checking does not allow to use other than Boolean types in IF expressions anyway.
3. Delphi compatibility (although Delphi documentation states otherwise).
git-svn-id: trunk@25494 -
rtl/objpas/classes/classesh.inc, TStringList:
* rename the private ExchangeItems to ExchangeItemsInt and allow inlining
+ add a protected virtual ExchangeItems
rtl/objpas/classes/stringl.inc, TStringList:
* Exchange: call ExchangeItemsInt
+ let default implementation of ExchangeItems simply call ExchangeItemsInt
* QuickSort: call ExchangeItemsInt directly if there is no override otherwise call ExchangeItems
+ added test
git-svn-id: trunk@25480 -