Permalink
Browse files

moved Xcode project to Xcode directory, disabled some tests that are …

…broken for iOS simulator-only.

oddly, these tests pass on the device.
  • Loading branch information...
1 parent fcdabbe commit 54a155640f5e6cc0ec76c105e73e158d5c7462ef @timburks timburks committed Jun 21, 2011
Showing with 1,406 additions and 1,484 deletions.
  1. +0 −1,260 MacOS/Nu-framework/Nu.xcodeproj/project.pbxproj
  2. +0 −1 MacOS/Nu-framework/test
  3. +0 −95 Rakefile.deprecated
  4. 0 {MacOS/Nu-framework → Xcode}/English.lproj/InfoPlist.strings
  5. 0 {MacOS/Nu-framework → Xcode}/Info.plist
  6. +1,290 −0 Xcode/Nu.xcodeproj/project.pbxproj
  7. 0 {MacOS/Nu-framework → Xcode}/Nu.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  8. 0 ...→ Xcode}/Nu.xcodeproj/project.xcworkspace/xcuserdata/tim.xcuserdatad/WorkspaceSettings.xcsettings
  9. 0 {MacOS/Nu-framework → Xcode}/Nu.xcodeproj/tim.mode1v3
  10. 0 {MacOS/Nu-framework → Xcode}/Nu.xcodeproj/tim.pbxuser
  11. +2 −5 {MacOS/Nu-framework → Xcode}/Nu.xcodeproj/xcuserdata/tim.xcuserdatad/xcschemes/Nu.xcscheme
  12. 0 {MacOS/Nu-framework → Xcode}/Nu.xcodeproj/xcuserdata/tim.xcuserdatad/xcschemes/NuApp.xcscheme
  13. +3 −7 {MacOS/Nu-framework → Xcode}/Nu.xcodeproj/xcuserdata/tim.xcuserdatad/xcschemes/nush.xcscheme
  14. +3 −3 .../Nu-framework → Xcode}/Nu.xcodeproj/xcuserdata/tim.xcuserdatad/xcschemes/xcschememanagement.plist
  15. 0 {MacOS/Nu-framework → Xcode}/NuApp/NuApp-Info.plist
  16. 0 {MacOS/Nu-framework → Xcode}/NuApp/NuApp-Prefix.pch
  17. 0 {MacOS/Nu-framework → Xcode}/NuApp/NuAppDelegate.h
  18. 0 {MacOS/Nu-framework → Xcode}/NuApp/NuAppDelegate.m
  19. 0 {MacOS/Nu-framework → Xcode}/NuApp/en.lproj/InfoPlist.strings
  20. 0 {MacOS/Nu-framework → Xcode}/NuApp/main.m
  21. 0 {MacOS/Nu-framework → Xcode}/Nu_Prefix.pch
  22. +0 −1 nu/beautify.nu
  23. +0 −3 nu/help.nu
  24. +2 −1 objc/NuBlock.h
  25. +16 −23 objc/NuOperator.m
  26. +1 −1 objc/NuReference.h
  27. +32 −30 test/test_exceptions.nu
  28. +57 −54 test/test_match.nu

Large diffs are not rendered by default.

Oops, something went wrong.
View
View
@@ -1,95 +0,0 @@
-#
-# This Rakefile is used to bootstrap Nu.
-# Use it to build "mininush", a simpler and statically-linked
-# version of nush, the Nu shell.
-#
-# THIS FILE IS DEPRECATED. PLEASE USE make AND THE INCLUDED Makefile instead.
-#
-require 'rake'
-require 'rake/clean'
-
-SYSTEM = `uname`.chomp
-
-PREFIX = ENV['PREFIX'] || '/usr/local'
-
-@frameworks = []
-@inc_dirs = %w{./include}
-@libs = %w{objc ffi pcre}
-@lib_dirs = []
-
-if SYSTEM == 'Darwin'
- @frameworks << 'Cocoa'
- @libs += %w{edit}
-else
- @libs += %w{readline m}
-end
-
-@inc_dirs << "#{PREFIX}/include" if File.exist? "#{PREFIX}/include"
-@lib_dirs << "#{PREFIX}/lib" if File.exists? "#{PREFIX}/lib"
-
-if SYSTEM == 'Darwin'
- if File.exist? '/usr/lib/libffi.dylib'
- # Use the libffi that ships with OS X.
- @inc_dirs << '/usr/include/ffi'
- else
- # Use the libffi that is distributed with Nu.
- @inc_dirs << './libffi/include'
- @lib_dirs << './libffi'
- end
-end
-
-PCRE_CONFIG = `which pcre-config 2>/dev/null`.chomp
-if PCRE_CONFIG
- prefix = `#{PCRE_CONFIG} --prefix`.chomp
- @inc_dirs << "#{prefix}/include"
- @lib_dirs << "#{prefix}/lib"
-end
-
-@leopard_cflags = ''
-if File.exists? '/Developer/SDKs/MacOSX10.5.sdk'
- @leopard_cflags = '-DLEOPARD_OBJC2'
-end
-
-CLEAN.include('*/*.o')
-CLOBBER.include('mininush')
-
-@c_files = FileList['objc/*.c']
-@objc_files = FileList['objc/*.m'] + FileList['main/*.m']
-@gcc_files = @objc_files + @c_files
-@gcc_objects = @gcc_files.sub(/\.c$/, '.o').sub(/\.m$/, '.o')
-
-@cc = "gcc"
-if SYSTEM == "Darwin"
- @cflags = "-g -O2 -Wall -DMACOSX -DDARWIN -DMININUSH -std=gnu99 #{@leopard_cflags}"
- @mflags = "-fobjc-exceptions"
-else
- @cflags = "-g -O2 -Wall -DLINUX -DMININUSH -std=gnu99 #{@leopard_cflags}"
- # @mflags = "-fobjc-exceptions -fconstant-string-class=NSConstantString"
- @mflags = `gnustep-config --objc-flags`.chomp
-end
-
-@cflags += @inc_dirs.map {|inc| " -I#{inc}"}.join
-@ldflags = @frameworks.map {|framework| " -framework #{framework}"}.join
-@ldflags += @libs.map {|lib| " -l#{lib}"}.join
-@ldflags += @lib_dirs.map {|libdir| " -L#{libdir}"}.join
-if SYSTEM == "Linux"
- # @ldflags += " -lobjc -lNuFound"
- @ldflags += " "
- @ldflags += `gnustep-config --base-libs`.chomp
- @ldflags += " -Wl,--rpath -Wl,/usr/local/lib"
-end
-
-rule ".o" => [".m"] do |t|
- sh "#{@cc} #{@cflags} #{@mflags} -c -o #{t.name} #{t.source}"
-end
-
-rule ".o" => [".c"] do |t|
- sh "#{@cc} #{@cflags} -c -o #{t.name} #{t.source}"
-end
-
-file "mininush" => @gcc_objects do
- sh "gcc #{@gcc_objects} -g -O2 -o mininush #{@ldflags}"
-end
-
-task :default => "mininush"
-
File renamed without changes.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -32,17 +32,14 @@
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
- displayScaleIsEnabled = "NO"
- displayScale = "1.00"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug">
+ buildConfiguration = "Debug"
+ enablesOpenGLESFrameCapture = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
- displayScaleIsEnabled = "NO"
- displayScale = "1.00"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- version = "1.8">
+ version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@@ -30,10 +30,8 @@
</Testables>
</TestAction>
<LaunchAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- displayScaleIsEnabled = "NO"
- displayScale = "1.00"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "YES"
customWorkingDirectory = "/Volumes/Users/tim/Desktop/Repositories/nu"
@@ -58,8 +56,6 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
- displayScaleIsEnabled = "NO"
- displayScale = "1.00"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
@@ -7,17 +7,17 @@
<key>Nu.xcscheme</key>
<dict>
<key>orderHint</key>
- <integer>0</integer>
+ <integer>4</integer>
</dict>
<key>NuApp.xcscheme</key>
<dict>
<key>orderHint</key>
- <integer>2</integer>
+ <integer>1</integer>
</dict>
<key>nush.xcscheme</key>
<dict>
<key>orderHint</key>
- <integer>1</integer>
+ <integer>3</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
File renamed without changes.
File renamed without changes.
View
@@ -42,7 +42,6 @@
;; @abstract A Nu code beautifier.
;; @discussion This class is used by nubile, the standalone Nu code beautifier, to automatically indent Nu code.
(class NuBeautifier is NSObject
- (ivars)
(+ (id) beautify:(id) text is
(set b ((NuBeautifier alloc) init))
View
@@ -216,9 +216,6 @@ The string is not followed by a carriage return.END)
(class-help Nu_load_operator <<-END
This operator loads a file or bundle.END)
-(class-help Nu_beep_operator <<-END
-This operator causes the system to beep.END)
-
(class-help Nu_class_operator <<-END
This operator defines or extends a class.
If a subclass is specified, presumably a new
View
@@ -38,7 +38,8 @@
The Nu <b>macro</b> operator uses blocks to create macros.
Since macros evaluate in their callers' contexts, no context information is kept for blocks used to create macros.
- The <b>imethod</b> and <b>cmethod</b> operators use blocks to create new method implementations.
+ When used in a class context, the <b>-</b> and <b>+</b> operators
+ use blocks to create new method implementations.
When a block is called as a method implementation, its context includes the symbols
<b>self</b> and <b>super</b>. This allows method implementations to send messages to
the owning object and its superclass.
View
@@ -34,6 +34,9 @@
#ifndef IPHONE
#include <readline/readline.h>
#endif
+#ifdef IPHONE
+#include <UIKit/UIKit.h>
+#endif
#include <stdlib.h>
#include <unistd.h>
@@ -1784,8 +1787,8 @@ - (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)context
cursor = [cursor cdr];
NSString *signature = signature_for_identifier(variableType, symbolTable);
nu_class_addInstanceVariable_withSignature(classToExtend,
- [[variableName stringValue] cStringUsingEncoding:NSUTF8StringEncoding],
- [signature cStringUsingEncoding:NSUTF8StringEncoding]);
+ [[variableName stringValue] cStringUsingEncoding:NSUTF8StringEncoding],
+ [signature cStringUsingEncoding:NSUTF8StringEncoding]);
//NSLog(@"adding ivar %@ with signature %@", [variableName stringValue], signature);
}
return Nu__null;
@@ -1817,22 +1820,6 @@ - (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)context
@end
-#if !defined(IPHONE)
-#import <Cocoa/Cocoa.h>
-
-@interface Nu_beep_operator : NuOperator {}
-@end
-
-@implementation Nu_beep_operator
-- (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)context
-{
- NSBeep();
- return Nu__null;
-}
-
-@end
-#endif
-
@interface Nu_system_operator : NuOperator {}
@end
@@ -1890,11 +1877,20 @@ @interface Nu_uname_operator : NuOperator {}
@implementation Nu_uname_operator
- (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)context
{
+ if (!cdr || (cdr == Nu__null)) {
#ifdef IPHONE
- return @"iOS";
+ return @"iOS";
#else
- return @"Darwin";
+ return @"Darwin";
#endif
+ }
+ if ([[[cdr car] stringValue] isEqualToString:@"systemName"]) {
+#ifdef IPHONE
+ return [[UIDevice currentDevice] systemName];
+#else
+ return @"Macintosh";
+#endif
+ }
}
@end
@@ -2205,9 +2201,6 @@ void load_builtins(NuSymbolTable *symbolTable)
install("let", Nu_let_operator);
install("load", Nu_load_operator);
-#if !defined(IPHONE)
- install("beep", Nu_beep_operator);
-#endif
install("uname", Nu_uname_operator);
install("system", Nu_system_operator);
View
@@ -27,7 +27,7 @@
<div style="margin-left:2em">
<code>
- (imethod (id) save is<br/>
+ (- (id) save is<br/>
&nbsp;&nbsp;(set perror ((NuReference alloc) init))<br/>
&nbsp;&nbsp;(set result ((self managedObjectContext) save:perror))<br/>
&nbsp;&nbsp;(unless result<br/>
View
@@ -5,37 +5,39 @@
(class TestExceptions is NuTestCase
- (- (id) testRangeException is
- (set name nil)
- (set before nil)
- (set after nil)
- (set z nil)
- (try
- (set before "this should always be set")
- ((NSArray array) objectAtIndex:1)
- (set after "this should never be set")
- (catch (exception) (set name (exception name)))
- (finally (set z 99)))
- (assert_equal "this should always be set" before)
- (assert_equal nil after)
- (assert_equal "NSRangeException" name)
- (assert_equal 99 z))
+ (if (eq (uname) "Darwin") ;; broken for iOS simulator-only
+ (- (id) testRangeException is
+ (set name nil)
+ (set before nil)
+ (set after nil)
+ (set z nil)
+ (try
+ (set before "this should always be set")
+ ((NSArray array) objectAtIndex:1)
+ (set after "this should never be set")
+ (catch (exception) (set name (exception name)))
+ (finally (set z 99)))
+ (assert_equal "this should always be set" before)
+ (assert_equal nil after)
+ (assert_equal "NSRangeException" name)
+ (assert_equal 99 z)))
- (- (id) testUserRaisedException is
- (set name nil)
- (set before nil)
- (set after nil)
- (set z nil)
- (try
- (set before "this should always be set")
- (((NSException alloc) initWithName:"UserException" reason:"" userInfo:nil) raise)
- (set after "this should never be set")
- (catch (exception) (set name (exception name)))
- (finally (set z 99)))
- (assert_equal "this should always be set" before)
- (assert_equal nil after)
- (assert_equal "UserException" name)
- (assert_equal 99 z))
+ (if (eq (uname) "Darwin") ;; broken for iOS simulator-only
+ (- (id) testUserRaisedException is
+ (set name nil)
+ (set before nil)
+ (set after nil)
+ (set z nil)
+ (try
+ (set before "this should always be set")
+ (((NSException alloc) initWithName:"UserException" reason:"" userInfo:nil) raise)
+ (set after "this should never be set")
+ (catch (exception) (set name (exception name)))
+ (finally (set z 99)))
+ (assert_equal "this should always be set" before)
+ (assert_equal nil after)
+ (assert_equal "UserException" name)
+ (assert_equal 99 z)))
(- (id) testUserThrownException is
(set name nil)
Oops, something went wrong.

0 comments on commit 54a1556

Please sign in to comment.