Martin Carlberg
c979a69e6b
Fixed: Compiler can now handle only @action/IBAction declared return type when checking for 'Conflicting return type' method declaration.
...
Also made the warning message point to correct return type token when type is not declared.
2013-08-28 11:23:55 +02:00
Martin Carlberg
0e4ad998d8
Fixed: Remove all protocols in objj_resetRegisterClasses
2013-08-22 16:54:19 +02:00
Martin Carlberg
9eebb0a64b
Fixed: Pass correct node to error message when finding duplicated protocol
2013-08-22 16:53:22 +02:00
Martin Carlberg
0afe21dd29
Fixed: Copy method descriptions to an array instead of JSObject
2013-08-22 12:37:29 +02:00
Martin Carlberg
cfc682c165
Fixed: Protocol methods is now registered in the correct place
2013-08-22 12:36:29 +02:00
Martin Carlberg
c326168e83
Fixed: Protocol definition in compiler was not created correct from protocol definition in the runtime
2013-08-22 12:35:16 +02:00
Martin Carlberg
b8b96a17d7
Fixed: Check if global function exists in correct way
2013-08-22 12:34:14 +02:00
Aparajita Fishman
fa86c54fff
Fixed: missing semicolon.
2013-08-15 10:21:45 -04:00
Martin Carlberg
0b75876283
Fixed: Moved incorrect positioned parenthesis to handle '@required' token
2013-08-12 22:44:35 +02:00
Martin Carlberg
beec0c5293
Fixed: Handle '@required' before any method declarations
2013-08-12 22:43:03 +02:00
Martin Carlberg
672ed6ed0c
Fixed: Handle protocol declaration with no method declarations
2013-08-12 22:41:36 +02:00
Martin Carlberg
f74312dc42
Fixed: Allow type on return or parameter type to be a class if superclass or protocol declared it as 'id'
2013-08-12 16:55:35 +02:00
Martin Carlberg
2e216d7e9a
Fixed: Make default return type to 'void' for '@action' or 'IBAction' marked method.
2013-08-12 16:53:19 +02:00
Martin Carlberg
29d7833fcb
Fixed: Renamed local variable that used reserved variable name ('arguments')
2013-08-12 16:52:07 +02:00
Martin Carlberg
4eba639c73
Fixed: Allow some tokens to be identifiers
2013-08-12 16:50:34 +02:00
Martin Carlberg
361f421816
Fixed: Added 'id' as a token and enforce that protocol can only follow 'id' as a Objective-J type
2013-08-12 16:49:39 +02:00
Martin Carlberg
7c2c2a3114
Fixed: Allow protocols in interface declaration
2013-08-12 09:40:20 +02:00
Martin Carlberg
d38125db13
New: Added Objective-J protocol support
...
The Objective-J parser and compiler now handles protocol syntax. The Objective-J runtime has new functions to handle protocols. The method 'conformsToProtocol:' has been added to CPObject as an instance and a class method.
2013-08-09 19:02:45 +02:00
Aparajita Fishman
86e5c15e3c
Formatting, optimizations.
2013-08-09 08:28:37 -04:00
Aparajita Fishman
3c9435ed21
Fixed: FileRequest was broken under CommonJS.
...
The progress event was being used even under CommonJS, which broke file loading and thus jake deploy.
2013-08-02 19:05:57 -04:00
Aparajita Fishman
4221acf3fd
New: added support for continuous load progress notification.
...
Previously, Cappuccino only called OBJJ_PROGRESS_CALLBACK when an executable or image sprite file was finished loading. Only a slow connection, this would result in long periods with no visible progress.
Now OBJJ_PROGRESS_CALLBACK is called continuously during download via the XHR progress event. All supported browsers except IE 9 support this event.
2013-08-02 17:33:59 -04:00
Alexander Ljungberg
d3a44cbc63
New: objj_getClassList().
...
This function obtains the list of registered classes at the time its called.
2013-06-13 18:18:13 +01:00
Aparajita Fishman
50d3bfd456
Fixed: Frameworks/Source directory was being copied to Build
2013-06-01 15:48:02 -04:00
Martin Carlberg
595736b8c6
Fixed: When selector is only a ':' in a send message statement the new compiler crashed.
...
The program below crashed on the last line with a 'null is not an object' error message. Also added a test case.
@implementation MyObject {
- (int):(int)a {
return a;
}
@end
var a = [[MyObject alloc] init];
var b = [a:3];
2013-05-30 14:39:58 +02:00
Martin Carlberg
ee4112b7f1
Fixed: Removed double spaces before '@ref' and '@selector' generated output from compiler.
...
'@ref' is generated to ' function(__input…' with the starting space if, for example, the code is 'return(@ref(a))'. This will create a space between 'return' and 'function(__input…'. When the compiler is generate the code this is not necessary.
2013-05-22 10:34:46 +02:00
Martin Carlberg
1d896c6ac9
Fixed: Code generator didn't generate ';' for empty loops
...
The line 'while (count--);' was generated to 'while (count--)'. The same with 'for(;;);' and 'for (a in []);'
2013-05-22 10:27:01 +02:00
Aparajita Fishman
6bac934d0c
Fixed: changed indentation of generated code to Cappuccino standard of 4 spaces.
2013-05-18 18:42:26 -04:00
Alexander Ljungberg
501310c058
Formatting: OldBrowserCompatibility.js.
...
Refs #1929 .
2013-05-16 15:24:24 -07:00
Martin Carlberg
b3e6eb74b2
Fixed: Reset all the macros when compiling a new file in the default implementation of the macro store.
2013-05-16 12:07:44 +02:00
Martin Carlberg
8145df9613
Fixed: Removed all uses of preprocess macros in the compiler
2013-05-13 16:23:12 +02:00
Martin Carlberg
ee9b04944a
Merge branch 'master' of https://github.com/cappuccino/cappuccino into preprocess
2013-05-06 16:24:54 +02:00
Martin Carlberg
e9ca7c7395
Fixed: IE8 Browser support.
...
The compiler can now run in IE8. Also found the use of the function .indexOf on Arrays in CPView.j.
It is not supported in IE8.
Added a new file (OldBrowserCompatibility.js) in the Objective-J framework that will add functions if they are not supported in the javascript runtime.
2013-05-06 16:17:09 +02:00
Martin Carlberg
14ee789df4
Fixed: Mark correct column position in 'Expected a Semicolon' errors in the parser.
2013-04-24 10:12:42 +02:00
Martin Carlberg
b6fd6a15f0
Fixed: Removed extra spaces in code generation between 'else' and 'if' in 'else if' statements
2013-04-23 17:07:26 +02:00
Martin Carlberg
e35bfaf96c
Fixed: Better looking code generation with correct indentation for 'if' - 'else if' statements
2013-04-23 15:48:25 +02:00
Aparajita Fishman
7ec660c509
New: record the source filename in SyntaxError.
2013-04-20 13:24:50 -04:00
Martin Carlberg
689ab09555
New: Now supports 'defined' operator, which lets you check whether macros are defined in the middle of an ‘#if’.
...
Also the evaluation of expressions are now lazy.
2013-04-11 09:37:40 +02:00
Martin Carlberg
30ee1ad8cd
New: Handles line continue token '\' on lines starting with '#'
...
We now support lines like this:
#define StopButtonTitle() \
CPLocalizedString(@"Stop", @"Stop button title")
2013-04-11 09:32:41 +02:00
Aparajita Fishman
cc2503ac0f
Fixed: CFBundle.prototype.bundleURL() did not return an absolute URL.
...
CFBundle internally stores its URL in relative form, and returned that relative URL in the bundleURL() function. However, in Cocoa an absolute URL is returned. It is reasonable to assume an absolute URL would be expected by some asking for the bundle's URL. Even within CFBundle, most times bundleURL() is called it is followed with absoluteURL().
This commit returns an absolute URL from bundleURL().
2013-04-06 15:51:09 -04:00
Aparajita Fishman
486bff44df
Fixed: wrong display name for CFBundle.bundleContainingURL.
2013-04-06 15:48:41 -04:00
Aparajita Fishman
a3730812bc
New: CFBundle.identifier, CFBundle.bundleWithIdentifier, CPBundle -bundleWithIdentifier.
...
Finding a bundle by identifier is theoretically better than using a class.
2013-04-05 23:16:05 -04:00
Martin Carlberg
84df301f3e
New: #if macro statement works for simple literals but not for macro identifiers and defined keyword
2013-03-28 22:43:26 +01:00
Martin Carlberg
2751f4fea9
New: Added missed #ifdef derective
2013-03-27 14:52:05 +01:00
Martin Carlberg
c21cfeb28e
New: Added #ifdef, #ifndef, #else, #endif and #undef macro derectives
2013-03-27 14:50:55 +01:00
Martin Carlberg
8707247008
New: Always generate code when compiling
2013-03-27 14:45:25 +01:00
Martin Carlberg
89457845f9
Fixed: Made some smaller code generation changes to get better formatted compiled code
2013-03-21 14:32:21 +01:00
Martin Carlberg
1842d7127a
New: The generated code will now have correct indentation.
2013-03-21 11:33:13 +01:00
Martin Carlberg
ecc1e774b9
New: Added macro/identifier concatenation with the '##' operator
...
Example:
#define first Martin
#define second Carlberg
var first##second = 13;
Compiles to:
var MartinCarlberg = 13;
Example 2:
#define _function(inline) function inline { return _##inline; }
#define _CGPointMake(x_, y_) { x:x_, y:y_ }
_function(CGPointMake(x, y))
Compiles to:
function CGPointMake (x, y) {
return {x: x, y: y};
}
2013-03-20 21:00:36 +01:00
Martin Carlberg
fa18095538
Fixed: Does not add extra parentheses for expression operators with the same precedence
2013-03-20 20:47:27 +01:00
Martin Carlberg
92ac8569b3
New: Full support for generate code instead of copy
...
The new compiler can now generate code. The old way of copy and alter the source
code is still supported.
2013-03-17 21:00:24 +01:00