daff 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/daff.rb +6 -1
- data/lib/lib/_list/list_iterator.rb +31 -0
- data/lib/lib/coopy/bag.rb +1 -0
- data/lib/lib/coopy/coopy.rb +1 -1
- data/lib/lib/haxe/format/json_parser.rb +11 -11
- data/lib/lib/{imap.rb → haxe/imap.rb} +2 -0
- data/lib/lib/haxe/io/bytes_buffer.rb +18 -0
- data/lib/lib/haxe/io/bytes_input.rb +12 -0
- data/lib/lib/haxe/io/bytes_output.rb +32 -0
- data/lib/lib/haxe/io/input.rb +10 -0
- data/lib/lib/list.rb +2 -9
- data/lib/lib/string_buf.rb +4 -0
- metadata +8 -3
data/lib/daff.rb
CHANGED
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
require_relative 'lib/hx_overrides'
|
13
13
|
require_relative 'lib/lambda'
|
14
14
|
require_relative 'lib/list'
|
15
|
-
require_relative 'lib/
|
15
|
+
require_relative 'lib/_list/list_iterator'
|
16
16
|
require_relative 'lib/reflect'
|
17
17
|
require_relative 'lib/string_buf'
|
18
18
|
require_relative 'lib/sys'
|
@@ -56,13 +56,18 @@ require_relative 'lib/coopy/unit'
|
|
56
56
|
require_relative 'lib/coopy/viewed_datum'
|
57
57
|
require_relative 'lib/coopy/viterbi'
|
58
58
|
require_relative 'lib/coopy/workspace'
|
59
|
+
require_relative 'lib/haxe/imap'
|
59
60
|
require_relative 'lib/haxe/log'
|
60
61
|
require_relative 'lib/haxe/ds/int_map'
|
61
62
|
require_relative 'lib/haxe/ds/string_map'
|
62
63
|
require_relative 'lib/haxe/format/json_parser'
|
63
64
|
require_relative 'lib/haxe/format/json_printer'
|
64
65
|
require_relative 'lib/haxe/io/bytes'
|
66
|
+
require_relative 'lib/haxe/io/bytes_buffer'
|
67
|
+
require_relative 'lib/haxe/io/input'
|
68
|
+
require_relative 'lib/haxe/io/bytes_input'
|
65
69
|
require_relative 'lib/haxe/io/output'
|
70
|
+
require_relative 'lib/haxe/io/bytes_output'
|
66
71
|
require_relative 'lib/haxe/io/eof'
|
67
72
|
require_relative 'lib/haxe/io/error'
|
68
73
|
require_relative 'lib/rb/boot'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
module X_List
|
5
|
+
class ListIterator
|
6
|
+
|
7
|
+
def initialize(head)
|
8
|
+
@head = head
|
9
|
+
@val = nil
|
10
|
+
end
|
11
|
+
|
12
|
+
# protected - in ruby this doesn't play well with static/inline methods
|
13
|
+
|
14
|
+
attr_accessor :head
|
15
|
+
attr_accessor :val
|
16
|
+
|
17
|
+
public
|
18
|
+
|
19
|
+
def has_next
|
20
|
+
return @head != nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def _next
|
24
|
+
@val = @head[0]
|
25
|
+
@head = @head[1]
|
26
|
+
return @val
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
data/lib/lib/coopy/bag.rb
CHANGED
data/lib/lib/coopy/coopy.rb
CHANGED
@@ -200,7 +200,7 @@ module Format
|
|
200
200
|
|
201
201
|
def parse_string
|
202
202
|
start = @pos
|
203
|
-
|
203
|
+
buf_b = ""
|
204
204
|
while(true)
|
205
205
|
c = nil
|
206
206
|
begin
|
@@ -210,7 +210,7 @@ module Format
|
|
210
210
|
end
|
211
211
|
break if c == 34
|
212
212
|
if c == 92
|
213
|
-
|
213
|
+
buf_b += @str[start,@pos - start - 1]
|
214
214
|
begin
|
215
215
|
index1 = @pos
|
216
216
|
@pos+=1
|
@@ -218,17 +218,17 @@ module Format
|
|
218
218
|
end
|
219
219
|
case(c)
|
220
220
|
when 114
|
221
|
-
|
221
|
+
buf_b += [13].pack("U")
|
222
222
|
when 110
|
223
|
-
|
223
|
+
buf_b += [10].pack("U")
|
224
224
|
when 116
|
225
|
-
|
225
|
+
buf_b += [9].pack("U")
|
226
226
|
when 98
|
227
|
-
|
227
|
+
buf_b += [8].pack("U")
|
228
228
|
when 102
|
229
|
-
|
229
|
+
buf_b += [12].pack("U")
|
230
230
|
when 47,92,34
|
231
|
-
|
231
|
+
buf_b += [c].pack("U")
|
232
232
|
when 117
|
233
233
|
uc = nil
|
234
234
|
begin
|
@@ -236,7 +236,7 @@ module Format
|
|
236
236
|
uc = x.to_i
|
237
237
|
end
|
238
238
|
@pos += 4
|
239
|
-
|
239
|
+
buf_b += [uc].pack("U")
|
240
240
|
else
|
241
241
|
raise "Invalid escape sequence \\" + _hx_str([c].pack("U")) + " at position " + _hx_str((@pos - 1))
|
242
242
|
end
|
@@ -245,8 +245,8 @@ module Format
|
|
245
245
|
raise "Unclosed string"
|
246
246
|
end
|
247
247
|
end
|
248
|
-
|
249
|
-
return
|
248
|
+
buf_b += @str[start,@pos - start - 1]
|
249
|
+
return buf_b
|
250
250
|
end
|
251
251
|
|
252
252
|
def invalid_char
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
module Haxe
|
5
|
+
module Io
|
6
|
+
class BytesBuffer
|
7
|
+
|
8
|
+
# protected - in ruby this doesn't play well with static/inline methods
|
9
|
+
|
10
|
+
attr_accessor :b
|
11
|
+
|
12
|
+
public
|
13
|
+
|
14
|
+
attr_accessor :length
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
module Haxe
|
5
|
+
module Io
|
6
|
+
class BytesOutput < ::Haxe::Io::Output
|
7
|
+
|
8
|
+
# protected - in ruby this doesn't play well with static/inline methods
|
9
|
+
|
10
|
+
attr_accessor :b
|
11
|
+
|
12
|
+
public
|
13
|
+
|
14
|
+
attr_accessor :length
|
15
|
+
|
16
|
+
def write_byte(c)
|
17
|
+
@b.b.concat(c)
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def write_bytes(buf,pos,len)
|
22
|
+
begin
|
23
|
+
raise ::Haxe::Io::Error.outside_bounds if pos < 0 || len < 0 || pos + len > buf.length
|
24
|
+
@b.b += buf.b.byteslice(pos,len)
|
25
|
+
end
|
26
|
+
return len
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
data/lib/lib/list.rb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
@length = 0
|
8
8
|
end
|
9
9
|
|
10
|
-
protected
|
10
|
+
# protected - in ruby this doesn't play well with static/inline methods
|
11
11
|
|
12
12
|
attr_accessor :h
|
13
13
|
attr_accessor :q
|
@@ -28,14 +28,7 @@
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def iterator
|
31
|
-
return
|
32
|
-
return @h != nil
|
33
|
-
}, _next: lambda {
|
34
|
-
return nil if @h == nil
|
35
|
-
x = @h[0]
|
36
|
-
@h = @h[1]
|
37
|
-
return x
|
38
|
-
}}
|
31
|
+
return ::X_List::ListIterator.new(@h)
|
39
32
|
end
|
40
33
|
|
41
34
|
end
|
data/lib/lib/string_buf.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Diff and patch tables
|
16
16
|
email:
|
@@ -25,7 +25,6 @@ files:
|
|
25
25
|
- lib/lib/type.rb
|
26
26
|
- lib/lib/lambda.rb
|
27
27
|
- lib/lib/reflect.rb
|
28
|
-
- lib/lib/imap.rb
|
29
28
|
- lib/lib/rb/boot.rb
|
30
29
|
- lib/lib/rb/ruby_iterator.rb
|
31
30
|
- lib/lib/value_type.rb
|
@@ -72,8 +71,14 @@ files:
|
|
72
71
|
- lib/lib/sys/io/file_output.rb
|
73
72
|
- lib/lib/sys/io/file.rb
|
74
73
|
- lib/lib/sys/io/file_handle.rb
|
74
|
+
- lib/lib/_list/list_iterator.rb
|
75
75
|
- lib/lib/string_buf.rb
|
76
|
+
- lib/lib/haxe/imap.rb
|
77
|
+
- lib/lib/haxe/io/bytes_buffer.rb
|
78
|
+
- lib/lib/haxe/io/input.rb
|
76
79
|
- lib/lib/haxe/io/eof.rb
|
80
|
+
- lib/lib/haxe/io/bytes_input.rb
|
81
|
+
- lib/lib/haxe/io/bytes_output.rb
|
77
82
|
- lib/lib/haxe/io/bytes.rb
|
78
83
|
- lib/lib/haxe/io/error.rb
|
79
84
|
- lib/lib/haxe/io/output.rb
|