fancy 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/README.md +4 -1
  2. data/Rakefile +8 -0
  3. data/bin/fyi +25 -20
  4. data/bin/ifancy +39 -5
  5. data/{extconf.rb → boot/extconf.rb} +1 -1
  6. data/boot/fancy_ext/block_env.rb +0 -14
  7. data/boot/fancy_ext/kernel.rb +6 -2
  8. data/boot/rbx-compiler/parser/fancy_parser.bundle +0 -0
  9. data/examples/actor.fy +37 -0
  10. data/examples/armstrong_numbers.fy +1 -1
  11. data/examples/curl_async.fy +37 -0
  12. data/examples/echo.fy +1 -1
  13. data/examples/factorial.fy +1 -1
  14. data/examples/future_composition.fy +20 -0
  15. data/examples/game_of_life.fy +2 -2
  16. data/examples/person.fy +4 -8
  17. data/examples/rbx/blocks.fy +1 -1
  18. data/examples/return.fy +1 -1
  19. data/examples/struct.fy +9 -0
  20. data/lib/argv.fy +2 -2
  21. data/lib/array.fy +157 -0
  22. data/lib/block.fy +18 -1
  23. data/lib/boot.fy +5 -1
  24. data/lib/compiler/ast/class_def.fy +1 -1
  25. data/lib/compiler/ast/identifier.fy +2 -2
  26. data/lib/compiler/ast/message_send.fy +2 -2
  27. data/lib/compiler/ast/method_def.fy +2 -2
  28. data/lib/compiler/ast/try_catch.fy +5 -1
  29. data/lib/documentation.fy +1 -1
  30. data/lib/enumerable.fy +3 -7
  31. data/lib/enumerator.fy +77 -0
  32. data/lib/false_class.fy +52 -0
  33. data/lib/fancy_spec.fy +40 -12
  34. data/lib/fdoc.fy +2 -2
  35. data/lib/file.fy +8 -1
  36. data/lib/future.fy +23 -2
  37. data/lib/iteration.fy +60 -0
  38. data/lib/main.fy +4 -4
  39. data/lib/nil_class.fy +14 -22
  40. data/lib/number.fy +51 -0
  41. data/lib/object.fy +126 -43
  42. data/lib/package/installer.fy +1 -1
  43. data/lib/parser/ext/lexer.lex +6 -1
  44. data/lib/parser/ext/parser.y +18 -0
  45. data/lib/parser/methods.fy +20 -2
  46. data/lib/proxy.fy +20 -3
  47. data/lib/rbx.fy +0 -1
  48. data/lib/rbx/array.fy +4 -138
  49. data/lib/rbx/block.fy +25 -1
  50. data/lib/rbx/class.fy +21 -0
  51. data/lib/rbx/exception.fy +1 -0
  52. data/lib/rbx/fiber.fy +1 -0
  53. data/lib/rbx/file.fy +8 -0
  54. data/lib/rbx/integer.fy +0 -8
  55. data/lib/rbx/method.fy +34 -7
  56. data/lib/rbx/no_method_error.fy +8 -1
  57. data/lib/rbx/object.fy +3 -32
  58. data/lib/rbx/range.fy +13 -1
  59. data/lib/rbx/regexp.fy +3 -0
  60. data/lib/rbx/string.fy +6 -1
  61. data/lib/rbx/system.fy +20 -2
  62. data/lib/set.fy +2 -2
  63. data/lib/string.fy +1 -1
  64. data/lib/struct.fy +15 -12
  65. data/lib/symbol.fy +2 -2
  66. data/lib/true_class.fy +16 -20
  67. data/lib/version.fy +1 -1
  68. data/tests/argv.fy +1 -0
  69. data/tests/array.fy +33 -2
  70. data/tests/block.fy +44 -0
  71. data/tests/class.fy +102 -88
  72. data/tests/control_flow.fy +131 -8
  73. data/tests/enumerator.fy +85 -0
  74. data/tests/exception.fy +13 -13
  75. data/tests/file.fy +4 -13
  76. data/tests/future.fy +26 -0
  77. data/tests/method.fy +83 -72
  78. data/tests/nil_class.fy +20 -13
  79. data/tests/number.fy +16 -9
  80. data/tests/object.fy +39 -20
  81. data/tests/string.fy +7 -0
  82. data/tests/true_class.fy +4 -4
  83. data/tools/fancy-mode.el +1 -1
  84. metadata +15 -20
  85. data/boot/compiler/parser/ext/fancy_parser.bundle +0 -0
  86. data/boot/rbx-compiler/parser/Makefile +0 -162
  87. data/boot/rbx-compiler/parser/lexer.c +0 -2316
  88. data/boot/rbx-compiler/parser/lexer.h +0 -315
  89. data/boot/rbx-compiler/parser/parser.c +0 -3105
  90. data/boot/rbx-compiler/parser/parser.h +0 -114
  91. data/lib/lazy_array.fy +0 -23
  92. data/lib/parser/ext/Makefile +0 -162
  93. data/lib/parser/ext/fancy_parser.bundle +0 -0
  94. data/lib/parser/ext/lexer.c +0 -2360
  95. data/lib/parser/ext/lexer.h +0 -315
  96. data/lib/parser/ext/parser.c +0 -3382
  97. data/lib/parser/ext/parser.h +0 -118
  98. data/lib/rbx/false_class.fy +0 -58
@@ -1,118 +0,0 @@
1
- /* A Bison parser, made by GNU Bison 2.4.3. */
2
-
3
- /* Skeleton interface for Bison's Yacc-like parsers in C
4
-
5
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6
- 2009, 2010 Free Software Foundation, Inc.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
-
21
- /* As a special exception, you may create a larger work that contains
22
- part or all of the Bison parser skeleton and distribute that work
23
- under terms of your choice, so long as that work isn't itself a
24
- parser generator using the skeleton or a modified version thereof
25
- as a parser skeleton. Alternatively, if you modify or redistribute
26
- the parser skeleton itself, you may (at your option) remove this
27
- special exception, which will cause the skeleton and the resulting
28
- Bison output files to be licensed under the GNU General Public
29
- License without this special exception.
30
-
31
- This special exception was added by the Free Software Foundation in
32
- version 2.2 of Bison. */
33
-
34
-
35
- /* Tokens. */
36
- #ifndef YYTOKENTYPE
37
- # define YYTOKENTYPE
38
- /* Put the tokens into the symbol table, so that GDB and other debuggers
39
- know about them. */
40
- enum yytokentype {
41
- LPAREN = 258,
42
- RPAREN = 259,
43
- FUTURE_SEND = 260,
44
- ASYNC_SEND = 261,
45
- AT_LCURLY = 262,
46
- LCURLY = 263,
47
- RCURLY = 264,
48
- LBRACKET = 265,
49
- RBRACKET = 266,
50
- LHASH = 267,
51
- RHASH = 268,
52
- STAB = 269,
53
- ARROW = 270,
54
- THIN_ARROW = 271,
55
- COMMA = 272,
56
- SEMI = 273,
57
- NL = 274,
58
- COLON = 275,
59
- RETURN_LOCAL = 276,
60
- RETURN = 277,
61
- REQUIRE = 278,
62
- TRY = 279,
63
- CATCH = 280,
64
- FINALLY = 281,
65
- RETRY = 282,
66
- SUPER = 283,
67
- PRIVATE = 284,
68
- PROTECTED = 285,
69
- CLASS = 286,
70
- DEF = 287,
71
- DOT = 288,
72
- DOLLAR = 289,
73
- EQUALS = 290,
74
- MATCH = 291,
75
- CASE = 292,
76
- IDENTIFIER = 293,
77
- SELECTOR = 294,
78
- RUBY_SEND_OPEN = 295,
79
- RUBY_OPER_OPEN = 296,
80
- CONSTANT = 297,
81
- INTEGER_LITERAL = 298,
82
- HEX_LITERAL = 299,
83
- OCT_LITERAL = 300,
84
- BIN_LITERAL = 301,
85
- DOUBLE_LITERAL = 302,
86
- STRING_LITERAL = 303,
87
- MULTI_STRING_LITERAL = 304,
88
- SYMBOL_LITERAL = 305,
89
- REGEX_LITERAL = 306,
90
- OPERATOR = 307
91
- };
92
- #endif
93
-
94
-
95
-
96
- #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
97
- typedef union YYSTYPE
98
- {
99
-
100
- /* Line 1685 of yacc.c */
101
- #line 18 "/Users/backtype/projects/fancy/lib/parser/ext/parser.y"
102
-
103
- VALUE object;
104
- ID symbol;
105
-
106
-
107
-
108
- /* Line 1685 of yacc.c */
109
- #line 110 "/Users/backtype/projects/fancy/lib/parser/ext/parser.h"
110
- } YYSTYPE;
111
- # define YYSTYPE_IS_TRIVIAL 1
112
- # define yystype YYSTYPE /* obsolescent; will be withdrawn */
113
- # define YYSTYPE_IS_DECLARED 1
114
- #endif
115
-
116
- extern YYSTYPE yylval;
117
-
118
-
@@ -1,58 +0,0 @@
1
- class FalseClass {
2
- """
3
- FalseClass extensions for Fancy on rbx.
4
- """
5
-
6
- def if_true: then_block else: else_block {
7
- "Calls else_block."
8
- else_block call
9
- }
10
-
11
- def if_true: block {
12
- "Returns nil."
13
- nil
14
- }
15
-
16
- def if_false: block {
17
- "Calls the block."
18
- block call
19
- }
20
-
21
- def if_nil: block {
22
- "Calls the block."
23
- nil
24
- }
25
-
26
- def nil? {
27
- "Returns true."
28
- false
29
- }
30
-
31
- def false? {
32
- "Returns true."
33
- true
34
- }
35
-
36
- def true? {
37
- "Returns nil."
38
- false
39
- }
40
-
41
- def to_s {
42
- "false"
43
- }
44
-
45
- def to_a {
46
- []
47
- }
48
-
49
- def not {
50
- """
51
- @return @true
52
-
53
- Boolean negation of @false => @true.
54
- """
55
-
56
- true
57
- }
58
- }