strscan 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/strscan/strscan.c +12 -8
- 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: 55b86790043219a7a959b084db7665576bd1d6342b4cbef90dbfe4da131920cb
|
4
|
+
data.tar.gz: f80e735c0376d490dd5f565a39cbdf68a97b0f6bd34d01d16b493d7205453fa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95157252dd0df23caafd499d2e4bc09821cfb637d5dc1bc6f3ea2c290aa7263269899145fa6fd4e0b9ca5757fc33aaee694bd1a11dc0219f4760648bbafa0408
|
7
|
+
data.tar.gz: df2aa355dfa01e01ce60fea0ea13dc058dbf1067b51eb54086adc1a9ef5e6a210d05a073a916190490dc7b0f315133c010edcdac3344098f161a555915722e35
|
data/ext/strscan/strscan.c
CHANGED
@@ -22,7 +22,7 @@ extern size_t onig_region_memsize(const struct re_registers *regs);
|
|
22
22
|
|
23
23
|
#include <stdbool.h>
|
24
24
|
|
25
|
-
#define STRSCAN_VERSION "3.0.
|
25
|
+
#define STRSCAN_VERSION "3.0.8"
|
26
26
|
|
27
27
|
/* =======================================================================
|
28
28
|
Data Type Definitions
|
@@ -1243,10 +1243,10 @@ strscan_size(VALUE self)
|
|
1243
1243
|
* If nothing was priorly matched, it returns nil.
|
1244
1244
|
*
|
1245
1245
|
* s = StringScanner.new("Fri Dec 12 1975 14:39")
|
1246
|
-
* s.scan(/(\w+) (\w+) (\d+)
|
1247
|
-
* s.captures
|
1248
|
-
* s.scan(/(\w+) (\w+) (\d+)
|
1249
|
-
* s.captures
|
1246
|
+
* s.scan(/(\w+) (\w+) (\d+) (1980)?/) # -> "Fri Dec 12 "
|
1247
|
+
* s.captures # -> ["Fri", "Dec", "12", nil]
|
1248
|
+
* s.scan(/(\w+) (\w+) (\d+) (1980)?/) # -> nil
|
1249
|
+
* s.captures # -> nil
|
1250
1250
|
*/
|
1251
1251
|
static VALUE
|
1252
1252
|
strscan_captures(VALUE self)
|
@@ -1262,9 +1262,13 @@ strscan_captures(VALUE self)
|
|
1262
1262
|
new_ary = rb_ary_new2(num_regs);
|
1263
1263
|
|
1264
1264
|
for (i = 1; i < num_regs; i++) {
|
1265
|
-
VALUE str
|
1266
|
-
|
1267
|
-
|
1265
|
+
VALUE str;
|
1266
|
+
if (p->regs.beg[i] == -1)
|
1267
|
+
str = Qnil;
|
1268
|
+
else
|
1269
|
+
str = extract_range(p,
|
1270
|
+
adjust_register_position(p, p->regs.beg[i]),
|
1271
|
+
adjust_register_position(p, p->regs.end[i]));
|
1268
1272
|
rb_ary_push(new_ary, str);
|
1269
1273
|
}
|
1270
1274
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strscan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minero Aoki
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Provides lexical scanning operations on a String.
|
16
16
|
email:
|