X7ROOT File Manager
Current Path:
/opt/alt/ruby40/share/ruby/prism
opt
/
alt
/
ruby40
/
share
/
ruby
/
prism
/
??
..
??
compiler.rb
(23.17 KB)
??
desugar_compiler.rb
(9.89 KB)
??
dispatcher.rb
(111.71 KB)
??
dot_visitor.rb
(118.26 KB)
??
dsl.rb
(56.79 KB)
??
ffi.rb
(19.63 KB)
??
inspect_visitor.rb
(124.7 KB)
??
lex_compat.rb
(31.18 KB)
??
lex_ripper.rb
(1.5 KB)
??
mutation_compiler.rb
(21.1 KB)
??
node.rb
(623.78 KB)
??
node_ext.rb
(14.97 KB)
??
pack.rb
(5.88 KB)
??
parse_result
??
parse_result.rb
(29.17 KB)
??
pattern.rb
(8.16 KB)
??
polyfill
??
reflection.rb
(28.86 KB)
??
relocation.rb
(15.12 KB)
??
serialize.rb
(124.83 KB)
??
string_query.rb
(775 B)
??
translation
??
translation.rb
(727 B)
??
visitor.rb
(22.79 KB)
Editing: lex_ripper.rb
# frozen_string_literal: true # :markup: markdown require "ripper" module Prism # This is a class that wraps the Ripper lexer to produce almost exactly the # same tokens. class LexRipper # :nodoc: attr_reader :source def initialize(source) @source = source end def result previous = [] #: [[Integer, Integer], Symbol, String, untyped] | [] results = [] #: Array[[[Integer, Integer], Symbol, String, untyped]] lex(source).each do |token| case token[1] when :on_sp # skip when :on_tstring_content if previous[1] == :on_tstring_content && (token[2].start_with?("\#$") || token[2].start_with?("\#@")) previous[2] << token[2] else results << token previous = token end when :on_words_sep if previous[1] == :on_words_sep previous[2] << token[2] else results << token previous = token end else results << token previous = token end end results end private if Ripper.method(:lex).parameters.assoc(:keyrest) def lex(source) Ripper.lex(source, raise_errors: true) end else def lex(source) ripper = Ripper::Lexer.new(source) ripper.lex.tap do |result| raise SyntaxError, ripper.errors.map(&:message).join(' ;') if ripper.errors.any? end end end end private_constant :LexRipper end
Upload File
Create Folder