GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: The Nu programming language.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nu.git
removed nuke dependencies to fix mininush build
jsallis (author)
Mon Sep 01 21:47:35 -0700 2008
commit  9fd560a08635861a0a5c171823b1fa91e6f05fbf
tree    d3daf4792157052105b64c8e8c5d77fd090e89ec
parent  a01b63edfe38fa6500cf352856e43895b4955991
...
17
18
19
20
21
22
23
24
25
...
777
778
779
780
 
781
782
783
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784
785
786
...
809
810
811
812
813
814
815
816
817
 
 
 
 
 
 
818
819
820
...
17
18
19
 
 
 
20
21
22
...
774
775
776
 
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
...
825
826
827
 
 
 
 
 
 
828
829
830
831
832
833
834
835
836
0
@@ -17,9 +17,6 @@
0
 # See the License for the specific language governing permissions and
0
 # limitations under the License.
0
 
0
-(load "Nu:beautify")
0
-(load "Nu:doc")
0
-
0
 ;; basic declarations that allow nuke to run in mininush
0
 (set exit (NuBridgedFunction functionWithName:"exit" signature:"vi"))
0
 (set NSUTF8StringEncoding 4)
0
@@ -777,10 +774,29 @@
0
                   (eval (parse (NSString stringWithContentsOfFile:filename encoding:NSUTF8StringEncoding error:(set error (NuReference new))))))
0
           self))
0
 
0
-;; Helper functions
0
+;; Helper functions & extensions
0
 (function includedInOutput (task)
0
      (and (!= "default" (task name)) (not (task isFile))))
0
 
0
+(class NSString
0
+ ;; Create a string consisting of the specified number of spaces.
0
+ (cmethod (id) spaces: (id) count is
0
+ (unless $spaces (set $spaces (NSMutableDictionary dictionary)))
0
+ (unless (set spaces ($spaces objectForKey:count))
0
+ (set spaces "")
0
+ (set c count)
0
+ (unless c (set c 0))
0
+ (while (> c 0)
0
+ (spaces appendString:" ")
0
+ (set c (- c 1)))
0
+ ($spaces setObject:spaces forKey:count))
0
+ (NSMutableString stringWithString:spaces))
0
+
0
+ ;; Test to see whether a string begins with a specified substring.
0
+ (imethod (id) beginsWithString:(id) string is
0
+ (set range (self rangeOfString:string))
0
+ (and range (eq (range first) 0))))
0
+
0
 ;;;;;;;;;;;;;;;;;;;;;;;;;
0
 ;; main program
0
 ;;;;;;;;;;;;;;;;;;;;;;;;;
0
@@ -809,12 +825,12 @@
0
            ("-v" (set $verbose YES))
0
            ("--version" (system "nush -v") (exit 0))
0
            ("-V" (system "nush -v") (exit 0))
0
- (else
0
- (if ((argi beginsWithString:"-"))
0
- (puts "nuke: invalid option: #{argi}")
0
- (exit -1)
0
- (else
0
- (set target argi))))))
0
+ (else
0
+ (if ((argi beginsWithString:"-"))
0
+ (puts "nuke: invalid option: #{argi}")
0
+ (exit -1)
0
+ (else
0
+ (set target argi))))))
0
 
0
 (if $printHelp
0
     (puts "")

Comments

    No one has commented yet.