cadenza 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  require 'cgi'
2
2
 
3
3
  # adds slashes to \, ', and " characters in the given string
4
- define_filter :addslashes do |string|
4
+ define_filter :addslashes do |string, params|
5
5
  word = string.dup
6
6
  word.gsub!(/\\/, "\\\\\\\\")
7
7
  word.gsub!(/'/, "\\\\'")
@@ -10,27 +10,32 @@ define_filter :addslashes do |string|
10
10
  end
11
11
 
12
12
  # capitalizes the first letter of the string
13
- define_filter :capitalize, &:capitalize
13
+ define_filter :capitalize do |input, params|
14
+ input.capitalize
15
+ end
14
16
 
15
17
  # centers the string in a fixed width field with the given padding
16
- define_filter :center do |string, length, *args|
17
- padding = args.first || ' ' # Ruby 1.8.x compatibility
18
+ define_filter :center do |string, params|
19
+ length = params[0]
20
+ padding = params[1] || ' '
18
21
  string.center(length, padding)
19
22
  end
20
23
 
21
24
  # removes all instances of the given string from the string
22
- define_filter :cut do |string, value|
23
- string.gsub(value, '')
25
+ define_filter :cut do |string, params|
26
+ string.gsub(params.first, '')
24
27
  end
25
28
 
26
29
  # formats the given date object with the given format string
27
- define_filter :date do |date, *args|
28
- format = args.first || '%F' # Ruby 1.8.x compatibility
30
+ define_filter :date do |date, params|
31
+ format = params.first || '%F'
29
32
  date.strftime(format)
30
33
  end
31
34
 
32
35
  # returns the given value if the input is falsy or is empty
33
- define_filter :default do |input, default|
36
+ define_filter :default do |input, params|
37
+ default = params.first
38
+
34
39
  if input.respond_to?(:empty?) and input.empty?
35
40
  default
36
41
  else
@@ -39,12 +44,12 @@ define_filter :default do |input, default|
39
44
  end
40
45
 
41
46
  # escapes the HTML content of the value
42
- define_filter :escape do |input|
47
+ define_filter :escape do |input, params|
43
48
  CGI::escapeHTML(input)
44
49
  end
45
50
 
46
51
  # returns the first item of an iterable
47
- define_filter :first do |input|
52
+ define_filter :first do |input, params|
48
53
  if input.respond_to?(:[])
49
54
  RUBY_VERSION =~ /^1.8/ && input.is_a?(String) ? input[0].chr : input[0]
50
55
  else
@@ -53,7 +58,7 @@ define_filter :first do |input|
53
58
  end
54
59
 
55
60
  # returns the last item of an iterable
56
- define_filter :last do |input|
61
+ define_filter :last do |input, params|
57
62
  if input.respond_to?(:[])
58
63
  RUBY_VERSION =~ /^1.8/ && input.is_a?(String) ? input[-1].chr : input[-1]
59
64
  else
@@ -62,36 +67,90 @@ define_filter :last do |input|
62
67
  end
63
68
 
64
69
  # glues together elements of the input with the glue string
65
- define_filter :join do |input, glue|
70
+ define_filter :join do |input, params|
71
+ glue = params.first
66
72
  input.join(glue)
67
73
  end
68
74
 
69
75
  # returns the length of the input
70
- define_filter :length, &:length
76
+ define_filter :length do |input, params|
77
+ input.length
78
+ end
71
79
 
72
80
  # returns the string left justified with the given padding character
73
- define_filter :ljust do |input, length, *args|
74
- padding = args.first || ' ' # Ruby 1.8.x compatibility
81
+ define_filter :ljust do |input, params|
82
+ length = params[0]
83
+ padding = params[1] || ' '
75
84
  input.ljust(length, padding)
76
85
  end
77
86
 
78
87
  # returns the string right justified with the given padding character
79
- define_filter :rjust do |input, length, *args|
80
- padding = args.first || ' ' # Ruby 1.8.x compatibility
88
+ define_filter :rjust do |input, params|
89
+ length = params[0]
90
+ padding = params[1] || ' '
81
91
  input.rjust(length, padding)
82
92
  end
83
93
 
84
94
  # returns the string downcased
85
- define_filter :lower, &:downcase
95
+ define_filter :lower do |input, params|
96
+ input.downcase
97
+ end
86
98
 
87
99
  # returns the string upcased
88
- define_filter :upper, &:upcase
100
+ define_filter :upper do |input, params|
101
+ input.upcase
102
+ end
89
103
 
90
104
  # returns the given words wrapped to fit inside the given column width. Wrapping
91
105
  # is done on word boundaries so that no word cutting is done.
92
106
  # source: http://www.java2s.com/Code/Ruby/String/WordwrappingLinesofText.htm
93
- define_filter :wordwrap do |input, length, *args|
94
- linefeed = args.first || "\n" # Ruby 1.8.x compatibility
95
- input.gsub(/(.{1,#{length}})(\s+|\Z)/, "\\1#{linefeed}")
107
+ define_filter :wordwrap do |input, params|
108
+ length = params[0]
109
+ linefeed = params[1] || "\n"
110
+ input.gsub(/(.{1,#{length}})(\s+|\Z)/, "\\1\n").strip.gsub(/\n/, linefeed)
111
+ end
112
+
113
+ # returns the string or array reversed
114
+ define_filter :reverse do |input, params|
115
+ input.reverse
116
+ end
117
+
118
+ # returns the string or array with the first +length+ items/characters contained
119
+ define_filter :limit do |input, params|
120
+ length = params.first
121
+
122
+ if length > 0
123
+ input.slice(0..length-1)
124
+ else
125
+ input.is_a?(Array) ? [] : ""
126
+ end
127
+ end
128
+
129
+ # returns the string or array with all items/characters after the +index+
130
+ # item/character (where 1 is the first index, not 0 as programmers are used to)
131
+ define_filter :offset do |input, params|
132
+ index = params.first
133
+
134
+ input.slice(index..-1)
96
135
  end
97
136
 
137
+ # returns an array of objects with the given identifier looked up on all of the
138
+ # input array elements.
139
+ define_filter :pluck do |input, params|
140
+ identifier = params.first
141
+
142
+ input.map {|item| Cadenza::Context.lookup_on_object(identifier, item) }
143
+ end
144
+
145
+ alias_filter :pluck, :map
146
+ alias_filter :pluck, :collect
147
+
148
+ define_filter :sort do |input, params|
149
+ identifier = params.first
150
+
151
+ if identifier
152
+ input.sort {|a,b| Cadenza::Context.lookup_on_object(identifier, a) <=> Cadenza::Context.lookup_on_object(identifier, b) }
153
+ else
154
+ input.sort
155
+ end
156
+ end
@@ -4,9 +4,6 @@ module Cadenza
4
4
  # The {Lexer} class accepts in input {IO} object which it will parse simple
5
5
  # {Token}s from for use in a {Parser} class.
6
6
  class Lexer
7
- #TODO: look at using the CodeRay scanner instead, it supports reading from
8
- # an IO object (unlike StringScanner which must have a string in memory)
9
- # http://coderay.rubychan.de/doc/classes/CodeRay/Scanners/Scanner.html
10
7
 
11
8
  # constructs a new parser and sets it to the position (0, 0)
12
9
  def initialize
@@ -37,8 +37,7 @@ module Cadenza
37
37
  # @param [String] value the input value to filter
38
38
  # @return the input value when passed through this evaluated filter
39
39
  def evaluate(context, value)
40
- params = [value] + @parameters.map {|x| x.eval(context) }
41
- context.evaluate_filter(@identifier, params)
40
+ context.evaluate_filter(@identifier, value, @parameters.map {|x| x.eval(context) })
42
41
  end
43
42
  end
44
43
  end
@@ -0,0 +1,48 @@
1
+
2
+ module Cadenza
3
+ # The {FilteredValueNode} applies a list of passed {FilterNode} to it's value
4
+ # when evaluated.
5
+ class FilteredValueNode
6
+ # @return [Node] the value to be filtered
7
+ attr_accessor :value
8
+
9
+ # @return [Array] a list of {FilterNode} to evaluate the value with, once the
10
+ # value has itself been evaluated.
11
+ attr_accessor :filters
12
+
13
+ # creates a new {FilteredValueNode}.
14
+ # @param [String] identifier see {#identifier}
15
+ # @param [Array] filters see {#filters}
16
+ def initialize(value, filters=[])
17
+ @value = value
18
+ @filters = filters
19
+ end
20
+
21
+ # @return [Array] a list of names which are implied to be global variables
22
+ # from this node.
23
+ def implied_globals
24
+ (@value.implied_globals + @filters.map(&:implied_globals).flatten).uniq
25
+ end
26
+
27
+ # @param [Context] context
28
+ # @return [Object] gets the value and returns it after being passed
29
+ # through all filters
30
+ def eval(context)
31
+ value = @value.eval(context)
32
+
33
+ @filters.each {|filter| value = filter.evaluate(context, value) }
34
+
35
+ value
36
+ end
37
+
38
+ # @param [FilteredValueNode] rhs
39
+ # @return [Boolean] if the given {FilteredValueNode} is equivalent by
40
+ # value to this node.
41
+ def ==(rhs)
42
+ self.value == rhs.value && self.filters == rhs.filters
43
+ end
44
+
45
+
46
+ end
47
+
48
+ end
@@ -5,30 +5,43 @@ module Cadenza
5
5
  # @return [String] the name given to this variable
6
6
  attr_accessor :identifier
7
7
 
8
+ # @return [Array] a list of Node objects passed to the {#value} for use in a
9
+ # functional variable. See {Context#define_functional_variable}.
10
+ attr_accessor :parameters
11
+
8
12
  # creates a new {VariableNode} with the name given.
9
13
  # @param [String] identifier see {#identifier}
10
- def initialize(identifier)
14
+ # @param [Array] parameters see {#parameters}
15
+ def initialize(identifier, parameters=[])
11
16
  @identifier = identifier
17
+ @parameters = parameters
12
18
  end
13
19
 
14
20
  # @return [Array] a list of names which are implied to be global variables
15
21
  # from this node.
16
22
  def implied_globals
17
- [self.identifier]
23
+ ([self.identifier] + @parameters.map(&:implied_globals).flatten).uniq
18
24
  end
19
25
 
20
26
  # @param [Context] context
21
27
  # @return [Object] looks up and returns the value of this variable in the
22
28
  # given {Context}
23
29
  def eval(context)
24
- context.lookup(@identifier)
30
+ value = context.lookup(@identifier)
31
+
32
+ if value.is_a? Proc
33
+ args = parameters.map {|p| p.eval(context) }
34
+ value = value.call(context, *args)
35
+ end
36
+
37
+ value
25
38
  end
26
39
 
27
40
  # @param [VariableNode] rhs
28
41
  # @return [Boolean] if the given {VariableNode} is equivalent by value to
29
42
  # this node.
30
43
  def ==(rhs)
31
- self.identifier == rhs.identifier
44
+ self.identifier == rhs.identifier && self.parameters == rhs.parameters
32
45
  end
33
46
  end
34
47
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.7
3
+ # This file is automatically generated by Racc 1.4.9
4
4
  # from Racc grammer file "".
5
5
  #
6
6
 
@@ -11,243 +11,241 @@ require 'racc/parser.rb'
11
11
  module Cadenza
12
12
  class RaccParser < Racc::Parser
13
13
 
14
- module_eval(<<'...end cadenza.y/module_eval...', 'cadenza.y', 229)
14
+ module_eval(<<'...end cadenza.y/module_eval...', 'cadenza.y', 223)
15
15
 
16
16
  ...end cadenza.y/module_eval...
17
17
  ##### State transition tables begin ###
18
18
 
19
19
  racc_action_table = [
20
- 38, 3, 111, 4, 3, 38, 4, 55, 23, 24,
21
- 25, 26, 3, 38, 154, 70, 71, 9, 38, 95,
22
- 9, 70, 71, 31, 115, 34, 118, 35, 9, 38,
23
- 34, 36, 35, 79, 37, 93, 36, 39, 34, 37,
24
- 35, 157, 39, 34, 36, 35, 82, 37, 87, 36,
25
- 39, 38, 37, 93, 34, 39, 35, 82, 83, 3,
26
- 36, 155, 38, 37, 136, 3, 39, 129, 70, 71,
27
- 38, 81, 70, 71, 80, 9, 34, 114, 35, 59,
28
- 60, 9, 36, 38, 91, 37, 141, 34, 39, 35,
29
- 61, 62, 87, 36, 133, 34, 37, 35, 144, 39,
30
- 3, 36, 44, 3, 37, 124, 156, 39, 34, 95,
31
- 35, 97, 83, 96, 36, 91, 9, 37, 128, 9,
32
- 39, 55, 23, 24, 25, 26, 55, 23, 24, 25,
33
- 26, 55, 23, 24, 25, 26, 142, 31, 143, 142,
34
- 77, 149, 31, 3, 3, 40, 40, 31, 55, 23,
35
- 24, 25, 26, 55, 23, 24, 25, 26, 76, 9,
36
- 9, 3, 123, 4, 31, 3, 3, 4, 4, 31,
37
- 22, 23, 24, 25, 26, 122, 3, 9, 4, 61,
38
- 62, 9, 9, 3, 121, 4, 31, 55, 23, 24,
39
- 25, 26, 9, 55, 23, 24, 25, 26, 3, 9,
40
- 4, 120, 3, 31, 137, 3, 117, 134, 116, 31,
41
- 111, 3, 152, 129, 9, 3, 111, 129, 9, 61,
42
- 62, 9, 55, 23, 24, 25, 26, 9, 3, 98,
43
- 124, 9, 3, 3, 124, 44, 61, 62, 31, 70,
44
- 71, 70, 71, 73, 9, 72, 59, 60, 9, 9,
45
- 63, 64, 65, 66, 67, 68, 63, 64, 65, 66,
46
- 67, 68, 55, 23, 24, 25, 26, 55, 23, 24,
47
- 25, 26, 55, 23, 24, 25, 26, 55, 23, 24,
48
- 25, 26, 55, 23, 24, 25, 26, 55, 23, 24,
49
- 25, 26, 55, 23, 24, 25, 26, 55, 23, 24,
50
- 25, 26, 55, 23, 24, 25, 26, 55, 23, 24,
51
- 25, 26, 55, 23, 24, 25, 26, 59, 60, 61,
52
- 62, 61, 62, 61, 62, 54, 95, 51, 48, 18,
53
- 158, 159 ]
20
+ 39, 39, 95, 134, 3, 131, 122, 22, 23, 24,
21
+ 25, 26, 70, 71, 39, 72, 61, 62, 81, 39,
22
+ 9, 80, 126, 31, 35, 35, 36, 36, 116, 83,
23
+ 37, 37, 39, 38, 38, 152, 40, 40, 35, 121,
24
+ 36, 82, 83, 35, 37, 36, 39, 38, 87, 37,
25
+ 40, 120, 38, 119, 39, 40, 35, 138, 36, 39,
26
+ 139, 3, 37, 135, 118, 38, 115, 39, 40, 114,
27
+ 35, 109, 36, 82, 96, 87, 37, 9, 35, 38,
28
+ 36, 95, 40, 35, 37, 36, 93, 38, 93, 37,
29
+ 40, 35, 38, 36, 151, 40, 3, 37, 132, 91,
30
+ 38, 70, 71, 40, 22, 23, 24, 25, 26, 3,
31
+ 91, 127, 9, 77, 3, 76, 127, 109, 70, 71,
32
+ 31, 61, 62, 61, 62, 9, 112, 59, 60, 79,
33
+ 9, 22, 23, 24, 25, 26, 22, 23, 24, 25,
34
+ 26, 22, 23, 24, 25, 26, 147, 31, 70, 71,
35
+ 61, 62, 31, 70, 71, 73, 113, 31, 22, 23,
36
+ 24, 25, 26, 22, 23, 24, 25, 26, 22, 23,
37
+ 24, 25, 26, 3, 31, 122, 3, 55, 149, 31,
38
+ 3, 3, 41, 4, 31, 3, 3, 150, 45, 9,
39
+ 95, 3, 9, 4, 61, 62, 9, 9, 3, 52,
40
+ 45, 9, 9, 3, 3, 4, 41, 9, 3, 49,
41
+ 4, 61, 62, 18, 9, 3, 153, 127, 154, 9,
42
+ 9, 3, nil, 4, 9, 22, 23, 24, 25, 26,
43
+ nil, 9, 22, 23, 24, 25, 26, 9, 3, nil,
44
+ 4, 31, 3, 3, 4, 122, 59, 60, 31, 22,
45
+ 23, 24, 25, 26, 9, 3, nil, 4, 9, 9,
46
+ 22, 23, 24, 25, 26, 31, 22, 23, 24, 25,
47
+ 26, 9, 63, 64, 65, 66, 67, 68, 63, 64,
48
+ 65, 66, 67, 68, 22, 23, 24, 25, 26, 22,
49
+ 23, 24, 25, 26, 22, 23, 24, 25, 26, 22,
50
+ 23, 24, 25, 26, 22, 23, 24, 25, 26, 22,
51
+ 23, 24, 25, 26, 22, 23, 24, 25, 26, 22,
52
+ 23, 24, 25, 26, 22, 23, 24, 25, 26, 59,
53
+ 60, 61, 62 ]
54
54
 
55
55
  racc_action_check = [
56
- 137, 0, 97, 0, 145, 155, 145, 38, 38, 38,
57
- 38, 38, 146, 4, 146, 75, 75, 0, 44, 78,
58
- 145, 56, 56, 38, 75, 137, 78, 137, 146, 40,
59
- 155, 137, 155, 38, 137, 137, 155, 137, 4, 155,
60
- 4, 155, 155, 44, 4, 44, 44, 4, 44, 44,
61
- 4, 134, 44, 51, 40, 44, 40, 40, 40, 153,
62
- 40, 153, 129, 40, 93, 131, 40, 131, 74, 74,
63
- 154, 39, 139, 139, 39, 153, 134, 74, 134, 28,
64
- 28, 131, 134, 124, 134, 134, 111, 129, 134, 129,
65
- 108, 108, 129, 129, 91, 154, 129, 154, 116, 129,
66
- 6, 154, 6, 126, 154, 126, 154, 154, 124, 57,
67
- 124, 57, 124, 57, 124, 48, 6, 124, 87, 126,
68
- 124, 26, 26, 26, 26, 26, 141, 141, 141, 141,
69
- 141, 34, 34, 34, 34, 34, 113, 26, 113, 140,
70
- 37, 140, 141, 5, 42, 5, 42, 34, 35, 35,
71
- 35, 35, 35, 22, 22, 22, 22, 22, 36, 5,
72
- 42, 43, 83, 43, 35, 2, 47, 2, 47, 22,
73
- 3, 3, 3, 3, 3, 82, 119, 43, 119, 29,
74
- 29, 2, 47, 50, 81, 50, 3, 70, 70, 70,
75
- 70, 70, 119, 95, 95, 95, 95, 95, 53, 50,
76
- 53, 80, 94, 70, 94, 92, 77, 92, 76, 95,
77
- 142, 90, 144, 90, 53, 89, 73, 89, 94, 107,
78
- 107, 92, 71, 71, 71, 71, 71, 90, 86, 58,
79
- 86, 89, 85, 46, 85, 46, 106, 106, 71, 33,
80
- 33, 58, 58, 33, 86, 33, 101, 101, 85, 46,
81
- 30, 30, 30, 30, 30, 30, 69, 69, 69, 69,
82
- 69, 69, 63, 63, 63, 63, 63, 64, 64, 64,
83
- 64, 64, 65, 65, 65, 65, 65, 59, 59, 59,
84
- 59, 59, 60, 60, 60, 60, 60, 66, 66, 66,
85
- 66, 66, 61, 61, 61, 61, 61, 68, 68, 68,
86
- 68, 68, 31, 31, 31, 31, 31, 67, 67, 67,
87
- 67, 67, 62, 62, 62, 62, 62, 102, 102, 105,
88
- 105, 104, 104, 103, 103, 18, 150, 8, 7, 1,
89
- 156, 157 ]
56
+ 150, 122, 78, 93, 86, 91, 86, 95, 95, 95,
57
+ 95, 95, 33, 33, 41, 33, 106, 106, 40, 127,
58
+ 86, 40, 87, 95, 150, 122, 150, 122, 78, 122,
59
+ 150, 122, 4, 150, 122, 150, 150, 122, 41, 83,
60
+ 41, 41, 41, 127, 41, 127, 45, 41, 127, 127,
61
+ 41, 82, 127, 81, 135, 127, 4, 109, 4, 149,
62
+ 111, 94, 4, 94, 80, 4, 77, 132, 4, 76,
63
+ 45, 72, 45, 45, 58, 45, 45, 94, 135, 45,
64
+ 135, 57, 45, 149, 135, 149, 52, 135, 135, 149,
65
+ 135, 132, 149, 132, 149, 149, 92, 132, 92, 132,
66
+ 132, 137, 137, 132, 39, 39, 39, 39, 39, 90,
67
+ 49, 90, 92, 38, 89, 37, 89, 139, 74, 74,
68
+ 39, 103, 103, 105, 105, 90, 74, 100, 100, 39,
69
+ 89, 70, 70, 70, 70, 70, 35, 35, 35, 35,
70
+ 35, 36, 36, 36, 36, 36, 140, 70, 75, 75,
71
+ 102, 102, 35, 56, 56, 34, 75, 36, 138, 138,
72
+ 138, 138, 138, 26, 26, 26, 26, 26, 22, 22,
73
+ 22, 22, 22, 85, 138, 85, 142, 18, 142, 26,
74
+ 43, 44, 43, 44, 22, 148, 47, 148, 47, 85,
75
+ 145, 48, 142, 48, 101, 101, 43, 44, 6, 8,
76
+ 6, 148, 47, 51, 5, 51, 5, 48, 54, 7,
77
+ 54, 29, 29, 1, 6, 129, 151, 129, 152, 51,
78
+ 5, 2, nil, 2, 54, 114, 114, 114, 114, 114,
79
+ nil, 129, 3, 3, 3, 3, 3, 2, 117, nil,
80
+ 117, 114, 0, 124, 0, 124, 28, 28, 3, 71,
81
+ 71, 71, 71, 71, 117, 141, nil, 141, 0, 124,
82
+ 65, 65, 65, 65, 65, 71, 64, 64, 64, 64,
83
+ 64, 141, 30, 30, 30, 30, 30, 30, 69, 69,
84
+ 69, 69, 69, 69, 63, 63, 63, 63, 63, 62,
85
+ 62, 62, 62, 62, 68, 68, 68, 68, 68, 67,
86
+ 67, 67, 67, 67, 61, 61, 61, 61, 61, 31,
87
+ 31, 31, 31, 31, 59, 59, 59, 59, 59, 66,
88
+ 66, 66, 66, 66, 60, 60, 60, 60, 60, 99,
89
+ 99, 104, 104 ]
90
90
 
91
91
  racc_action_pointer = [
92
- -23, 329, 141, 168, 11, 119, 76, 302, 301, nil,
93
- nil, nil, nil, nil, nil, nil, nil, nil, 325, nil,
94
- nil, nil, 151, nil, nil, nil, 119, nil, 71, 169,
95
- 238, 300, nil, 220, 129, 146, 156, 138, 5, 69,
96
- 27, nil, 120, 137, 16, nil, 209, 142, 80, nil,
97
- 159, 16, nil, 174, nil, nil, 2, 88, 222, 275,
98
- 280, 290, 310, 260, 265, 270, 285, 305, 295, 244,
99
- 185, 220, nil, 214, 49, -4, 174, 178, -2, nil,
100
- 173, 156, 147, 134, nil, 208, 204, 90, nil, 191,
101
- 187, 66, 181, 36, 178, 191, nil, 0, nil, nil,
102
- nil, 238, 309, 313, 311, 309, 226, 209, 80, nil,
103
- nil, 64, nil, 113, nil, nil, 96, nil, nil, 152,
104
- nil, nil, nil, nil, 81, nil, 79, nil, nil, 60,
105
- nil, 41, nil, nil, 49, nil, nil, -2, nil, 53,
106
- 116, 124, 208, nil, 184, -20, -12, nil, nil, nil,
107
- 305, nil, nil, 35, 68, 3, 302, 303, nil, nil ]
92
+ 218, 213, 197, 229, 29, 180, 174, 183, 173, nil,
93
+ nil, nil, nil, nil, nil, nil, nil, nil, 177, nil,
94
+ nil, nil, 165, nil, nil, nil, 160, nil, 237, 200,
95
+ 259, 306, nil, -8, 130, 133, 138, 112, 110, 101,
96
+ 15, 11, nil, 156, 157, 43, nil, 162, 167, 75,
97
+ nil, 179, 49, nil, 184, nil, 133, 79, 66, 311,
98
+ 321, 301, 286, 281, 263, 257, 316, 296, 291, 265,
99
+ 128, 246, 68, nil, 98, 128, 35, 38, 0, nil,
100
+ 36, 25, 23, 11, nil, 149, -20, -6, nil, 90,
101
+ 85, -23, 72, -25, 37, 4, nil, nil, nil, 320,
102
+ 118, 183, 139, 110, 320, 112, 5, nil, nil, 35,
103
+ nil, 37, nil, nil, 222, nil, nil, 214, nil, nil,
104
+ nil, nil, -2, nil, 219, nil, nil, 16, nil, 191,
105
+ nil, nil, 64, nil, nil, 51, nil, 81, 155, 114,
106
+ 118, 231, 152, nil, nil, 188, nil, nil, 161, 56,
107
+ -3, 188, 190, nil, nil ]
108
108
 
109
109
  racc_action_default = [
110
110
  -2, -79, -1, -79, -79, -79, -79, -54, -59, -67,
111
111
  -68, -69, -70, -71, -72, -73, -75, -77, -79, -74,
112
- -76, -78, -3, -4, -5, -6, -79, -8, -11, -14,
113
- -21, -79, -23, -79, -79, -79, -79, -79, -79, -79,
114
- -79, -41, -79, -79, -79, -46, -79, -79, -79, -53,
115
- -79, -79, -58, -79, 160, -3, -26, -79, -79, -79,
116
- -79, -79, -79, -79, -79, -79, -79, -79, -79, -22,
117
- -79, -79, -32, -79, -79, -79, -79, -79, -79, -61,
112
+ -76, -78, -5, -7, -8, -9, -79, -11, -14, -17,
113
+ -24, -79, -26, -33, -79, -79, -79, -79, -79, -79,
114
+ -79, -79, -41, -79, -79, -79, -46, -79, -79, -79,
115
+ -53, -79, -79, -58, -79, 155, -3, -6, -79, -79,
116
+ -79, -79, -79, -79, -79, -79, -79, -79, -79, -25,
117
+ -79, -79, -79, -35, -79, -79, -79, -79, -79, -61,
118
118
  -79, -79, -79, -79, -42, -79, -79, -79, -47, -79,
119
- -79, -79, -79, -79, -79, -79, -34, -79, -7, -9,
120
- -10, -12, -13, -15, -16, -17, -18, -19, -20, -24,
121
- -25, -28, -30, -79, -36, -37, -79, -56, -63, -79,
122
- -65, -66, -38, -39, -79, -44, -79, -43, -40, -79,
123
- -49, -79, -48, -52, -79, -55, -57, -79, -60, -27,
124
- -79, -79, -79, -33, -79, -79, -79, -45, -50, -35,
125
- -29, -31, -51, -79, -79, -79, -79, -79, -62, -64 ]
119
+ -79, -79, -79, -79, -79, -79, -10, -12, -13, -15,
120
+ -16, -18, -19, -20, -21, -22, -23, -27, -28, -29,
121
+ -31, -34, -36, -37, -79, -56, -63, -79, -65, -66,
122
+ -38, -39, -79, -44, -79, -43, -40, -79, -49, -79,
123
+ -48, -52, -79, -55, -57, -79, -60, -4, -79, -79,
124
+ -79, -79, -79, -45, -50, -30, -32, -51, -79, -79,
125
+ -79, -79, -79, -62, -64 ]
126
126
 
127
127
  racc_goto_table = [
128
- 19, 21, 41, 45, 33, 43, 47, 57, 113, 52,
129
- 20, 50, 2, 69, 49, 99, 100, 42, 46, 109,
130
- 110, 101, 102, 78, 53, 119, 145, 58, 151, 1,
131
- nil, nil, 140, nil, nil, 74, 75, nil, nil, 84,
132
- 19, 21, 85, 88, 19, 21, 89, nil, nil, nil,
133
- 20, nil, nil, nil, 20, 86, nil, nil, nil, 90,
134
- nil, nil, 92, nil, nil, 94, 103, 104, 105, 106,
135
- 107, 108, nil, nil, nil, nil, nil, nil, nil, nil,
136
- nil, nil, 125, 127, 19, 21, 130, 132, 19, 21,
137
- 19, 21, 19, 21, 20, 138, 139, 126, 20, 135,
138
- 20, 131, 20, nil, nil, nil, nil, nil, nil, nil,
139
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
140
- nil, nil, nil, 147, 19, 21, 150, nil, 148, 19,
141
- 21, 146, nil, nil, 20, nil, nil, nil, nil, 20,
142
- nil, nil, nil, nil, 19, 21, nil, nil, nil, nil,
143
- nil, 19, 21, nil, 20, nil, nil, 153, nil, nil,
144
- nil, 20 ]
128
+ 19, 20, 42, 46, 57, 34, 110, 97, 98, 111,
129
+ 21, 50, 2, 53, 51, 44, 48, 43, 47, 107,
130
+ 108, 78, 56, 99, 100, 54, 117, 141, 58, 101,
131
+ 102, 103, 104, 105, 106, 74, 75, 69, 1, 56,
132
+ 84, 19, 20, nil, 88, 19, 20, nil, nil, nil,
133
+ nil, 21, nil, 85, nil, 21, 86, 89, nil, nil,
134
+ 90, nil, nil, 92, nil, nil, 94, nil, nil, nil,
135
+ nil, nil, nil, 146, nil, nil, nil, nil, nil, nil,
136
+ nil, nil, 123, 125, 19, 20, 128, 130, 19, 20,
137
+ 19, 20, 19, 20, 21, 137, 133, 124, 21, 136,
138
+ 21, 129, 21, nil, nil, nil, nil, nil, nil, nil,
139
+ nil, nil, nil, nil, nil, nil, 140, nil, nil, nil,
140
+ 145, 143, 19, 20, nil, nil, 144, 19, 20, 142,
141
+ nil, nil, 21, nil, nil, nil, nil, 21, 56, nil,
142
+ 19, 20, nil, nil, nil, nil, 19, 20, nil, nil,
143
+ 21, nil, nil, 148, nil, nil, 21 ]
145
144
 
146
145
  racc_goto_check = [
147
- 32, 26, 16, 17, 4, 15, 15, 9, 11, 25,
148
- 31, 23, 2, 7, 21, 3, 3, 2, 2, 8,
149
- 8, 5, 5, 9, 27, 29, 30, 4, 10, 1,
150
- nil, nil, 11, nil, nil, 4, 4, nil, nil, 16,
151
- 32, 26, 15, 17, 32, 26, 15, nil, nil, nil,
152
- 31, nil, nil, nil, 31, 2, nil, nil, nil, 2,
153
- nil, nil, 2, nil, nil, 2, 6, 6, 6, 6,
154
- 6, 6, nil, nil, nil, nil, nil, nil, nil, nil,
155
- nil, nil, 16, 16, 32, 26, 17, 17, 32, 26,
156
- 32, 26, 32, 26, 31, 25, 4, 2, 31, 21,
157
- 31, 2, 31, nil, nil, nil, nil, nil, nil, nil,
158
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
159
- nil, nil, nil, 16, 32, 26, 9, nil, 17, 32,
160
- 26, 2, nil, nil, 31, nil, nil, nil, nil, 31,
161
- nil, nil, nil, nil, 32, 26, nil, nil, nil, nil,
162
- nil, 32, 26, nil, 31, nil, nil, 2, nil, nil,
163
- nil, 31 ]
146
+ 33, 32, 17, 18, 3, 6, 11, 5, 5, 12,
147
+ 27, 22, 2, 26, 24, 16, 16, 2, 2, 10,
148
+ 10, 3, 4, 7, 7, 28, 30, 31, 6, 8,
149
+ 8, 8, 8, 8, 8, 4, 4, 9, 1, 4,
150
+ 17, 33, 32, nil, 18, 33, 32, nil, nil, nil,
151
+ nil, 27, nil, 16, nil, 27, 2, 16, nil, nil,
152
+ 2, nil, nil, 2, nil, nil, 2, nil, nil, nil,
153
+ nil, nil, nil, 11, nil, nil, nil, nil, nil, nil,
154
+ nil, nil, 17, 17, 33, 32, 18, 18, 33, 32,
155
+ 33, 32, 33, 32, 27, 4, 22, 2, 27, 26,
156
+ 27, 2, 27, nil, nil, nil, nil, nil, nil, nil,
157
+ nil, nil, nil, nil, nil, nil, 6, nil, nil, nil,
158
+ 3, 17, 33, 32, nil, nil, 18, 33, 32, 2,
159
+ nil, nil, 27, nil, nil, nil, nil, 27, 4, nil,
160
+ 33, 32, nil, nil, nil, nil, 33, 32, nil, nil,
161
+ 27, nil, nil, 2, nil, nil, 27 ]
164
162
 
165
163
  racc_goto_pointer = [
166
- nil, 29, 12, -44, 1, -40, 3, -18, -51, -15,
167
- -114, -65, nil, nil, nil, 0, -3, -3, nil, nil,
168
- nil, 7, nil, 4, nil, 1, -1, 16, nil, -54,
169
- -92, 8, -2 ]
164
+ nil, 38, 12, -18, 0, -52, 2, -38, -34, 6,
165
+ -51, -66, -63, nil, nil, nil, 10, -3, -3, nil,
166
+ nil, nil, 4, nil, 7, nil, 5, 8, 17, nil,
167
+ -53, -89, -1, -2 ]
170
168
 
171
169
  racc_goto_default = [
172
- nil, nil, nil, 27, 56, 28, 29, 30, 32, nil,
173
- 112, nil, 10, 5, 6, nil, nil, nil, 11, 12,
174
- 7, nil, 13, nil, 8, nil, 17, nil, 14, nil,
175
- nil, 16, 15 ]
170
+ nil, nil, nil, nil, 33, 27, nil, 28, 29, 30,
171
+ 32, nil, nil, 10, 5, 6, nil, nil, nil, 11,
172
+ 12, 7, nil, 13, nil, 8, nil, 17, nil, 14,
173
+ nil, nil, 16, 15 ]
176
174
 
177
175
  racc_reduce_table = [
178
176
  0, 0, :racc_error,
179
177
  1, 42, :_reduce_none,
180
178
  0, 42, :_reduce_2,
181
179
  1, 44, :_reduce_3,
182
- 1, 44, :_reduce_4,
183
- 1, 44, :_reduce_5,
184
- 1, 44, :_reduce_6,
185
- 3, 44, :_reduce_7,
186
- 1, 46, :_reduce_none,
187
- 3, 46, :_reduce_9,
180
+ 3, 44, :_reduce_4,
181
+ 1, 46, :_reduce_5,
182
+ 2, 46, :_reduce_6,
183
+ 1, 46, :_reduce_7,
184
+ 1, 46, :_reduce_8,
185
+ 1, 46, :_reduce_9,
188
186
  3, 46, :_reduce_10,
189
- 1, 47, :_reduce_none,
190
- 3, 47, :_reduce_12,
191
- 3, 47, :_reduce_13,
192
187
  1, 48, :_reduce_none,
193
- 3, 48, :_reduce_15,
194
- 3, 48, :_reduce_16,
195
- 3, 48, :_reduce_17,
196
- 3, 48, :_reduce_18,
197
- 3, 48, :_reduce_19,
198
- 3, 48, :_reduce_20,
188
+ 3, 48, :_reduce_12,
189
+ 3, 48, :_reduce_13,
199
190
  1, 49, :_reduce_none,
200
- 2, 49, :_reduce_22,
191
+ 3, 49, :_reduce_15,
192
+ 3, 49, :_reduce_16,
193
+ 1, 50, :_reduce_none,
194
+ 3, 50, :_reduce_18,
195
+ 3, 50, :_reduce_19,
196
+ 3, 50, :_reduce_20,
197
+ 3, 50, :_reduce_21,
198
+ 3, 50, :_reduce_22,
199
+ 3, 50, :_reduce_23,
200
+ 1, 51, :_reduce_none,
201
+ 2, 51, :_reduce_25,
201
202
  1, 45, :_reduce_none,
202
- 3, 45, :_reduce_24,
203
- 3, 45, :_reduce_25,
204
- 1, 50, :_reduce_26,
205
- 3, 50, :_reduce_27,
206
- 1, 51, :_reduce_28,
207
- 3, 51, :_reduce_29,
208
- 1, 52, :_reduce_30,
209
- 3, 52, :_reduce_31,
203
+ 3, 45, :_reduce_27,
204
+ 3, 45, :_reduce_28,
205
+ 1, 52, :_reduce_29,
206
+ 3, 52, :_reduce_30,
207
+ 1, 53, :_reduce_31,
210
208
  3, 53, :_reduce_32,
211
- 5, 53, :_reduce_33,
212
- 4, 53, :_reduce_34,
213
- 6, 53, :_reduce_35,
214
- 4, 54, :_reduce_36,
215
- 4, 55, :_reduce_37,
216
- 3, 56, :_reduce_38,
217
- 3, 57, :_reduce_none,
209
+ 1, 47, :_reduce_none,
210
+ 3, 47, :_reduce_34,
211
+ 3, 54, :_reduce_35,
212
+ 4, 55, :_reduce_36,
213
+ 4, 56, :_reduce_37,
214
+ 3, 57, :_reduce_38,
218
215
  3, 58, :_reduce_none,
219
- 2, 59, :_reduce_41,
220
- 3, 59, :_reduce_42,
221
- 4, 59, :_reduce_43,
222
- 4, 59, :_reduce_44,
223
- 5, 59, :_reduce_45,
224
- 2, 60, :_reduce_46,
225
- 3, 60, :_reduce_47,
226
- 4, 60, :_reduce_48,
227
- 4, 60, :_reduce_49,
228
- 5, 60, :_reduce_50,
229
- 6, 61, :_reduce_51,
230
- 3, 62, :_reduce_none,
231
- 2, 63, :_reduce_53,
232
- 0, 64, :_reduce_54,
233
- 4, 63, :_reduce_55,
234
- 4, 65, :_reduce_56,
235
- 3, 66, :_reduce_none,
236
- 2, 67, :_reduce_58,
237
- 0, 68, :_reduce_59,
238
- 4, 67, :_reduce_60,
239
- 0, 70, :_reduce_61,
240
- 8, 69, :_reduce_62,
241
- 0, 71, :_reduce_63,
242
- 9, 69, :_reduce_64,
243
- 4, 72, :_reduce_65,
244
- 4, 72, :_reduce_66,
245
- 1, 73, :_reduce_67,
246
- 1, 73, :_reduce_none,
247
- 1, 73, :_reduce_none,
248
- 1, 73, :_reduce_none,
249
- 1, 73, :_reduce_none,
250
- 1, 73, :_reduce_none,
216
+ 3, 59, :_reduce_none,
217
+ 2, 60, :_reduce_41,
218
+ 3, 60, :_reduce_42,
219
+ 4, 60, :_reduce_43,
220
+ 4, 60, :_reduce_44,
221
+ 5, 60, :_reduce_45,
222
+ 2, 61, :_reduce_46,
223
+ 3, 61, :_reduce_47,
224
+ 4, 61, :_reduce_48,
225
+ 4, 61, :_reduce_49,
226
+ 5, 61, :_reduce_50,
227
+ 6, 62, :_reduce_51,
228
+ 3, 63, :_reduce_none,
229
+ 2, 64, :_reduce_53,
230
+ 0, 65, :_reduce_54,
231
+ 4, 64, :_reduce_55,
232
+ 4, 66, :_reduce_56,
233
+ 3, 67, :_reduce_none,
234
+ 2, 68, :_reduce_58,
235
+ 0, 69, :_reduce_59,
236
+ 4, 68, :_reduce_60,
237
+ 0, 71, :_reduce_61,
238
+ 8, 70, :_reduce_62,
239
+ 0, 72, :_reduce_63,
240
+ 9, 70, :_reduce_64,
241
+ 4, 73, :_reduce_65,
242
+ 4, 73, :_reduce_66,
243
+ 1, 74, :_reduce_67,
244
+ 1, 74, :_reduce_none,
245
+ 1, 74, :_reduce_none,
246
+ 1, 74, :_reduce_none,
247
+ 1, 74, :_reduce_none,
248
+ 1, 74, :_reduce_none,
251
249
  1, 43, :_reduce_73,
252
250
  2, 43, :_reduce_74,
253
251
  1, 43, :_reduce_75,
@@ -257,31 +255,31 @@ racc_reduce_table = [
257
255
 
258
256
  racc_reduce_n = 79
259
257
 
260
- racc_shift_n = 160
258
+ racc_shift_n = 155
261
259
 
262
260
  racc_token_table = {
263
261
  false => 0,
264
262
  :error => 1,
265
- :IDENTIFIER => 2,
266
- :INTEGER => 3,
267
- :REAL => 4,
268
- :STRING => 5,
269
- "(" => 6,
270
- ")" => 7,
271
- "*" => 8,
272
- "/" => 9,
273
- "+" => 10,
274
- "-" => 11,
275
- :OP_EQ => 12,
276
- :OP_NEQ => 13,
277
- :OP_LEQ => 14,
278
- :OP_GEQ => 15,
279
- ">" => 16,
280
- "<" => 17,
281
- :NOT => 18,
282
- :AND => 19,
283
- :OR => 20,
284
- "," => 21,
263
+ "," => 2,
264
+ :IDENTIFIER => 3,
265
+ :INTEGER => 4,
266
+ :REAL => 5,
267
+ :STRING => 6,
268
+ "(" => 7,
269
+ ")" => 8,
270
+ "*" => 9,
271
+ "/" => 10,
272
+ "+" => 11,
273
+ "-" => 12,
274
+ :OP_EQ => 13,
275
+ :OP_NEQ => 14,
276
+ :OP_LEQ => 15,
277
+ :OP_GEQ => 16,
278
+ ">" => 17,
279
+ "<" => 18,
280
+ :NOT => 19,
281
+ :AND => 20,
282
+ :OR => 21,
285
283
  ":" => 22,
286
284
  "|" => 23,
287
285
  :VAR_OPEN => 24,
@@ -325,6 +323,7 @@ Racc_arg = [
325
323
  Racc_token_to_s_table = [
326
324
  "$end",
327
325
  "error",
326
+ "\",\"",
328
327
  "IDENTIFIER",
329
328
  "INTEGER",
330
329
  "REAL",
@@ -344,7 +343,6 @@ Racc_token_to_s_table = [
344
343
  "NOT",
345
344
  "AND",
346
345
  "OR",
347
- "\",\"",
348
346
  "\":\"",
349
347
  "\"|\"",
350
348
  "VAR_OPEN",
@@ -367,13 +365,14 @@ Racc_token_to_s_table = [
367
365
  "$start",
368
366
  "target",
369
367
  "document",
370
- "primary_expression",
368
+ "parameter_list",
371
369
  "logical_expression",
370
+ "primary_expression",
371
+ "filtered_expression",
372
372
  "multiplicative_expression",
373
373
  "additive_expression",
374
374
  "boolean_expression",
375
375
  "inverse_expression",
376
- "parameter_list",
377
376
  "filter",
378
377
  "filter_list",
379
378
  "inject_statement",
@@ -415,215 +414,206 @@ module_eval(<<'.,.,', 'cadenza.y', 8)
415
414
 
416
415
  module_eval(<<'.,.,', 'cadenza.y', 12)
417
416
  def _reduce_3(val, _values, result)
418
- result = VariableNode.new(val[0].value)
417
+ result = [val[0]]
419
418
  result
420
419
  end
421
420
  .,.,
422
421
 
423
422
  module_eval(<<'.,.,', 'cadenza.y', 13)
424
423
  def _reduce_4(val, _values, result)
425
- result = ConstantNode.new(val[0].value)
424
+ result = val[0].push(val[2])
426
425
  result
427
426
  end
428
427
  .,.,
429
428
 
430
- module_eval(<<'.,.,', 'cadenza.y', 14)
429
+ module_eval(<<'.,.,', 'cadenza.y', 18)
431
430
  def _reduce_5(val, _values, result)
432
- result = ConstantNode.new(val[0].value)
431
+ result = VariableNode.new(val[0].value)
433
432
  result
434
433
  end
435
434
  .,.,
436
435
 
437
- module_eval(<<'.,.,', 'cadenza.y', 15)
436
+ module_eval(<<'.,.,', 'cadenza.y', 19)
438
437
  def _reduce_6(val, _values, result)
439
- result = ConstantNode.new(val[0].value)
438
+ result = VariableNode.new(val[0].value, val[1])
440
439
  result
441
440
  end
442
441
  .,.,
443
442
 
444
- module_eval(<<'.,.,', 'cadenza.y', 16)
443
+ module_eval(<<'.,.,', 'cadenza.y', 20)
445
444
  def _reduce_7(val, _values, result)
446
- result = val[1]
445
+ result = ConstantNode.new(val[0].value)
447
446
  result
448
447
  end
449
448
  .,.,
450
449
 
451
- # reduce 8 omitted
452
-
453
450
  module_eval(<<'.,.,', 'cadenza.y', 21)
454
- def _reduce_9(val, _values, result)
455
- result = OperationNode.new(val[0], "*", val[2])
451
+ def _reduce_8(val, _values, result)
452
+ result = ConstantNode.new(val[0].value)
456
453
  result
457
454
  end
458
455
  .,.,
459
456
 
460
457
  module_eval(<<'.,.,', 'cadenza.y', 22)
458
+ def _reduce_9(val, _values, result)
459
+ result = ConstantNode.new(val[0].value)
460
+ result
461
+ end
462
+ .,.,
463
+
464
+ module_eval(<<'.,.,', 'cadenza.y', 23)
461
465
  def _reduce_10(val, _values, result)
462
- result = OperationNode.new(val[0], "/", val[2])
466
+ result = val[1]
463
467
  result
464
468
  end
465
469
  .,.,
466
470
 
467
471
  # reduce 11 omitted
468
472
 
469
- module_eval(<<'.,.,', 'cadenza.y', 27)
473
+ module_eval(<<'.,.,', 'cadenza.y', 28)
470
474
  def _reduce_12(val, _values, result)
471
- result = OperationNode.new(val[0], "+", val[2])
475
+ result = OperationNode.new(val[0], "*", val[2])
472
476
  result
473
477
  end
474
478
  .,.,
475
479
 
476
- module_eval(<<'.,.,', 'cadenza.y', 28)
480
+ module_eval(<<'.,.,', 'cadenza.y', 29)
477
481
  def _reduce_13(val, _values, result)
478
- result = OperationNode.new(val[0], "-", val[2])
482
+ result = OperationNode.new(val[0], "/", val[2])
479
483
  result
480
484
  end
481
485
  .,.,
482
486
 
483
487
  # reduce 14 omitted
484
488
 
485
- module_eval(<<'.,.,', 'cadenza.y', 33)
489
+ module_eval(<<'.,.,', 'cadenza.y', 34)
486
490
  def _reduce_15(val, _values, result)
487
- result = OperationNode.new(val[0], "==", val[2])
491
+ result = OperationNode.new(val[0], "+", val[2])
488
492
  result
489
493
  end
490
494
  .,.,
491
495
 
492
- module_eval(<<'.,.,', 'cadenza.y', 34)
496
+ module_eval(<<'.,.,', 'cadenza.y', 35)
493
497
  def _reduce_16(val, _values, result)
494
- result = OperationNode.new(val[0], "!=", val[2])
498
+ result = OperationNode.new(val[0], "-", val[2])
495
499
  result
496
500
  end
497
501
  .,.,
498
502
 
499
- module_eval(<<'.,.,', 'cadenza.y', 35)
500
- def _reduce_17(val, _values, result)
501
- result = OperationNode.new(val[0], "<=", val[2])
502
- result
503
- end
504
- .,.,
503
+ # reduce 17 omitted
505
504
 
506
- module_eval(<<'.,.,', 'cadenza.y', 36)
505
+ module_eval(<<'.,.,', 'cadenza.y', 40)
507
506
  def _reduce_18(val, _values, result)
508
- result = OperationNode.new(val[0], ">=", val[2])
507
+ result = OperationNode.new(val[0], "==", val[2])
509
508
  result
510
509
  end
511
510
  .,.,
512
511
 
513
- module_eval(<<'.,.,', 'cadenza.y', 37)
512
+ module_eval(<<'.,.,', 'cadenza.y', 41)
514
513
  def _reduce_19(val, _values, result)
515
- result = OperationNode.new(val[0], ">", val[2])
514
+ result = OperationNode.new(val[0], "!=", val[2])
516
515
  result
517
516
  end
518
517
  .,.,
519
518
 
520
- module_eval(<<'.,.,', 'cadenza.y', 38)
519
+ module_eval(<<'.,.,', 'cadenza.y', 42)
521
520
  def _reduce_20(val, _values, result)
522
- result = OperationNode.new(val[0], "<", val[2])
521
+ result = OperationNode.new(val[0], "<=", val[2])
523
522
  result
524
523
  end
525
524
  .,.,
526
525
 
527
- # reduce 21 omitted
528
-
529
526
  module_eval(<<'.,.,', 'cadenza.y', 43)
530
- def _reduce_22(val, _values, result)
531
- result = BooleanInverseNode.new(val[1])
527
+ def _reduce_21(val, _values, result)
528
+ result = OperationNode.new(val[0], ">=", val[2])
532
529
  result
533
530
  end
534
531
  .,.,
535
532
 
536
- # reduce 23 omitted
537
-
538
- module_eval(<<'.,.,', 'cadenza.y', 48)
539
- def _reduce_24(val, _values, result)
540
- result = OperationNode.new(val[0], "and", val[2])
533
+ module_eval(<<'.,.,', 'cadenza.y', 44)
534
+ def _reduce_22(val, _values, result)
535
+ result = OperationNode.new(val[0], ">", val[2])
541
536
  result
542
537
  end
543
538
  .,.,
544
539
 
545
- module_eval(<<'.,.,', 'cadenza.y', 49)
546
- def _reduce_25(val, _values, result)
547
- result = OperationNode.new(val[0], "or", val[2])
540
+ module_eval(<<'.,.,', 'cadenza.y', 45)
541
+ def _reduce_23(val, _values, result)
542
+ result = OperationNode.new(val[0], "<", val[2])
548
543
  result
549
544
  end
550
545
  .,.,
551
546
 
552
- module_eval(<<'.,.,', 'cadenza.y', 53)
553
- def _reduce_26(val, _values, result)
554
- result = [val[0]]
547
+ # reduce 24 omitted
548
+
549
+ module_eval(<<'.,.,', 'cadenza.y', 50)
550
+ def _reduce_25(val, _values, result)
551
+ result = BooleanInverseNode.new(val[1])
555
552
  result
556
553
  end
557
554
  .,.,
558
555
 
559
- module_eval(<<'.,.,', 'cadenza.y', 54)
556
+ # reduce 26 omitted
557
+
558
+ module_eval(<<'.,.,', 'cadenza.y', 55)
560
559
  def _reduce_27(val, _values, result)
561
- result = val[0].push(val[2])
560
+ result = OperationNode.new(val[0], "and", val[2])
562
561
  result
563
562
  end
564
563
  .,.,
565
564
 
566
- module_eval(<<'.,.,', 'cadenza.y', 58)
565
+ module_eval(<<'.,.,', 'cadenza.y', 56)
567
566
  def _reduce_28(val, _values, result)
568
- result = FilterNode.new(val[0].value)
567
+ result = OperationNode.new(val[0], "or", val[2])
569
568
  result
570
569
  end
571
570
  .,.,
572
571
 
573
- module_eval(<<'.,.,', 'cadenza.y', 59)
572
+ module_eval(<<'.,.,', 'cadenza.y', 60)
574
573
  def _reduce_29(val, _values, result)
575
- result = FilterNode.new(val[0].value, val[2])
574
+ result = FilterNode.new(val[0].value)
576
575
  result
577
576
  end
578
577
  .,.,
579
578
 
580
- module_eval(<<'.,.,', 'cadenza.y', 63)
579
+ module_eval(<<'.,.,', 'cadenza.y', 61)
581
580
  def _reduce_30(val, _values, result)
582
- result = [val[0]]
581
+ result = FilterNode.new(val[0].value, val[2])
583
582
  result
584
583
  end
585
584
  .,.,
586
585
 
587
- module_eval(<<'.,.,', 'cadenza.y', 64)
586
+ module_eval(<<'.,.,', 'cadenza.y', 65)
588
587
  def _reduce_31(val, _values, result)
589
- result = val[0].push(val[2])
588
+ result = [val[0]]
590
589
  result
591
590
  end
592
591
  .,.,
593
592
 
594
- module_eval(<<'.,.,', 'cadenza.y', 69)
593
+ module_eval(<<'.,.,', 'cadenza.y', 66)
595
594
  def _reduce_32(val, _values, result)
596
- result = InjectNode.new(val[1])
595
+ result = val[0].push(val[2])
597
596
  result
598
597
  end
599
598
  .,.,
600
599
 
601
- module_eval(<<'.,.,', 'cadenza.y', 71)
602
- def _reduce_33(val, _values, result)
603
- result = InjectNode.new(val[1], val[3])
604
- result
605
- end
606
- .,.,
600
+ # reduce 33 omitted
607
601
 
608
- module_eval(<<'.,.,', 'cadenza.y', 74)
602
+ module_eval(<<'.,.,', 'cadenza.y', 71)
609
603
  def _reduce_34(val, _values, result)
610
- variable = VariableNode.new(val[1].value)
611
- result = InjectNode.new(variable, [], val[2])
612
-
604
+ result = FilteredValueNode.new(val[0], val[2])
613
605
  result
614
606
  end
615
607
  .,.,
616
608
 
617
- module_eval(<<'.,.,', 'cadenza.y', 79)
609
+ module_eval(<<'.,.,', 'cadenza.y', 75)
618
610
  def _reduce_35(val, _values, result)
619
- variable = VariableNode.new(val[1].value)
620
- result = InjectNode.new(variable, val[4], val[2])
621
-
611
+ result = val[1]
622
612
  result
623
613
  end
624
614
  .,.,
625
615
 
626
- module_eval(<<'.,.,', 'cadenza.y', 87)
616
+ module_eval(<<'.,.,', 'cadenza.y', 81)
627
617
  def _reduce_36(val, _values, result)
628
618
  @stack.push DocumentNode.new
629
619
  result = val[2]
@@ -632,7 +622,7 @@ module_eval(<<'.,.,', 'cadenza.y', 87)
632
622
  end
633
623
  .,.,
634
624
 
635
- module_eval(<<'.,.,', 'cadenza.y', 95)
625
+ module_eval(<<'.,.,', 'cadenza.y', 89)
636
626
  def _reduce_37(val, _values, result)
637
627
  @stack.push DocumentNode.new
638
628
  result = BooleanInverseNode.new(val[2])
@@ -641,7 +631,7 @@ module_eval(<<'.,.,', 'cadenza.y', 95)
641
631
  end
642
632
  .,.,
643
633
 
644
- module_eval(<<'.,.,', 'cadenza.y', 101)
634
+ module_eval(<<'.,.,', 'cadenza.y', 95)
645
635
  def _reduce_38(val, _values, result)
646
636
  @stack.push DocumentNode.new
647
637
  result
@@ -652,21 +642,21 @@ module_eval(<<'.,.,', 'cadenza.y', 101)
652
642
 
653
643
  # reduce 40 omitted
654
644
 
655
- module_eval(<<'.,.,', 'cadenza.y', 113)
645
+ module_eval(<<'.,.,', 'cadenza.y', 107)
656
646
  def _reduce_41(val, _values, result)
657
647
  @stack.pop; result = IfNode.new(val[0])
658
648
  result
659
649
  end
660
650
  .,.,
661
651
 
662
- module_eval(<<'.,.,', 'cadenza.y', 114)
652
+ module_eval(<<'.,.,', 'cadenza.y', 108)
663
653
  def _reduce_42(val, _values, result)
664
654
  result = IfNode.new(val[0], @stack.pop.children)
665
655
  result
666
656
  end
667
657
  .,.,
668
658
 
669
- module_eval(<<'.,.,', 'cadenza.y', 117)
659
+ module_eval(<<'.,.,', 'cadenza.y', 111)
670
660
  def _reduce_43(val, _values, result)
671
661
  false_children, true_children = @stack.pop.children, @stack.pop.children
672
662
  result = IfNode.new(val[0], true_children, false_children)
@@ -675,7 +665,7 @@ module_eval(<<'.,.,', 'cadenza.y', 117)
675
665
  end
676
666
  .,.,
677
667
 
678
- module_eval(<<'.,.,', 'cadenza.y', 122)
668
+ module_eval(<<'.,.,', 'cadenza.y', 116)
679
669
  def _reduce_44(val, _values, result)
680
670
  false_children, true_children = @stack.pop.children, @stack.pop.children
681
671
  result = IfNode.new(val[0], true_children, false_children)
@@ -684,7 +674,7 @@ module_eval(<<'.,.,', 'cadenza.y', 122)
684
674
  end
685
675
  .,.,
686
676
 
687
- module_eval(<<'.,.,', 'cadenza.y', 127)
677
+ module_eval(<<'.,.,', 'cadenza.y', 121)
688
678
  def _reduce_45(val, _values, result)
689
679
  false_children, true_children = @stack.pop.children, @stack.pop.children
690
680
  result = IfNode.new(val[0], true_children, false_children)
@@ -693,21 +683,21 @@ module_eval(<<'.,.,', 'cadenza.y', 127)
693
683
  end
694
684
  .,.,
695
685
 
696
- module_eval(<<'.,.,', 'cadenza.y', 133)
686
+ module_eval(<<'.,.,', 'cadenza.y', 127)
697
687
  def _reduce_46(val, _values, result)
698
688
  @stack.pop; result = IfNode.new(val[0])
699
689
  result
700
690
  end
701
691
  .,.,
702
692
 
703
- module_eval(<<'.,.,', 'cadenza.y', 134)
693
+ module_eval(<<'.,.,', 'cadenza.y', 128)
704
694
  def _reduce_47(val, _values, result)
705
695
  result = IfNode.new(val[0], @stack.pop.children)
706
696
  result
707
697
  end
708
698
  .,.,
709
699
 
710
- module_eval(<<'.,.,', 'cadenza.y', 137)
700
+ module_eval(<<'.,.,', 'cadenza.y', 131)
711
701
  def _reduce_48(val, _values, result)
712
702
  false_children, true_children = @stack.pop.children, @stack.pop.children
713
703
  result = IfNode.new(val[0], true_children, false_children)
@@ -716,7 +706,7 @@ module_eval(<<'.,.,', 'cadenza.y', 137)
716
706
  end
717
707
  .,.,
718
708
 
719
- module_eval(<<'.,.,', 'cadenza.y', 142)
709
+ module_eval(<<'.,.,', 'cadenza.y', 136)
720
710
  def _reduce_49(val, _values, result)
721
711
  false_children, true_children = @stack.pop.children, @stack.pop.children
722
712
  result = IfNode.new(val[0], true_children, false_children)
@@ -725,7 +715,7 @@ module_eval(<<'.,.,', 'cadenza.y', 142)
725
715
  end
726
716
  .,.,
727
717
 
728
- module_eval(<<'.,.,', 'cadenza.y', 147)
718
+ module_eval(<<'.,.,', 'cadenza.y', 141)
729
719
  def _reduce_50(val, _values, result)
730
720
  false_children, true_children = @stack.pop.children, @stack.pop.children
731
721
  result = IfNode.new(val[0], true_children, false_children)
@@ -734,19 +724,19 @@ module_eval(<<'.,.,', 'cadenza.y', 147)
734
724
  end
735
725
  .,.,
736
726
 
737
- module_eval(<<'.,.,', 'cadenza.y', 153)
727
+ module_eval(<<'.,.,', 'cadenza.y', 147)
738
728
  def _reduce_51(val, _values, result)
739
- result = [val[2].value, val[4].value]
729
+ result = [val[2].value, val[4]]
740
730
  result
741
731
  end
742
732
  .,.,
743
733
 
744
734
  # reduce 52 omitted
745
735
 
746
- module_eval(<<'.,.,', 'cadenza.y', 164)
736
+ module_eval(<<'.,.,', 'cadenza.y', 158)
747
737
  def _reduce_53(val, _values, result)
748
738
  iterator = VariableNode.new(val[0][0])
749
- iterable = VariableNode.new(val[0][1])
739
+ iterable = val[0][1]
750
740
 
751
741
  result = ForNode.new(iterator, iterable, [])
752
742
 
@@ -754,17 +744,17 @@ module_eval(<<'.,.,', 'cadenza.y', 164)
754
744
  end
755
745
  .,.,
756
746
 
757
- module_eval(<<'.,.,', 'cadenza.y', 169)
747
+ module_eval(<<'.,.,', 'cadenza.y', 163)
758
748
  def _reduce_54(val, _values, result)
759
749
  @stack.push DocumentNode.new
760
750
  result
761
751
  end
762
752
  .,.,
763
753
 
764
- module_eval(<<'.,.,', 'cadenza.y', 171)
754
+ module_eval(<<'.,.,', 'cadenza.y', 165)
765
755
  def _reduce_55(val, _values, result)
766
756
  iterator = VariableNode.new(val[0][0])
767
- iterable = VariableNode.new(val[0][1])
757
+ iterable = val[0][1]
768
758
 
769
759
  result = ForNode.new(iterator, iterable, @stack.pop.children)
770
760
 
@@ -772,7 +762,7 @@ module_eval(<<'.,.,', 'cadenza.y', 171)
772
762
  end
773
763
  .,.,
774
764
 
775
- module_eval(<<'.,.,', 'cadenza.y', 179)
765
+ module_eval(<<'.,.,', 'cadenza.y', 173)
776
766
  def _reduce_56(val, _values, result)
777
767
  result = val[2].value
778
768
  result
@@ -781,70 +771,70 @@ module_eval(<<'.,.,', 'cadenza.y', 179)
781
771
 
782
772
  # reduce 57 omitted
783
773
 
784
- module_eval(<<'.,.,', 'cadenza.y', 188)
774
+ module_eval(<<'.,.,', 'cadenza.y', 182)
785
775
  def _reduce_58(val, _values, result)
786
776
  result = BlockNode.new(val[0], [])
787
777
  result
788
778
  end
789
779
  .,.,
790
780
 
791
- module_eval(<<'.,.,', 'cadenza.y', 189)
781
+ module_eval(<<'.,.,', 'cadenza.y', 183)
792
782
  def _reduce_59(val, _values, result)
793
783
  @stack.push DocumentNode.new
794
784
  result
795
785
  end
796
786
  .,.,
797
787
 
798
- module_eval(<<'.,.,', 'cadenza.y', 189)
788
+ module_eval(<<'.,.,', 'cadenza.y', 183)
799
789
  def _reduce_60(val, _values, result)
800
790
  result = BlockNode.new(val[0], @stack.pop.children)
801
791
  result
802
792
  end
803
793
  .,.,
804
794
 
805
- module_eval(<<'.,.,', 'cadenza.y', 193)
795
+ module_eval(<<'.,.,', 'cadenza.y', 187)
806
796
  def _reduce_61(val, _values, result)
807
797
  @stack.push DocumentNode.new
808
798
  result
809
799
  end
810
800
  .,.,
811
801
 
812
- module_eval(<<'.,.,', 'cadenza.y', 195)
802
+ module_eval(<<'.,.,', 'cadenza.y', 189)
813
803
  def _reduce_62(val, _values, result)
814
804
  result = GenericBlockNode.new(val[1].value, @stack.pop.children)
815
805
  result
816
806
  end
817
807
  .,.,
818
808
 
819
- module_eval(<<'.,.,', 'cadenza.y', 196)
809
+ module_eval(<<'.,.,', 'cadenza.y', 190)
820
810
  def _reduce_63(val, _values, result)
821
811
  @stack.push DocumentNode.new
822
812
  result
823
813
  end
824
814
  .,.,
825
815
 
826
- module_eval(<<'.,.,', 'cadenza.y', 198)
816
+ module_eval(<<'.,.,', 'cadenza.y', 192)
827
817
  def _reduce_64(val, _values, result)
828
818
  result = GenericBlockNode.new(val[1].value, @stack.pop.children, val[2])
829
819
  result
830
820
  end
831
821
  .,.,
832
822
 
833
- module_eval(<<'.,.,', 'cadenza.y', 202)
823
+ module_eval(<<'.,.,', 'cadenza.y', 196)
834
824
  def _reduce_65(val, _values, result)
835
825
  result = val[2].value
836
826
  result
837
827
  end
838
828
  .,.,
839
829
 
840
- module_eval(<<'.,.,', 'cadenza.y', 203)
830
+ module_eval(<<'.,.,', 'cadenza.y', 197)
841
831
  def _reduce_66(val, _values, result)
842
832
  result = VariableNode.new(val[2].value)
843
833
  result
844
834
  end
845
835
  .,.,
846
836
 
847
- module_eval(<<'.,.,', 'cadenza.y', 207)
837
+ module_eval(<<'.,.,', 'cadenza.y', 201)
848
838
  def _reduce_67(val, _values, result)
849
839
  result = TextNode.new(val[0].value)
850
840
  result
@@ -861,42 +851,42 @@ module_eval(<<'.,.,', 'cadenza.y', 207)
861
851
 
862
852
  # reduce 72 omitted
863
853
 
864
- module_eval(<<'.,.,', 'cadenza.y', 216)
854
+ module_eval(<<'.,.,', 'cadenza.y', 210)
865
855
  def _reduce_73(val, _values, result)
866
856
  push_child val[0]
867
857
  result
868
858
  end
869
859
  .,.,
870
860
 
871
- module_eval(<<'.,.,', 'cadenza.y', 217)
861
+ module_eval(<<'.,.,', 'cadenza.y', 211)
872
862
  def _reduce_74(val, _values, result)
873
863
  push_child val[1]
874
864
  result
875
865
  end
876
866
  .,.,
877
867
 
878
- module_eval(<<'.,.,', 'cadenza.y', 218)
868
+ module_eval(<<'.,.,', 'cadenza.y', 212)
879
869
  def _reduce_75(val, _values, result)
880
870
  @stack.first.extends = val[0]
881
871
  result
882
872
  end
883
873
  .,.,
884
874
 
885
- module_eval(<<'.,.,', 'cadenza.y', 219)
875
+ module_eval(<<'.,.,', 'cadenza.y', 213)
886
876
  def _reduce_76(val, _values, result)
887
877
  @stack.first.extends = val[1]
888
878
  result
889
879
  end
890
880
  .,.,
891
881
 
892
- module_eval(<<'.,.,', 'cadenza.y', 220)
882
+ module_eval(<<'.,.,', 'cadenza.y', 214)
893
883
  def _reduce_77(val, _values, result)
894
884
  push_block(val[0])
895
885
  result
896
886
  end
897
887
  .,.,
898
888
 
899
- module_eval(<<'.,.,', 'cadenza.y', 221)
889
+ module_eval(<<'.,.,', 'cadenza.y', 215)
900
890
  def _reduce_78(val, _values, result)
901
891
  push_block(val[1])
902
892
  result