ruby_grammar_builder 1.1.3 → 1.1.7

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: 4bc116a2b7fc4ad4c8c2b1dc21649077ef79997acb5a879b085d1a54ce4e0283
4
- data.tar.gz: 490041ab03dc6fe548a05c3be48f83fcbca1eaeb92c7cb5a0074bbbca9e56b49
3
+ metadata.gz: 56dfb466636e1129250201678d584ea52657d7a89a6fd3d6d1a9b345074df2c3
4
+ data.tar.gz: d31f097e6d6cf9db18ad9c1d965d7c4ea4b666ce9ccecb7a560990716b2bfe46
5
5
  SHA512:
6
- metadata.gz: 56fe81abf11819e9ea602b59139ad75294ce90304819424a211b945aeaeb29385e473165ea31e2fb4069c8f70a55da161c71230418de010edb8d23bb5f6a0dca
7
- data.tar.gz: 7301dce1d7e8728aa77c389a652591f71e9ca8fd711010094de7f912574a615b22211150db500030b94641d07e4fbfa411e239295d9f78f505e47dd719abd3d9
6
+ metadata.gz: 3bf2133a31d655e8ab263e1bfc151ba485e029d34f91631d1e590da2930d284e8713a040fe68a10b9b2b6bd00f33e6a6272a4d32a2784ce247ef7af9b02bbf9c
7
+ data.tar.gz: 7f06a5c4e2e9ae5fc7381987ab13630337675a6349302f4001205c2af560b0539121d8e6f1c7e848f67bbbdc73627c67aa3b5697f58cc9e0b3f05861ee65b494
@@ -295,7 +295,7 @@ class Grammar
295
295
  #
296
296
  # @return [Hash] the generated grammar
297
297
  #
298
- def generate(options)
298
+ def generate(options={})
299
299
  default = {
300
300
  inherit_or_embedded: :embedded,
301
301
  should_lint: true,
@@ -2,11 +2,11 @@
2
2
 
3
3
  require 'deep_clone'
4
4
  require 'yaml'
5
- require 'ruby_grammar_builder/grammar_plugin'
6
- require 'ruby_grammar_builder/util'
7
- require 'ruby_grammar_builder/regex_operator'
8
- require 'ruby_grammar_builder/regex_operators/concat'
9
- require 'ruby_grammar_builder/tokens'
5
+ require_relative '../ruby_grammar_builder/grammar_plugin'
6
+ require_relative '../ruby_grammar_builder/util'
7
+ require_relative '../ruby_grammar_builder/regex_operator'
8
+ require_relative '../ruby_grammar_builder/regex_operators/concat'
9
+ require_relative '../ruby_grammar_builder/tokens'
10
10
 
11
11
  # import Pattern, LegacyPattern, and PatternRange
12
12
  Dir[File.join(__dir__, 'pattern_variations', '*.rb')].each { |file| require file }
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby_grammar_builder/util'
3
+ require_relative '../../ruby_grammar_builder/util'
4
4
 
5
5
  #
6
6
  # Internal check, ensures that :includes is nil or a flat array
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby_grammar_builder/util'
3
+ require_relative '../../ruby_grammar_builder/util'
4
4
 
5
5
  #
6
6
  # A pattern that has an includes cannot have any tag_as in @match
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby_grammar_builder/util'
3
+ require_relative '../../ruby_grammar_builder/util'
4
4
 
5
5
  #
6
6
  # Warns when a PatternRange has a start_pattern that matches the empty string
@@ -723,7 +723,11 @@ class PatternBase
723
723
  end
724
724
 
725
725
  # if the reference does exist, then replace it with it's number
726
- "\\k<#{references[match_reference]}>"
726
+ if references[match_reference] < 10
727
+ "\\#{references[match_reference]}"
728
+ else
729
+ "\\k<#{references[match_reference]}>"
730
+ end
727
731
  end
728
732
 
729
733
  # check for a subroutine to the Nth group, replace it with `\N`
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby_grammar_builder/grammar'
4
- require 'ruby_grammar_builder/stdlib/common'
3
+ require_relative 'ruby_grammar_builder/grammar'
4
+ require_relative 'ruby_grammar_builder/stdlib/common'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_grammar_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Hykin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-05-23 00:00:00.000000000 Z
12
+ date: 2022-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: deep_clone