red 3.5.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +0,0 @@
1
- module Red
2
- class WrapNode # :nodoc:
3
- def initialize(expression = nil)
4
- @expression = expression.build_node
5
- end
6
-
7
- def compile_internals(options = {})
8
- return [@expression].compile_nodes(:as_argument => true)
9
- end
10
-
11
- class DefinedNode < WrapNode # :nodoc:
12
- def compile_node(options = {})
13
- return "typeof %s" % self.compile_internals
14
- end
15
- end
16
-
17
- class NotNode < WrapNode # :nodoc:
18
- def compile_node(options = {})
19
- return "!(%s)" % self.compile_internals
20
- end
21
- end
22
-
23
- class ReturnNode < WrapNode # :nodoc:
24
- def compile_node(options = {})
25
- return ("return %s" % self.compile_internals).rstrip
26
- end
27
- end
28
-
29
- class SuperNode < WrapNode # :nodoc:
30
- def initialize(args = [nil])
31
- case @@red_library
32
- when :Prototype : @args = args[1..-1].build_nodes
33
- else raise(BuildError::NoSuperMethods, "Calls to super are not supported in #{@@red_library} JavaScript library")
34
- end
35
- end
36
-
37
- def compile_node(options = {})
38
- case @@red_library
39
- when :Prototype : return "$super(%s)" % @args.compile_nodes(:as_argument => true).join(', ')
40
- else return ""
41
- end
42
- end
43
- end
44
-
45
- class YieldNode < WrapNode # :nodoc:
46
- def compile_node(options = {})
47
- return ("yield %s" % self.compile_internals).rstrip
48
- end
49
- end
50
- end
51
- end