Sha256: 8001508a2d3cbe566f60eabd47e8cc02ca4179416fa9188cb584bab052041031
Contents?: true
Size: 358 Bytes
Versions: 30
Compression:
Stored size: 358 Bytes
Contents
module Babelyoda class StringsLexer TOKENS = [ :multiline_comment, :singleline_comment, :string, :reserved0, :equal_sign, :semicolon ].freeze def lex(str) str.scan(/(\/\*.*\*\/)|(\s*\/\/.*\n)|((["])(?:\\?+.)*?\4)|(\s*=\s*)|(;)/).each do |m| idx = m.index { |x| x } yield TOKENS[idx], m[idx].strip end end end end
Version data entries
30 entries across 30 versions & 1 rubygems