regexp_parser 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79c8b7838ef53335c9d0fbd21ffdf6815473ee560380a3687e8fab514d031d53
4
- data.tar.gz: 2a91f7c7640fc5f2d304c2cbf240886d8e8642994861a9c092f1d4db2ae6b77a
3
+ metadata.gz: 077b8a0c90d90cf46e44671ec1335a5373eef72c61a0bcf4de43ba5217a188c3
4
+ data.tar.gz: b9aed868af73adcdf40c09720c5d10091b25a53b25a792717ceb5591039a2931
5
5
  SHA512:
6
- metadata.gz: 3559a8c7af9c0087ab7a54862c9913e40a3703ffa23f62e6919eec50042523424c2aa4c99b3de9d28d03fc0edd14af37e0dcd0eab7bf822b9af73113be468b59
7
- data.tar.gz: 31ed468565bd41fe2d0bd7b82d53d64e213a15e1ade2108ddf813637c228c18f6f7b456725c7e359a08754188ee19c90d06e013be90775ee6a64723b04fa25f0
6
+ metadata.gz: 9c04d9a6434c6e3f322e97e8e2a1c86b3ddda88bd8821368a37b92f5836e4c3df1dc27a79165303420c3e8d5eea31bda1483824da01a40ce30961b645ba65ddd
7
+ data.tar.gz: 01e5c261e9dca0c4df7c696128dbc0520ca40aa6b9393cc8d6c3bdb8386470aeb773566000b811f98c1407038216c8d2c0b444c7955ea5a881ac759796f8a440
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.1.1] - 2021-02-23 - [Janosch Müller](mailto:janosch84@gmail.com)
4
+
5
+ ### Fixed
6
+
7
+ - fixed `NameError` when requiring only `'regexp_parser/scanner'` in v2.1.0
8
+ * thanks to [Jared White and Sam Ruby](https://github.com/ruby2js/ruby2js) for the report
9
+
3
10
  ## [2.1.0] - 2021-02-22 - [Janosch Müller](mailto:janosch84@gmail.com)
4
11
 
5
12
  ### Added
data/lib/regexp_parser.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'regexp_parser/version'
4
- require 'regexp_parser/error'
5
4
  require 'regexp_parser/token'
6
5
  require 'regexp_parser/scanner'
7
6
  require 'regexp_parser/syntax'
@@ -1,5 +1,6 @@
1
- module Regexp::Expression
1
+ require 'regexp_parser/error'
2
2
 
3
+ module Regexp::Expression
3
4
  class Base
4
5
  attr_accessor :type, :token
5
6
  attr_accessor :text, :ts
@@ -1,3 +1,4 @@
1
+ require 'regexp_parser/error'
1
2
  require 'regexp_parser/expression'
2
3
 
3
4
  class Regexp::Parser
@@ -8,6 +8,8 @@
8
8
  # THIS IS A GENERATED FILE, DO NOT EDIT DIRECTLY
9
9
  # This file was generated from lib/regexp_parser/scanner/scanner.rl
10
10
 
11
+ require 'regexp_parser/error'
12
+
11
13
  class Regexp::Scanner
12
14
  # General scanner error (catch all)
13
15
  class ScannerError < Regexp::Parser::Error; end
@@ -91,7 +93,7 @@ class Regexp::Scanner
91
93
  self.char_pos = 0
92
94
 
93
95
 
94
- # line 94 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
96
+ # line 96 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
95
97
  class << self
96
98
  attr_accessor :_re_scanner_trans_keys
97
99
  private :_re_scanner_trans_keys, :_re_scanner_trans_keys=
@@ -1070,9 +1072,9 @@ end
1070
1072
  self.re_scanner_en_main = 119;
1071
1073
 
1072
1074
 
1073
- # line 737 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
1075
+ # line 739 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
1074
1076
 
1075
- # line 1075 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
1077
+ # line 1077 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
1076
1078
  begin
1077
1079
  p ||= 0
1078
1080
  pe ||= data.length
@@ -1083,9 +1085,9 @@ begin
1083
1085
  act = 0
1084
1086
  end
1085
1087
 
1086
- # line 738 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
1088
+ # line 740 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
1087
1089
 
1088
- # line 1088 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
1090
+ # line 1090 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
1089
1091
  begin
1090
1092
  testEof = false
1091
1093
  _slen, _trans, _keys, _inds, _acts, _nacts = nil
@@ -1113,7 +1115,7 @@ begin
1113
1115
  begin
1114
1116
  ts = p
1115
1117
  end
1116
- # line 1116 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
1118
+ # line 1118 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
1117
1119
  end
1118
1120
  _keys = cs << 1
1119
1121
  _inds = _re_scanner_index_offsets[cs]
@@ -2517,7 +2519,7 @@ te = p+1
2517
2519
  # line 477 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
2518
2520
  begin
2519
2521
  act = 40; end
2520
- # line 2520 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
2522
+ # line 2522 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
2521
2523
  end
2522
2524
  end
2523
2525
  end
@@ -2535,7 +2537,7 @@ ts = nil; end
2535
2537
  begin
2536
2538
  act = 0
2537
2539
  end
2538
- # line 2538 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
2540
+ # line 2540 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
2539
2541
  end
2540
2542
 
2541
2543
  if cs == 0
@@ -2569,7 +2571,7 @@ act = 0
2569
2571
  text = copy(data, ts ? ts-1 : 0, -1)
2570
2572
  raise PrematureEndError.new( text )
2571
2573
  end
2572
- # line 2572 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
2574
+ # line 2574 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
2573
2575
  end
2574
2576
  end
2575
2577
 
@@ -2580,7 +2582,7 @@ act = 0
2580
2582
  end
2581
2583
  end
2582
2584
 
2583
- # line 739 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
2585
+ # line 741 "/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
2584
2586
 
2585
2587
  # to avoid "warning: assigned but unused variable - testEof"
2586
2588
  testEof = testEof
@@ -2603,14 +2605,13 @@ end
2603
2605
 
2604
2606
  # lazy-load property maps when first needed
2605
2607
  require 'yaml'
2606
- PROP_MAPS_DIR = File.join(__dir__, 'scanner', 'properties')
2607
2608
 
2608
2609
  def self.short_prop_map
2609
- @short_prop_map ||= YAML.load_file("#{PROP_MAPS_DIR}/short.yml")
2610
+ @short_prop_map ||= YAML.load_file("#{__dir__}/scanner/properties/short.yml")
2610
2611
  end
2611
2612
 
2612
2613
  def self.long_prop_map
2613
- @long_prop_map ||= YAML.load_file("#{PROP_MAPS_DIR}/long.yml")
2614
+ @long_prop_map ||= YAML.load_file("#{__dir__}/scanner/properties/long.yml")
2614
2615
  end
2615
2616
 
2616
2617
  # Emits an array with the details of the scanned pattern
@@ -651,6 +651,8 @@
651
651
  # THIS IS A GENERATED FILE, DO NOT EDIT DIRECTLY
652
652
  # This file was generated from lib/regexp_parser/scanner/scanner.rl
653
653
 
654
+ require 'regexp_parser/error'
655
+
654
656
  class Regexp::Scanner
655
657
  # General scanner error (catch all)
656
658
  class ScannerError < Regexp::Parser::Error; end
@@ -758,14 +760,13 @@ class Regexp::Scanner
758
760
 
759
761
  # lazy-load property maps when first needed
760
762
  require 'yaml'
761
- PROP_MAPS_DIR = File.join(__dir__, 'scanner', 'properties')
762
763
 
763
764
  def self.short_prop_map
764
- @short_prop_map ||= YAML.load_file("#{PROP_MAPS_DIR}/short.yml")
765
+ @short_prop_map ||= YAML.load_file("#{__dir__}/scanner/properties/short.yml")
765
766
  end
766
767
 
767
768
  def self.long_prop_map
768
- @long_prop_map ||= YAML.load_file("#{PROP_MAPS_DIR}/long.yml")
769
+ @long_prop_map ||= YAML.load_file("#{__dir__}/scanner/properties/long.yml")
769
770
  end
770
771
 
771
772
  # Emits an array with the details of the scanned pattern
@@ -1,3 +1,5 @@
1
+ require 'regexp_parser/error'
2
+
1
3
  module Regexp::Syntax
2
4
  class SyntaxError < Regexp::Parser::Error; end
3
5
  end
@@ -3,4 +3,4 @@
3
3
  #
4
4
  # Aliases for the latest patch version are provided as 'ruby/n.n',
5
5
  # e.g. 'ruby/1.9' refers to Ruby v1.9.3.
6
- Dir[File.join(__dir__, 'versions', '*.rb')].sort.each { |f| require f }
6
+ Dir[File.expand_path('../versions/*.rb', __FILE__)].sort.each { |f| require f }
@@ -1,5 +1,5 @@
1
1
  class Regexp
2
2
  class Parser
3
- VERSION = '2.1.0'
3
+ VERSION = '2.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regexp_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ammar Ali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-22 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A library for tokenizing, lexing, and parsing Ruby regular expressions.
14
14
  email: