Skip to content

Commit

Permalink
Merge pull request #92 from tagliala/chore/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
jaynetics committed May 13, 2024
2 parents 2d196c1 + 316bf15 commit 9883215
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/regexp_parser/expression/classes/keep.rb
@@ -1,6 +1,6 @@
module Regexp::Expression
module Keep
# TOOD: in regexp_parser v3.0.0 this should possibly be a Subexpression
# TODO: in regexp_parser v3.0.0 this should possibly be a Subexpression
# that contains all expressions to its left.
class Mark < Regexp::Expression::Base; end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/regexp_parser/parser.rb
Expand Up @@ -575,18 +575,18 @@ def active_opts
options_stack.last
end

# Assigns referenced expressions to refering expressions, e.g. if there is
# Assigns referenced expressions to referring expressions, e.g. if there is
# an instance of Backreference::Number, its #referenced_expression is set to
# the instance of Group::Capture that it refers to via its number.
def assign_referenced_expressions
# find all referencable and refering expressions
# find all referenceable and referring expressions
targets = { 0 => root }
referrers = []
root.each_expression do |exp|
exp.is_a?(Group::Capture) && targets[exp.identifier] = exp
referrers << exp if exp.referential?
end
# assign reference expression to refering expressions
# assign reference expression to referring expressions
# (in a second iteration because there might be forward references)
referrers.each do |exp|
exp.referenced_expression = targets[exp.reference] ||
Expand Down
2 changes: 1 addition & 1 deletion spec/parser/errors_spec.rb
Expand Up @@ -10,7 +10,7 @@
end

RSpec.shared_examples 'UnknownTokenError' do |type|
it "raises for unkown tokens of type #{type}" do
it "raises for unknown tokens of type #{type}" do
expect { parser.send(:parse_token, Regexp::Token.new(type, :foo)) }
.to raise_error(Regexp::Parser::UnknownTokenError)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/parser/escapes_spec.rb
Expand Up @@ -47,7 +47,7 @@
expect { exp.codepoint }.to raise_error(/#codepoints/)
end

# Meta/control espaces
# Meta/control escapes
#
# After the following fix in Ruby 3.1, a Regexp#source containing meta/control
# escapes can only be set with the Regexp::new constructor.
Expand Down
2 changes: 1 addition & 1 deletion spec/scanner/escapes_spec.rb
Expand Up @@ -55,7 +55,7 @@
include_examples 'scan', /a\
b/x, 0 => [:literal, :literal, 'ab', 0, 2]

# Meta/control espaces
# Meta/control escapes
#
# After the following fix in Ruby 3.1, a Regexp#source containing meta/control
# escapes can only be set with the Regexp::new constructor.
Expand Down
2 changes: 1 addition & 1 deletion spec/scanner/refcalls_spec.rb
Expand Up @@ -8,7 +8,7 @@
#
# NOTE: only \g supports forward-looking references using '+', e.g. \g<+1>
# refers to the next group, but \k<+1> refers to a group named '+1'.
# Inversely, only \k supports addition or substraction of a recursion level.
# Inversely, only \k supports addition or subtraction of a recursion level.
# E.g. \k<x+0> refers to a group named 'x' at the current recursion level,
# but \g<x+0> refers to a a group named 'x+0'.
#
Expand Down

0 comments on commit 9883215

Please sign in to comment.