parsanol 1.3.9-x86_64-linux → 1.3.10-x86_64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/parsanol/3.3/parsanol_native.so +0 -0
- data/lib/parsanol/3.4/parsanol_native.so +0 -0
- data/lib/parsanol/4.0/parsanol_native.so +0 -0
- data/lib/parsanol/grammar_builder.rb +1 -1
- data/lib/parsanol/native/batch_decoder.rb +1 -2
- data/lib/parsanol/native/types.rb +0 -13
- data/lib/parsanol/native.rb +7 -19
- data/lib/parsanol/options/zero_copy.rb +1 -2
- data/lib/parsanol/slice.rb +1 -1
- data/lib/parsanol/source/line_cache.rb +0 -7
- data/lib/parsanol/version.rb +1 -1
- metadata +3 -4
- data/lib/parsanol/3.2/parsanol_native.so +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 350cb0575aed05f8dd7bfa0b46c2af30b9e539fd3cbeed242748bd37883dbec2
|
|
4
|
+
data.tar.gz: c967788989220c6747a1705ac22a12fcd8af1b3e1b0d16a66912706bf6c0aca0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc7fa5aa460ab85b7d603b9bf5f5862d315dcf47dc5089a51f2200606c0d74bf9398d6cd6761db5efa3e90f286acaa7e48ea91e417d8597645f519b6213279b4
|
|
7
|
+
data.tar.gz: aa6e5d3595d2f9970019b23fc2f321367cd69d649abd38f82f302c4a399776e50df315f3ddef812c6246be5260858cfa2b4ac9d70137b1ad768440bad25abb4a
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -57,9 +57,8 @@ module Parsanol
|
|
|
57
57
|
# pre-decoded Ruby value from _parse_raw
|
|
58
58
|
# @param input [String] Original input string (for Slice references)
|
|
59
59
|
# @param slice_class [Class] The Slice class to use
|
|
60
|
-
# @param grammar_atom [Parsanol::Atoms::Base] The grammar atom (unused, kept for API compat)
|
|
61
60
|
# @return [Object] Transformed Ruby AST
|
|
62
|
-
def decode_and_flatten(data, input, slice_class
|
|
61
|
+
def decode_and_flatten(data, input, slice_class)
|
|
63
62
|
# Check if data is batch data (flat u64 array) or already a Ruby value
|
|
64
63
|
if data.is_a?(Integer) || (data.is_a?(Array) && data.first.is_a?(Integer))
|
|
65
64
|
# Batch data (flat u64 array) - decode first, then transform
|
|
@@ -25,18 +25,5 @@ module Parsanol
|
|
|
25
25
|
EMPTY_ARRAY = [].freeze
|
|
26
26
|
EMPTY_HASH = {}.freeze
|
|
27
27
|
end
|
|
28
|
-
|
|
29
|
-
# Symbol cache to avoid repeated string-to-symbol conversions
|
|
30
|
-
# This is a class variable to share across all transformations
|
|
31
|
-
@@symbol_cache = {}
|
|
32
|
-
|
|
33
|
-
# Convert string key to symbol with caching
|
|
34
|
-
# @param key [String, Symbol] The key to convert
|
|
35
|
-
# @return [Symbol] The symbol version of the key
|
|
36
|
-
def self.cached_symbol(key)
|
|
37
|
-
return key if key.is_a?(Symbol)
|
|
38
|
-
|
|
39
|
-
@@symbol_cache[key] ||= key.to_sym
|
|
40
|
-
end
|
|
41
28
|
end
|
|
42
29
|
end
|
data/lib/parsanol/native.rb
CHANGED
|
@@ -10,8 +10,6 @@ require "parsanol/native/batch_decoder"
|
|
|
10
10
|
|
|
11
11
|
module Parsanol
|
|
12
12
|
module Native
|
|
13
|
-
VERSION = "0.1.0"
|
|
14
|
-
|
|
15
13
|
class << self
|
|
16
14
|
# Check if native extension is available
|
|
17
15
|
def available?
|
|
@@ -41,20 +39,17 @@ module Parsanol
|
|
|
41
39
|
raise LoadError, "Native parser not available" unless available?
|
|
42
40
|
|
|
43
41
|
# Handle both grammar atoms and pre-serialized JSON strings
|
|
44
|
-
if grammar.is_a?(String)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
grammar_atom = grammar
|
|
50
|
-
end
|
|
42
|
+
grammar_json = if grammar.is_a?(String)
|
|
43
|
+
grammar
|
|
44
|
+
else
|
|
45
|
+
Parser.serialize_grammar(grammar)
|
|
46
|
+
end
|
|
51
47
|
|
|
52
48
|
# Use _parse_raw which returns properly tagged Ruby arrays via transform_ast.
|
|
53
49
|
# The batch format doesn't preserve :repetition/:sequence tags, so we use
|
|
54
50
|
# the direct FFI path. Apply the Ruby transformer to handle tags correctly.
|
|
55
51
|
raw_ast = _parse_raw(grammar_json, input)
|
|
56
|
-
BatchDecoder.decode_and_flatten(raw_ast, input, Parsanol::Slice
|
|
57
|
-
grammar_atom)
|
|
52
|
+
BatchDecoder.decode_and_flatten(raw_ast, input, Parsanol::Slice)
|
|
58
53
|
end
|
|
59
54
|
|
|
60
55
|
# Memory-bounded parsing without packrat cache.
|
|
@@ -75,7 +70,7 @@ module Parsanol
|
|
|
75
70
|
end
|
|
76
71
|
|
|
77
72
|
raw_ast = _parse_fresh_raw(grammar_json, input)
|
|
78
|
-
BatchDecoder.decode_and_flatten(raw_ast, input, Parsanol::Slice
|
|
73
|
+
BatchDecoder.decode_and_flatten(raw_ast, input, Parsanol::Slice)
|
|
79
74
|
end
|
|
80
75
|
|
|
81
76
|
# Parse and return RAW AST without transformation.
|
|
@@ -187,13 +182,6 @@ module Parsanol
|
|
|
187
182
|
end
|
|
188
183
|
stats
|
|
189
184
|
end
|
|
190
|
-
|
|
191
|
-
private
|
|
192
|
-
|
|
193
|
-
# Get the Slice class
|
|
194
|
-
def get_slice_class
|
|
195
|
-
Parsanol::Slice
|
|
196
|
-
end
|
|
197
185
|
end
|
|
198
186
|
end
|
|
199
187
|
end
|
|
@@ -89,11 +89,10 @@ module Parsanol
|
|
|
89
89
|
# Parse input and return direct Ruby objects (no serialization)
|
|
90
90
|
#
|
|
91
91
|
# @param input [String] The input string to parse
|
|
92
|
-
# @param options [Hash] Parse options (ignored for zero-copy)
|
|
93
92
|
# @return [Object] Direct Ruby object (type depends on grammar)
|
|
94
93
|
# @raise [LoadError] If native extension not available
|
|
95
94
|
# @raise [Parsanol::ParseFailed] If parsing fails
|
|
96
|
-
def parse(input
|
|
95
|
+
def parse(input)
|
|
97
96
|
unless Parsanol::Native.available?
|
|
98
97
|
raise LoadError,
|
|
99
98
|
"ZeroCopy mode requires native extension for direct FFI object construction. " \
|
data/lib/parsanol/slice.rb
CHANGED
|
@@ -97,13 +97,6 @@ module Parsanol
|
|
|
97
97
|
return hi if hi <= lo
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
|
-
|
|
101
|
-
# Legacy method name for backward compatibility
|
|
102
|
-
alias find_mid midpoint_index
|
|
103
|
-
alias lbound lower_bound_index
|
|
104
100
|
end
|
|
105
|
-
|
|
106
|
-
# Legacy constant name for backward compatibility
|
|
107
|
-
RangeSearch = IntervalLookup
|
|
108
101
|
end
|
|
109
102
|
end
|
data/lib/parsanol/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parsanol
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.10
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -151,7 +151,6 @@ files:
|
|
|
151
151
|
- README.adoc
|
|
152
152
|
- Rakefile
|
|
153
153
|
- lib/parsanol.rb
|
|
154
|
-
- lib/parsanol/3.2/parsanol_native.so
|
|
155
154
|
- lib/parsanol/3.3/parsanol_native.so
|
|
156
155
|
- lib/parsanol/3.4/parsanol_native.so
|
|
157
156
|
- lib/parsanol/4.0/parsanol_native.so
|
|
@@ -262,7 +261,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
262
261
|
requirements:
|
|
263
262
|
- - ">="
|
|
264
263
|
- !ruby/object:Gem::Version
|
|
265
|
-
version: '3.
|
|
264
|
+
version: '3.3'
|
|
266
265
|
- - "<"
|
|
267
266
|
- !ruby/object:Gem::Version
|
|
268
267
|
version: 4.1.dev
|
|
Binary file
|