Skip to content
This repository
Browse code

removing -=> form

  • Loading branch information...
commit f3affff34201fc5a019661429e721170c7143952 1 parent a9cf45a
Tim Disney authored August 31, 2011
2  lib/grammar.js
@@ -170,8 +170,6 @@
170 170
         return 'callOnly';
171 171
       }), o('==>', function() {
172 172
         return 'newOnly';
173  
-      }), o('-=>', function() {
174  
-        return 'newSafe';
175 173
       })
176 174
     ],
177 175
     ContractArgList: [
344  lib/parser.js
171 additions, 173 deletions not shown
2  lib/rewriter.js
@@ -393,7 +393,7 @@
393 393
   IMPLICIT_UNSPACED_CALL = ['+', '-'];
394 394
   IMPLICIT_BLOCK = ['->', '=>', '{', '[', ','];
395 395
   IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
396  
-  SINGLE_LINERS = ['ELSE', '->', '=>', '-->', '==>', '-=>', 'TRY', 'FINALLY', 'THEN'];
  396
+  SINGLE_LINERS = ['ELSE', '->', '=>', '-->', '==>', 'TRY', 'FINALLY', 'THEN'];
397 397
   SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
398 398
   LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
399 399
 }).call(this);
1  src/grammar.coffee
@@ -208,7 +208,6 @@ grammar =
208 208
     o '->',  -> 'func'
209 209
     o '-->', -> 'callOnly'
210 210
     o '==>', -> 'newOnly'
211  
-    o '-=>', -> 'newSafe'
212 211
   ]
213 212
 
214 213
   ContractArgList: [
2  src/rewriter.coffee
@@ -349,7 +349,7 @@ IMPLICIT_END     = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'T
349 349
 
350 350
 # Single-line flavors of block expressions that have unclosed endings.
351 351
 # The grammar can't disambiguate them, so we insert the implicit indentation.
352  
-SINGLE_LINERS    = ['ELSE', '->', '=>', '-->', '==>', '-=>', 'TRY', 'FINALLY', 'THEN']
  352
+SINGLE_LINERS    = ['ELSE', '->', '=>', '-->', '==>', 'TRY', 'FINALLY', 'THEN']
353 353
 SINGLE_CLOSERS   = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']
354 354
 
355 355
 # Tokens that end a line.
3  syntax.coffee
@@ -27,9 +27,6 @@ f :: (Num) --> Num # can't be used with 'new'
27 27
 # new only
28 28
 f :: (Num) ==> Any # can't be used without 'new'
29 29
 
30  
-# new safe
31  
-f :: (Num) -=> Any
32  
-
33 30
 # dependent
34 31
 inc :: (Num, Num) -> !(result) -> result > $1 and $1 > $2
35 32
 
10  test/webtest/test.coffee
@@ -87,16 +87,6 @@ test "function, call/new only", ->
87 87
   same x.a, 42, "abides by contract"
88 88
   raises (-> newOnly 42), "violates contract by not calling new"
89 89
 
90  
-  newSafe :: (Num) -=> { a: Num }
91  
-  newSafe = (x) -> @.a = x
92  
-  newSafe = newSafe.use()
93  
-
94  
-  withnew = new newSafe 42
95  
-  without = newSafe 42
96  
-  same without.a, 42, "abides by contract"
97  
-  same withnew.a, 42, "abides by contract"
98  
-
99  
-
100 90
 test "function, dependent", ->
101 91
   # gt = (result) -> result > $1
102 92
 

0 notes on commit f3affff

Please sign in to comment.
Something went wrong with that request. Please try again.