Skip to content

Commit

Permalink
Merge pull request #82 from ksjogo/three
Browse files Browse the repository at this point in the history
update libffi to current submodule and more 64-bit fixes
  • Loading branch information
timburks committed Apr 13, 2017
2 parents 9806965 + 56d2f79 commit c32f271
Show file tree
Hide file tree
Showing 46 changed files with 659 additions and 3,357 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ Nu.framework
libNu.a
examples/*/*.app
xcuserdata
*.xcscmblueprint
4 changes: 4 additions & 0 deletions .gitmodules
@@ -0,0 +1,4 @@
[submodule "libffi"]
path = libffi
url = https://github.com/ksjogo/libffi.git
branch = master
2 changes: 1 addition & 1 deletion Xcode/Info.plist
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>nu.programming.framework</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
411 changes: 301 additions & 110 deletions Xcode/Nu.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Xcode/NuApp/NuApp-Info.plist
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.radtastical.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -26,6 +26,8 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
36 changes: 31 additions & 5 deletions Xcode/NuApp/NuAppDelegate.m
Expand Up @@ -9,17 +9,29 @@
#import "NuAppDelegate.h"

#import "Nu.h"
#import "NuBlock.h"
#import "NuBridgedBlock.h"

#import <UIKit/UIKit.h>

@class ViewController;

@implementation NuAppDelegate
@synthesize window;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.window.backgroundColor = [UIColor greenColor];
self.window.rootViewController = [[UIViewController alloc] init];
CGRect frame = [[UIScreen mainScreen] bounds];
self.window = [[[UIWindow alloc] initWithFrame:frame] autorelease];
[self.window makeKeyAndVisible];

UIViewController *viewController = [[UIViewController alloc] init];
self.window.rootViewController = viewController;
UIView *view = [[UIView alloc] initWithFrame:frame];
viewController.view = view;
UILabel *label = [[UILabel alloc] initWithFrame:frame];
label.textAlignment = NSTextAlignmentCenter;
[view addSubview:label];

NuInit();

[[Nu sharedParser] parseEval:@"(load \"nu\")"];
Expand All @@ -45,7 +57,21 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}
[regex release];
NSLog(@"running tests");
[[Nu sharedParser] parseEval:@"(NuTestCase runAllTests)"];
int failures = [[[Nu sharedParser] parseEval:@"(NuTestCase runAllTests)"] intValue];

NSString* script = @"(do () (puts \"cBlock Work!\"))";
id parsed = [[Nu sharedParser] parse:script];
NuBlock* block = [[Nu sharedParser] eval:parsed];
void (^cblock)() = [NuBridgedBlock cBlockWithNuBlock:block signature:@"v"];
cblock();

if (failures == 0) {
view.backgroundColor = [UIColor greenColor];
label.text = @"Everything Nu!";
} else {
view.backgroundColor = [UIColor redColor];
label.text = [NSString stringWithFormat:@"%d failures!",failures];
}
NSLog(@"ok");
return YES;
}
Expand Down
1 change: 1 addition & 0 deletions libffi
Submodule libffi added at 7d504f
21 changes: 0 additions & 21 deletions libffi/LICENSE

This file was deleted.

28 changes: 0 additions & 28 deletions libffi/README.markdown

This file was deleted.

0 comments on commit c32f271

Please sign in to comment.