parsanol 1.3.113-arm-linux → 1.3.114-arm-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/native/libparsanol.so +2 -2
- data/lib/parsanol/parg/compiler.rb +19 -5
- data/lib/parsanol/parg/document.rb +5 -1
- data/lib/parsanol/parg/parser.rb +18 -0
- data/lib/parsanol/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ccfe53145a4fbf2af4f7c2cc47071231be0016d8047e9bb0f75386738ff0480
|
|
4
|
+
data.tar.gz: 395d7bccac544d4842b29e5764d1198816ab823e1f9defdc3874009395caaa24
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1436b7af7ea025b302e14fc14970c42252c75f5aa6a2252f1701862ebca604ccc05349a39fdbd77b09fef78c7e633b9a6ff15c3f22e3a36845f49133a84eb7a
|
|
7
|
+
data.tar.gz: 188fe5c41d516ab6f3372ca339d0c313b0460e912e122a9e32ed5f8b948deb743c3a38f406997dddbb97cc9e3a5a7a25587640273eb44c97dde75d518d24ad6b
|
|
@@ -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: 39082700 bytes
|
|
4
|
+
sha256: d252dd306fb0dcb4726ed8a1deb826cecfc1ca8bf5528603f50ac20058e0aea9
|
|
@@ -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: 39267920 bytes
|
|
4
|
+
sha256: 4f500faf69c8b85dff0055043e37d08bdb897cabd0bc814ce1a5a7f31db0fad4
|
|
@@ -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: 39262108 bytes
|
|
4
|
+
sha256: b24c02b2f5d0848c59dba33cf4751107b1799ec8f96c961c3952114e96eb10f7
|
|
@@ -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: 39271824 bytes
|
|
4
|
+
sha256: 3bc6176aec3d4bb697ce024b174ddeca6a4b50a297bdd84492a277205e46efed
|
|
@@ -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: 35442920 bytes
|
|
4
|
+
sha256: 0a129844ae8acce2330a6b009be2fc9d918a6f46d53f744429ae02b9bf039aea
|
|
@@ -233,12 +233,24 @@ module Parsanol
|
|
|
233
233
|
# compile time — the tree shape consumers read, opt-in via
|
|
234
234
|
# `mode` in the grammar header. Engines see ordinary
|
|
235
235
|
# Named atoms; identity rides the differential corpus.
|
|
236
|
-
def apply_modern_captures(atom)
|
|
236
|
+
def apply_modern_captures(atom, rule_name)
|
|
237
237
|
return atom if @document.edition == "v1"
|
|
238
|
+
# A glue rule's own body compiles unwrapped (parsanol-ruby#364):
|
|
239
|
+
# the declaration means the tree never sees this subtree named,
|
|
240
|
+
# inside or out.
|
|
241
|
+
return atom if glue_rule?(rule_name)
|
|
238
242
|
|
|
239
243
|
wrap_uncaptured(atom)
|
|
240
244
|
end
|
|
241
245
|
|
|
246
|
+
# The `glue` declaration's verdict (parsanol-ruby#364): references
|
|
247
|
+
# to declared glue rules never wrap — the trivia exemption's
|
|
248
|
+
# "glue never becomes a capture", author-declared for rules that
|
|
249
|
+
# eat more than whitespace.
|
|
250
|
+
def glue_rule?(name)
|
|
251
|
+
@document.glue_rules.include?(name.to_s)
|
|
252
|
+
end
|
|
253
|
+
|
|
242
254
|
def wrap_uncaptured(atom)
|
|
243
255
|
case atom
|
|
244
256
|
when Atoms::Named
|
|
@@ -254,10 +266,11 @@ module Parsanol
|
|
|
254
266
|
# capture-producing refs both stay unwrapped; the bodies
|
|
255
267
|
# agree by design.
|
|
256
268
|
if trivia_only?(atom.rule_name.to_s, { atom.rule_name.to_s => true }) ||
|
|
269
|
+
glue_rule?(atom.rule_name.to_s) ||
|
|
257
270
|
produces_capture?(atom.parslet)
|
|
258
271
|
atom
|
|
259
272
|
else
|
|
260
|
-
Atoms::Named.new(atom, atom.rule_name.
|
|
273
|
+
Atoms::Named.new(atom, atom.rule_name.to_sym)
|
|
261
274
|
end
|
|
262
275
|
# rubocop:enable Lint/DuplicateBranch
|
|
263
276
|
when Atoms::Sequence, Atoms::Alternative
|
|
@@ -440,9 +453,10 @@ module Parsanol
|
|
|
440
453
|
case atom
|
|
441
454
|
when Atoms::Named then nil
|
|
442
455
|
when Atoms::Entity
|
|
443
|
-
# Mirror wrap_uncaptured's verdicts: trivia glue
|
|
444
|
-
# capture-producing refs
|
|
456
|
+
# Mirror wrap_uncaptured's verdicts: trivia glue, declared
|
|
457
|
+
# glue, and capture-producing refs all stay bare.
|
|
445
458
|
unless trivia_only?(atom.rule_name.to_s, { atom.rule_name.to_s => true }) ||
|
|
459
|
+
glue_rule?(atom.rule_name.to_s) ||
|
|
446
460
|
produces_capture?(atom.parslet)
|
|
447
461
|
lines << "rule #{site}: reference to #{atom.rule_name} produces no capture -- " \
|
|
448
462
|
"modern mode would name it #{atom.rule_name}"
|
|
@@ -482,7 +496,7 @@ module Parsanol
|
|
|
482
496
|
# atom_for; a mutual-reference grammar must hit the cache,
|
|
483
497
|
# not rebuild), then the cache takes the wrapped tree.
|
|
484
498
|
@atom_cache[name] = atom
|
|
485
|
-
atom = apply_modern_captures(atom)
|
|
499
|
+
atom = apply_modern_captures(atom, name)
|
|
486
500
|
@atom_cache[name] = atom
|
|
487
501
|
atom
|
|
488
502
|
end
|
|
@@ -18,7 +18,7 @@ module Parsanol
|
|
|
18
18
|
Test = Struct.new(:entry, :kind, :input, :expect)
|
|
19
19
|
|
|
20
20
|
attr_accessor :grammar_name, :version, :edition, :source, :uses, :skip_declaration, :skip_source,
|
|
21
|
-
:atomic_rules, :skip_capture_key, :brace_rules
|
|
21
|
+
:atomic_rules, :skip_capture_key, :brace_rules, :glue_rules
|
|
22
22
|
# R2 declared resync: rule name -> skip pattern (the span matched
|
|
23
23
|
# at a recovery point is consumed as annotated error text).
|
|
24
24
|
attr_reader :resyncs
|
|
@@ -60,6 +60,10 @@ module Parsanol
|
|
|
60
60
|
# contiguously).
|
|
61
61
|
@atomic_rules = []
|
|
62
62
|
@brace_rules = []
|
|
63
|
+
# Rules declared `glue <name> ...` (parsanol-ruby#364): the
|
|
64
|
+
# edition-2 wrap never names them — references stay bare and
|
|
65
|
+
# the rule's own body compiles unwrapped.
|
|
66
|
+
@glue_rules = []
|
|
63
67
|
@authored_rules = nil
|
|
64
68
|
# R2 declared resync: rule -> skip pattern. Recovery consumes
|
|
65
69
|
# each pattern match at a failure point as annotated error text
|
data/lib/parsanol/parg/parser.rb
CHANGED
|
@@ -338,6 +338,24 @@ module Parsanol
|
|
|
338
338
|
skip_newlines
|
|
339
339
|
next
|
|
340
340
|
end
|
|
341
|
+
# `glue <rule> [<rule>...]` (parsanol-ruby#364): names rules
|
|
342
|
+
# whose references edition 2 never wraps — glue the tree must
|
|
343
|
+
# not see. Same-line names accumulate; the declaration may
|
|
344
|
+
# appear any number of times.
|
|
345
|
+
if peek&.type == :ident && peek.value == "glue"
|
|
346
|
+
advance
|
|
347
|
+
names = []
|
|
348
|
+
while peek&.type == :ident
|
|
349
|
+
names << ident.value
|
|
350
|
+
end
|
|
351
|
+
if names.empty?
|
|
352
|
+
raise ParseError, "glue must name at least one rule"
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
document.glue_rules.concat(names)
|
|
356
|
+
skip_newlines
|
|
357
|
+
next
|
|
358
|
+
end
|
|
341
359
|
# `atomic <rule> = ...` suppresses skip-trivia injection inside
|
|
342
360
|
# the rule body: token-shaped rules match their input
|
|
343
361
|
# contiguously instead of spanning trivia between iterations.
|
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.114
|
|
5
5
|
platform: arm-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A small Ruby library for constructing parsers in the PEG (Parsing Expression
|
|
14
14
|
Grammar) fashion. Parsanol provides Parslet-compatible API with additional features
|