Sha256: 2c50f88e0e4fb89f2557c3fd2c24172e10a9a77446a6387cfa9aa65d3f2b891d

Contents?: true

Size: 487 Bytes

Versions: 1

Compression:

Stored size: 487 Bytes

Contents

require 'spec_helper'

RSpec.describe('Keep lexing') do
  specify('lex keep token') do
    regexp = /ab\Kcd/
    tokens = RL.lex(regexp)

    expect(tokens[1].type).to eq :keep
    expect(tokens[1].token).to eq :mark
  end

  specify('lex keep nested') do
    regexp = /(a\Kb)|(c\\\Kd)ef/
    tokens = RL.lex(regexp)

    expect(tokens[2].type).to eq :keep
    expect(tokens[2].token).to eq :mark

    expect(tokens[9].type).to eq :keep
    expect(tokens[9].token).to eq :mark
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
regexp_parser-1.5.0 spec/lexer/keep_spec.rb