Sha256: 481a675c247b2bc7502f2a5ae4a73e35c49cc4a3933590fc40e95aaf732f6085

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

# encoding: utf-8
# Terminal definitions for the EBNF grammar
module EBNF::Terminals
  SYMBOL  = %r([a-zA-Z0-9_\.]+)u.freeze
  HEX     = %r(\#x[a-fA-F0-9]+)u.freeze
  CHAR    = %r([\u0009\u000A\u000D\u0020-\uD7FF\u{10000}-\u{10FFFF}])u.freeze
  R_CHAR  = %r([\u0009\u000A\u000D\u0020-\u005C\u005E-\uD7FF\u{10000}-\u{10FFFF}])u.freeze
  RANGE   = %r(\[(?:(?:#{R_CHAR})\-(?:#{R_CHAR})|(?:#{HEX})-(?:#{HEX}))\])u.freeze
  ENUM_BASE = %r(\[(?:(?:#{R_CHAR})+|(?:#{HEX})+)\])u.freeze
  ENUM    = %r((?:#{ENUM_BASE})(?!\s+#{SYMBOL}))u.freeze
  LHS     = %r(\[(?:(?:#{SYMBOL})+\]\s+)?(?:#{SYMBOL})\s*::=)u.freeze
  O_RANGE = %r(\[^(?:#{R_CHAR}\-#{R_CHAR})|(?:#{HEX}-#{HEX})\])u.freeze
  O_ENUM  = %r(\[^(?:#{R_CHAR})+\])u.freeze
  STRING1 = %r("[\u0009\u000A\u000D\u0020\u0021\u0023-\uD7FF\u{10000}-\u{10FFFF}]*")u.freeze
  STRING2 = %r('[\u0009\u000A\u000D\u0020-\u0026\u0028-\uD7FF\u{10000}-\u{10FFFF}]*')u.freeze
  POSTFIX = %r([?*+])u.freeze
  PASS    = %r((\s|(?:(#[^x]|//)[^\n\r]*$)|(?:/\*(?:(?:\*[^/])|[^*])*\*/))+)mu.freeze
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ebnf-2.0.0 lib/ebnf/terminals.rb