░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/vendor/bundle/ruby/3.1.0/gems/crass-1.0.6/lib/crass
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: token-scanner.rb
# encoding: utf-8 module Crass # Like {Scanner}, but for tokens! class TokenScanner attr_reader :current, :pos, :tokens def initialize(tokens) @tokens = tokens.to_a reset end # Executes the given block, collects all tokens that are consumed during its # execution, and returns them. def collect start = @pos yield @tokens[start...@pos] || [] end # Consumes the next token and returns it, advancing the pointer. Returns # `nil` if there is no next token. def consume @current = @tokens[@pos] @pos += 1 if @current @current end # Returns the next token without consuming it, or `nil` if there is no next # token. def peek @tokens[@pos] end # Reconsumes the current token, moving the pointer back one position. # # http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#reconsume-the-current-input-token def reconsume @pos -= 1 if @pos > 0 end # Resets the pointer to the first token in the list. def reset @current = nil @pos = 0 end end end
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 parser.rb
RB
18.8 KB
2023-09-24 03:46
EDIT
📄 scanner.rb
RB
3.3 KB
2023-09-24 03:46
EDIT
📄 token-scanner.rb
RB
1.1 KB
2023-09-24 03:46
EDIT
📄 tokenizer.rb
RB
16.7 KB
2023-09-24 03:46
EDIT
📄 version.rb
RB
56 B
2023-09-24 03:46
EDIT