Sha256: 44c762947c08479b4e893a111b99456aee514b1430441d090f1d072099f5f466

Contents?: true

Size: 1.01 KB

Versions: 6632

Compression:

Stored size: 1.01 KB

Contents

module CodeRay
module Scanners
  
  class Taskpaper < Scanner
    
    register_for :taskpaper
    file_extension 'taskpaper'
    
  protected
    
    def scan_tokens encoder, options
      until eos?
        if match = scan(/\S.*:.*$/)                  # project
          encoder.text_token(match, :namespace)
        elsif match = scan(/-.+@done.*/)             # completed task
          encoder.text_token(match, :done)
        elsif match = scan(/-(?:[^@\n]+|@(?!due))*/) # task
          encoder.text_token(match, :plain)
        elsif match = scan(/@due.*/)                 # comment
          encoder.text_token(match, :important)
        elsif match = scan(/.+/)                     # comment
          encoder.text_token(match, :comment)
        elsif match = scan(/\s+/)                    # space
          encoder.text_token(match, :space)
        else                                         # other
          encoder.text_token getch, :error
        end
      end
      
      encoder
    end
    
  end
  
end
end

Version data entries

6,632 entries across 6,620 versions & 69 rubygems

Version Path
cybrid_api_id_ruby-0.122.67 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_bank_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_organization_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_id_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_id_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_bank_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_organization_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_bank_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_id_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_organization_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_id_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_bank_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_organization_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_organization_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_bank_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_id_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_bank_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_organization_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_id_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
cybrid_api_id_ruby-0.122.57 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb