daff 1.1.16 → 1.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/lib/daff.rb +24 -4
  2. data/lib/lib/coopy/alignment.rb +2 -1
  3. data/lib/lib/coopy/bag.rb +1 -0
  4. data/lib/lib/coopy/cell_builder.rb +17 -0
  5. data/lib/lib/coopy/cell_info.rb +1 -0
  6. data/lib/lib/coopy/change.rb +1 -0
  7. data/lib/lib/coopy/compare.rb +1 -0
  8. data/lib/lib/coopy/compare_flags.rb +28 -0
  9. data/lib/lib/coopy/compare_table.rb +29 -10
  10. data/lib/lib/coopy/coopy.rb +29 -15
  11. data/lib/lib/coopy/cross_match.rb +1 -0
  12. data/lib/lib/coopy/csv.rb +1 -0
  13. data/lib/lib/coopy/diff_render.rb +1 -0
  14. data/lib/lib/coopy/flat_cell_builder.rb +72 -0
  15. data/lib/lib/coopy/highlight_patch.rb +1 -0
  16. data/lib/lib/coopy/highlight_patch_unit.rb +1 -0
  17. data/lib/lib/coopy/index.rb +1 -0
  18. data/lib/lib/coopy/index_item.rb +1 -0
  19. data/lib/lib/coopy/index_pair.rb +1 -0
  20. data/lib/lib/coopy/merger.rb +1 -0
  21. data/lib/lib/coopy/mover.rb +1 -0
  22. data/lib/lib/coopy/ordering.rb +1 -0
  23. data/lib/lib/coopy/report.rb +1 -0
  24. data/lib/lib/coopy/row.rb +1 -0
  25. data/lib/lib/coopy/simple_cell.rb +1 -0
  26. data/lib/lib/coopy/simple_table.rb +5 -0
  27. data/lib/lib/coopy/simple_view.rb +3 -3
  28. data/lib/lib/coopy/sparse_sheet.rb +1 -0
  29. data/lib/lib/coopy/table.rb +2 -0
  30. data/lib/lib/coopy/table_comparison_state.rb +1 -0
  31. data/lib/lib/coopy/table_diff.rb +235 -172
  32. data/lib/lib/coopy/table_io.rb +1 -0
  33. data/lib/lib/coopy/table_modifier.rb +1 -0
  34. data/lib/lib/coopy/table_text.rb +1 -0
  35. data/lib/lib/coopy/terminal_diff_render.rb +1 -0
  36. data/lib/lib/coopy/unit.rb +1 -0
  37. data/lib/lib/coopy/view.rb +1 -0
  38. data/lib/lib/coopy/viewed_datum.rb +1 -0
  39. data/lib/lib/coopy/viterbi.rb +2 -1
  40. data/lib/lib/coopy/workspace.rb +1 -0
  41. data/lib/lib/haxe/ds/int_map.rb +1 -0
  42. data/lib/lib/haxe/ds/string_map.rb +1 -0
  43. data/lib/lib/haxe/format/json_parser.rb +1 -0
  44. data/lib/lib/haxe/format/json_printer.rb +1 -0
  45. data/lib/lib/haxe/imap.rb +1 -0
  46. data/lib/lib/haxe/io/bytes.rb +1 -0
  47. data/lib/lib/haxe/io/bytes_buffer.rb +1 -0
  48. data/lib/lib/haxe/io/bytes_input.rb +1 -0
  49. data/lib/lib/haxe/io/bytes_output.rb +1 -0
  50. data/lib/lib/haxe/io/eof.rb +1 -0
  51. data/lib/lib/haxe/io/input.rb +1 -0
  52. data/lib/lib/haxe/io/output.rb +1 -0
  53. data/lib/lib/hx_overrides.rb +1 -0
  54. data/lib/lib/hx_sys.rb +66 -0
  55. data/lib/lib/lambda.rb +1 -0
  56. data/lib/lib/list.rb +1 -0
  57. data/lib/lib/rb/boot.rb +2 -5
  58. data/lib/lib/rb/ruby_iterator.rb +1 -0
  59. data/lib/lib/reflect.rb +1 -0
  60. data/lib/lib/string_buf.rb +1 -0
  61. data/lib/lib/sys/io/file_output.rb +1 -0
  62. data/lib/lib/sys/io/hx_file.rb +20 -0
  63. data/lib/lib/type.rb +1 -0
  64. data/lib/lib/x_list/list_iterator.rb +32 -0
  65. metadata +7 -2
@@ -646,6 +646,7 @@ module Coopy
646
646
  end
647
647
  end
648
648
 
649
+ haxe_me
649
650
  end
650
651
 
651
652
  end
@@ -32,6 +32,7 @@ module Coopy
32
32
  return _hx_str(@code) + " patchRow " + _hx_str(@patch_row) + " sourceRows " + _hx_str(@source_prev_row) + "," + _hx_str(@source_row) + "," + _hx_str(@source_next_row) + " destRow " + _hx_str(@dest_row)
33
33
  end
34
34
 
35
+ haxe_me
35
36
  end
36
37
 
37
38
  end
@@ -97,6 +97,7 @@ module Coopy
97
97
  return @indexed_table
98
98
  end
99
99
 
100
+ haxe_me
100
101
  end
101
102
 
102
103
  end
@@ -23,6 +23,7 @@ module Coopy
23
23
  return @lst[0]
24
24
  end
25
25
 
26
+ haxe_me
26
27
  end
27
28
 
28
29
  end
@@ -90,6 +90,7 @@ module Coopy
90
90
  return @quality
91
91
  end
92
92
 
93
+ haxe_me
93
94
  end
94
95
 
95
96
  end
@@ -178,6 +178,7 @@ module Coopy
178
178
  return view.to_datum("((( " + _hx_str(view.to_s(pcell)) + " ))) " + _hx_str(view.to_s(lcell)) + " /// " + _hx_str(view.to_s(rcell)))
179
179
  end
180
180
 
181
+ haxe_me
181
182
  end
182
183
 
183
184
  end
@@ -190,6 +190,7 @@ module Coopy
190
190
  return moved
191
191
  end
192
192
 
193
+ haxe_me
193
194
  end
194
195
 
195
196
  end
@@ -44,6 +44,7 @@ module Coopy
44
44
  @ignore_parent = true
45
45
  end
46
46
 
47
+ haxe_me
47
48
  end
48
49
 
49
50
  end
@@ -18,6 +18,7 @@ module Coopy
18
18
  @changes = Array.new
19
19
  end
20
20
 
21
+ haxe_me
21
22
  end
22
23
 
23
24
  end
data/lib/lib/coopy/row.rb CHANGED
@@ -4,6 +4,7 @@
4
4
  module Coopy
5
5
  class Row
6
6
  def getRowString(c) puts "Abstract Row.getRowString called" end
7
+ haxe_me
7
8
  end
8
9
 
9
10
  end
@@ -18,6 +18,7 @@ module Coopy
18
18
  return @datum
19
19
  end
20
20
 
21
+ haxe_me
21
22
  end
22
23
 
23
24
  end
@@ -210,6 +210,10 @@ module Coopy
210
210
  return true
211
211
  end
212
212
 
213
+ def get_data
214
+ return nil
215
+ end
216
+
213
217
  def SimpleTable.table_to_string(tab)
214
218
  x = ""
215
219
  begin
@@ -237,6 +241,7 @@ module Coopy
237
241
  return x
238
242
  end
239
243
 
244
+ haxe_me
240
245
  end
241
246
 
242
247
  end
@@ -31,11 +31,11 @@ module Coopy
31
31
  return "" + _hx_str(d1.to_s) == "" + _hx_str(d2.to_s)
32
32
  end
33
33
 
34
- def to_datum(str)
35
- return nil if str == nil
36
- return ::Coopy::SimpleCell.new(str)
34
+ def to_datum(x)
35
+ return x
37
36
  end
38
37
 
38
+ haxe_me
39
39
  end
40
40
 
41
41
  end
@@ -45,6 +45,7 @@ module Coopy
45
45
  cursor[x] = val
46
46
  end
47
47
 
48
+ haxe_me
48
49
  end
49
50
 
50
51
  end
@@ -14,6 +14,8 @@ module Coopy
14
14
  def trimBlank() puts "Abstract Table.trimBlank called" end
15
15
  def get_width() puts "Abstract Table.get_width called" end
16
16
  def get_height() puts "Abstract Table.get_height called" end
17
+ def getData() puts "Abstract Table.getData called" end
18
+ haxe_me
17
19
  end
18
20
 
19
21
  end
@@ -29,6 +29,7 @@ module Coopy
29
29
  @compare_flags = nil
30
30
  end
31
31
 
32
+ haxe_me
32
33
  end
33
34
 
34
35
  end
@@ -7,17 +7,21 @@ module Coopy
7
7
  def initialize(align,flags)
8
8
  @align = align
9
9
  @flags = flags
10
+ @builder = nil
10
11
  end
11
12
 
12
13
  protected
13
14
 
14
15
  attr_accessor :align
15
16
  attr_accessor :flags
16
- attr_accessor :l_prev
17
- attr_accessor :r_prev
17
+ attr_accessor :builder
18
18
 
19
19
  public
20
20
 
21
+ def set_cell_builder(builder)
22
+ @builder = builder
23
+ end
24
+
21
25
  def get_separator(t,t2,root)
22
26
  sep = root
23
27
  w = t.get_width
@@ -173,25 +177,46 @@ module Coopy
173
177
  end
174
178
  end
175
179
 
176
- def report_unit(unit)
177
- txt = unit.to_s
178
- reordered = false
179
- if unit.l >= 0
180
- reordered = true if unit.l < @l_prev
181
- @l_prev = unit.l
180
+ def set_ignore(ignore,idx_ignore,tab,r_header)
181
+ v = tab.get_cell_view
182
+ if tab.get_height >= r_header
183
+ _g1 = 0
184
+ _g = tab.get_width
185
+ while(_g1 < _g)
186
+ i = _g1
187
+ _g1+=1
188
+ name = v.to_s(tab.get_cell(i,r_header))
189
+ next if !ignore.include?(name)
190
+ idx_ignore[i] = true
191
+ end
182
192
  end
183
- if unit.r >= 0
184
- reordered = true if unit.r < @r_prev
185
- @r_prev = unit.r
193
+ end
194
+
195
+ def count_active(active)
196
+ ct = 0
197
+ showed_dummy = false
198
+ begin
199
+ _g1 = 0
200
+ _g = active.length
201
+ while(_g1 < _g)
202
+ i = _g1
203
+ _g1+=1
204
+ publish = active[i] > 0
205
+ dummy = active[i] == 3
206
+ next if dummy && showed_dummy
207
+ next if !publish
208
+ showed_dummy = dummy
209
+ ct+=1
210
+ end
186
211
  end
187
- txt = "[" + _hx_str(txt) + "]" if reordered
188
- return txt
212
+ return ct
189
213
  end
190
214
 
191
215
  public
192
216
 
193
217
  def hilite(output)
194
218
  return false if !output.is_resizable
219
+ @builder = ::Coopy::FlatCellBuilder.new if @builder == nil
195
220
  output.resize(0,0)
196
221
  output.clear
197
222
  row_map = {}
@@ -202,6 +227,7 @@ module Coopy
202
227
  a = nil
203
228
  b = nil
204
229
  p = nil
230
+ rp_header = 0
205
231
  ra_header = 0
206
232
  rb_header = 0
207
233
  is_index_p = {}
@@ -211,6 +237,7 @@ module Coopy
211
237
  p = @align.get_source
212
238
  a = @align.reference.get_target
213
239
  b = @align.get_target
240
+ rp_header = @align.reference.meta.get_source_header
214
241
  ra_header = @align.reference.meta.get_target_header
215
242
  rb_header = @align.meta.get_target_header
216
243
  if @align.get_index_columns != nil
@@ -237,7 +264,7 @@ module Coopy
237
264
  a = @align.get_source
238
265
  b = @align.get_target
239
266
  p = a
240
- ra_header = @align.meta.get_source_header
267
+ rp_header = ra_header = @align.meta.get_source_header
241
268
  rb_header = @align.meta.get_target_header
242
269
  if @align.get_index_columns != nil
243
270
  _g3 = 0
@@ -252,6 +279,28 @@ module Coopy
252
279
  end
253
280
  column_order = @align.meta.to_order
254
281
  column_units = column_order.get_list
282
+ p_ignore = {}
283
+ a_ignore = {}
284
+ b_ignore = {}
285
+ ignore = @flags.get_ignored_columns
286
+ if ignore != nil
287
+ self.set_ignore(ignore,p_ignore,p,rp_header)
288
+ self.set_ignore(ignore,a_ignore,a,ra_header)
289
+ self.set_ignore(ignore,b_ignore,b,rb_header)
290
+ ncolumn_units = Array.new
291
+ begin
292
+ _g13 = 0
293
+ _g4 = column_units.length
294
+ while(_g13 < _g4)
295
+ j = _g13
296
+ _g13+=1
297
+ cunit = column_units[j]
298
+ next if p_ignore.include?(cunit.p) || a_ignore.include?(cunit.l) || b_ignore.include?(cunit.r)
299
+ ncolumn_units.push(cunit)
300
+ end
301
+ end
302
+ column_units = ncolumn_units
303
+ end
255
304
  show_rc_numbers = false
256
305
  row_moves = nil
257
306
  col_moves = nil
@@ -259,11 +308,11 @@ module Coopy
259
308
  row_moves = {}
260
309
  moves = ::Coopy::Mover.move_units(units)
261
310
  begin
262
- _g13 = 0
263
- _g4 = moves.length
264
- while(_g13 < _g4)
265
- i = _g13
266
- _g13+=1
311
+ _g14 = 0
312
+ _g5 = moves.length
313
+ while(_g14 < _g5)
314
+ i = _g14
315
+ _g14+=1
267
316
  begin
268
317
  row_moves[moves[i]] = i
269
318
  i
@@ -273,11 +322,11 @@ module Coopy
273
322
  col_moves = {}
274
323
  moves = ::Coopy::Mover.move_units(column_units)
275
324
  begin
276
- _g14 = 0
277
- _g5 = moves.length
278
- while(_g14 < _g5)
279
- i1 = _g14
280
- _g14+=1
325
+ _g15 = 0
326
+ _g6 = moves.length
327
+ while(_g15 < _g6)
328
+ i1 = _g15
329
+ _g15+=1
281
330
  begin
282
331
  col_moves[moves[i1]] = i1
283
332
  i1
@@ -288,11 +337,11 @@ module Coopy
288
337
  active = Array.new
289
338
  active_column = nil
290
339
  if !@flags.show_unchanged
291
- _g15 = 0
292
- _g6 = units.length
293
- while(_g15 < _g6)
294
- i2 = _g15
295
- _g15+=1
340
+ _g16 = 0
341
+ _g7 = units.length
342
+ while(_g16 < _g7)
343
+ i2 = _g16
344
+ _g16+=1
296
345
  active[units.length - 1 - i2] = 0
297
346
  end
298
347
  end
@@ -302,11 +351,11 @@ module Coopy
302
351
  if !@flags.show_unchanged_columns
303
352
  active_column = Array.new
304
353
  begin
305
- _g16 = 0
306
- _g7 = column_units.length
307
- while(_g16 < _g7)
308
- i3 = _g16
309
- _g16+=1
354
+ _g17 = 0
355
+ _g8 = column_units.length
356
+ while(_g17 < _g8)
357
+ i3 = _g17
358
+ _g17+=1
310
359
  v = 0
311
360
  unit = column_units[i3]
312
361
  v = 1 if unit.l >= 0 && is_index_a[unit.l]
@@ -316,54 +365,55 @@ module Coopy
316
365
  end
317
366
  end
318
367
  end
368
+ v1 = a.get_cell_view
369
+ @builder.set_view(v1)
319
370
  outer_reps_needed = nil
320
371
  if @flags.show_unchanged && @flags.show_unchanged_columns
321
372
  outer_reps_needed = 1
322
373
  else
323
374
  outer_reps_needed = 2
324
375
  end
325
- v1 = a.get_cell_view
326
376
  sep = ""
327
377
  conflict_sep = ""
328
378
  schema = Array.new
329
379
  have_schema = false
330
380
  begin
331
- _g17 = 0
332
- _g8 = column_units.length
333
- while(_g17 < _g8)
334
- j = _g17
335
- _g17+=1
336
- cunit = column_units[j]
381
+ _g18 = 0
382
+ _g9 = column_units.length
383
+ while(_g18 < _g9)
384
+ j1 = _g18
385
+ _g18+=1
386
+ cunit1 = column_units[j1]
337
387
  reordered = false
338
388
  if @flags.ordered
339
- reordered = true if col_moves.include?(j)
389
+ reordered = true if col_moves.include?(j1)
340
390
  show_rc_numbers = true if reordered
341
391
  end
342
392
  act = ""
343
- if cunit.r >= 0 && cunit.lp == -1
393
+ if cunit1.r >= 0 && cunit1.lp == -1
344
394
  have_schema = true
345
395
  act = "+++"
346
396
  if active_column != nil
347
- active_column[j] = 1 if allow_update
397
+ active_column[j1] = 1 if allow_update
348
398
  end
349
399
  end
350
- if cunit.r < 0 && cunit.lp >= 0
400
+ if cunit1.r < 0 && cunit1.lp >= 0
351
401
  have_schema = true
352
402
  act = "---"
353
403
  if active_column != nil
354
- active_column[j] = 1 if allow_update
404
+ active_column[j1] = 1 if allow_update
355
405
  end
356
406
  end
357
- if cunit.r >= 0 && cunit.lp >= 0
358
- if a.get_height >= ra_header && b.get_height >= rb_header
359
- aa = a.get_cell(cunit.lp,ra_header)
360
- bb = b.get_cell(cunit.r,rb_header)
361
- if !v1.equals(aa,bb)
407
+ if cunit1.r >= 0 && cunit1.lp >= 0
408
+ if p.get_height >= rp_header && b.get_height >= rb_header
409
+ pp = p.get_cell(cunit1.lp,rp_header)
410
+ bb = b.get_cell(cunit1.r,rb_header)
411
+ if !v1.equals(pp,bb)
362
412
  have_schema = true
363
413
  act = "("
364
- act += v1.to_s(aa)
414
+ act += v1.to_s(pp)
365
415
  act += ")"
366
- active_column[j] = 1 if active_column != nil
416
+ active_column[j1] = 1 if active_column != nil
367
417
  end
368
418
  end
369
419
  end
@@ -378,14 +428,14 @@ module Coopy
378
428
  if have_schema
379
429
  at = output.get_height
380
430
  output.resize(column_units.length + 1,at + 1)
381
- output.set_cell(0,at,v1.to_datum("!"))
431
+ output.set_cell(0,at,@builder.marker("!"))
382
432
  begin
383
- _g18 = 0
384
- _g9 = column_units.length
385
- while(_g18 < _g9)
386
- j1 = _g18
387
- _g18+=1
388
- output.set_cell(j1 + 1,at,v1.to_datum(schema[j1]))
433
+ _g19 = 0
434
+ _g10 = column_units.length
435
+ while(_g19 < _g10)
436
+ j2 = _g19
437
+ _g19+=1
438
+ output.set_cell(j2 + 1,at,v1.to_datum(schema[j2]))
389
439
  end
390
440
  end
391
441
  end
@@ -393,51 +443,57 @@ module Coopy
393
443
  if @flags.always_show_header
394
444
  at1 = output.get_height
395
445
  output.resize(column_units.length + 1,at1 + 1)
396
- output.set_cell(0,at1,v1.to_datum("@@"))
446
+ output.set_cell(0,at1,@builder.marker("@@"))
397
447
  begin
398
- _g19 = 0
399
- _g10 = column_units.length
400
- while(_g19 < _g10)
401
- j2 = _g19
402
- _g19+=1
403
- cunit1 = column_units[j2]
404
- if cunit1.r >= 0
405
- output.set_cell(j2 + 1,at1,b.get_cell(cunit1.r,rb_header)) if b.get_height > 0
406
- elsif cunit1.lp >= 0
407
- output.set_cell(j2 + 1,at1,a.get_cell(cunit1.lp,ra_header)) if a.get_height > 0
448
+ _g110 = 0
449
+ _g20 = column_units.length
450
+ while(_g110 < _g20)
451
+ j3 = _g110
452
+ _g110+=1
453
+ cunit2 = column_units[j3]
454
+ if cunit2.r >= 0
455
+ output.set_cell(j3 + 1,at1,b.get_cell(cunit2.r,rb_header)) if b.get_height > 0
456
+ elsif cunit2.lp >= 0
457
+ output.set_cell(j3 + 1,at1,p.get_cell(cunit2.lp,rp_header)) if p.get_height > 0
408
458
  end
409
- col_map[j2 + 1] = cunit1
459
+ col_map[j3 + 1] = cunit2
410
460
  end
411
461
  end
412
462
  top_line_done = true
413
463
  end
464
+ output_height = output.get_height
465
+ output_height_init = output.get_height
414
466
  begin
415
- _g20 = 0
416
- while(_g20 < outer_reps_needed)
417
- out = _g20
418
- _g20+=1
467
+ _g21 = 0
468
+ while(_g21 < outer_reps_needed)
469
+ out = _g21
470
+ _g21+=1
419
471
  if out == 1
420
472
  self.spread_context(units,@flags.unchanged_context,active)
421
473
  self.spread_context(column_units,@flags.unchanged_column_context,active_column)
422
474
  if active_column != nil
423
- _g21 = 0
424
- _g110 = column_units.length
425
- while(_g21 < _g110)
426
- i4 = _g21
427
- _g21+=1
475
+ _g22 = 0
476
+ _g111 = column_units.length
477
+ while(_g22 < _g111)
478
+ i4 = _g22
479
+ _g22+=1
428
480
  active_column[i4] = 0 if active_column[i4] == 3
429
481
  end
430
482
  end
483
+ rows = self.count_active(active) + output_height_init
484
+ rows-=1 if top_line_done
485
+ output_height = output_height_init
486
+ output.resize(column_units.length + 1,rows) if rows > output.get_height
431
487
  end
432
488
  showed_dummy = false
433
489
  l = -1
434
490
  r = -1
435
491
  begin
436
- _g22 = 0
437
- _g111 = units.length
438
- while(_g22 < _g111)
439
- i5 = _g22
440
- _g22+=1
492
+ _g23 = 0
493
+ _g112 = units.length
494
+ while(_g23 < _g112)
495
+ i5 = _g23
496
+ _g23+=1
441
497
  unit1 = units[i5]
442
498
  reordered1 = false
443
499
  if @flags.ordered
@@ -457,19 +513,22 @@ module Coopy
457
513
  next if !publish
458
514
  end
459
515
  showed_dummy = false if !dummy
460
- at2 = output.get_height
461
- output.resize(column_units.length + 1,at2 + 1) if publish
516
+ at2 = output_height
517
+ if publish
518
+ output_height+=1
519
+ output.resize(column_units.length + 1,output_height) if output.get_height < output_height
520
+ end
462
521
  if dummy
463
522
  begin
464
523
  _g41 = 0
465
524
  _g31 = column_units.length + 1
466
525
  while(_g41 < _g31)
467
- j3 = _g41
526
+ j4 = _g41
468
527
  _g41+=1
469
- output.set_cell(j3,at2,v1.to_datum("..."))
470
- showed_dummy = true
528
+ output.set_cell(j4,at2,v1.to_datum("..."))
471
529
  end
472
530
  end
531
+ showed_dummy = true
473
532
  next
474
533
  end
475
534
  have_addition = false
@@ -492,10 +551,10 @@ module Coopy
492
551
  _g42 = 0
493
552
  _g32 = column_units.length
494
553
  while(_g42 < _g32)
495
- j4 = _g42
554
+ j5 = _g42
496
555
  _g42+=1
497
- cunit2 = column_units[j4]
498
- pp = nil
556
+ cunit3 = column_units[j5]
557
+ pp1 = nil
499
558
  ll = nil
500
559
  rr = nil
501
560
  dd = nil
@@ -506,18 +565,18 @@ module Coopy
506
565
  have_pp = false
507
566
  have_ll = false
508
567
  have_rr = false
509
- if cunit2.p >= 0 && unit1.p >= 0
510
- pp = p.get_cell(cunit2.p,unit1.p)
568
+ if cunit3.p >= 0 && unit1.p >= 0
569
+ pp1 = p.get_cell(cunit3.p,unit1.p)
511
570
  have_pp = true
512
571
  end
513
- if cunit2.l >= 0 && unit1.l >= 0
514
- ll = a.get_cell(cunit2.l,unit1.l)
572
+ if cunit3.l >= 0 && unit1.l >= 0
573
+ ll = a.get_cell(cunit3.l,unit1.l)
515
574
  have_ll = true
516
575
  end
517
- if cunit2.r >= 0 && unit1.r >= 0
518
- rr = b.get_cell(cunit2.r,unit1.r)
576
+ if cunit3.r >= 0 && unit1.r >= 0
577
+ rr = b.get_cell(cunit3.r,unit1.r)
519
578
  have_rr = true
520
- if (((have_pp) ? cunit2.p : cunit2.l)) < 0
579
+ if (((have_pp) ? cunit3.p : cunit3.l)) < 0
521
580
  if rr != nil
522
581
  if v1.to_s(rr) != ""
523
582
  have_addition = true if @flags.allow_update
@@ -527,15 +586,15 @@ module Coopy
527
586
  end
528
587
  if have_pp
529
588
  if !have_rr
530
- dd = pp
531
- elsif v1.equals(pp,rr)
532
- dd = pp
589
+ dd = pp1
590
+ elsif v1.equals(pp1,rr)
591
+ dd = pp1
533
592
  else
534
- dd = pp
593
+ dd = pp1
535
594
  dd_to = rr
536
595
  have_dd_to = true
537
- if !v1.equals(pp,ll)
538
- if !v1.equals(pp,rr)
596
+ if !v1.equals(pp1,ll)
597
+ if !v1.equals(pp1,rr)
539
598
  dd_to_alt = ll
540
599
  have_dd_to_alt = true
541
600
  end
@@ -554,43 +613,50 @@ module Coopy
554
613
  else
555
614
  dd = rr
556
615
  end
557
- txt = nil
616
+ cell = dd
558
617
  if have_dd_to && allow_update
559
- active_column[j4] = 1 if active_column != nil
560
- txt = self.quote_for_diff(v1,dd)
561
- sep = self.get_separator(a,b,"->") if sep == ""
618
+ active_column[j5] = 1 if active_column != nil
619
+ if sep == ""
620
+ if @builder.need_separator
621
+ sep = self.get_separator(a,b,"->")
622
+ @builder.set_separator(sep)
623
+ else
624
+ sep = "->"
625
+ end
626
+ end
562
627
  is_conflict = false
563
628
  if have_dd_to_alt
564
629
  is_conflict = true if !v1.equals(dd_to,dd_to_alt)
565
630
  end
566
631
  if !is_conflict
567
- txt = _hx_str(txt) + _hx_str(sep) + _hx_str(self.quote_for_diff(v1,dd_to))
632
+ cell = @builder.update(dd,dd_to)
568
633
  act1 = sep if sep.length > act1.length
569
634
  else
570
- conflict_sep = _hx_str(self.get_separator(p,a,"!")) + _hx_str(sep) if conflict_sep == ""
571
- txt = _hx_str(txt) + _hx_str(conflict_sep) + _hx_str(self.quote_for_diff(v1,dd_to_alt)) + _hx_str(conflict_sep) + _hx_str(self.quote_for_diff(v1,dd_to))
635
+ if conflict_sep == ""
636
+ if @builder.need_separator
637
+ conflict_sep = _hx_str(self.get_separator(p,a,"!")) + _hx_str(sep)
638
+ @builder.set_conflict_separator(conflict_sep)
639
+ else
640
+ conflict_sep = "!->"
641
+ end
642
+ end
643
+ cell = @builder.conflict(dd,dd_to_alt,dd_to)
572
644
  act1 = conflict_sep
573
645
  end
574
646
  end
575
647
  act1 = "+" if act1 == "" && have_addition
576
648
  if act1 == "+++"
577
649
  if have_rr
578
- active_column[j4] = 1 if active_column != nil
650
+ active_column[j5] = 1 if active_column != nil
579
651
  end
580
652
  end
581
653
  if publish
582
- if active_column == nil || active_column[j4] > 0
583
- if txt != nil
584
- output.set_cell(j4 + 1,at2,v1.to_datum(txt))
585
- else
586
- output.set_cell(j4 + 1,at2,dd)
587
- end
588
- end
654
+ output.set_cell(j5 + 1,at2,cell) if active_column == nil || active_column[j5] > 0
589
655
  end
590
656
  end
591
657
  end
592
658
  if publish
593
- output.set_cell(0,at2,v1.to_datum(act1))
659
+ output.set_cell(0,at2,@builder.marker(act1))
594
660
  row_map[at2] = unit1
595
661
  end
596
662
  if act1 != ""
@@ -615,62 +681,58 @@ module Coopy
615
681
  admin_w+=1
616
682
  target = Array.new
617
683
  begin
618
- _g112 = 0
619
- _g23 = output.get_width
620
- while(_g112 < _g23)
621
- i6 = _g112
622
- _g112+=1
684
+ _g113 = 0
685
+ _g24 = output.get_width
686
+ while(_g113 < _g24)
687
+ i6 = _g113
688
+ _g113+=1
623
689
  target.push(i6 + 1)
624
690
  end
625
691
  end
626
692
  output.insert_or_delete_columns(target,output.get_width + 1)
627
- @l_prev = -1
628
- @r_prev = -1
629
693
  begin
630
- _g113 = 0
631
- _g24 = output.get_height
632
- while(_g113 < _g24)
633
- i7 = _g113
634
- _g113+=1
694
+ _g114 = 0
695
+ _g25 = output.get_height
696
+ while(_g114 < _g25)
697
+ i7 = _g114
698
+ _g114+=1
635
699
  unit2 = row_map[i7]
636
700
  next if unit2 == nil
637
- output.set_cell(0,i7,self.report_unit(unit2))
701
+ output.set_cell(0,i7,@builder.links(unit2))
638
702
  end
639
703
  end
640
704
  target = Array.new
641
705
  begin
642
- _g114 = 0
643
- _g25 = output.get_height
644
- while(_g114 < _g25)
645
- i8 = _g114
646
- _g114+=1
706
+ _g115 = 0
707
+ _g26 = output.get_height
708
+ while(_g115 < _g26)
709
+ i8 = _g115
710
+ _g115+=1
647
711
  target.push(i8 + 1)
648
712
  end
649
713
  end
650
714
  output.insert_or_delete_rows(target,output.get_height + 1)
651
- @l_prev = -1
652
- @r_prev = -1
653
715
  begin
654
- _g115 = 1
655
- _g26 = output.get_width
656
- while(_g115 < _g26)
657
- i9 = _g115
658
- _g115+=1
716
+ _g116 = 1
717
+ _g27 = output.get_width
718
+ while(_g116 < _g27)
719
+ i9 = _g116
720
+ _g116+=1
659
721
  unit3 = col_map[i9 - 1]
660
722
  next if unit3 == nil
661
- output.set_cell(i9,0,self.report_unit(unit3))
723
+ output.set_cell(i9,0,@builder.links(unit3))
662
724
  end
663
725
  end
664
- output.set_cell(0,0,"@:@")
726
+ output.set_cell(0,0,@builder.marker("@:@"))
665
727
  end
666
728
  if active_column != nil
667
729
  all_active = true
668
730
  begin
669
- _g116 = 0
670
- _g27 = active_column.length
671
- while(_g116 < _g27)
672
- i10 = _g116
673
- _g116+=1
731
+ _g117 = 0
732
+ _g28 = active_column.length
733
+ while(_g117 < _g28)
734
+ i10 = _g117
735
+ _g117+=1
674
736
  if active_column[i10] == 0
675
737
  all_active = false
676
738
  break
@@ -680,10 +742,10 @@ module Coopy
680
742
  if !all_active
681
743
  fate = Array.new
682
744
  begin
683
- _g28 = 0
684
- while(_g28 < admin_w)
685
- i11 = _g28
686
- _g28+=1
745
+ _g29 = 0
746
+ while(_g29 < admin_w)
747
+ i11 = _g29
748
+ _g29+=1
687
749
  fate.push(i11)
688
750
  end
689
751
  end
@@ -691,11 +753,11 @@ module Coopy
691
753
  ct = 0
692
754
  dots = Array.new
693
755
  begin
694
- _g117 = 0
695
- _g29 = active_column.length
696
- while(_g117 < _g29)
697
- i12 = _g117
698
- _g117+=1
756
+ _g118 = 0
757
+ _g30 = active_column.length
758
+ while(_g118 < _g30)
759
+ i12 = _g118
760
+ _g118+=1
699
761
  off = active_column[i12] == 0
700
762
  if off
701
763
  ct = ct + 1
@@ -713,17 +775,17 @@ module Coopy
713
775
  end
714
776
  output.insert_or_delete_columns(fate,at3)
715
777
  begin
716
- _g30 = 0
717
- while(_g30 < dots.length)
718
- d = dots[_g30]
719
- _g30+=1
778
+ _g33 = 0
779
+ while(_g33 < dots.length)
780
+ d = dots[_g33]
781
+ _g33+=1
720
782
  begin
721
783
  _g210 = 0
722
- _g118 = output.get_height
723
- while(_g210 < _g118)
724
- j5 = _g210
784
+ _g119 = output.get_height
785
+ while(_g210 < _g119)
786
+ j6 = _g210
725
787
  _g210+=1
726
- output.set_cell(d,j5,"...")
788
+ output.set_cell(d,j6,@builder.marker("..."))
727
789
  end
728
790
  end
729
791
  end
@@ -733,6 +795,7 @@ module Coopy
733
795
  return true
734
796
  end
735
797
 
798
+ haxe_me
736
799
  end
737
800
 
738
801
  end