stupidedi 1.2.16 → 1.2.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -12
  3. data/bin/edi-pp +2 -12
  4. data/lib/stupidedi/builder/generation.rb +2 -6
  5. data/lib/stupidedi/builder/states/failure_state.rb +5 -13
  6. data/lib/stupidedi/config.rb +5 -0
  7. data/lib/stupidedi/editor.rb +1 -0
  8. data/lib/stupidedi/guides/005010/X279-HB271.rb +832 -0
  9. data/lib/stupidedi/guides/005010/X279-HS270.rb +594 -0
  10. data/lib/stupidedi/guides/005010/X279A1-HB271.rb +845 -0
  11. data/lib/stupidedi/guides/005010/X279A1-HS270.rb +594 -0
  12. data/lib/stupidedi/guides/005010.rb +9 -0
  13. data/lib/stupidedi/version.rb +1 -1
  14. data/lib/stupidedi/versions/functional_groups/005010/element_defs.rb +619 -9
  15. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/AAA.rb +22 -0
  16. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/EB.rb +34 -0
  17. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/EQ.rb +25 -0
  18. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/HSD.rb +29 -0
  19. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/III.rb +31 -0
  20. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/MPI.rb +27 -0
  21. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/MSG.rb +23 -0
  22. data/lib/stupidedi/versions/functional_groups/005010/segment_defs.rb +22 -4
  23. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HB271.rb +14 -13
  24. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HS270.rb +13 -12
  25. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs.rb +4 -4
  26. metadata +12 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 040c365b1e70df2668c3c5ed37a799ae7c8962ec0d3d665f362937680f9b3d25
4
- data.tar.gz: 8f35cd7f6e0a1cbf2c37017e073e212153efc21d668188e89c1113c4b0c46c89
3
+ metadata.gz: 3c46085ad290ee14271363696a00ac3a9a270cfd2fda4c18c15b1cd3012bcefc
4
+ data.tar.gz: 1cb000b1738736fa2a350691cc8c1c42a286ab26cff4a58baec7d526d65e2d93
5
5
  SHA512:
6
- metadata.gz: 4c75ef9c84ea65e420ef42405ea4c743b33520fce54320a5700fa7e1d47b8ac4fea9ca2ceef9857ec35d7e07ffe12b353f76b5bd8e3127fc15302b948feb2ddb
7
- data.tar.gz: 66a6626c91edfa67d0089e9eaadf62e6801b741ad5733b007be40be7668557b3d281b6fc5759a60606799c7ebf39fc5c164026333a5286c604ee5c74cb7d4bd3
6
+ metadata.gz: 9d6cb0264b9ecf66838eba432f0bf84901e481e1b7458008854dc7eef4b24c4d4bfb0938d7380360397d670aff5a3de7414ebebe2fe831496a80d8c5d628ac39
7
+ data.tar.gz: 1acd64f95de0249078ae28546c2634396bfe25547c25189ad2feac6b056f3491197b9e97e7617ac49d2f29f931e62762c39272f59001609304b14a37876aefbb
data/README.md CHANGED
@@ -86,7 +86,6 @@ very large files aren't read into memory all at once.
86
86
  <table>
87
87
  <tr>
88
88
  <th>segments</th>
89
- <th>2.5.0</th>
90
89
  <th>1.9.3</th>
91
90
  <th>1.9.2</th>
92
91
  <th>rbx-head</th>
@@ -94,7 +93,6 @@ very large files aren't read into memory all at once.
94
93
  </tr>
95
94
  <tr>
96
95
  <td>1680</td>
97
- <td></td>
98
96
  <td>2107.90</td>
99
97
  <td>2007.17</td>
100
98
  <td>503.14</td>
@@ -102,7 +100,6 @@ very large files aren't read into memory all at once.
102
100
  </tr>
103
101
  <tr>
104
102
  <td>3360</td>
105
- <td></td>
106
103
  <td>2461.54</td>
107
104
  <td>2420.75</td>
108
105
  <td>731.71</td>
@@ -110,7 +107,6 @@ very large files aren't read into memory all at once.
110
107
  </tr>
111
108
  <tr>
112
109
  <td>6720</td>
113
- <td></td>
114
110
  <td>2677.29</td>
115
111
  <td>2620.90</td>
116
112
  <td>950.63</td>
@@ -118,7 +114,6 @@ very large files aren't read into memory all at once.
118
114
  </tr>
119
115
  <tr>
120
116
  <td>13440</td>
121
- <td></td>
122
117
  <td>2699.88</td>
123
118
  <td>2663.50</td>
124
119
  <td>1071.00</td>
@@ -126,7 +121,6 @@ very large files aren't read into memory all at once.
126
121
  </tr>
127
122
  <tr>
128
123
  <td>26880</td>
129
- <td></td>
130
124
  <td>2558.54</td>
131
125
  <td>2510.51</td>
132
126
  <td>1124.50</td>
@@ -134,7 +128,6 @@ very large files aren't read into memory all at once.
134
128
  </tr>
135
129
  <tr>
136
130
  <td>53760</td>
137
- <td></td>
138
131
  <td>2254.94</td>
139
132
  <td>2164.16</td>
140
133
  <td>1039.81</td>
@@ -358,8 +351,3 @@ parser.first
358
351
  ```ruby
359
352
  rake spec
360
353
  ```
361
-
362
- ### Run benchmarks
363
- ```bash
364
- notes/benchmark/bench.sh | ./notes/benchmark/fmt.rb
365
- ```
data/bin/edi-pp CHANGED
@@ -1,7 +1,6 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env ruby -w
2
2
  require File.expand_path("../../lib/stupidedi", __FILE__)
3
3
  require "pp"
4
- require 'oj'
5
4
 
6
5
  # Short-lived processes should win some peformance gains here
7
6
  GC.disable
@@ -27,8 +26,6 @@ end
27
26
 
28
27
  stop = Time.now
29
28
 
30
-
31
- test = []
32
29
  parser.zipper.map{|z| pp z.root.node }.explain do
33
30
  # Multiple parse trees (non-deterministic state)
34
31
  unless nondet
@@ -40,18 +37,11 @@ parser.zipper.map{|z| pp z.root.node }.explain do
40
37
  parser.active.each do |state|
41
38
  zipper = state.node.zipper
42
39
  pp zipper.root.node
43
-
44
- pp 'here'
45
- puts "\n#{"-" * 70}\n\n"
40
+ puts "\n#{"-" * 70}\n\n"
46
41
  end
47
-
48
-
49
42
  end
50
43
  end
51
44
 
52
-
53
-
54
-
55
45
  begin
56
46
  a = parser.first
57
47
  b = parser.last
@@ -32,12 +32,8 @@ module Stupidedi
32
32
  state = zipper.node
33
33
  instructions = state.instructions.matches(segment_tok)
34
34
 
35
- if instructions.empty?
36
- if zipper.class == Stupidedi::Zipper::RootCursor
37
- active << zipper.replace(FailureState.mksegment(segment_tok, state))
38
- else
39
- active << zipper.append(FailureState.mksegment(segment_tok, state))
40
- end
35
+ if instructions.empty?
36
+ active << zipper.append(FailureState.mksegment(segment_tok, state))
41
37
  next
42
38
  end
43
39
 
@@ -58,19 +58,11 @@ module Stupidedi
58
58
  segment_val = Values::InvalidSegmentVal.new \
59
59
  "unexpected segment", segment_tok
60
60
 
61
- if parent.zipper.class == Stupidedi::Zipper::RootCursor
62
- new(parent.separators,
63
- parent.segment_dict,
64
- parent.instructions,
65
- parent.zipper.replace(segment_val),
66
- [])
67
- else
68
- new(parent.separators,
69
- parent.segment_dict,
70
- parent.instructions,
71
- parent.zipper.append(segment_val),
72
- [])
73
- end
61
+ new(parent.separators,
62
+ parent.segment_dict,
63
+ parent.instructions,
64
+ parent.zipper.append(segment_val),
65
+ [])
74
66
  end
75
67
 
76
68
  # @endgroup
@@ -111,10 +111,15 @@ module Stupidedi
111
111
  x.register("005010X222", "HC", "837") { Stupidedi::Guides::FiftyTen::X222::HC837P }
112
112
  x.register("005010X223", "HC", "837") { Stupidedi::Guides::FiftyTen::X223::HC837I }
113
113
  x.register("005010X231", "FA", "999") { Stupidedi::Guides::FiftyTen::X231::FA999 }
114
+ x.register("005010X279", "HS", "270") { Stupidedi::Guides::FiftyTen::X279::HS270 }
115
+ x.register("005010X279", "HB", "271") { Stupidedi::Guides::FiftyTen::X279::HB271 }
116
+
114
117
  x.register("005010X220A1", "BE", "834") { Stupidedi::Guides::FiftyTen::X220A1::BE834 }
115
118
  x.register("005010X221A1", "HP", "835") { Stupidedi::Guides::FiftyTen::X221A1::HP835 }
116
119
  x.register("005010X222A1", "HC", "837") { Stupidedi::Guides::FiftyTen::X222A1::HC837P }
117
120
  x.register("005010X231A1", "FA", "999") { Stupidedi::Guides::FiftyTen::X231A1::FA999 }
121
+ x.register("005010X279A1", "HS", "270") { Stupidedi::Guides::FiftyTen::X279A1::HS270 }
122
+ x.register("005010X279A1", "HB", "271") { Stupidedi::Guides::FiftyTen::X279A1::HB271 }
118
123
  end
119
124
  end
120
125
  end
@@ -23,6 +23,7 @@ module Stupidedi
23
23
  autoload :TransmissionEd, "stupidedi/editor/transmission_ed"
24
24
 
25
25
  autoload :X12, "stupidedi/editor/X12"
26
+ autoload :X221, "stupidedi/editor/X221-HP835"
26
27
  autoload :X222, "stupidedi/editor/X222-HC837"
27
28
 
28
29
  # TA1