strscan 3.0.0 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYING +56 -0
- data/LICENSE.txt +22 -0
- data/ext/strscan/extconf.rb +7 -3
- data/ext/strscan/strscan.c +15 -16
- metadata +8 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac97143ad3475bb22b506c3841a206ce2c6ef70a44330ba05be5e72a6bf183f2
|
4
|
+
data.tar.gz: f66c4ed0b225115748bff2a26352f7bfad39f333be8219b8b84a0b9b5af831d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f6b0e1faf495ba2e3b8d9f82ba40964eaad9f730477a5253d3fe8890fb75e1756c38d1187fae3e0dd88c71bfed728cd6bd7c7174606b1e004d35f3cefa9dfcd
|
7
|
+
data.tar.gz: 5dba60f70b968815b342be3537aec8220176cd49c0a752a12b7e8c3085ed6f17af82052a35557398fb7f259ade8a42bdd1beedb1f35247f59292b3cb7d9cbce2
|
data/COPYING
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
StringScanner is copyrighted free software by Minero Aoki.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file LICENSE.txt), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b. use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c. give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d. make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a. distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c. give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d. make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (C) 1999-2006 Minero Aoki. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions
|
5
|
+
are met:
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
13
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
16
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
17
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
18
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
19
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
20
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
21
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
22
|
+
SUCH DAMAGE.
|
data/ext/strscan/extconf.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'mkmf'
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
if RUBY_ENGINE == 'ruby'
|
4
|
+
$INCFLAGS << " -I$(top_srcdir)" if $extmk
|
5
|
+
have_func("onig_region_memsize", "ruby.h")
|
6
|
+
create_makefile 'strscan'
|
7
|
+
else
|
8
|
+
File.write('Makefile', dummy_makefile("").join)
|
9
|
+
end
|
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.4"
|
26
26
|
|
27
27
|
/* =======================================================================
|
28
28
|
Data Type Definitions
|
@@ -435,23 +435,20 @@ strscan_get_pos(VALUE self)
|
|
435
435
|
*
|
436
436
|
* In short, it's a 0-based index into the string.
|
437
437
|
*
|
438
|
-
* s = StringScanner.new("
|
439
|
-
* s.charpos
|
440
|
-
* s.scan_until(
|
441
|
-
* s.pos
|
442
|
-
* s.charpos
|
438
|
+
* s = StringScanner.new("abc\u00e4def\u00f6ghi")
|
439
|
+
* s.charpos # -> 0
|
440
|
+
* s.scan_until(/\u00e4/) # -> "abc\u00E4"
|
441
|
+
* s.pos # -> 5
|
442
|
+
* s.charpos # -> 4
|
443
443
|
*/
|
444
444
|
static VALUE
|
445
445
|
strscan_get_charpos(VALUE self)
|
446
446
|
{
|
447
447
|
struct strscanner *p;
|
448
|
-
VALUE substr;
|
449
448
|
|
450
449
|
GET_SCANNER(self, p);
|
451
450
|
|
452
|
-
|
453
|
-
|
454
|
-
return rb_str_length(substr);
|
451
|
+
return LONG2NUM(rb_enc_strlen(S_PBEG(p), CURPTR(p), rb_enc_get(p->str)));
|
455
452
|
}
|
456
453
|
|
457
454
|
/*
|
@@ -984,7 +981,7 @@ strscan_unscan(VALUE self)
|
|
984
981
|
}
|
985
982
|
|
986
983
|
/*
|
987
|
-
* Returns +true+
|
984
|
+
* Returns +true+ if and only if the scan pointer is at the beginning of the line.
|
988
985
|
*
|
989
986
|
* s = StringScanner.new("test\ntest\n")
|
990
987
|
* s.bol? # => true
|
@@ -1037,7 +1034,7 @@ strscan_empty_p(VALUE self)
|
|
1037
1034
|
}
|
1038
1035
|
|
1039
1036
|
/*
|
1040
|
-
* Returns true
|
1037
|
+
* Returns true if and only if there is more data in the string. See #eos?.
|
1041
1038
|
* This method is obsolete; use #eos? instead.
|
1042
1039
|
*
|
1043
1040
|
* s = StringScanner.new('test string')
|
@@ -1054,7 +1051,7 @@ strscan_rest_p(VALUE self)
|
|
1054
1051
|
}
|
1055
1052
|
|
1056
1053
|
/*
|
1057
|
-
* Returns +true+
|
1054
|
+
* Returns +true+ if and only if the last match was successful.
|
1058
1055
|
*
|
1059
1056
|
* s = StringScanner.new('test string')
|
1060
1057
|
* s.match?(/\w+/) # => 4
|
@@ -1471,6 +1468,8 @@ strscan_fixed_anchor_p(VALUE self)
|
|
1471
1468
|
* StringScanner provides for lexical scanning operations on a String. Here is
|
1472
1469
|
* an example of its usage:
|
1473
1470
|
*
|
1471
|
+
* require 'strscan'
|
1472
|
+
*
|
1474
1473
|
* s = StringScanner.new('This is an example string')
|
1475
1474
|
* s.eos? # -> false
|
1476
1475
|
*
|
@@ -1537,7 +1536,7 @@ strscan_fixed_anchor_p(VALUE self)
|
|
1537
1536
|
*
|
1538
1537
|
* === Finding Where we Are
|
1539
1538
|
*
|
1540
|
-
* - #beginning_of_line? (
|
1539
|
+
* - #beginning_of_line? (<tt>#bol?</tt>)
|
1541
1540
|
* - #eos?
|
1542
1541
|
* - #rest?
|
1543
1542
|
* - #rest_size
|
@@ -1554,13 +1553,13 @@ strscan_fixed_anchor_p(VALUE self)
|
|
1554
1553
|
* - #matched
|
1555
1554
|
* - #matched?
|
1556
1555
|
* - #matched_size
|
1557
|
-
* - []
|
1556
|
+
* - <tt>#[]</tt>
|
1558
1557
|
* - #pre_match
|
1559
1558
|
* - #post_match
|
1560
1559
|
*
|
1561
1560
|
* === Miscellaneous
|
1562
1561
|
*
|
1563
|
-
* -
|
1562
|
+
* - <tt><<</tt>
|
1564
1563
|
* - #concat
|
1565
1564
|
* - #string
|
1566
1565
|
* - #string=
|
metadata
CHANGED
@@ -1,67 +1,29 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minero Aoki
|
8
8
|
- Sutou Kouhei
|
9
|
+
- Charles Oliver Nutter
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: rake-compiler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: benchmark-driver
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '0'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '0'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: test-unit
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">="
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0'
|
13
|
+
date: 2022-07-23 00:00:00.000000000 Z
|
14
|
+
dependencies: []
|
56
15
|
description: Provides lexical scanning operations on a String.
|
57
16
|
email:
|
58
17
|
-
|
59
18
|
- kou@cozmixng.org
|
19
|
+
- headius@headius.com
|
60
20
|
executables: []
|
61
21
|
extensions:
|
62
22
|
- ext/strscan/extconf.rb
|
63
23
|
extra_rdoc_files: []
|
64
24
|
files:
|
25
|
+
- COPYING
|
26
|
+
- LICENSE.txt
|
65
27
|
- ext/strscan/extconf.rb
|
66
28
|
- ext/strscan/strscan.c
|
67
29
|
homepage: https://github.com/ruby/strscan
|
@@ -84,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
46
|
- !ruby/object:Gem::Version
|
85
47
|
version: '0'
|
86
48
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
49
|
+
rubygems_version: 3.3.7
|
88
50
|
signing_key:
|
89
51
|
specification_version: 4
|
90
52
|
summary: Provides lexical scanning operations on a String.
|