- 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 -
because the associated simplifications can turn invalid statements
into valid statements (based on patch by Aleksa Todorovic, mantis
#15594)
git-svn-id: trunk@14998 -
- fix arguments description if the first argument is empty
- fix restype field value (describes result value type in variant types)
git-svn-id: trunk@14790 -
- implement class properties: properties which can access only static fields and static class methods
- tests
- fix a possibility to call an instance method from the class method
git-svn-id: trunk@14585 -
also return regular objcclass methods before, because these are also
registered under class helper procsyms for future id.anymethod support
* give an error when calling an inherited method from an objccategory
method, if that is not declared in the parent of the extended class
(since calling inherited in an objccategory method is the same as
calling inherited in a method of the extended class; if a method is
replaced, calling inherited will *not* call the original method
from the original class)
git-svn-id: trunk@14213 -
rtl: add enumerators to the basic classes
tests: add enumerators test which compiles and work both by fpc and dcc
compiler:
+ start for-in loop implementation: implement for-in loop for types (enumerations and ranges), strings, arrays and sets. todo: perform type checking, optimize array and string loops - use temp for expression, implement for-in loop for classes
test:
+ add a simple test for the 'for-in' loop
compiler: fix string for-in loop. now it uses a temp variable to store string expression result
complier: fix for-in array loop. use a temp variable for the loop expression only if loop is not an open array loop
complier: continue enumerator implementation:
+ add operator enumerator which give an ability to add enumerator for an existent type (for example to override builtin string enumerator)
+ add class enumerator support via delphi compatible GetEnumerator method + enumerator class/object template (function MoveNext: Boolean; property Current)
+ tests
compiler: fix for-in loop for arrays. delphi does not copy arrays to a temp variable and it is possible to change array during loop. + test
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: enumerator directive support:
+ allow to mark methods and properties by 'enumerator MoveNext' and 'enumerator Current' modifiers. Parser checks return types and duplicates.
+ prefer *marked* by enumerator directive methods and properties than GetEnumerator and Current builtin symbols
+ increase ppu version
+ test
rtl: add IEnumerator and IEnumerable interfaces declarations
tests: for-in loop tests:
+ add small comment at the top of test program
compiler: allow 'enumerator MoveNext' for the interface function declaration + test
compiler: move all for-in loop helpers to the nflw unit
compiler: don't allow the compiler to choose the non-valid enumerator operator for the for-in loop
git-svn-id: trunk@14008 -
- compiler: allow message after the *deprecated* keyword
- compiler: raise an internal error if deprecated message is trying to set to a non clear string pointer
git-svn-id: trunk@13997 -
change, resulting in slightly different DWARF debug information
(mantis #13508)
The cause was saving a node pointer in a local variable, processing
it further, and later on checking whether it changed by comparing
the stored and the current instance pointer. The problem was that
the node could have been freed and reallocated at the same address
(but with different contents), so this check sometimes resulted
in (hard to reproduce) false negatives.
git-svn-id: trunk@13580 -
associated with an Objective-C protocol. Code generator part will
always generate an internalerror currently, because it cannot yet
be implemented (needs support for generating RTTI for Objective-C
classes)
git-svn-id: branches/objc@13461 -
starting with a previous 2.3.1 or compiler built from the objc branch
+ added basic objcprotocol support (only for external protocols
currently)
o use in type declaration: "type xp = objcprotocol ... end;"
o when defining a root class that implements it:
"type yc = objcclass(xp) ... end" (note: no support yet
for something like "objcclass(id,xp)" or so)
o when defining a non-root class that implements a protocol:
"type zc = objcclass(nsobject,xp) ... end"
o includes support for "required" and "optional" sections
o no support yet for the objcprotocol(<protocol>) expression
that enables getting a class instance representing the
protocol (e.g., for use with "conformsToProtocol:")
o message names have to specified in protocol declarations,
but if an objcclass implements a protocol, the message names do
not have to be repeated (but if they are, they have to match;
the same goes when overriding inherited methods)
+ allow specifying the external name of Objective-C classes and
protocols, since classes and protocols can have the same name
(and you cannot use the same Pascal identifier in such caseq)
+ added NSObject protocol, and make the NSObject class use it
+ added missing NSObject class methods that have the same name
as instance methods (added "class" name prefix to avoid clashes)
* fixed several cases where the compiler did not treat Objective-C
classes/protocols the same as Object Pascal classes/interfaces
(a.o., forward declarations, alignment, regvars, several type
conversions, ...)
* allow "override" directive in objcclass declarations, and print
a hint if it's forgotten in an external declaration (because it
doesn't really matter there, and may make automated header
conversion harder than necessary) and an error if will be used in
a non-external declaration (because it is not possible to start
a new vmt entry-tree in Objective-C, you can only override parent
methods)
* reject objcclasses/protocols as parameters to typeof()
* don't try to test VMT validity of objcclasses/protocols
git-svn-id: branches/objc@13375 -
the use of Objective-C 1.0 constructs. Because it is a mode switch, it
can be used cumulatively with every syntax mode. Note that a {$mode xxx}
statement resets all mode switches as well, so you cannot use the
-Mobjectivec1 variant if you have such a statement in a unit. This
modeswitch is currently only enabled for Darwin/PowerPC and Darwin/i386,
as the backend support is not yet implemented for other platforms.
+ implemented selector() statement that can be used to create an Objective-C
selector for the message with the specified *constant* name (in the future,
it will also work for Objective-C method identifiers)
+ added SEL type to the system unit (the selector() statement returns it)
+ added all Objective-C segments to the assembler writers
+ (currently mostly dummy) objc1 unit that is automatically included if the
{$modeswitch objectivec1} statement is used
+ some tests for the selector() statement
git-svn-id: trunk@12870 -
context of a class. This can be either the class declaration or
a method implementation
* replaced all current_procinfo.procdef._class with current_objectdef
git-svn-id: trunk@12059 -