File: escape.rb

package info (click to toggle)
ruby-regexp-parser 2.11.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,092 kB
  • sloc: ruby: 6,891; makefile: 6; sh: 3
file content (35 lines) | stat: -rw-r--r-- 891 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

module Regexp::Syntax
  module Token
    module Escape
      Basic = %i[backslash literal].freeze

      Control = %i[control meta_sequence].freeze

      ASCII = %i[bell backspace escape form_feed newline carriage
                 tab vertical_tab].freeze

      Unicode = %i[codepoint codepoint_list].freeze

      Meta  = %i[dot alternation
                 zero_or_one zero_or_more one_or_more
                 bol eol
                 group_open group_close
                 interval_open interval_close
                 set_open set_close].freeze

      Hex   = %i[hex utf8_hex].freeze

      Octal = %i[octal].freeze

      All   = Basic + Control + ASCII + Unicode + Meta + Hex + Octal
      Type  = :escape
    end

    Map[Escape::Type] = Escape::All

    # alias for symmetry between Token::* and Expression::*
    EscapeSequence = Escape
  end
end