livetext 0.9.26 → 0.9.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/livetext/funcall.rb +13 -94
  3. data/lib/livetext/lineparser.rb +165 -31
  4. data/lib/livetext/parser/string.rb +14 -5
  5. data/lib/livetext/skeleton.rb +0 -4
  6. data/lib/livetext/standard.rb +2 -2
  7. data/lib/livetext/userapi.rb +0 -1
  8. data/lib/livetext/version.rb +1 -1
  9. data/lib/livetext.rb +0 -1
  10. data/test/snapshots/basic_formatting/actual-output.txt +8 -8
  11. data/test/snapshots/basic_formatting/out-sdiff.txt +8 -8
  12. data/test/snapshots/functions/actual-error.txt +19 -0
  13. data/test/snapshots/functions/actual-output.txt +0 -0
  14. data/test/snapshots/functions/err-sdiff.txt +20 -0
  15. data/test/snapshots/more_complex_vars/actual-error.txt +0 -0
  16. data/test/snapshots/more_complex_vars/actual-output.txt +4 -0
  17. data/test/snapshots/more_complex_vars/err-sdiff.txt +1 -0
  18. data/test/snapshots/more_complex_vars/out-sdiff.txt +5 -0
  19. data/test/snapshots/more_functions/actual-error.txt +19 -0
  20. data/test/snapshots/more_functions/actual-output.txt +0 -37
  21. data/test/snapshots/more_functions/err-sdiff.txt +19 -0
  22. data/test/snapshots/raw_lines/actual-error.txt +22 -0
  23. data/test/snapshots/raw_lines/actual-output.txt +0 -0
  24. data/test/snapshots/raw_lines/err-sdiff.txt +23 -0
  25. data/test/snapshots/simple_vars/actual-output.txt +2 -2
  26. data/test/snapshots/simple_vars/out-sdiff.txt +2 -2
  27. data/test/snapshots/var_into_func/actual-error.txt +19 -0
  28. data/test/snapshots/var_into_func/actual-output.txt +0 -16
  29. data/test/snapshots/var_into_func/err-sdiff.txt +19 -0
  30. data/test/unit/all.rb +0 -1
  31. data/test/unit/lineparser.rb +62 -353
  32. data/test/unit/new_lineparser.rb +359 -0
  33. data/test/unit/tokenizer.rb +2 -1
  34. metadata +13 -6
  35. data/lib/livetext/formatline.rb +0 -408
  36. data/test/snapshots/more_functions/out-sdiff.txt +0 -38
  37. data/test/testlines.rb +0 -37
  38. data/test/unit/formatline.rb +0 -638
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1744d4ccec6a1c997c1f37660276d9bbd13bc458b612e00ff90de5f0eab93261
4
- data.tar.gz: 0ce2af2ed7e189f8128a94c93468f9044fdef6a044c4e551655ece97b6eaa3da
3
+ metadata.gz: 47f377b248a2fdc2136cf68dc4a05596629723072ef84ce52b6aaea0a02edb03
4
+ data.tar.gz: 3867a6a0ca695985aed1555eefcc93193bb530dc1d43047f2c70c8b9b5f37744
5
5
  SHA512:
6
- metadata.gz: 497f2e381f4ee255dc2b336fb6f287e136858e4d8daf96e6f652c321013d68e13139f41507e532bb1a57dd85b41afd6e8b5b6a35ce8f9cbb2b5b38eb7ccbde51
7
- data.tar.gz: c5fcb435da4ee42395872a91f27ed5f2a1f67273f70b7e7bfdafe781b90a3170203bae9536ffd9dfb0e9af14e3cd0fde7a543c17e9aecdea1983fb4be8d74fd9
6
+ metadata.gz: c4d46b9519adeee2385e686739b4b29580c76cacf71d6bc8ed3679573378a19e54833c199e000a8a457d7561d1c68855e9b64805cbd599f54eb61bd902f49a38
7
+ data.tar.gz: 5183aa745907e4680f3b30b5a27dabc76373cc9e7926fb0df936b6f0e812681a9bc51b6533410532bdfe23e37774ba02981926cec8f5e16b4730e899a06a1489
@@ -37,6 +37,7 @@ module Livetext::LineParser::FunCall
37
37
 
38
38
  def funcall(name, param)
39
39
  err = "[Error evaluating $$#{name}(#{param})]"
40
+ name = name.gsub(/\./, "__")
40
41
  result =
41
42
  if self.send?(name, param)
42
43
  # do nothing
@@ -51,7 +52,7 @@ module Livetext::LineParser::FunCall
51
52
  add_token(:str, @token)
52
53
  func = grab_alpha
53
54
  add_token(:func, func)
54
- param = grab_func_param # may be null/missing
55
+ param = grab_func_param(grab) # may be null/missing
55
56
  param
56
57
  end
57
58
 
@@ -64,17 +65,17 @@ module Livetext::LineParser::FunCall
64
65
  end
65
66
  end
66
67
 
67
- def grab_func_param
68
- case peek
69
- when "["
70
- param = grab_bracket_param
71
- add_token(:brackets, param)
72
- when ":"
73
- param = grab_colon_param
74
- add_token(:colon, param)
75
- else # do nothing
76
- end
77
- end
68
+ # def grab_func_param
69
+ # case peek
70
+ # when "["
71
+ # param = grab_bracket_param
72
+ # add_token(:brackets, param)
73
+ # when ":"
74
+ # param = grab_colon_param
75
+ # add_token(:colon, param)
76
+ # else # do nothing
77
+ # end
78
+ # end
78
79
 
79
80
  def escaped
80
81
  grab # Eat the backslash
@@ -84,85 +85,3 @@ module Livetext::LineParser::FunCall
84
85
 
85
86
  end
86
87
 
87
-
88
- # FIXME...
89
-
90
- module Livetext::FormatLine::FunCall
91
-
92
- include Livetext::ParsingConstants
93
-
94
- def param_loop(char)
95
- param = ""
96
- loop do
97
- case peek
98
- when Escape
99
- param << escaped
100
- when char, LF, nil
101
- break
102
- else
103
- param << peek
104
- grab
105
- end
106
- end
107
- param = nil if param.empty?
108
- param
109
- end
110
-
111
- def grab_colon_param
112
- grab # grab :
113
- param = param_loop(Space)
114
- end
115
-
116
- def grab_bracket_param
117
- grab # [
118
- param = param_loop("]")
119
- grab # "]"
120
- param
121
- end
122
-
123
- def funcall(name, param)
124
- err = "[Error evaluating $$#{name}(#{param})]"
125
- func_name = name # "func_" + name.to_s
126
- result =
127
- if self.send?(func_name, param) # self.respond_to?(func_name)
128
- # do nothing
129
- else
130
- fobj = ::Livetext::Functions.new
131
- fobj.send(name, param) rescue err
132
- end
133
- result.to_s
134
- end
135
-
136
- def double_dollar
137
- case lookahead
138
- when Space; add_token :string, "$$ "; grab; return
139
- when LF, nil; add "$$"; add_token :str
140
- when Alpha
141
- add_token(:str, @token)
142
- func = grab_alpha
143
- add_token(:func, func)
144
- param = grab_func_param # may be null/missing
145
- else
146
- grab; add_token :str, "$$" + peek; return
147
- end
148
- end
149
-
150
- def grab_func_param
151
- case lookahead
152
- when "["
153
- param = grab_bracket_param
154
- add_token(:brackets, param)
155
- when ":"
156
- param = grab_colon_param
157
- add_token(:colon, param)
158
- else # do nothing
159
- end
160
- end
161
-
162
- def escaped
163
- grab # Eat the backslash
164
- ch = grab # Take next char
165
- ch
166
- end
167
-
168
- end
@@ -11,11 +11,19 @@ class Livetext::LineParser < StringParser
11
11
 
12
12
  FMTS = %w[* _ ~ `]
13
13
 
14
- attr_reader :out
15
- attr_reader :tokenlist
14
+ Ident = "[[:alpha:]]([[:alnum:]]|_)*"
15
+ Dotted = "#{Ident}(\\.#{Ident})*"
16
+ Func = "\\$\\$"
17
+ Var = "\\$"
18
+ Lbrack = "\\["
19
+ Colon = ":"
16
20
 
17
21
  def initialize(line)
18
22
  super
23
+ @rx_func_brack = Regexp.compile("^" + Func + Dotted + Lbrack)
24
+ @rx_func_colon = Regexp.compile("^" + Func + Dotted + Colon)
25
+ @rx_func_bare = Regexp.compile("^" + Func + Dotted)
26
+ @rx_var = Regexp.compile("^" + Var + Dotted)
19
27
  @token = Null.dup
20
28
  @tokenlist = []
21
29
  @live = Livetext.new
@@ -41,6 +49,14 @@ api.tty "-- result: #{result.inspect}" if $testme
41
49
  result
42
50
  end
43
51
 
52
+
53
+ def parse_formatting_brute_force
54
+ # For each format * _ ` ~
55
+ # search for: [Space|^] Char Char .* [\.,]|$
56
+ # search for: [Space|^] Char [^\[]* Space|$
57
+ # search for: [Space|^] Char \[ [^\]*] ]|$
58
+ end
59
+
44
60
  def parse_formatting
45
61
  loop do
46
62
  case peek
@@ -60,7 +76,123 @@ api.tty "-- result: #{result.inspect}" if $testme
60
76
  add_token(:str)
61
77
  @tokenlist
62
78
  end
79
+
80
+ def grab_str
81
+ @buffer = ""
82
+ loop do
83
+ @buffer << self.grab
84
+ break if remainder.empty? || self.peek == "$"
85
+ end
86
+ @buffer
87
+ end
88
+
89
+ def grab_dd
90
+ @buffer = self.grab(2)
91
+ add_token(:str, @buffer)
92
+ @buffer = ""
93
+ end
94
+
95
+ def grab_var
96
+ matched = @rx_var.match(remainder)
97
+ vname = matched[0]
98
+ add_token(:var, vname[1..-1])
99
+ grab(vname.length)
100
+ end
101
+
102
+ def parse_variables
103
+ @buffer = ""
104
+ loop do
105
+ case
106
+ when remainder.empty? # end of string
107
+ break
108
+ when self.peek != "$" # Junk
109
+ str = grab_str
110
+ add_token(:str, str)
111
+ when self.peek(2) == "$$" # Func?
112
+ grab_dd
113
+ when self.peek == "$" # Var?
114
+ grab_var
115
+ end
116
+ end
117
+ @tokenlist
118
+ end
119
+
120
+ def grab_until(char)
121
+ string = ""
122
+ loop do
123
+ break if remainder.empty? || peek == char
124
+ string << grab
125
+ end
126
+ # ch = grab # eat the delimiter
127
+ # check ch == char ?
128
+ string
129
+ end
130
+
131
+ def grab_func_param(which)
132
+ case which
133
+ when ":"
134
+ param = grab_until(" ") # don't eat the space
135
+ when "["
136
+ param = grab_until("]")
137
+ grab # eat the ]
138
+ else
139
+ ungrab # just "forget" this character
140
+ param = nil
141
+ # abort "#{__method__}: Can't happen - which = #{which.inspect}"
142
+ end
143
+ param
144
+ end
145
+
146
+ def grab_funcall
147
+ matched = func_name = param = nil
148
+ case
149
+ when remainder.empty?
150
+ return
151
+ when matched = @rx_func_brack.match(remainder)
152
+ func_name = matched[0]
153
+ grab(2) # eat the $$
154
+ func_name = grab(func_name.length-3) # $$...[
155
+ param = grab_func_param(grab) # "["
156
+ add_token(:func, func_name, :brackets, param)
157
+ # Livetext::TTY.puts "1 matched is #{matched.inspect}"
158
+ when matched = @rx_func_colon.match(remainder)
159
+ func_name = matched[0]
160
+ grab(2) # eat the $$
161
+ func_name = grab(func_name.length-3) # $$...:
162
+ param = grab_func_param(grab) # ":"
163
+ add_token(:func, func_name, :colon, param)
164
+ # Livetext::TTY.puts "2 matched is #{matched.inspect}"
165
+ when matched = @rx_func_bare.match(remainder)
166
+ func_name = matched[0]
167
+ grab(2) # eat the $$
168
+ func_name = grab(func_name.length-2) # $$...
169
+ add_token(:func, func_name, nil, nil)
170
+ # Livetext::TTY.puts "3 matched is #{matched.inspect}"
171
+ else
172
+ abort "#{__method__}: Can't happen"
173
+ end
174
+ end
175
+
176
+ def parse_functions
177
+ # Assume variables already expanded?
178
+ @buffer = ""
179
+ loop do
180
+ break if remainder.empty? # end of string
181
+ if self.peek(2) == "$$" # Func?
182
+ grab_funcall
183
+ else # Junk
184
+ add_token(:str, grab_str)
185
+ end
186
+ end
187
+ @tokenlist
188
+ end
63
189
 
190
+ def expand_function_calls
191
+ # Assume variables already resolved?
192
+ tokens = self.parse_functions
193
+ self.evaluate
194
+ end
195
+
64
196
  def self.parse_formatting(str)
65
197
  fmt = self.new(str)
66
198
  loop do
@@ -82,22 +214,6 @@ api.tty "-- result: #{result.inspect}" if $testme
82
214
  fmt.tokenlist
83
215
  end
84
216
 
85
- def self.parse_variables(str)
86
- return nil if str.nil?
87
- x = self.new(str.chomp)
88
- char = x.peek
89
- loop do
90
- char = x.grab
91
- break if char == LF || char == nil
92
- x.escaped if char == Escape
93
- x.dollar if char == "$" # Could be $$
94
- x.add char
95
- end
96
- x.add_token(:str)
97
- result = x.evaluate
98
- result
99
- end
100
-
101
217
  def embed(sym, str)
102
218
  pre, post = SimpleFormats[sym]
103
219
  pre + str + post
@@ -105,15 +221,6 @@ api.tty "-- result: #{result.inspect}" if $testme
105
221
 
106
222
  #########
107
223
 
108
- def handle_simple_formatting(ch)
109
- # api.tty "ch = #{ch.inspect}"
110
- marker ch
111
- add ch
112
- # api.tty "token = #{@token.inspect} #{@tokenlist.inspect}"
113
- c2 = grab
114
- # api.tty "c2 = #{c2.inspect}"
115
- end
116
-
117
224
  def grab_string
118
225
  weird = ["$", nil] # [Escape, "$", nil]
119
226
  ch = grab
@@ -125,7 +232,7 @@ api.tty "-- result: #{result.inspect}" if $testme
125
232
  break if eos? # ch = grab # advance pointer # api.tty "gs3 ch = #{ch.inspect}"
126
233
  add grab
127
234
  end # ch = grab # advance pointer # api.tty "-- gs4 ch = #{ch.inspect}"; sleep 0.01
128
- add_token :str
235
+ add_token :str, @token
129
236
  end
130
237
 
131
238
  def grab_token(ch)
@@ -136,7 +243,7 @@ api.tty "-- result: #{result.inspect}" if $testme
136
243
  when LF; finish = true # do nothing - break if eos?
137
244
  when Escape; ch = self.escaped; add ch
138
245
  when "$"; dollar
139
- when *FMTS; handle_simple_formatting(ch)
246
+ when *FMTS; marker(ch)
140
247
  else grab_string
141
248
  end
142
249
  # api.tty "#{__method__}: AFTER CASE: api.data = #{api.data.inspect}"
@@ -255,9 +362,9 @@ api.tty "-- result: #{result.inspect}" if $testme
255
362
  @token << str unless str.nil?
256
363
  end
257
364
 
258
- def add_token(kind, token = @token)
365
+ def add_token(kind, *token)
259
366
  return if token.nil?
260
- @tokenlist << [kind, token] unless token.empty?
367
+ @tokenlist << [kind, token].flatten unless token.empty?
261
368
  @token = Null.dup
262
369
  end
263
370
 
@@ -438,4 +545,31 @@ api.tty "-- result: #{result.inspect}" if $testme
438
545
  @out << val unless val == "\n" # BUG
439
546
  end
440
547
 
548
+ def expand_variables
549
+ rx = @rx_var
550
+ buffer = ""
551
+ loop do |i|
552
+ case # Var or Func or false alarm
553
+ when remainder.empty? # end of string
554
+ break
555
+ when self.peek(2) == "$$" # Func?
556
+ buffer << self.grab(2)
557
+ when self.peek == "$" # Var?
558
+ vname = rx.match(remainder)
559
+ puts "----"
560
+ p @line
561
+ p rx.match(@line)
562
+ p vname
563
+ puts "----"
564
+ # value = @live.vars[vname[1..-1]]
565
+ # @line.sub!(vname["result"], value)
566
+ add_token(:var, vname[1..-1])
567
+ grab(vname.length)
568
+ else # other
569
+ buffer << self.grab
570
+ end
571
+ end
572
+ buffer
573
+ end
574
+
441
575
  end
@@ -11,10 +11,12 @@ class StringParser
11
11
  @i = 0
12
12
  end
13
13
 
14
- def grab
14
+ def grab(n = 1)
15
+ raise "n <= 0 for #grab" if n <= 0
15
16
  return nil if @eos
16
- char = @line[@i]
17
- @i += 1
17
+ i2 = @i + n - 1
18
+ char = @line[@i..i2]
19
+ @i += n
18
20
  check_eos
19
21
  char
20
22
  end
@@ -25,9 +27,14 @@ class StringParser
25
27
  end
26
28
 
27
29
  def lookahead
30
+ # Get rid of this?
28
31
  @line[@i + 1]
29
32
  end
30
33
 
34
+ def remainder
35
+ @line[@i..-1]
36
+ end
37
+
31
38
  def prev
32
39
  return nil if @i <= 0
33
40
  @line[@i-1]
@@ -37,9 +44,11 @@ class StringParser
37
44
  @eos
38
45
  end
39
46
 
40
- def peek
47
+ def peek(n = 1)
48
+ raise "n <= 0 for #grab" if n <= 0
41
49
  return nil if @eos
42
- @line[@i]
50
+ i2 = @i + n - 1
51
+ @line[@i..i2]
43
52
  end
44
53
 
45
54
  def skip_spaces
@@ -14,9 +14,5 @@ class Livetext
14
14
  end
15
15
  end
16
16
 
17
- class FormatLine < StringParser
18
- module FunCall
19
- end
20
- end
21
17
  end
22
18
 
@@ -63,7 +63,8 @@ module Livetext::Standard
63
63
 
64
64
  def func(args = nil, body = nil)
65
65
  funcname = api.args[0]
66
- check_disallowed(funcname)
66
+ # check_disallowed(funcname) # should any be invalid?
67
+ funcname = funcname.gsub(/\./, "__")
67
68
  func_def = <<~EOS
68
69
  def #{funcname}(param)
69
70
  #{api.body.to_a.join("\n")}
@@ -207,7 +208,6 @@ module Livetext::Standard
207
208
  indent = @parent.indentation.last
208
209
  indented = " " * indent
209
210
  api.setvar(var, rhs.chomp)
210
- # @parent.setvar(var, rhs.chomp)
211
211
  api.optional_blank_line
212
212
  end
213
213
 
@@ -1,5 +1,4 @@
1
1
 
2
- # require_relative 'formatline' # FIXME meh, because of #format
3
2
  require_relative 'lineparser' # FIXME meh, because of #format
4
3
 
5
4
  # Encapsulate the UserAPI as a class
@@ -2,5 +2,5 @@
2
2
  # Defining VERSION
3
3
 
4
4
  class Livetext
5
- VERSION = "0.9.26"
5
+ VERSION = "0.9.27"
6
6
  end
data/lib/livetext.rb CHANGED
@@ -9,7 +9,6 @@ require_relative 'livetext/errors'
9
9
  require_relative 'livetext/standard'
10
10
  require_relative 'livetext/functions'
11
11
  require_relative 'livetext/userapi'
12
- # require_relative 'livetext/formatline'
13
12
  require_relative 'livetext/lineparser'
14
13
  require_relative 'livetext/processor'
15
14
  require_relative 'livetext/helpers'
@@ -1,13 +1,13 @@
1
- Here are examples of <b>boldface</b>
2
- and <i>italics</i>
3
- and <font size=+1><tt>code</tt></font>
4
- as well as <b>ore complex</b>*examples
5
- of <i>talicized text</i>
6
- and <font size=+1><tt>ode font</tt></font>
1
+ Here are examples of <b></b>
2
+ and <i></i>
3
+ and <font size=+1><tt></tt></font>
4
+ as well as <b></b> examples
5
+ of <i></i>
6
+ and <font size=+1><tt></tt></font>.
7
7
  <p>
8
8
 
9
9
  Here are some random punctuation marks:
10
- ; # . * * ` ` @ % ^ & $
10
+ ; # . : @ % ^ & $
11
11
  <p>
12
12
 
13
- No need to escape these: * * `
13
+ No need to escape these:
@@ -1,14 +1,14 @@
1
1
  ACTUAL | EXPECTED
2
- Here are examples of <b>boldface</b> | Here are examples of <b>boldface</b>
3
- and <i>italics</i> and <i>italics</i>
4
- and <font size=+1><tt>code</tt></font> and <font size=+1><tt>code</tt></font>
5
- as well as <b>ore complex</b>*examples | as well as <b>more complex</b> examples
6
- of <i>talicized text</i> | of <i>italicized text</i>
7
- and <font size=+1><tt>ode font</tt></font> | and <font size=+1><tt>code font</tt></font>.
2
+ Here are examples of <b></b> | Here are examples of <b>boldface</b>
3
+ and <i></i> | and <i>italics</i>
4
+ and <font size=+1><tt></tt></font> | and <font size=+1><tt>code</tt></font>
5
+ as well as <b></b> examples | as well as <b>more complex</b> examples
6
+ of <i></i> | of <i>italicized text</i>
7
+ and <font size=+1><tt></tt></font>. | and <font size=+1><tt>code font</tt></font>.
8
8
  <p> <p>
9
9
 
10
10
  Here are some random punctuation marks: Here are some random punctuation marks:
11
- ; # . * * ` ` @ % ^ & $ | ; # . * _ ` : @ % ^ & $
11
+ ; # . : @ % ^ & $ | ; # . * _ ` : @ % ^ & $
12
12
  <p> <p>
13
13
 
14
- No need to escape these: * * ` | No need to escape these: * _ `
14
+ No need to escape these: | No need to escape these: * _ `
@@ -0,0 +1,19 @@
1
+ /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:123:in `grab_func_param': wrong number of arguments (given 0, expected 1) (ArgumentError)
2
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/funcall.rb:55:in `grab_func_with_param'
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/funcall.rb:63:in `double_dollar'
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:387:in `dollar'
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:235:in `grab_token'
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:247:in `block in tokenize'
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:245:in `loop'
8
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:245:in `tokenize'
9
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:45:in `parse!'
10
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/userapi.rb:122:in `format'
11
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/userapi.rb:129:in `passthru'
12
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:104:in `process_line'
13
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:86:in `block in process_file'
14
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:83:in `loop'
15
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:83:in `process_file'
16
+ from ../../../bin/livetext:89:in `block in parse_command_line'
17
+ from ../../../bin/livetext:75:in `loop'
18
+ from ../../../bin/livetext:75:in `parse_command_line'
19
+ from ../../../bin/livetext:106:in `<main>'
File without changes
@@ -0,0 +1,20 @@
1
+ ACTUAL | EXPECTED
2
+ /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparse <
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
8
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
9
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
10
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
11
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
12
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
13
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
14
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
15
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
16
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livet <
17
+ from ../../../bin/livetext:89:in `block in parse_co <
18
+ from ../../../bin/livetext:75:in `loop' <
19
+ from ../../../bin/livetext:75:in `parse_command_lin <
20
+ from ../../../bin/livetext:106:in `<main>' <
File without changes
@@ -0,0 +1,4 @@
1
+ Just some more text.
2
+ My birthday is , so they tell me.
3
+ That's if you're American.
4
+ That's all.
@@ -0,0 +1 @@
1
+ ACTUAL | EXPECTED
@@ -0,0 +1,5 @@
1
+ ACTUAL | EXPECTED
2
+ Just some more text. Just some more text.
3
+ My birthday is , so they tell me. | My birthday is May 31, so they tell me.
4
+ That's if you're American. | That's 5/31 if you're American.
5
+ That's all. That's all.
@@ -0,0 +1,19 @@
1
+ /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:123:in `grab_func_param': wrong number of arguments (given 0, expected 1) (ArgumentError)
2
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/funcall.rb:55:in `grab_func_with_param'
3
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/funcall.rb:63:in `double_dollar'
4
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:387:in `dollar'
5
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:235:in `grab_token'
6
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:247:in `block in tokenize'
7
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:245:in `loop'
8
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:245:in `tokenize'
9
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/lineparser.rb:45:in `parse!'
10
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/userapi.rb:122:in `format'
11
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/userapi.rb:129:in `passthru'
12
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:104:in `process_line'
13
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:86:in `block in process_file'
14
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:83:in `loop'
15
+ from /Users/Hal/Dropbox/topx/git/livetext/lib/livetext/helpers.rb:83:in `process_file'
16
+ from ../../../bin/livetext:89:in `block in parse_command_line'
17
+ from ../../../bin/livetext:75:in `loop'
18
+ from ../../../bin/livetext:75:in `parse_command_line'
19
+ from ../../../bin/livetext:106:in `<main>'
@@ -1,37 +0,0 @@
1
- Testing some more functions here...
2
- <p>
3
-
4
- Here I am calling a function with
5
- a colon parameter...
6
- <p>
7
-
8
- <p>
9
-
10
- Next let's <b>do</b>*something with our parameter:
11
- <p>
12
-
13
- I'll call these variants...
14
- <p>
15
-
16
- "Motel" spelled backwards is letom :)
17
- <p>
18
-
19
- "lamina" reversed is animal
20
- <p>
21
-
22
- I can also use the erutaef tekcarb here.
23
- <p>
24
-
25
- If I don't use a parameter for [Error evaluating $$reverse()] - it gives
26
- me an error. (Bug or feature??)
27
- <p>
28
-
29
- What if a function doesn't use parameters at all, but
30
- we pass them? Hmm...
31
- <p>
32
-
33
- Now we succeed and succeed some more
34
- and finally we succeed in life.
35
- <p>
36
-
37
- But can we succeed, when our beds are burning?