Commit Graph

2120 Commits

Author SHA1 Message Date
Jonas Maebe
72758864e4 * only allow field names in record/object typed constant declarations (mantis #16234)
* improved error recovery after encountering invalid field name in record/object typed constant
    declaration

git-svn-id: trunk@15150 -
2010-04-18 07:55:42 +00:00
paul
a1d94c6829 rtl: implement TStreamAdapter.CopyTo, .SetSize, return proper error value for Clone instead of raising exception (#0016161) + test
git-svn-id: trunk@15138 -
2010-04-11 12:52:31 +00:00
paul
c62c487b24 compiler: fix nested type typecast (issue #0016222)
git-svn-id: trunk@15122 -
2010-04-09 17:10:52 +00:00
Jonas Maebe
a18f2594e2 * fixed FloatToStr for ffGeneral when dealing with numbers whose number of
significant digits before the decimal points matches the precision
    parameter exactly (mantis #16188)
  * round instead of cut off digits in FloatToStr with ffGeneral
  * take into account the minus sign when determining whether a number needs
    to be represented using ffExponent instead of ffGeneral because it has
    too many digits

git-svn-id: trunk@15114 -
2010-04-05 14:54:24 +00:00
paul
8a0028a62e compiler: support *sealed* and *abstract* for objects (issue #0016174)
git-svn-id: trunk@15105 -
2010-04-01 14:36:33 +00:00
Jonas Maebe
4833867826 * moved most handling of records that fit in a register but that cannot be
treated as a regvar from pass_1 to the code generator, because this
    can always occur with a function result from a called function (in
    case the ABI prescribes returning certain records in registers)
    (mantis #16163)

git-svn-id: trunk@15101 -
2010-03-31 20:19:42 +00:00
Jonas Maebe
60f8b7fcb1 + int64 version of randomrange() (mantis #16108)
git-svn-id: trunk@15097 -
2010-03-30 20:04:19 +00:00
Jonas Maebe
734f9de2a0 + support for array of widechar typed constants (based on patch by
Blaise Thorn, mantis #16004)

git-svn-id: trunk@15096 -
2010-03-30 19:45:50 +00:00
paul
c879230f08 compiler: fix parsing and handling of typed constants declared inside classes/objects + tests
git-svn-id: trunk@15094 -
2010-03-30 07:09:44 +00:00
paul
973d947d6c compiler: allow const, type, var and class var sections for objects + test
git-svn-id: trunk@15092 -
2010-03-30 04:22:19 +00:00
ivost
d7e149805b * added new testset for interfaces and delegation, also GetInterface, GetInterfaceWeak, GetInterfaceByStr, AS and IS is tested
git-svn-id: trunk@15081 -
2010-03-28 00:44:20 +00:00
Jonas Maebe
a48a37d38b * fixed extended syntax checking {$x-} by moving it from the typecheck pass
to the parser, so that it only looks at what the programmer wrote rather
    than at all statements that the compiler may generate internally
    (mantis #11619)
  + several tests for {$x-} mode
  * modified tenumerators1 so it compiles without extended syntax enabled
    (to check for..in with {$x-})

git-svn-id: trunk@15075 -
2010-03-27 12:51:27 +00:00
Jonas Maebe
d8a902b4c4 * fixed internalerror in case the from-value of a for-loop has loc_jump
(mantis #15750)

git-svn-id: trunk@15071 -
2010-03-26 22:26:25 +00:00
Jonas Maebe
f0298ad2f5 + test for mantis #15363 fixed in r15066
git-svn-id: trunk@15070 -
2010-03-26 22:12:31 +00:00
ivost
f0ce69b264 * added testcase for right behavior of AS and SUPPORTS so that QueryInterface is called before GetInterface
git-svn-id: trunk@15067 -
2010-03-26 00:43:53 +00:00
paul
1b614b526a compiler:
- add own symbol table for enumeration to store enumeration elements
  - reimplement enumeration member traverse using symbol table instead of firstenum/nextenum - that members are removed
  - implement TEnum.Element access syntax - element is searched in the enumeration symtable in this case instead of global/local symtables
  - implement {$SCOPEDENUM ON/OFF} local switch
  + tests

git-svn-id: trunk@15051 -
2010-03-25 05:46:53 +00:00
Jonas Maebe
4d8f578e4c * when typecasting the result of pthread_self, always call it using
pthread_self(), because it's a procvar under Linux and hence otherwise
    the value of the procvar instead of the function result will be
    taken (mantis #15821)

git-svn-id: trunk@15049 -
2010-03-24 21:51:07 +00:00
Jonas Maebe
653974f679 * also give a "potential range error" hint with -CO in case the sizes
match but the source range does not fit in the dest range
    (related to mantis #16023)
  * don't give a "potential range error" when converting between
    s80real and sc80real, since even though the size may differ,
    the represented range does not

git-svn-id: trunk@15044 -
2010-03-24 21:21:19 +00:00
Jonas Maebe
8542632ebe * fixed evaluating constant expressions consisting of more than one term and
that start with a minus in the intel assembler reader (mantis #15843)

git-svn-id: trunk@15041 -
2010-03-24 20:52:31 +00:00
paul
1768810783 compiler: allow to derive classes from a nested class type (issue #0016083)
git-svn-id: trunk@15036 -
2010-03-23 05:36:11 +00:00
Jonas Maebe
82ff623390 + fixed Julian date helpers (based on patch by Bernd Engelhardt, mantis
#16040)
  * finished remaining unimplemented Julian date helpers

git-svn-id: trunk@15032 -
2010-03-22 21:01:46 +00:00
Jonas Maebe
87c9773ac0 + also support & to escape identifiers (and for octal notation) in Delplhi
mode (patch by Blaise Thorn, mantis #15930)

git-svn-id: trunk@15031 -
2010-03-21 23:33:44 +00:00
Jonas Maebe
6db635210a * don't give an internalerror when passing a constant string to an
openstring parameter (mantis #16022)

git-svn-id: trunk@15030 -
2010-03-21 14:51:12 +00:00
marco
c477df5046 * TCriticalSection.Tryenter support (Mantis 15928) + short test/demo
tested on FreeBSD (general Unix) and Windows. Note that Haiku seems 
    to have a native threadmgr rather than the Unix one. Will notify 
    maintainer (Olivier)

git-svn-id: trunk@15026 -
2010-03-21 11:34:05 +00:00
paul
49d94c5a16 compiler: implement {$VARPROPSETTER ON/OFF} support which is required for COM (D7 compatibility):
- add an option to skip varspez during parameters comparison
  - skip varspez comparison when searching a property reader candidate if $VARPROPSETTER is ON

git-svn-id: trunk@15020 -
2010-03-17 09:56:50 +00:00
Jonas Maebe
45d25bbe77 * fixed storing/loading widestring constant nodes into/from ppu files
(mantis #15909)
  * fixed storing/loading widestring constants into/from token streams
  * made storing/loading widestring constant nodes into/from ppu files
    endian safe

git-svn-id: trunk@15017 -
2010-03-14 13:27:00 +00:00
marco
8529d66523 * unzipper unit basic extraction test. (related to mantis 15836)
git-svn-id: trunk@15015 -
2010-03-14 11:41:54 +00:00
Jonas Maebe
171c0289b0 + tests from mantis #15777
git-svn-id: trunk@15013 -
2010-03-14 11:03:09 +00:00
Jonas Maebe
0cfc6e1cac + support for "univ" in macpas mode: a parameter modifier that allows
passing any value to that parameter which has the same size as the
    parameter (it basically acts as if there is an explicit type conversion
    to the parameter type around the value at the caller side). If a procvar
    has an univ parameter, all procvars whose corresponding parameter
    has the same size as that univ parameter are similarly compatible.

    This transparent compatibility can however cause crashes in case of
    of the procvars when one of the types is passed on the stack and the
    other isn't (because then the called routine will a) load the parameter
    from a wrong location and b) pop the wrong amount off of the stack at
    then end). Therefore FPC will warn in most cases where this can happen.
    (mantis #15777)

git-svn-id: trunk@15010 -
2010-03-13 22:13:20 +00:00
michael
f39e9ba873 * Test unit for testing purposes
git-svn-id: trunk@15009 -
2010-03-13 16:04:19 +00:00
paul
949290e62f fcl-res: support tlb resources
git-svn-id: trunk@15001 -
2010-03-11 03:00:41 +00:00
Jonas Maebe
88f5addd1c * do not typecheck statements before checking whether they are valid,
because the associated simplifications can turn invalid statements
    into valid statements (based on patch by Aleksa Todorovic, mantis
    #15594)

git-svn-id: trunk@14998 -
2010-03-09 21:13:22 +00:00
marco
18cef789c6 * regenned makefile for Loesje
git-svn-id: trunk@14955 -
2010-02-28 16:11:01 +00:00
florian
e9c95ea46f + NvApi package for win32 and win64 by Dmitry Boyarintsev, resolves #15771
git-svn-id: trunk@14951 -
2010-02-28 09:56:36 +00:00
paul
8d7312f87b rtl: use CreateVCLComObject routing to create VCLComObject in case it is not assigned + test
git-svn-id: trunk@14948 -
2010-02-27 08:49:50 +00:00
paul
f607b7bdd5 tests: add SafeCallException test
git-svn-id: trunk@14941 -
2010-02-26 10:28:19 +00:00
Jonas Maebe
fe5d0b0ef4 * fixed internalerror in case of dereferencing a loc_(c)subsetreg/ref
(mantis #15812)

git-svn-id: trunk@14925 -
2010-02-19 16:26:36 +00:00
Jonas Maebe
78b9820e11 * support record fields separated by commas instead of semicolons in typed
constant record definitions in MacPas mode (patch by Adriaan van Os,
    mantis #15764)

git-svn-id: trunk@14915 -
2010-02-14 14:33:30 +00:00
Jonas Maebe
025ec34e4d + "CExtended" type that is the same as "extended", but conforming to the
properties/behaviour of the equivalent of Extended in C (i.e., to
    "long double" on i386 and x86_64 platforms that support a 10 byte
    long double, and to "double" elsewhere)

git-svn-id: trunk@14912 -
2010-02-14 13:45:58 +00:00
Jonas Maebe
674cdaf3fc * handle fields with the same name as a type also correctly in case of
nested records (mantis #15592)

git-svn-id: trunk@14910 -
2010-02-13 20:51:19 +00:00
Jonas Maebe
85984c2d8f * insert proper type conversions when optimising logical operations and
compares by avoiding unnecessary sign extensions (fixes bug reported in
    http://lists.freepascal.org/lists/fpc-pascal/2010-January/023907.html )
  * never throw away int2int type conversions on bitpacked loads, because
    in these cases the proper bits still need to be selected

git-svn-id: trunk@14892 -
2010-02-12 18:13:08 +00:00
florian
092153e7ad * handle unrolling of for ... downto ... correctly, resolves #15668
git-svn-id: trunk@14884 -
2010-02-10 21:08:54 +00:00
Jonas Maebe
6b0a0c149b * don't perform a range check in Delphi mode when passing a cardinal as
vtInteger to an array-of-const parameter (mantis #15727)

git-svn-id: trunk@14882 -
2010-02-10 16:35:37 +00:00
Jonas Maebe
d60e1f674c * automatically try to call procvars that are subscripted or used in a
with-statement, both in FPC and TP/Delphi modes (mantis #15728)

git-svn-id: trunk@14881 -
2010-02-10 16:12:18 +00:00
florian
c459100773 + basic info program
git-svn-id: trunk@14878 -
2010-02-07 22:56:05 +00:00
florian
0c153a46df * math.power/intpower(0,0) return 1, this is as recommended in IEEE 754
as well as compatible with other programming languages and delphi

git-svn-id: trunk@14873 -
2010-02-06 23:10:03 +00:00
Jonas Maebe
89110baab8 * don't modify the flags while simplifying PIC memory references
(mantis #15694)

git-svn-id: trunk@14871 -
2010-02-06 20:18:36 +00:00
Jonas Maebe
b1d2ab5450 * tobject.inheritsfrom(nil) has to return false (mantis #15690)
git-svn-id: trunk@14870 -
2010-02-06 18:14:26 +00:00
Jonas Maebe
870edaf916 * tobject.unitname and tobject.tostring have to return an ansistring instead
of a shortstring (mantis #15693)
  * changed tobject5 so it checks whether the return values are correct

git-svn-id: trunk@14869 -
2010-02-06 17:53:49 +00:00
michael
7096ee6bfa * Regenerated
git-svn-id: trunk@14863 -
2010-02-04 20:31:49 +00:00