parsanol 1.3.76-aarch64-linux → 1.3.77-aarch64-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.2/parsanol_native.so +2 -2
- data/lib/parsanol/3.3/parsanol_native.so +2 -2
- data/lib/parsanol/3.4/parsanol_native.so +2 -2
- data/lib/parsanol/4.0/parsanol_native.so +2 -2
- data/lib/parsanol/atoms/lookbehind.rb +39 -9
- data/lib/parsanol/native/libparsanol.so +2 -2
- data/lib/parsanol/native/serializer.rb +11 -9
- data/lib/parsanol/parg/artifact.rb +10 -2
- data/lib/parsanol/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 237536c5543feeee187f725cefadecb004938ea5fffc48f138075bf87bb8fe81
|
|
4
|
+
data.tar.gz: 2b77dca5437b84a811cf14ef76ff4a75ddabf60104c6f96ee33ae9b55d2bd47c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad8e95dfe39e5105e088dc75bf23559dbed8d89d425ea6a7c5108f9527564b7fcf0768f17b1dd207efd88922f400d74b0a200d11a95b9c9d6ce79c2096e8c4db
|
|
7
|
+
data.tar.gz: 829a4d2ee8d777e54eabcdb05ce4d111adab5be847cfb60ad2a945ab4130ad40c045544684a9131f174f78e0b20479c8e1aeddc713dc533f7852ec71f03132d5
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/parsanol/3.2/parsanol_native.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 39947696 bytes
|
|
4
|
+
sha256: 3f642d14ad0b823fc3a133014ef6929d3a597c5ab9c3a832d3fa996caf7bbabc
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/parsanol/3.3/parsanol_native.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 40182696 bytes
|
|
4
|
+
sha256: 67674d19fb132d8ef5ee0aaf763d4d3df4ee823a01469e7adc1213430f6a1fc3
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/parsanol/3.4/parsanol_native.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 40182568 bytes
|
|
4
|
+
sha256: 821e0e98b25e93c7a140b795af49dd7b7ce45b7e90401142e88d255ccaf7a3c5
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/parsanol/4.0/parsanol_native.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 40192624 bytes
|
|
4
|
+
sha256: 1f5c4793a904141f174de9bd33ce872e5cef2b2637a0f69590e0da37a4ab37ad
|
|
@@ -2,30 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
module Parsanol
|
|
4
4
|
module Atoms
|
|
5
|
-
# Inspects the
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
5
|
+
# Inspects the text behind the current position and consumes
|
|
6
|
+
# nothing, yielding nil.
|
|
7
|
+
#
|
|
8
|
+
# Two forms (rs#137/#163):
|
|
9
|
+
# - Literal: the previous +count+ bytes must equal +pattern+
|
|
10
|
+
# (the precedes?/does_not_precede? fixed-window guard).
|
|
11
|
+
# - Regex: +source+ is searched in the preceding text and must
|
|
12
|
+
# end at the position — the CommonMark flanking form, which is
|
|
13
|
+
# class-based, multibyte and variable-length.
|
|
10
14
|
class Lookbehind < Base
|
|
11
|
-
attr_reader :count, :pattern, :positive
|
|
15
|
+
attr_reader :count, :pattern, :regex_source, :positive
|
|
12
16
|
|
|
13
17
|
def initialize(count, pattern, positive: true)
|
|
14
18
|
super()
|
|
15
19
|
@count = count
|
|
16
20
|
@pattern = pattern
|
|
21
|
+
@regex_source = nil
|
|
22
|
+
@compiled = nil
|
|
17
23
|
@positive = positive
|
|
18
24
|
end
|
|
19
25
|
|
|
26
|
+
# Class-based flanking guard: +source+ must match the text
|
|
27
|
+
# ending at the position.
|
|
28
|
+
def self.regex(source, positive: true)
|
|
29
|
+
atom = new(0, "", positive: positive)
|
|
30
|
+
atom.instance_variable_set(:@regex_source, source)
|
|
31
|
+
atom
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def regex?
|
|
35
|
+
!@regex_source.nil?
|
|
36
|
+
end
|
|
37
|
+
|
|
20
38
|
def try(source, _context, _consume_all)
|
|
21
39
|
start = source.bytepos
|
|
22
|
-
|
|
23
|
-
|
|
40
|
+
if regex?
|
|
41
|
+
@compiled ||= Regexp.new("(?:#{@regex_source})\\z")
|
|
42
|
+
matched = @compiled.match?(source.input.byteslice(0, start))
|
|
43
|
+
else
|
|
44
|
+
behind =
|
|
45
|
+
if start >= @count
|
|
46
|
+
source.input.byteslice(start - @count, @count)
|
|
47
|
+
end
|
|
48
|
+
matched = !behind.nil? && behind == @pattern.b
|
|
49
|
+
end
|
|
24
50
|
[matched == @positive, nil]
|
|
25
51
|
end
|
|
26
52
|
|
|
27
53
|
def to_s_inner(_prec)
|
|
28
|
-
|
|
54
|
+
if regex?
|
|
55
|
+
"lookbehind(/#{@regex_source}/, #{@positive ? '+' : '-'})"
|
|
56
|
+
else
|
|
57
|
+
"lookbehind(#{@count}, #{@pattern.inspect}, #{@positive ? '+' : '-'})"
|
|
58
|
+
end
|
|
29
59
|
end
|
|
30
60
|
end
|
|
31
61
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: data/lib/parsanol/native/libparsanol.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 35749424 bytes
|
|
4
|
+
sha256: 17585f657e7684ce70ff38a9bc4c85c928aa67caeaf7f7b7b5fdb32105c75980
|
|
@@ -103,15 +103,17 @@ module Parsanol
|
|
|
103
103
|
# atoms — empty match yielding a wire constant.
|
|
104
104
|
{ "Constant" => { "value" => serialize_constant_value(atom.value) } }
|
|
105
105
|
when Parsanol::Atoms::Lookbehind
|
|
106
|
-
# rs#137
|
|
107
|
-
#
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
# rs#137/#163: the behind-window test — a fixed
|
|
107
|
+
# literal window or an end-anchored regex (the
|
|
108
|
+
# CommonMark flanking form).
|
|
109
|
+
look = if atom.regex?
|
|
110
|
+
{ "Regex" => { "source" => atom.regex_source } }
|
|
111
|
+
else
|
|
112
|
+
{ "Literal" => { "count" => atom.count,
|
|
113
|
+
"pattern" => atom.pattern } }
|
|
114
|
+
end
|
|
115
|
+
{ "Lookbehind" => { "look" => look,
|
|
116
|
+
"positive" => atom.positive } }
|
|
115
117
|
when Parsanol::Atoms::Ignored
|
|
116
118
|
serialize_ignored(atom)
|
|
117
119
|
else
|
|
@@ -65,8 +65,16 @@ module Parsanol
|
|
|
65
65
|
def parse(entry_name, input, mode: :native)
|
|
66
66
|
case mode
|
|
67
67
|
when :native
|
|
68
|
-
if !envelope["dynamic"]
|
|
69
|
-
|
|
68
|
+
if Native.available? && !envelope["dynamic"]
|
|
69
|
+
# Fast lane (parsanol-ruby#162): the per-instance atom
|
|
70
|
+
# tree rides the DSL serialization/registration caches
|
|
71
|
+
# (GRAMMAR_CACHE / HANDLE_CACHE keyed on the stable root
|
|
72
|
+
# atom), so an artifact parses at compiled speed after
|
|
73
|
+
# the first call. The old path re-serialized the whole
|
|
74
|
+
# grammar JSON and re-registered it per parse (~8x).
|
|
75
|
+
# Dynamic artifacts carry ruby-tier atoms their wire
|
|
76
|
+
# cannot express — they keep the interpreter.
|
|
77
|
+
return root_atom(entry_name).parse(input, mode: :native)
|
|
70
78
|
end
|
|
71
79
|
|
|
72
80
|
root_atom(entry_name).parse(input)
|
data/lib/parsanol/version.rb
CHANGED