rugments-1.0.0.beta8/0000755000076400007640000000000012544707752013427 5ustar pravipravirugments-1.0.0.beta8/LICENSE0000644000076400007640000000503212544707752014434 0ustar pravipraviThe MIT License (MIT) Copyright (c) 2012-2014 Jeanine Adkisson Copyright (c) 2014 Stefan Tatschner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Many of the lexers in this project are adaptations of those in Pygments (pygments.org). The license for Pygments is as follows: Copyright (c) 2006-2014 by the respective authors (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. rugments-1.0.0.beta8/bin/0000755000076400007640000000000012544707752014177 5ustar pravipravirugments-1.0.0.beta8/bin/rugmentize0000755000076400007640000000007212544707752016315 0ustar pravipravi#!/usr/bin/env ruby require "thor" class Cli < Thor end rugments-1.0.0.beta8/README.md0000644000076400007640000001620512544707752014712 0ustar pravipravi# Rugments [![Gem Version](https://badge.fury.io/rb/rugments.svg)](http://badge.fury.io/rb/rugments) Rouge is a pure-ruby syntax highlighter. It can highlight over 60 languages, and output HTML or ANSI 256-color text. Its HTML output is compatible with stylesheets designed for [pygments][]. If you'd like to help out with this project, assign yourself something from the [issues][] page, and send me a pull request (even if it's not done yet!). Bonus points for feature branches. In particular, I would appreciate help with the following lexers, from someone who has more experience with the language than I do: * Delphi/Pascal Also, if anyone with design skills feels like helping me make a website for rouge, I'd really appreciate the help. So far all I've got is the [demo page][pretty colors]. [issues]: https://github.com/jneen/rouge/issues "Help Out" [pygments]: http://pygments.org/ "Pygments" ## Usage First, take a look at the [pretty colors][]. [pretty colors]: http://rouge.jayferd.us/demo ``` ruby # make some nice lexed html source = File.read('/etc/bashrc') formatter = Rouge::Formatters::HTML.new(css_class: 'highlight') lexer = Rouge::Lexers::Shell.new formatter.format(lexer.lex(source)) # Get some CSS Rouge::Themes::Base16.mode(:light).render(scope: '.highlight') # Or use Theme#find with string input Rouge::Theme.find('base16.light').render(scope: '.highlight') ``` ### Full options #### Formatter options ##### css_class: 'highlight' Apply a class to the syntax-highlighted output. Set to false to not apply any css class. ##### line_numbers: false Generate line numbers. ##### start_line: 1 Index to start line numbers. ##### inline_theme: nil A `Rouge::CSSTheme` used to highlight the output with inline styles instead of classes. Allows string inputs (separate mode with a dot): ``` %w[colorful github monokai monokai.sublime thankful_eyes base16 base16.dark base16.light base16.solarized base16.monokai] ``` ##### wrap: true Wrap the highlighted content in a container. Defaults to `
`, or `
` if line numbers are enabled. #### Lexer options ##### debug: false Print a trace of the lex on stdout ##### parent: '' Allows you to specify which language the template is inside #### CSS theme options ##### scope: '.highlight' CSS selector that styles are applied to, e.g. `Rouge::Themes::Monokai.mode(:sublime).render(scope: 'code')` Rouge aims to be simple to extend, and to be a drop-in replacement for pygments, with the same quality of output. Also, Rouge ships with a `rougify` command which allows you to easily highlight files in your terminal: ``` bash $ rougify foo.rb $ rougify style monokai.sublime > syntax.css ``` ### Advantages to pygments.rb * No need to [spawn Python processes](https://github.com/tmm1/pygments.rb). ### Advantages to CodeRay * The HTML output from Rouge is fully compatible with stylesheets designed for pygments. * The lexers are implemented with a dedicated DSL, rather than being hand-coded. * Rouge supports every language CodeRay does except for Pascal/Delphi (pull requests happily accepted!), and more. ## You can even use it with Redcarpet ``` ruby require 'redcarpet' require 'rouge' require 'rouge/plugins/redcarpet' class HTML < Redcarpet::Render::HTML include Rouge::Plugins::Redcarpet # yep, that's it. end ``` If you have `:fenced_code_blocks` enabled, you can specify languages, and even options with CGI syntax, like `php?start_inline=1`, or `erb?parent=javascript`. ## Encodings Rouge is only for UTF-8 strings. If you'd like to highlight a string with a different encoding, please convert it to UTF-8 first. ## Other integrations * Middleman: [middleman-syntax](https://github.com/middleman/middleman-syntax) (@bhollis) * Middleman: [middleman-rouge][] (@Linuus) * RDoc: [rdoc-rouge][] (@zzak) [middleman-rouge]: https://github.com/Linuus/middleman-rouge [rdoc-rouge]: https://github.com/zzak/rdoc-rouge ## Contributing ### Installing Ruby If you're here to implement a lexer for your awesome language, there's a good chance you don't already have a ruby development environment set up. Follow the [instructions on the wiki](https://github.com/jneen/rouge/wiki/Setting-up-Ruby) to get up and running. If you have trouble getting set up, let me know - I'm always happy to help. ### Run the tests You can test the core of Rouge simply by running `rake` (no `bundle exec` required). It's also set up with `guard`, if you like. To test a lexer visually, run `rackup` from the root and go to `localhost:9292/#{some_lexer}` where `some_lexer` is the tag or an alias of a lexer you'd like to test. If you add `?debug=1`, helpful debugging info will be printed on stdout. ### API Documentation is at http://rubydoc.info/gems/rouge/frames. ### Using the lexer DSL You can probably learn a lot just by reading through the existing lexers. Basically, a lexer consists of a collection of states, each of which has several rules. A rule consists of a regular expression and an action, which yields tokens and manipulates the state stack. Each rule in the state on top of the stack is tried *in order* until a match is found, at which point the action is run, the match consumed from the stream, and the process repeated with the new lexer on the top of the stack. Each lexer has a special state called `:root`, and the initial state stack consists of just this state. Here's how you might use it: ``` ruby class MyLexer < Rouge::RegexLexer state :root do # the "easy way" # simple rules rule /0x[0-9a-f]+/, Num::Hex # simple state stack manipulation rule /{-/, Comment, :next_state rule /-}/, Comment, :pop! # the "flexible way" rule /abc/ do |m| # m is the match, for accessing match groups manually # you can do the following things: pop! push :another_state push # assumed to be the current state state? :some_state # check if the current state is :some_state in_state? :some_state # check if :some_state is in the state stack # yield a token. if no second argument is supplied, the value is # taken to be the whole match. # The sum of all the tokens yielded must be equivalent to the whole # match - otherwise characters will go missing from the user's input. token Generic::Output, m[0] # calls SomeOtherLexer.lex(str) and yields its output. See the # HTML lexer for a nice example of this. # if no second argument is supplied, it is assumed to be the whole # match string. delegate SomeOtherLexer, str # the context object is the lexer itself, so you can stash state here @count ||= 0 @count += 1 # advanced: push a dynamically created anonymous state push do rule /.../, Generic::Output end end rule /(\w+)(:)/ # "groups" yields the matched groups in order groups Name::Label, Punctuation end end start do # this is run whenever a fresh lex is started end end ``` ## Tips I don't get paid to maintain rouge. If you've found this software useful, consider dropping a tip in the [bucket](http://www.gittip.com/jneen). ## License Rouge is released under the MIT license. Please see the `LICENSE` file for more information. rugments-1.0.0.beta8/metadata.yml0000644000076400007640000001016712544707752015737 0ustar pravipravi--- !ruby/object:Gem::Specification name: rugments version: !ruby/object:Gem::Version version: 1.0.0.beta8 platform: ruby authors: - Jeanine Adkisson - Stefan Tatschner autorequire: bindir: bin cert_chain: [] date: 2015-06-28 00:00:00.000000000 Z dependencies: [] description: Rugments aims to a be a simple,easy-to-extend drop-in replacement for pygments. email: - jneen@jneen.net - stefan@sevenbyte.org executables: - rugmentize extensions: [] extra_rdoc_files: [] files: - LICENSE - README.md - bin/rugmentize - lib/rugments.rb - lib/rugments/cli.rb - lib/rugments/formatter.rb - lib/rugments/formatters/html.rb - lib/rugments/formatters/null.rb - lib/rugments/formatters/terminal256.rb - lib/rugments/lexer.rb - lib/rugments/lexers/apache.rb - lib/rugments/lexers/apache/keywords.yml - lib/rugments/lexers/apple_script.rb - lib/rugments/lexers/c.rb - lib/rugments/lexers/clojure.rb - lib/rugments/lexers/coffeescript.rb - lib/rugments/lexers/common_lisp.rb - lib/rugments/lexers/conf.rb - lib/rugments/lexers/cpp.rb - lib/rugments/lexers/csharp.rb - lib/rugments/lexers/css.rb - lib/rugments/lexers/dart.rb - lib/rugments/lexers/diff.rb - lib/rugments/lexers/elixir.rb - lib/rugments/lexers/erb.rb - lib/rugments/lexers/erlang.rb - lib/rugments/lexers/factor.rb - lib/rugments/lexers/gherkin.rb - lib/rugments/lexers/gherkin/keywords.rb - lib/rugments/lexers/go.rb - lib/rugments/lexers/groovy.rb - lib/rugments/lexers/haml.rb - lib/rugments/lexers/handlebars.rb - lib/rugments/lexers/haskell.rb - lib/rugments/lexers/html.rb - lib/rugments/lexers/http.rb - lib/rugments/lexers/ini.rb - lib/rugments/lexers/io.rb - lib/rugments/lexers/java.rb - lib/rugments/lexers/javascript.rb - lib/rugments/lexers/literate_coffeescript.rb - lib/rugments/lexers/literate_haskell.rb - lib/rugments/lexers/llvm.rb - lib/rugments/lexers/lua.rb - lib/rugments/lexers/lua/builtins.rb - lib/rugments/lexers/make.rb - lib/rugments/lexers/markdown.rb - lib/rugments/lexers/matlab.rb - lib/rugments/lexers/matlab/builtins.rb - lib/rugments/lexers/moonscript.rb - lib/rugments/lexers/nginx.rb - lib/rugments/lexers/nim.rb - lib/rugments/lexers/objective_c.rb - lib/rugments/lexers/ocaml.rb - lib/rugments/lexers/perl.rb - lib/rugments/lexers/php.rb - lib/rugments/lexers/php/builtins.rb - lib/rugments/lexers/plain_text.rb - lib/rugments/lexers/prolog.rb - lib/rugments/lexers/properties.rb - lib/rugments/lexers/puppet.rb - lib/rugments/lexers/python.rb - lib/rugments/lexers/qml.rb - lib/rugments/lexers/r.rb - lib/rugments/lexers/racket.rb - lib/rugments/lexers/ruby.rb - lib/rugments/lexers/rust.rb - lib/rugments/lexers/sass.rb - lib/rugments/lexers/sass/common.rb - lib/rugments/lexers/scala.rb - lib/rugments/lexers/scheme.rb - lib/rugments/lexers/scss.rb - lib/rugments/lexers/sed.rb - lib/rugments/lexers/shell.rb - lib/rugments/lexers/slim.rb - lib/rugments/lexers/smalltalk.rb - lib/rugments/lexers/sml.rb - lib/rugments/lexers/sql.rb - lib/rugments/lexers/swift.rb - lib/rugments/lexers/tcl.rb - lib/rugments/lexers/tex.rb - lib/rugments/lexers/toml.rb - lib/rugments/lexers/vb.rb - lib/rugments/lexers/viml.rb - lib/rugments/lexers/viml/keywords.rb - lib/rugments/lexers/xml.rb - lib/rugments/lexers/yaml.rb - lib/rugments/plugins/redcarpet.rb - lib/rugments/regex_lexer.rb - lib/rugments/template_lexer.rb - lib/rugments/text_analyzer.rb - lib/rugments/theme.rb - lib/rugments/themes/base16.rb - lib/rugments/themes/colorful.rb - lib/rugments/themes/github.rb - lib/rugments/themes/monokai.rb - lib/rugments/themes/monokai_sublime.rb - lib/rugments/themes/thankful_eyes.rb - lib/rugments/token.rb - lib/rugments/util.rb - lib/rugments/version.rb homepage: https://github.com/rumpelsepp/rugments licenses: - MIT metadata: {} post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">" - !ruby/object:Gem::Version version: 1.3.1 requirements: [] rubyforge_project: rubygems_version: 2.4.5 signing_key: specification_version: 4 summary: A pure-ruby colorizer based on pygments test_files: [] rugments-1.0.0.beta8/lib/0000755000076400007640000000000012544707752014175 5ustar pravipravirugments-1.0.0.beta8/lib/rugments.rb0000644000076400007640000000205212544707752016365 0ustar pravipravirequire_relative 'rugments/version' require_relative 'rugments/util' require_relative 'rugments/text_analyzer' require_relative 'rugments/token' require_relative 'rugments/lexer' require_relative 'rugments/regex_lexer' require_relative 'rugments/template_lexer' require_relative 'rugments/formatter' require_relative 'rugments/theme' module Rugments module_function # Highlight some text with a given lexer and formatter. # # @example # Rouge.highlight('@foo = 1', 'ruby', 'html') # Rouge.highlight('var foo = 1;', 'js', 'terminal256') # # # streaming - chunks become available as they are lexed # Rouge.highlight(large_string, 'ruby', 'html') do |chunk| # $stdout.print chunk # end def highlight(text, lexer, formatter, &b) lexer = Lexer.find(lexer) unless lexer.respond_to?(:lex) fail "unknown lexer #{lexer}" unless lexer formatter = Formatter.find(formatter) unless formatter.respond_to?(:format) fail "unknown formatter #{formatter}" unless formatter formatter.format(lexer.lex(text), &b) end end rugments-1.0.0.beta8/lib/rugments/0000755000076400007640000000000012544707752016041 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/formatter.rb0000644000076400007640000000131412544707752020370 0ustar pravipravimodule Rugments # A Formatter takes a token stream and formats it for human viewing. class Formatter REGISTRY = {} # Specify or get the unique tag for this formatter. This is used # for specifying a formatter in `rougify`. def self.tag(tag = nil) return @tag unless tag REGISTRY[tag] = self @tag = tag end # Find a formatter class given a unique tag. def self.find(tag) REGISTRY[tag] end # Format a token stream. Delegates to {#format}. def self.format(tokens, opts = {}, &b) new(opts).format(tokens, &b) end end end require_relative 'formatters/html' require_relative 'formatters/terminal256' require_relative 'formatters/null' rugments-1.0.0.beta8/lib/rugments/cli.rb0000644000076400007640000002035512544707752017142 0ustar pravipravi# not required by the main lib. # to use this module, require 'rouge/cli'. module Rugments class FileReader attr_reader :input def initialize(input) @input = input end def file case input when '-' $stdin when String File.new(input) when ->(i){ i.respond_to? :read } input end end def read @read ||= begin file.read rescue => e $stderr.puts "unable to open #{input}: #{e.message}" exit 1 ensure file.close end end end class CLI def self.doc return enum_for(:doc) unless block_given? yield %|usage: rougify [command] [args...]| yield %|| yield %|where is one of:| yield %| highlight #{Highlight.desc}| yield %| help #{Help.desc}| yield %| style #{Style.desc}| yield %| list #{List.desc}| yield %| version #{Version.desc}| yield %|| yield %|See `rougify help ` for more info.| end class Error < StandardError attr_reader :message, :status def initialize(message, status=1) @message = message @status = status end end def self.parse(argv=ARGV) argv = normalize_syntax(argv) mode = argv.shift klass = class_from_arg(mode) return klass.parse(argv) if klass case mode when '-h', '--help', 'help', '-help' Help.parse(argv) else argv.unshift(mode) if mode Highlight.parse(argv) end end def initialize(options={}) end def self.error!(msg, status=1) raise Error.new(msg, status) end def error!(*a) self.class.error!(*a) end def self.class_from_arg(arg) case arg when 'version', '--version' Version when 'help' Help when 'highlight', 'hi' Highlight when 'style' Style when 'list' List end end class Version < CLI def self.desc "print the rouge version number" end def self.parse(*); new; end def run puts Rouge.version end end class Help < CLI def self.desc "print help info" end def self.doc return enum_for(:doc) unless block_given? yield %|usage: rougify help | yield %|| yield %|print help info for .| end def self.parse(argv) opts = { :mode => CLI } until argv.empty? arg = argv.shift klass = class_from_arg(arg) if klass opts[:mode] = klass next end end new(opts) end def initialize(opts={}) @mode = opts[:mode] end def run @mode.doc.each(&method(:puts)) end end class Highlight < CLI def self.desc "highlight code" end def self.doc return enum_for(:doc) unless block_given? yield %[usage: rougify highlight [options...]] yield %[ rougify highlight [options...]] yield %[] yield %[--input-file|-i specify a file to read, or - to use stdin] yield %[] yield %[--lexer|-l specify the lexer to use.] yield %[ If not provided, rougify will try to guess] yield %[ based on --mimetype, the filename, and the] yield %[ file contents.] yield %[] yield %[--mimetype|-m specify a mimetype for lexer guessing] yield %[] yield %[--lexer-opts|-L specify lexer options in CGI format] yield %[ (opt1=val1&opt2=val2)] yield %[] yield %[--formatter-opts|-F specify formatter options in CGI format] yield %[ (opt1=val1&opt2=val2)] end def self.parse(argv) opts = { :formatter => 'terminal256', :input_file => '-', :lexer_opts => {}, :formatter_opts => {}, } until argv.empty? arg = argv.shift case arg when '--input-file', '-i' opts[:input_file] = argv.shift when '--mimetype', '-m' opts[:mimetype] = argv.shift when '--lexer', '-l' opts[:lexer] = argv.shift when '--formatter', '-f' opts[:formatter] = argv.shift when '--lexer-opts', '-L' opts[:lexer_opts] = parse_cgi(argv.shift) when '--formatter-opts', '-F' opts[:formatter_opts] = parse_cgi(argv.shift) when /^--/ error! "unknown option #{arg.inspect}" else opts[:input_file] = arg end end new(opts) end def input_stream @input_stream ||= FileReader.new(@input_file) end def input @input ||= input_stream.read end def lexer_class @lexer_class ||= Lexer.guess( :filename => @input_file, :mimetype => @mimetype, :source => input_stream, ) end def lexer @lexer ||= lexer_class.new(@lexer_opts) end attr_reader :input_file, :lexer_name, :mimetype, :formatter def initialize(opts={}) @input_file = opts[:input_file] if opts[:lexer] @lexer_class = Lexer.find(opts[:lexer]) \ or error! "unkown lexer #{opts[:lexer].inspect}" else @lexer_name = opts[:lexer] @mimetype = opts[:mimetype] end @lexer_opts = opts[:lexer_opts] formatter_class = Formatter.find(opts[:formatter]) \ or error! "unknown formatter #{opts[:formatter]}" @formatter = formatter_class.new(opts[:formatter_opts]) end def run formatter.format(lexer.lex(input), &method(:print)) end private def self.parse_cgi(str) pairs = CGI.parse(str).map { |k, v| [k.to_sym, v.first] } Hash[pairs] end end class Style < CLI def self.desc "print CSS styles" end def self.doc return enum_for(:doc) unless block_given? yield %|usage: rougify style [] []| yield %|| yield %|Print CSS styles for the given theme. Extra options are| yield %|passed to the theme. Theme defaults to thankful_eyes.| yield %|| yield %|options:| yield %| --scope (default: .highlight) a css selector to scope by| yield %|| yield %|available themes:| yield %| #{Theme.registry.keys.sort.join(', ')}| end def self.parse(argv) opts = { :theme_name => 'thankful_eyes' } until argv.empty? arg = argv.shift case arg when /--(\w+)/ opts[$1.tr('-', '_').to_sym] = argv.shift else opts[:theme_name] = arg end end new(opts) end def initialize(opts) theme_name = opts.delete(:theme_name) theme_class = Theme.find(theme_name) \ or error! "unknown theme: #{theme_name}" @theme = theme_class.new(opts) end def run @theme.render(&method(:puts)) end end class List < CLI def self.desc "list available lexers" end def self.doc return enum_for(:doc) unless block_given? yield %|usage: rouge list| yield %|| yield %|print a list of all available lexers with their descriptions.| end def self.parse(argv) new end def run puts "== Available Lexers ==" Lexer.all.sort_by(&:tag).each do |lexer| desc = "#{lexer.desc}" if lexer.aliases.any? desc << " [aliases: #{lexer.aliases.join(',')}]" end puts "%s: %s" % [lexer.tag, desc] puts end end end private def self.normalize_syntax(argv) out = [] argv.each do |arg| case arg when /^(--\w+)=(.*)$/ out << $1 << $2 when /^(-\w)(.+)$/ out << $1 << $2 else out << arg end end out end end end rugments-1.0.0.beta8/lib/rugments/theme.rb0000644000076400007640000001037012544707752017471 0ustar pravipravimodule Rugments class Theme include Token::Tokens class Style < Hash def initialize(theme, hsh = {}) super() @theme = theme merge!(hsh) end [:fg, :bg].each do |mode| define_method mode do return self[mode] unless @theme @theme.palette(self[mode]) if self[mode] end end def render(selector, &b) return enum_for(:render, selector).to_a.join("\n") unless b return if empty? yield "#{selector} {" rendered_rules.each do |rule| yield " #{rule};" end yield '}' end def rendered_rules(&b) return enum_for(:rendered_rules) unless b yield "color: #{fg}" if fg yield "background-color: #{bg}" if bg yield 'font-weight: bold' if self[:bold] yield 'font-style: italic' if self[:italic] yield 'text-decoration: underline' if self[:underline] (self[:rules] || []).each(&b) end end def styles @styles ||= self.class.styles.dup end @palette = {} def self.palette(arg = {}) @palette ||= InheritableHash.new(superclass.palette) if arg.is_a? Hash @palette.merge! arg @palette else case arg when /#[0-9a-f]+/i arg else @palette[arg] || fail("not in palette: #{arg.inspect}") end end end @styles = {} def self.styles @styles ||= InheritableHash.new(superclass.styles) end def self.render(opts = {}, &b) new(opts).render(&b) end class << self def style(*tokens) style = tokens.last.is_a?(Hash) ? tokens.pop : {} style = Style.new(self, style) tokens.each do |tok| styles[tok] = style end end def get_own_style(token) token.token_chain.each do |anc| return styles[anc] if styles[anc] end nil end def get_style(token) get_own_style(token) || base_style end def base_style styles[Token::Tokens::Text] end def name(n = nil) return @name if n.nil? @name = n.to_s Theme.registry[@name] = self end def find(n) registry[n.to_s] end def registry @registry ||= {} end end end module HasModes def mode(arg = :absent) return @mode if arg == :absent @modes ||= {} @modes[arg] ||= get_mode(arg) end def get_mode(mode) return self if self.mode == mode new_name = "#{name}.#{mode}" Class.new(self) { name(new_name); mode!(mode) } end def mode!(arg) @mode = arg send("make_#{arg}!") end end class CSSTheme < Theme def initialize(opts = {}) @scope = opts[:scope] || '.highlight' end def render(&b) return enum_for(:render).to_a.join("\n") unless b # shared styles for tableized line numbers yield "#{@scope} table td { padding: 5px; }" yield "#{@scope} table pre { margin: 0; }" styles.each do |tok, style| style.render(css_selector(tok), &b) end end def render_base(selector, &b) self.class.base_style.render(selector, &b) end def style_for(tok) self.class.get_style(tok) end private def css_selector(token) inflate_token(token).map do |tok| fail "unknown token: #{tok.inspect}" if tok.shortname.nil? single_css_selector(tok) end.join(', ') end def single_css_selector(token) return @scope if token == Text "#{@scope} .#{token.shortname}" end # yield all of the tokens that should be styled the same # as the given token. Essentially this recursively all of # the subtokens, except those which are more specifically # styled. def inflate_token(tok, &b) return enum_for(:inflate_token, tok) unless block_given? yield tok tok.sub_tokens.each do |(_, st)| next if styles[st] inflate_token(st, &b) end end end end require_relative 'themes/thankful_eyes' require_relative 'themes/colorful' require_relative 'themes/base16' require_relative 'themes/github' require_relative 'themes/monokai' require_relative 'themes/monokai_sublime' rugments-1.0.0.beta8/lib/rugments/token.rb0000644000076400007640000001027712544707752017515 0ustar pravipravimodule Rugments class Token class << self attr_reader :name attr_reader :parent attr_reader :shortname def cache @cache ||= {} end def sub_tokens @sub_tokens ||= {} end def [](qualname) return qualname unless qualname.is_a?(::String) Token.cache[qualname] end def inspect "" end def matches?(other) other.token_chain.include? self end def token_chain @token_chain ||= ancestors.take_while { |x| x != Token }.reverse end def qualname @qualname ||= token_chain.map(&:name).join('.') end def register! Token.cache[qualname] = self parent.sub_tokens[name] = self end def make_token(name, shortname, &b) parent = self Class.new(parent) do @parent = parent @name = name @shortname = shortname register! class_eval(&b) if b end end def token(name, shortname, &b) tok = make_token(name, shortname, &b) const_set(name, tok) end def each_token(&b) Token.cache.each do |(_, t)| b.call(t) end end end module Tokens def self.token(name, shortname, &b) tok = Token.make_token(name, shortname, &b) const_set(name, tok) end # IMPORTANT: # For compatibility, this list must be kept in sync with # pygments.token.STANDARD_TYPES # please see https://github.com/jayferd/rouge/wiki/List-of-tokens token :Text, '' do token :Whitespace, 'w' end token :Error, 'err' token :Other, 'x' token :Keyword, 'k' do token :Constant, 'kc' token :Declaration, 'kd' token :Namespace, 'kn' token :Pseudo, 'kp' token :Reserved, 'kr' token :Type, 'kt' token :Variable, 'kv' end token :Name, 'n' do token :Attribute, 'na' token :Builtin, 'nb' do token :Pseudo, 'bp' end token :Class, 'nc' token :Constant, 'no' token :Decorator, 'nd' token :Entity, 'ni' token :Exception, 'ne' token :Function, 'nf' token :Property, 'py' token :Label, 'nl' token :Namespace, 'nn' token :Other, 'nx' token :Tag, 'nt' token :Variable, 'nv' do token :Class, 'vc' token :Global, 'vg' token :Instance, 'vi' end end token :Literal, 'l' do token :Date, 'ld' token :String, 's' do token :Backtick, 'sb' token :Char, 'sc' token :Doc, 'sd' token :Double, 's2' token :Escape, 'se' token :Heredoc, 'sh' token :Interpol, 'si' token :Other, 'sx' token :Regex, 'sr' token :Single, 's1' token :Symbol, 'ss' end token :Number, 'm' do token :Float, 'mf' token :Hex, 'mh' token :Integer, 'mi' do token :Long, 'il' end token :Oct, 'mo' token :Bin, 'mb' token :Other, 'mx' end end token :Operator, 'o' do token :Word, 'ow' end token :Punctuation, 'p' do token :Indicator, 'pi' end token :Comment, 'c' do token :Doc, 'cd' token :Multiline, 'cm' token :Preproc, 'cp' token :Single, 'c1' token :Special, 'cs' end token :Generic, 'g' do token :Deleted, 'gd' token :Emph, 'ge' token :Error, 'gr' token :Heading, 'gh' token :Inserted, 'gi' token :Output, 'go' token :Prompt, 'gp' token :Strong, 'gs' token :Subheading, 'gu' token :Traceback, 'gt' token :Lineno, 'gl' end # convenience Num = Literal::Number Str = Literal::String end end end rugments-1.0.0.beta8/lib/rugments/lexers/0000755000076400007640000000000012544707752017343 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/lexers/puppet.rb0000644000076400007640000000621412544707752021210 0ustar pravipravimodule Rugments module Lexers class Puppet < RegexLexer title 'Puppet' desc 'The Puppet configuration management language (puppetlabs.org)' tag 'puppet' aliases 'pp' filenames '*.pp' def self.analyze_text(text) return 1 if text.shebang? 'puppet-apply' return 1 if text.shebang? 'puppet' end def self.keywords @keywords ||= Set.new %w( and case class default define else elsif if in import inherits node unless ) end def self.constants @constants ||= Set.new %w( false true undef ) end def self.metaparameters @metaparameters ||= Set.new %w( before require notify subscribe ) end id = /[a-z]\w*/ cap_id = /[A-Z]\w*/ qualname = /(::)?(#{id}::)*\w+/ state :whitespace do rule /\s+/m, Text rule /#.*?\n/, Comment end state :root do mixin :whitespace rule /[$]#{qualname}/, Name::Variable rule /(#{id})(?=\s*[=+]>)/m do |m| if self.class.metaparameters.include? m[0] token Keyword::Pseudo else token Name::Property end end rule /(#{qualname})(?=\s*[(])/m, Name::Function rule cap_id, Name::Class rule /[+=|~-]>|<[|~-]/, Punctuation rule /[:}();\[\]]/, Punctuation # HACK for case statements and selectors rule /{/, Punctuation, :regex_allowed rule /,/, Punctuation, :regex_allowed rule /(in|and|or)\b/, Operator::Word rule /[=!<>]=/, Operator rule /[=!]~/, Operator, :regex_allowed rule %r{[<>!+*/-]}, Operator rule /(class|include)(\s*)(#{qualname})/ do groups Keyword, Text, Name::Class end rule /node\b/, Keyword, :regex_allowed rule /'(\\[\\']|[^'])*'/m, Str::Single rule /"/, Str::Double, :dquotes rule /\d+([.]\d+)?(e[+-]\d+)?/, Num # a valid regex. TODO: regexes are only allowed # in certain places in puppet. rule qualname do |m| if self.class.keywords.include? m[0] token Keyword elsif self.class.constants.include? m[0] token Keyword::Constant else token Name end end end state :regex_allowed do mixin :whitespace rule %r{/}, Str::Regex, :regex rule(//) { pop! } end state :regex do rule %r{/}, Str::Regex, :pop! rule /\\./, Str::Escape rule /[(){}]/, Str::Interpol rule /\[/, Str::Interpol, :regex_class rule /./, Str::Regex end state :regex_class do rule /\]/, Str::Interpol, :pop! rule /(?\/\*(?:(?>[^\/\*\*\/]+)|\g)*\*\/)}m, Comment::Multiline end state :whitespace do rule /\n+/m, Text, :bol rule %r{\/\/.*?\n}, Comment::Single, :bol mixin :inline_whitespace end state :root do mixin :whitespace rule /\$(([1-9]\d*)?\d)/, Name::Variable rule %r{[()\[\]{}:;,?]}, Punctuation rule %r{[-/=+*%<>!&|^.~]+}, Operator rule /@?"/, Str, :dq rule /'(\\.|.)'/, Str::Char rule /(\d+\*|\d*\.\d+)(e[+-]?[0-9]+)?/i, Num::Float rule /\d+e[+-]?[0-9]+/i, Num::Float rule /0_?[0-7]+(?:_[0-7]+)*/, Num::Oct rule /0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*/, Num::Hex rule /0b[01]+(?:_[01]+)*/, Num::Bin rule %r{[\d]+(?:_\d+)*}, Num::Integer rule /@availability[(][^)]+[)]/, Keyword::Declaration rule /(@objc[(])([^)]+)([)])/ do groups Keyword::Declaration, Name::Class, Keyword::Declaration end rule /@(#{id})/ do |m| if attributes.include? m[1] token Keyword else token Error end end rule /(private|internal)(\([ ]*)(\w+)([ ]*\))/ do |m| if m[3] == 'set' token Keyword::Declaration else groups Keyword::Declaration, Keyword::Declaration, Error, Keyword::Declaration end end rule /(unowned\([ ]*)(\w+)([ ]*\))/ do |m| if m[2] == 'safe' || m[2] == 'unsafe' token Keyword::Declaration else groups Keyword::Declaration, Error, Keyword::Declaration end end rule /(let|var)\b(\s*)(#{id})/ do groups Keyword, Text, Name::Variable end rule /(?!\b(if|while|for|private|internal|unowned|switch|case)\b)\b#{id}(?=(\?|!)?\s*[(])/ do |m| if m[0] =~ /^[[:upper:]]/ token Keyword::Type else token Name::Function end end rule /(#?(?!default)(?![[:upper:]])#{id})(\s*)(:)/ do groups Name::Variable, Text, Punctuation end rule id do |m| if keywords.include? m[0] token Keyword elsif declarations.include? m[0] token Keyword::Declaration elsif constants.include? m[0] token Keyword::Constant elsif m[0] =~ /^[[:upper:]]/ token Keyword::Type else token Name end end end state :dq do rule /\\[\\0tnr'"]/, Str::Escape rule /\\[(]/, Str::Escape, :interp rule /\\u\{\h{1,8}\}/, Str::Escape rule /[^\\"]+/, Str rule /"/, Str, :pop! end state :interp do rule /[(]/, Punctuation, :interp_inner rule /[)]/, Str::Escape, :pop! mixin :root end state :interp_inner do rule /[(]/, Punctuation, :push rule /[)]/, Punctuation, :pop! mixin :root end end end end rugments-1.0.0.beta8/lib/rugments/lexers/nim.rb0000644000076400007640000001103212544707752020450 0ustar pravipravimodule Rugments module Lexers class Nim < RegexLexer # This is pretty much a 1-1 port of the pygments NimrodLexer class title 'Nim' desc 'The Nim programming language (http://nim-lang.org/)' tag 'nim' aliases 'nimrod' filenames '*.nim' KEYWORDS = %w( addr as asm atomic bind block break case cast const continue converter defer discard distinct do elif else end enum except export func finally for from generic if import include interface iterator let macro method mixin nil object of out proc ptr raise ref return static template try tuple type using var when while with without yield ) OPWORDS = %w( and or not xor shl shr div mod in notin is isnot ) PSEUDOKEYWORDS = %w( nil true false ) TYPES = %w( int int8 int16 int32 int64 float float32 float64 bool char range array seq set string ) NAMESPACE = %w( from import include ) def self.underscorize(words) words.map do |w| w.gsub(/./) { |x| "#{Regexp.escape(x)}_?" } end.join('|') end state :chars do rule(/\\([\\abcefnrtvl"\']|x[a-fA-F0-9]{2}|[0-9]{1,3})/, Str::Escape) rule(/'/, Str::Char, :pop!) rule(/./, Str::Char) end state :strings do rule(/(?|<|\+|-|\/|@|\$|~|&|%|\!|\?|\||\\|\[|\]/, Operator) rule(/\.\.|\.|,|\[\.|\.\]|{\.|\.}|\(\.|\.\)|{|}|\(|\)|:|\^|`|;/, Punctuation) # Strings rule(/(?:[\w]+)"/, Str, :rdqs) rule(/"""/, Str, :tdqs) rule(/"/, Str, :dqs) # Char rule(/'/, Str::Char, :chars) # Keywords rule(%r{(#{Nim.underscorize(OPWORDS)})\b}, Operator::Word) rule(/(p_?r_?o_?c_?\s)(?![\(\[\]])/, Keyword, :funcname) rule(%r{(#{Nim.underscorize(KEYWORDS)})\b}, Keyword) rule(%r{(#{Nim.underscorize(NAMESPACE)})\b}, Keyword::Namespace) rule(/(v_?a_?r)\b/, Keyword::Declaration) rule(%r{(#{Nim.underscorize(TYPES)})\b}, Keyword::Type) rule(%r{(#{Nim.underscorize(PSEUDOKEYWORDS)})\b}, Keyword::Pseudo) # Identifiers rule(/\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*/, Name) # Numbers # Note: Have to do this with a block to push multiple states first, # since we can't pass array of states like w/ Pygments. rule(/[0-9][0-9_]*(?=([eE.]|'?[fF](32|64)))/) do |_number| push :floatsuffix push :floatnumber token Num::Float end rule(/0[xX][a-fA-F0-9][a-fA-F0-9_]*/, Num::Hex, :intsuffix) rule(/0[bB][01][01_]*/, Num, :intsuffix) rule(/0o[0-7][0-7_]*/, Num::Oct, :intsuffix) rule(/[0-9][0-9_]*/, Num::Integer, :intsuffix) # Whitespace rule(/\s+/, Text) rule(/.+$/, Error) end end end end rugments-1.0.0.beta8/lib/rugments/lexers/smalltalk.rb0000644000076400007640000000600412544707752021654 0ustar pravipravimodule Rugments module Lexers class Smalltalk < RegexLexer title 'Smalltalk' desc 'The Smalltalk programming language' tag 'smalltalk' aliases 'st', 'squeak' filenames '*.st' mimetypes 'text/x-smalltalk' ops = %r{[-+*/\\~<>=|&!?,@%]} state :root do rule /(<)(\w+:)(.*?)(>)/ do groups Punctuation, Keyword, Text, Punctuation end # mixin :squeak_fileout mixin :whitespaces mixin :method_definition rule /([|])([\w\s]*)([|])/ do groups Punctuation, Name::Variable, Punctuation end mixin :objects rule /\^|:=|_/, Operator rule /[)}\]]/, Punctuation, :after_object rule /[({\[!]/, Punctuation end state :method_definition do rule /([a-z]\w*:)(\s*)(\w+)/i do groups Name::Function, Text, Name::Variable end rule /^(\s*)(\b[a-z]\w*\b)(\s*)$/i do groups Text, Name::Function, Text end rule %r{^(\s*)(#{ops}+)(\s*)(\w+)(\s*)$} do groups Text, Name::Function, Text, Name::Variable, Text end end state :block_variables do mixin :whitespaces rule /(:)(\s*)(\w+)/ do groups Operator, Text, Name::Variable end rule /[|]/, Punctuation, :pop! rule(//) { pop! } end state :literals do rule /'(''|.)*?'/m, Str, :after_object rule /[$]./, Str::Char, :after_object rule /#[(]/, Str::Symbol, :parenth rule /(\d+r)?-?\d+(\.\d+)?(e-?\d+)?/, Num, :after_object rule /#("[^"]*"|#{ops}+|[\w:]+)/, Str::Symbol, :after_object end state :parenth do rule /[)]/ do token Str::Symbol goto :after_object end mixin :inner_parenth end state :inner_parenth do rule /#[(]/, Str::Symbol, :inner_parenth rule /[)]/, Str::Symbol, :pop! mixin :whitespaces mixin :literals rule /(#{ops}|[\w:])+/, Str::Symbol end state :whitespaces do rule /! !$/, Keyword # squeak chunk delimiter rule /\s+/m, Text rule /".*?"/m, Comment end state :objects do rule /\[/, Punctuation, :block_variables rule /(self|super|true|false|nil|thisContext)\b/, Name::Builtin::Pseudo, :after_object rule /[A-Z]\w*(?!:)\b/, Name::Class, :after_object rule /[a-z]\w*(?!:)\b/, Name::Variable, :after_object mixin :literals end state :after_object do mixin :whitespaces rule /(ifTrue|ifFalse|whileTrue|whileFalse|timesRepeat):/, Name::Builtin, :pop! rule /new(?!:)\b/, Name::Builtin rule /:=|_/, Operator, :pop! rule /[a-z]+\w*:/i, Name::Function, :pop! rule /[a-z]+\w*/i, Name::Function rule /#{ops}+/, Name::Function, :pop! rule /[.]/, Punctuation, :pop! rule /;/, Punctuation rule(//) { pop! } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/matlab.rb0000644000076400007640000000342512544707752021134 0ustar pravipravimodule Rugments module Lexers class Matlab < RegexLexer title 'MATLAB' desc 'Matlab' tag 'matlab' aliases 'm' filenames '*.m' mimetypes 'text/x-matlab', 'application/x-matlab' def self.analyze_text(text) return 0.4 if text.match(/^\s*% /) # % comments are a dead giveaway end def self.keywords @keywords = Set.new %w( break case catch classdef continue else elseif end for function global if otherwise parfor persistent return spmd switch try while ) end def self.builtins load Pathname.new(__FILE__).dirname.join('matlab/builtins.rb') builtins end state :root do rule /\s+/m, Text # Whitespace rule %r([{]%.*?%[}])m, Comment::Multiline rule /%.*$/, Comment::Single rule /([.][.][.])(.*?)$/ do groups(Keyword, Comment) end rule /^(!)(.*?)(?=%|$)/ do |m| token Keyword, m[1] delegate Shell, m[2] end rule /[a-zA-Z][_a-zA-Z0-9]*/m do |m| match = m[0] if self.class.keywords.include? match token Keyword elsif self.class.builtins.include? match token Name::Builtin else token Name end end rule %r{[(){};:,\/\\\]\[]}, Punctuation rule /~=|==|<<|>>|[-~+\/*%=<>&^|.]/, Operator rule /(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?/i, Num::Float rule /\d+e[+-]?[0-9]+/i, Num::Float rule /\d+L/, Num::Integer::Long rule /\d+/, Num::Integer rule /'/, Str::Single, :string end state :string do rule /[^']+/, Str::Single rule /''/, Str::Escape rule /'/, Str::Single, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/io.rb0000644000076400007640000000316312544707752020302 0ustar pravipravimodule Rugments module Lexers class IO < RegexLexer tag 'io' title 'Io' desc 'The IO programming language (http://iolanguage.com)' mimetypes 'text/x-iosrc' filenames '*.io' def self.analyze_text(text) return 1 if text.shebang? 'io' end def self.constants @constants ||= Set.new %w(nil false true) end def self.builtins @builtins ||= Set.new %w( args call clone do doFile doString else elseif for if list method return super then ) end state :root do rule /\s+/m, Text rule %r{//.*?\n}, Comment::Single rule %r{#.*?\n}, Comment::Single rule %r{/(\\\n)?[*].*?[*](\\\n)?/}m, Comment::Multiline rule %r{/[+]}, Comment::Multiline, :nested_comment rule /"(\\\\|\\"|[^"])*"/, Str rule %r{:?:=}, Keyword rule /[()]/, Punctuation rule %r([-=;,*+> / < <= = == > >= accessor agent agent-errors aget alength all-ns alter and append-child apply array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc await await-for bean binding bit-and bit-not bit-or bit-shift-left bit-shift-right bit-xor boolean branch? butlast byte cast char children class clear-agent-errors comment commute comp comparator complement concat conj cons constantly construct-proxy contains? count create-ns create-struct cycle dec deref difference disj dissoc distinct doall doc dorun doseq dosync dotimes doto double down drop drop-while edit end? ensure eval every? false? ffirst file-seq filter find find-doc find-ns find-var first float flush fnseq frest gensym get-proxy-class get hash-map hash-set identical? identity if-let import in-ns inc index insert-child insert-left insert-right inspect-table inspect-tree instance? int interleave intersection into into-array iterate join key keys keyword keyword? last lazy-cat lazy-cons left lefts line-seq list* list load load-file locking long loop macroexpand macroexpand-1 make-array make-node map map-invert map? mapcat max max-key memfn merge merge-with meta min min-key name namespace neg? new newline next nil? node not not-any? not-every? not= ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unmap nth nthrest or parse partial path peek pop pos? pr pr-str print print-str println println-str prn prn-str project proxy proxy-mappings quot rand rand-int range re-find re-groups re-matcher re-matches re-pattern re-seq read read-line reduce ref ref-set refer rem remove remove-method remove-ns rename rename-keys repeat replace replicate resolve rest resultset-seq reverse rfirst right rights root rrest rseq second select select-keys send send-off seq seq-zip seq? set short slurp some sort sort-by sorted-map sorted-map-by sorted-set special-symbol? split-at split-with str string? struct struct-map subs subvec symbol symbol? sync take take-nth take-while test time to-array to-array-2d tree-seq true? union up update-proxy val vals var-get var-set var? vector vector-zip vector? when when-first when-let when-not with-local-vars with-meta with-open with-out-str xml-seq xml-zip zero? zipmap zipper' ) end identifier = %r{[\w!$%*+,<=>?/.-]+} keyword = %r{[\w!\#$%*+,<=>?/.-]+} def name_token(name) return Keyword if self.class.keywords.include?(name) return Name::Builtin if self.class.builtins.include?(name) nil end state :root do rule /;.*?\n/, Comment::Single rule /\s+/m, Text::Whitespace rule /-?\d+\.\d+/, Num::Float rule /-?\d+/, Num::Integer rule /0x-?[0-9a-fA-F]+/, Num::Hex rule /"(\\.|[^"])*"/, Str rule /'#{keyword}/, Str::Symbol rule /::?#{keyword}/, Name::Constant rule /\\(.|[a-z]+)/i, Str::Char rule /~@|[`\'#^~&]/, Operator rule /(\()(\s*)(#{identifier})/m do |m| token Punctuation, m[1] token Text::Whitespace, m[2] token(name_token(m[3]) || Name::Function, m[3]) end rule identifier do |m| token name_token(m[0]) || Name end # vectors rule /[\[\]]/, Punctuation # maps rule /[{}]/, Punctuation # parentheses rule /[()]/, Punctuation end end end end rugments-1.0.0.beta8/lib/rugments/lexers/markdown.rb0000644000076400007640000000717512544707752021524 0ustar pravipravimodule Rugments module Lexers class Markdown < RegexLexer title 'Markdown' desc 'Markdown, a light-weight markup language for authors' tag 'markdown' aliases 'md', 'mkd' filenames '*.markdown', '*.md', '*.mkd' mimetypes 'text/x-markdown' def html @html ||= HTML.new(options) end start { html.reset! } edot = /\\.|[^\\\n]/ state :root do # YAML frontmatter rule(/\A(---\s*\n.*?\n?)^(---\s*$\n?)/m) { delegate YAML } rule /\\./, Str::Escape rule /^[\S ]+\n(?:---*)\n/, Generic::Heading rule /^[\S ]+\n(?:===*)\n/, Generic::Subheading rule /^#(?=[^#]).*?$/, Generic::Heading rule /^##*.*?$/, Generic::Subheading # TODO: syntax highlight the code block, github style rule /(\n[ \t]*)(```|~~~)(.*?)(\n.*?)(\2)/m do |m| sublexer = Lexer.find_fancy(m[3].strip, m[4]) sublexer ||= PlainText.new(token: Str::Backtick) token Text, m[1] token Punctuation, m[2] token Name::Label, m[3] delegate sublexer, m[4] token Punctuation, m[5] end rule /\n\n(( |\t).*?\n|\n)+/, Str::Backtick rule /(`+)#{edot}*\1/, Str::Backtick # various uses of * are in order of precedence # line breaks rule /^(\s*[*]){3,}\s*$/, Punctuation rule /^(\s*[-]){3,}\s*$/, Punctuation # bulleted lists rule /^\s*[*+-](?=\s)/, Punctuation # numbered lists rule /^\s*\d+\./, Punctuation # blockquotes rule /^\s*>.*?$/, Generic::Traceback # link references # [foo]: bar "baz" rule %r{^ (\s*) # leading whitespace (\[) (#{edot}+?) (\]) # the reference (\s*) (:) # colon }x do groups Text, Punctuation, Str::Symbol, Punctuation, Text, Punctuation push :title push :url end # links and images rule /(!?\[)(#{edot}+?)(\])/ do groups Punctuation, Name::Variable, Punctuation push :link end rule /[*][*]#{edot}*?[*][*]/, Generic::Strong rule /__#{edot}*?__/, Generic::Strong rule /[*]#{edot}*?[*]/, Generic::Emph rule /_#{edot}*?_/, Generic::Emph # Automatic links rule /<.*?@.+[.].+>/, Name::Variable rule %r{<(https?|mailto|ftp)://#{edot}*?>}, Name::Variable rule /[^\\`\[*\n&<]+/, Text # inline html rule(/&\S*;/) { delegate html } rule(/<#{edot}*?>/) { delegate html } rule /[&<]/, Text rule /\n/, Text end state :link do rule /(\[)(#{edot}*?)(\])/ do groups Punctuation, Str::Symbol, Punctuation pop! end rule /[(]/ do token Punctuation push :inline_title push :inline_url end rule /[ \t]+/, Text rule(//) { pop! } end state :url do rule /[ \t]+/, Text # the url rule /(<)(#{edot}*?)(>)/ do groups Name::Tag, Str::Other, Name::Tag pop! end rule /\S+/, Str::Other, :pop! end state :title do rule /"#{edot}*?"/, Name::Namespace rule /'#{edot}*?'/, Name::Namespace rule /[(]#{edot}*?[)]/, Name::Namespace rule /\s*(?=["'()])/, Text rule(//) { pop! } end state :inline_title do rule /[)]/, Punctuation, :pop! mixin :title end state :inline_url do rule /[^<\s)]+/, Str::Other, :pop! rule /\s+/m, Text mixin :url end end end end rugments-1.0.0.beta8/lib/rugments/lexers/haskell.rb0000644000076400007640000001165212544707752021320 0ustar pravipravimodule Rugments module Lexers class Haskell < RegexLexer title 'Haskell' desc 'The Haskell programming language (haskell.org)' tag 'haskell' aliases 'hs' filenames '*.hs' mimetypes 'text/x-haskell' def self.analyze_text(text) return 1 if text.shebang?('runhaskell') end reserved = %w( _ case class data default deriving do else if in infix[lr]? instance let newtype of then type where ) ascii = %w( NUL SOH [SE]TX EOT ENQ ACK BEL BS HT LF VT FF CR S[OI] DLE DC[1-4] NAK SYN ETB CAN EM SUB ESC [FGRU]S SP DEL ) state :basic do rule /\s+/m, Text rule /{-#/, Comment::Preproc, :comment_preproc rule /{-/, Comment::Multiline, :comment rule /^--\s+\|.*?$/, Comment::Doc # this is complicated in order to support custom symbols # like --> rule /--(?![!#\$\%&*+.\/<=>?@\^\|_~]).*?$/, Comment::Single end # nested commenting state :comment do rule /-}/, Comment::Multiline, :pop! rule /{-/, Comment::Multiline, :comment rule /[^-{}]+/, Comment::Multiline rule /[-{}]/, Comment::Multiline end state :comment_preproc do rule /-}/, Comment::Preproc, :pop! rule /{-/, Comment::Preproc, :comment rule /[^-{}]+/, Comment::Preproc rule /[-{}]/, Comment::Preproc end state :root do mixin :basic rule /\bimport\b/, Keyword::Reserved, :import rule /\bmodule\b/, Keyword::Reserved, :module rule /\berror\b/, Name::Exception rule /\b(?:#{reserved.join('|')})\b/, Keyword::Reserved # not sure why, but ^ doesn't work here # rule /^[_a-z][\w']*/, Name::Function rule /[_a-z][\w']*/, Name rule /[A-Z][\w']*/, Keyword::Type # lambda operator rule %r{\\(?![:!#\$\%&*+.\\/<=>?@^\|~-]+)}, Name::Function # special operators rule %r{(<-|::|->|=>|=)(?![:!#\$\%&*+.\\/<=>?@^\|~-]+)}, Operator # constructor/type operators rule %r{:[:!#\$\%&*+.\\/<=>?@^\|~-]*}, Operator # other operators rule %r{[:!#\$\%&*+.\\/<=>?@^\|~-]+}, Operator rule /\d+e[+-]?\d+/i, Num::Float rule /\d+\.\d+(e[+-]?\d+)?/i, Num::Float rule /0o[0-7]+/i, Num::Oct rule /0x[\da-f]+/i, Num::Hex rule /\d+/, Num::Integer rule /'/, Str::Char, :character rule /"/, Str, :string rule /\[\s*\]/, Keyword::Type rule /\(\s*\)/, Name::Builtin rule /[\[\](),;`{}]/, Punctuation end state :import do rule /\s+/, Text rule /"/, Str, :string rule /\bqualified\b/, Keyword # import X as Y rule /([A-Z][\w.]*)(\s+)(as)(\s+)([A-Z][a-zA-Z0-9_.]*)/ do groups( Name::Namespace, # X Text, Keyword, # as Text, Name # Y ) pop! end # import X hiding (functions) rule /([A-Z][\w.]*)(\s+)(hiding)(\s+)(\()/ do groups( Name::Namespace, # X Text, Keyword, # hiding Text, Punctuation # ( ) goto :funclist end # import X (functions) rule /([A-Z][\w.]*)(\s+)(\()/ do groups( Name::Namespace, # X Text, Punctuation # ( ) goto :funclist end rule /[\w.]+/, Name::Namespace, :pop! end state :module do rule /\s+/, Text # module Foo (functions) rule /([A-Z][\w.]*)(\s+)(\()/ do groups Name::Namespace, Text, Punctuation push :funclist end rule /\bwhere\b/, Keyword::Reserved, :pop! rule /[A-Z][a-zA-Z0-9_.]*/, Name::Namespace, :pop! end state :funclist do mixin :basic rule /[A-Z]\w*/, Keyword::Type rule /(_[\w\']+|[a-z][\w\']*)/, Name::Function rule /,/, Punctuation rule /[:!#\$\%&*+.\\\/<=>?@^\|~-]+/, Operator rule /\(/, Punctuation, :funclist rule /\)/, Punctuation, :pop! end state :character do rule /\\/ do token Str::Escape push :character_end push :escape end rule /./ do token Str::Char goto :character_end end end state :character_end do rule /'/, Str::Char, :pop! rule /./, Error, :pop! end state :string do rule /"/, Str, :pop! rule /\\/, Str::Escape, :escape rule /[^\\"]+/, Str end state :escape do rule /[abfnrtv"'&\\]/, Str::Escape, :pop! rule /\^[\]\[A-Z@\^_]/, Str::Escape, :pop! rule /#{ascii.join('|')}/, Str::Escape, :pop! rule /o[0-7]+/i, Str::Escape, :pop! rule /x[\da-f]/i, Str::Escape, :pop! rule /\d+/, Str::Escape, :pop! rule /\s+\\/, Str::Escape, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/cpp.rb0000644000076400007640000000346412544707752020461 0ustar pravipravimodule Rugments module Lexers load_const :C, 'c.rb' class Cpp < C title 'C++' desc 'The C++ programming language' tag 'cpp' aliases 'c++' # the many varied filenames of c++ source files... filenames '*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx' mimetypes 'text/x-c++hdr', 'text/x-c++src' def self.keywords @keywords ||= super + Set.new(%w( asm catch const_cast delete dynamic_cast explicit export friend mutable namespace new operator private protected public reinterpret_cast restrict static_cast template this throw throws typeid typename using virtual )) end def self.reserved @reserved ||= super + Set.new(%w( __virtual_inheritance __uuidof __super __single_inheritance __multiple_inheritance __interface __event )) end id = /[a-zA-Z_][a-zA-Z0-9]*/ prepend :root do # Offload C++ extensions, http://offload.codeplay.com/ rule /(?:__offload|__blockingoffload|__outer)\b/, Keyword::Pseudo end # digits with optional inner quotes # see www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf dq = /\d('?\d)*/ prepend :statements do rule /class\b/, Keyword, :classname rule %r{(#{dq}[.]#{dq}?|[.]#{dq})(e[+-]?#{dq}[lu]*)?}i, Num::Float rule %r{#{dq}e[+-]?#{dq}[lu]*}i, Num::Float rule /0x\h('?\h)*[lu]*/i, Num::Hex rule /0[0-7]('?[0-7])*[lu]*/i, Num::Oct rule /#{dq}[lu]*/i, Num::Integer end state :classname do rule id, Name::Class, :pop! # template specification rule /\s*(?=>)/m, Text, :pop! mixin :whitespace end end end end rugments-1.0.0.beta8/lib/rugments/lexers/erlang.rb0000644000076400007640000001026712544707752021146 0ustar pravipravimodule Rugments module Lexers class Erlang < RegexLexer title 'Erlang' desc 'The Erlang programming language (erlang.org)' tag 'erlang' aliases 'erl' filenames '*.erl', '*.hrl' mimetypes 'text/x-erlang', 'application/x-erlang' def self.analyze_text(text) return 0.3 if text =~ /^-module[(]\w+[)][.]/ end keywords = %w( after begin case catch cond end fun if let of query receive try when ) builtins = %w( abs append_element apply atom_to_list binary_to_list bitstring_to_list binary_to_term bit_size bump_reductions byte_size cancel_timer check_process_code delete_module demonitor disconnect_node display element erase exit float float_to_list fun_info fun_to_list function_exported garbage_collect get get_keys group_leader hash hd integer_to_list iolist_to_binary iolist_size is_atom is_binary is_bitstring is_boolean is_builtin is_float is_function is_integer is_list is_number is_pid is_port is_process_alive is_record is_reference is_tuple length link list_to_atom list_to_binary list_to_bitstring list_to_existing_atom list_to_float list_to_integer list_to_pid list_to_tuple load_module localtime_to_universaltime make_tuple md5 md5_final md5_update memory module_loaded monitor monitor_node node nodes open_port phash phash2 pid_to_list port_close port_command port_connect port_control port_call port_info port_to_list process_display process_flag process_info purge_module put read_timer ref_to_list register resume_process round send send_after send_nosuspend set_cookie setelement size spawn spawn_link spawn_monitor spawn_opt split_binary start_timer statistics suspend_process system_flag system_info system_monitor system_profile term_to_binary tl trace trace_delivered trace_info trace_pattern trunc tuple_size tuple_to_list universaltime_to_localtime unlink unregister whereis ) operators = %r{(\+\+?|--?|\*|/|<|>|/=|=:=|=/=|=<|>=|==?|<-|!|\?)} word_operators = %w( and andalso band bnot bor bsl bsr bxor div not or orelse rem xor ) atom_re = %r{(?:[a-z][a-zA-Z0-9_]*|'[^\n']*[^\\]')} variable_re = %r{(?:[A-Z_][a-zA-Z0-9_]*)} escape_re = %r{(?:\\(?:[bdefnrstv\'"\\/]|[0-7][0-7]?[0-7]?|\^[a-zA-Z]))} macro_re = %r{(?:#{variable_re}|#{atom_re})} base_re = %r{(?:[2-9]|[12][0-9]|3[0-6])} state :root do rule(/\s+/, Text) rule(/%.*\n/, Comment) rule(%r{(#{keywords.join('|')})\b}, Keyword) rule(%r{(#{builtins.join('|')})\b}, Name::Builtin) rule(%r{(#{word_operators.join('|')})\b}, Operator::Word) rule(/^-/, Punctuation, :directive) rule(operators, Operator) rule(/"/, Str, :string) rule(/<>/, Name::Label) rule %r{(#{atom_re})(:)} do groups Name::Namespace, Punctuation end rule %r{(?:^|(?<=:))(#{atom_re})(\s*)(\()} do groups Name::Function, Text, Punctuation end rule(%r{[+-]?#{base_re}#[0-9a-zA-Z]+}, Num::Integer) rule(/[+-]?\d+/, Num::Integer) rule(/[+-]?\d+.\d+/, Num::Float) rule(%r{[\]\[:_@\".{}()|;,]}, Punctuation) rule(variable_re, Name::Variable) rule(atom_re, Name) rule(%r{\?#{macro_re}}, Name::Constant) rule(%r{\$(?:#{escape_re}|\\[ %]|[^\\])}, Str::Char) rule(%r{##{atom_re}(:?\.#{atom_re})?}, Name::Label) end state :string do rule(escape_re, Str::Escape) rule(/"/, Str, :pop!) rule(%r{~[0-9.*]*[~#+bBcdefginpPswWxX]}, Str::Interpol) rule(%r{[^"\\~]+}, Str) rule(/~/, Str) end state :directive do rule %r{(define)(\s*)(\()(#{macro_re})} do groups Name::Entity, Text, Punctuation, Name::Constant pop! end rule %r{(record)(\s*)(\()(#{macro_re})} do groups Name::Entity, Text, Punctuation, Name::Label pop! end rule(atom_re, Name::Entity, :pop!) end end end end rugments-1.0.0.beta8/lib/rugments/lexers/sml.rb0000644000076400007640000002010412544707752020460 0ustar pravipravimodule Rugments module Lexers class SML < RegexLexer title 'SML' desc 'Standard ML' tag 'sml' aliases 'ml' filenames '*.sml', '*.sig', '*.fun' mimetypes 'text/x-standardml', 'application/x-standardml' def self.keywords @keywords ||= Set.new %w( abstype and andalso as case datatype do else end exception fn fun handle if in infix infixr let local nonfix of op open orelse raise rec then type val with withtype while eqtype functor include sharing sig signature struct structure where ) end def self.symbolic_reserved @symbolic_reserved ||= Set.new %w(: | = => -> # :>) end id = /[\w']+/i symbol = %r{[!%&$#/:<=>?@\\~`^|*+-]+} def self.analyze_text(_text) 0 end state :whitespace do rule /\s+/m, Text rule /[(][*]/, Comment, :comment end state :delimiters do rule /[(\[{]/, Punctuation, :main rule /[)\]}]/, Punctuation, :pop! rule /\b(let|if|local)\b(?!')/, Keyword::Reserved do push; push end rule /\b(struct|sig|while)\b(?!')/ do token Keyword::Reserved push end rule /\b(do|else|end|in|then)\b(?!')/, Keyword::Reserved, :pop! end def token_for_id_with_dot(id) if self.class.keywords.include? id Error else Name::Namespace end end def token_for_final_id(id) if self.class.keywords.include?(id) || self.class.symbolic_reserved.include?(id) Error else Name end end def token_for_id(id) if self.class.keywords.include? id Keyword::Reserved elsif self.class.symbolic_reserved.include? id Punctuation else Name end end state :core do rule /[()\[\]{},;_]|[.][.][.]/, Punctuation rule /#"/, Str::Char, :char rule /"/, Str::Double, :string rule /~?0x[0-9a-fA-F]+/, Num::Hex rule /0wx[0-9a-fA-F]+/, Num::Hex rule /0w\d+/, Num::Integer rule /~?\d+([.]\d+)?[eE]~?\d+/, Num::Float rule /~?\d+[.]\d+/, Num::Float rule /~?\d+/, Num::Integer rule /#\s*[1-9][0-9]*/, Name::Label rule /#\s*#{id}/, Name::Label rule /#\s+#{symbol}/, Name::Label rule /\b(datatype|abstype)\b(?!')/, Keyword::Reserved, :dname rule(/(?=\bexception\b(?!'))/) { push :ename } rule /\b(functor|include|open|signature|structure)\b(?!')/, Keyword::Reserved, :sname rule /\b(type|eqtype)\b(?!')/, Keyword::Reserved, :tname rule /'#{id}/, Name::Decorator rule /(#{id})([.])/ do |m| groups(token_for_id_with_dot(m[1]), Punctuation) push :dotted end rule id do |m| token token_for_id(m[0]) end rule symbol do |m| token token_for_id(m[0]) end end state :dotted do rule /(#{id})([.])/ do |m| groups(token_for_id_with_dot(m[1]), Punctuation) end rule id do |m| token token_for_id(m[0]) pop! end rule symbol do |m| token token_for_id(m[0]) pop! end end state :root do rule /#!.*?\n/, Comment::Preproc rule(//) { push :main } end state :main do mixin :whitespace rule /\b(val|and)\b(?!')/, Keyword::Reserved, :vname rule /\b(fun)\b(?!')/ do token Keyword::Reserved goto :main_fun push :fname end mixin :delimiters mixin :core end state :main_fun do mixin :whitespace rule /\b(fun|and)\b(?!')/, Keyword::Reserved, :fname rule /\bval\b(?!')/ do token Keyword::Reserved goto :main push :vname end rule /[|]/, Punctuation, :fname rule /\b(case|handle)\b(?!')/ do token Keyword::Reserved goto :main end mixin :delimiters mixin :core end state :has_escapes do rule /\\[\\"abtnvfr]/, Str::Escape rule /\\\^[\x40-\x5e]/, Str::Escape rule /\\[0-9]{3}/, Str::Escape rule /\\u\h{4}/, Str::Escape rule /\\\s+\\/, Str::Interpol end state :string do rule /[^"\\]+/, Str::Double rule /"/, Str::Double, :pop! mixin :has_escapes end state :char do rule /[^"\\]+/, Str::Char rule /"/, Str::Char, :pop! mixin :has_escapes end state :breakout do rule /(?=\w+\b(#{SML.keywords.to_a.join('|')})\b(?!'))/ do pop! end end state :sname do mixin :whitespace mixin :breakout rule id, Name::Namespace rule(//) { pop! } end state :has_annotations do rule /'[\w']*/, Name::Decorator rule /[(]/, Punctuation, :tyvarseq end state :fname do mixin :whitespace mixin :has_annotations rule id, Name::Function, :pop! rule symbol, Name::Function, :pop! end state :vname do mixin :whitespace mixin :has_annotations rule /(#{id})(\s*)(=(?!#{symbol}))/m do groups Name::Variable, Text, Punctuation pop! end rule /(#{symbol})(\s*)(=(?!#{symbol}))/m do groups Name::Variable, Text, Punctuation end rule id, Name::Variable, :pop! rule symbol, Name::Variable, :pop! rule(//) { pop! } end state :tname do mixin :whitespace mixin :breakout mixin :has_annotations rule /'[\w']*/, Name::Decorator rule /[(]/, Punctuation, :tyvarseq rule %r{=(?!#{symbol})} do token Punctuation goto :typbind end rule id, Keyword::Type rule symbol, Keyword::Type end state :typbind do mixin :whitespace rule /\b(and)\b(?!')/ do token Keyword::Reserved goto :tname end mixin :breakout mixin :core end state :dname do mixin :whitespace mixin :breakout mixin :has_annotations rule /(=)(\s*)(datatype)\b/ do groups Punctuation, Text, Keyword::Reserved pop! end rule %r{=(?!#{symbol})} do token Punctuation goto :datbind push :datcon end rule id, Keyword::Type rule symbol, Keyword::Type end state :datbind do mixin :whitespace rule /\b(and)\b(?!')/ do token Keyword::Reserved; goto :dname end rule /\b(withtype)\b(?!')/ do token Keyword::Reserved; goto :tname end rule /\bof\b(?!')/, Keyword::Reserved rule /([|])(\s*)(#{id})/ do groups(Punctuation, Text, Name::Class) end rule /([|])(\s+)(#{symbol})/ do groups(Punctuation, Text, Name::Class) end mixin :breakout mixin :core end state :ename do mixin :whitespace rule /(exception|and)(\s+)(#{id})/ do groups Keyword::Reserved, Text, Name::Class end rule /(exception|and)(\s*)(#{symbol})/ do groups Keyword::Reserved, Text, Name::Class end rule /\b(of)\b(?!')/, Keyword::Reserved mixin :breakout mixin :core end state :datcon do mixin :whitespace rule id, Name::Class, :pop! rule symbol, Name::Class, :pop! end state :tyvarseq do mixin :whitespace rule /'[\w']*/, Name::Decorator rule id, Name rule /,/, Punctuation rule /[)]/, Punctuation, :pop! rule symbol, Name end state :comment do rule /[^(*)]+/, Comment::Multiline rule /[(][*]/ do token Comment::Multiline; push end rule /[*][)]/, Comment::Multiline, :pop! rule /[(*)]/, Comment::Multiline end end end end rugments-1.0.0.beta8/lib/rugments/lexers/ocaml.rb0000644000076400007640000000614312544707752020767 0ustar pravipravimodule Rugments module Lexers class OCaml < RegexLexer title 'OCaml' desc 'Objective CAML (ocaml.org)' tag 'ocaml' filenames '*.ml', '*.mli', '*.mll', '*.mly' mimetypes 'text/x-ocaml' def self.keywords @keywords ||= Set.new %w( as assert begin class constraint do done downto else end exception external false for fun function functor if in include inherit initializer lazy let match method module mutable new object of open private raise rec sig struct then to true try type value val virtual when while with ) end def self.keyopts @keyopts ||= Set.new %w( != # & && ( ) * \+ , - -. -> . .. : :: := :> ; ;; < <- = > >] >} ? ?? [ [< [> [| ] _ ` { {< | |] } ~ ) end def self.word_operators @word_operators ||= Set.new %w(and asr land lor lsl lxor mod or) end def self.primitives @primitives ||= Set.new %w(unit int float bool string char list array) end operator = %r([\[\];,{}_()!$%&*+./:<=>?@^|~#-]+) id = /[a-z][\w']*/i upper_id = /[A-Z][\w']*/ state :root do rule /\s+/m, Text rule /false|true|[(][)]|\[\]/, Name::Builtin::Pseudo rule /#{upper_id}(?=\s*[.])/, Name::Namespace, :dotted rule upper_id, Name::Class rule /[(][*](?![)])/, Comment, :comment rule id do |m| match = m[0] if self.class.keywords.include? match token Keyword elsif self.class.word_operators.include? match token Operator::Word elsif self.class.primitives.include? match token Keyword::Type else token Name end end rule operator do |m| match = m[0] if self.class.keyopts.include? match token Punctuation else token Operator end end rule /-?\d[\d_]*(.[\d_]*)?(e[+-]?\d[\d_]*)/i, Num::Float rule /0x\h[\h_]*/i, Num::Hex rule /0o[0-7][0-7_]*/i, Num::Oct rule /0b[01][01_]*/i, Num::Bin rule /\d[\d_]*/, Num::Integer rule /'(?:(\\[\\"'ntbr ])|(\\[0-9]{3})|(\\x\h{2}))'/, Str::Char rule /'[.]'/, Str::Char rule /'/, Keyword rule /"/, Str::Double, :string rule /[~?]#{id}/, Name::Variable end state :comment do rule /[^(*)]+/, Comment rule(/[(][*]/) { token Comment; push } rule /[*][)]/, Comment, :pop! rule /[(*)]/, Comment end state :string do rule /[^\\"]+/, Str::Double mixin :escape_sequence rule /\\\n/, Str::Double rule /"/, Str::Double, :pop! end state :escape_sequence do rule /\\[\\"'ntbr]/, Str::Escape rule /\\\d{3}/, Str::Escape rule /\\x\h{2}/, Str::Escape end state :dotted do rule /\s+/m, Text rule /[.]/, Punctuation rule /#{upper_id}(?=\s*[.])/, Name::Namespace rule upper_id, Name::Class, :pop! rule id, Name, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/php.rb0000644000076400007640000001205312544707752020460 0ustar pravipravimodule Rugments module Lexers class PHP < TemplateLexer title 'PHP' desc 'The PHP scripting language (php.net)' tag 'php' aliases 'php', 'php3', 'php4', 'php5' filenames '*.php', '*.php[345]', # Support Drupal file extensions, see #5. '*.module', '*.inc', '*.profile', '*.install', '*.test' mimetypes 'text/x-php' default_options parent: 'html' def initialize(opts = {}) # if truthy, the lexer starts highlighting with php code # (no /, Comment::Preproc, :pop! # heredocs rule /<<<('?)([a-z_]\w*)\1\n.*?\n\2;?\n/im, Str::Heredoc rule /\s+/, Text rule /#.*?\n/, Comment::Single rule %r{//.*?\n}, Comment::Single # empty comment, otherwise seen as the start of a docstring rule %r{/\*\*/}, Comment::Multiline rule %r{/\*\*.*?\*/}m, Str::Doc rule %r{/\*.*?\*/}m, Comment::Multiline rule /(->|::)(\s*)([a-zA-Z_][a-zA-Z0-9_]*)/ do groups Operator, Text, Name::Attribute end rule /[~!%^&*+=\|:.<>\/?@-]+/, Operator rule /[\[\]{}();,]+/, Punctuation rule /class\b/, Keyword, :classname # anonymous functions rule /(function)(\s*)(?=\()/ do groups Keyword, Text end # named functions rule /(function)(\s+)(&?)(\s*)/ do groups Keyword, Text, Operator, Text push :funcname end rule /(const)(\s+)([a-zA-Z_]\w*)/i do groups Keyword, Text, Name::Constant end rule /(true|false|null)\b/, Keyword::Constant rule /\$\{\$+[a-z_]\w*\}/i, Name::Variable rule /\$+[a-z_]\w*/i, Name::Variable # may be intercepted for builtin highlighting rule /[\\a-z_][\\\w]*/i do |m| name = m[0] if self.class.keywords.include? name token Keyword elsif builtins.include? name token Name::Builtin else token Name::Other end end rule /(\d+\.\d*|\d*\.\d+)(e[+-]?\d+)?/i, Num::Float rule /\d+e[+-]?\d+/i, Num::Float rule /0[0-7]+/, Num::Oct rule /0x[a-f0-9]+/i, Num::Hex rule /\d+/, Num::Integer rule /'([^'\\]*(?:\\.[^'\\]*)*)'/, Str::Single rule /`([^`\\]*(?:\\.[^`\\]*)*)`/, Str::Backtick rule /"/, Str::Double, :string end state :classname do rule /\s+/, Text rule /[a-z_][\\\w]*/i, Name::Class, :pop! end state :funcname do rule /[a-z_]\w*/i, Name::Function, :pop! end state :string do rule /"/, Str::Double, :pop! rule /[^\\{$"]+/, Str::Double rule /\\([nrt\"$\\]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})/, Str::Escape rule /\$[a-zA-Z_][a-zA-Z0-9_]*(\[\S+\]|->[a-zA-Z_][a-zA-Z0-9_]*)?/, Name::Variable rule /\{\$\{/, Str::Interpol, :interp_double rule /\{(?=\$)/, Str::Interpol, :interp_single rule /(\{)(\S+)(\})/ do groups Str::Interpol, Name::Variable, Str::Interpol end rule /[${\\]+/, Str::Double end state :interp_double do rule /\}\}/, Str::Interpol, :pop! mixin :php end state :interp_single do rule /\}/, Str::Interpol, :pop! mixin :php end end end end rugments-1.0.0.beta8/lib/rugments/lexers/yaml.rb0000644000076400007640000002234712544707752020642 0ustar pravipravimodule Rugments module Lexers class YAML < RegexLexer title 'YAML' desc "Yaml Ain't Markup Language (yaml.org)" mimetypes 'text/x-yaml' tag 'yaml' aliases 'yml' def self.analyze_text(text) # look for the %YAML directive return 1 if text =~ /\A\s*%YAML/m end filenames '*.yaml', '*.yml' # NB: Tabs are forbidden in YAML, which is why you see things # like /[ ]+/. # reset the indentation levels def reset_indent puts ' yaml: reset_indent' if @debug @indent_stack = [0] @next_indent = 0 @block_scalar_indent = nil end def indent fail 'empty indent stack!' if @indent_stack.empty? @indent_stack.last end def dedent?(level) level < indent end def indent?(level) level > indent end # Save a possible indentation level def save_indent(match) @next_indent = match.size puts " yaml: indent: #{indent}/#{@next_indent}" if @debug puts " yaml: popping indent stack - before: #{@indent_stack}" if @debug if dedent?(@next_indent) @indent_stack.pop while dedent?(@next_indent) puts " yaml: popping indent stack - after: #{@indent_stack}" if @debug puts " yaml: indent: #{indent}/#{@next_indent}" if @debug # dedenting to a state not previously indented to is an error [match[0...indent], match[indent..-1]] else [match, ''] end end def continue_indent(match) puts ' yaml: continue_indent' if @debug @next_indent += match.size end def set_indent(match, opts = {}) if indent < @next_indent @indent_stack << @next_indent end @next_indent += match.size unless opts[:implicit] end plain_scalar_start = /[^ \t\n\r\f\v?:,\[\]{}#&*!\|>'"%@`]/ start { reset_indent } state :basic do rule /#.*$/, Comment::Single end state :root do mixin :basic rule /\n+/, Text # trailing or pre-comment whitespace rule /[ ]+(?=#|$)/, Text rule /^%YAML\b/ do token Name::Tag reset_indent push :yaml_directive end rule /^%TAG\b/ do token Name::Tag reset_indent push :tag_directive end # doc-start and doc-end indicators rule /^(?:---|\.\.\.)(?= |$)/ do token Name::Namespace reset_indent push :block_line end # indentation spaces rule /[ ]*(?!\s|$)/ do |m| text, err = save_indent(m[0]) token Text, text token Error, err push :block_line; push :indentation end end state :indentation do rule(/\s*?\n/) { token Text; pop! 2 } # whitespace preceding block collection indicators rule /[ ]+(?=[-:?](?:[ ]|$))/ do |m| token Text continue_indent(m[0]) end # block collection indicators rule(/[?:-](?=[ ]|$)/) { |m| token Punctuation::Indicator; set_indent m[0] } # the beginning of a block line rule(/[ ]*/) { |m| token Text; continue_indent(m[0]); pop! } end # indented line in the block context state :block_line do # line end rule /[ ]*(?=#|$)/, Text, :pop! rule /[ ]+/, Text # tags, anchors, and aliases mixin :descriptors # block collections and scalars mixin :block_nodes # flow collections and quoed scalars mixin :flow_nodes # a plain scalar rule /(?=#{plain_scalar_start}|[?:-][^ \t\n\r\f\v])/ do token Name::Variable push :plain_scalar_in_block_context end end state :descriptors do # a full-form tag rule /!<[0-9A-Za-z;\/?:@&=+$,_.!~*'()\[\]%-]+>/, Keyword::Type # a tag in the form '!', '!suffix' or '!handle!suffix' rule %r{ (?:![\w-]+)? # handle !(?:[\w;/?:@&=+$,.!~*\'()\[\]%-]*) # suffix }x, Keyword::Type # an anchor rule /&[\w-]+/, Name::Label # an alias rule /\*[\w-]+/, Name::Variable end state :block_nodes do # implicit key rule /:(?=\s|$)/ do |m| token Punctuation::Indicator set_indent m[0], implicit: true end # literal and folded scalars rule /[\|>]/ do token Punctuation::Indicator push :block_scalar_content push :block_scalar_header end end state :flow_nodes do rule /\[/, Punctuation::Indicator, :flow_sequence rule /\{/, Punctuation::Indicator, :flow_mapping rule /'/, Str::Single, :single_quoted_scalar rule /"/, Str::Double, :double_quoted_scalar end state :flow_collection do rule /\s+/m, Text mixin :basic rule /[?:,]/, Punctuation::Indicator mixin :descriptors mixin :flow_nodes rule /(?=#{plain_scalar_start})/ do push :plain_scalar_in_flow_context end end state :flow_sequence do rule /\]/, Punctuation::Indicator, :pop! mixin :flow_collection end state :flow_mapping do rule /\}/, Punctuation::Indicator, :pop! mixin :flow_collection end state :block_scalar_content do rule /\n+/, Text # empty lines never dedent, but they might be part of the scalar. rule /^[ ]+$/ do |m| text = m[0] indent_size = text.size indent_mark = @block_scalar_indent || indent_size token Text, text[0...indent_mark] token Name::Constant, text[indent_mark..-1] end # TODO: ^ doesn't actually seem to affect the match at all. # Find a way to work around this limitation. rule /^[ ]*/ do |m| token Text indent_size = m[0].size dedent_level = @block_scalar_indent || indent @block_scalar_indent ||= indent_size if indent_size < dedent_level pop! 2 end end rule /[^\n\r\f\v]+/, Name::Constant end state :block_scalar_header do # optional indentation indicator and chomping flag, in either order rule %r{ ( ([1-9])[+-]? | [+-]?([1-9])? )(?=[ ]|$) }x do |m| @block_scalar_indent = nil goto :ignored_line next if m[0].empty? increment = m[1] || m[2] if increment @block_scalar_indent = indent + increment.to_i end token Punctuation::Indicator end end state :ignored_line do mixin :basic rule /[ ]+/, Text rule /\n/, Text, :pop! end state :quoted_scalar_whitespaces do # leading and trailing whitespace is ignored rule /^[ ]+/, Text rule /[ ]+$/, Text rule /\n+/m, Text rule /[ ]+/, Name::Variable end state :single_quoted_scalar do mixin :quoted_scalar_whitespaces rule /\\'/, Str::Escape rule /'/, Str, :pop! rule /[^\s']+/, Str end state :double_quoted_scalar do rule /"/, Str, :pop! mixin :quoted_scalar_whitespaces # escapes rule /\\[0abt\tn\nvfre "\\N_LP]/, Str::Escape rule /\\(?:x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, Str::Escape rule /[^ \t\n\r\f\v"\\]+/, Str end state :plain_scalar_in_block_context_new_line do rule /^[ ]+\n/, Text rule /\n+/m, Text rule /^(?=---|\.\.\.)/ do pop! 3 end # dedent detection rule /^[ ]*/ do |m| token Text pop! indent_size = m[0].size # dedent = end of scalar if indent_size <= indent pop! save_indent(m[0]) push :indentation end end end state :plain_scalar_in_block_context do # the : indicator ends a scalar rule /[ ]*(?=:[ \n]|:$)/, Text, :pop! rule /[ ]*:/, Str rule /[ ]+(?=#)/, Text, :pop! rule /[ ]+$/, Text # check for new documents or dedents at the new line rule /\n+/ do token Text push :plain_scalar_in_block_context_new_line end rule /[ ]+/, Str # regular non-whitespace characters rule /[^\s:]+/, Str end state :plain_scalar_in_flow_context do rule /[ ]*(?=[,:?\[\]{}])/, Text, :pop! rule /[ ]+(?=#)/, Text, :pop! rule /^[ ]+/, Text rule /[ ]+$/, Text rule /\n+/, Text rule /[ ]+/, Name::Variable rule /[^\s,:?\[\]{}]+/, Name::Variable end state :yaml_directive do rule /([ ]+)(\d+\.\d+)/ do groups Text, Num goto :ignored_line end end state :tag_directive do rule %r{ ([ ]+)(!|![\w-]*!) # prefix ([ ]+)(!|!?[\w;/?:@&=+$,.!~*'()\[\]%-]+) # tag handle }x do groups Text, Keyword::Type, Text, Keyword::Type goto :ignored_line end end end end end rugments-1.0.0.beta8/lib/rugments/lexers/vb.rb0000644000076400007640000001140712544707752020302 0ustar pravipravimodule Rugments module Lexers class VisualBasic < RegexLexer title 'Visual Basic' desc 'Visual Basic' tag 'vb' aliases 'visualbasic' filenames '*.vbs' mimetypes 'text/x-visualbasic', 'application/x-visualbasic' def self.keywords @keywords ||= Set.new %w( AddHandler Alias ByRef ByVal CBool CByte CChar CDate CDbl CDec CInt CLng CObj CSByte CShort CSng CStr CType CUInt CULng CUShort Call Case Catch Class Const Continue Declare Default Delegate Dim DirectCast Do Each Else ElseIf End EndIf Enum Erase Error Event Exit False Finally For Friend Function Get Global GoSub GoTo Handles If Implements Imports Inherits Interface Let Lib Loop Me Module MustInherit MustOverride MyBase MyClass Namespace Narrowing New Next Not NotInheritable NotOverridable Nothing Of On Operator Option Optional Overloads Overridable Overrides ParamArray Partial Private Property Protected Public RaiseEvent ReDim ReadOnly RemoveHandler Resume Return Select Set Shadows Shared Single Static Step Stop Structure Sub SyncLock Then Throw To True Try TryCast Using Wend When While Widening With WithEvents WriteOnly ) end def self.keywords_type @keywords_type ||= Set.new %w( Boolean Byte Char Date Decimal Double Integer Long Object SByte Short Single String Variant UInteger ULong UShort ) end def self.operator_words @operator_words ||= Set.new %w( AddressOf And AndAlso As GetType In Is IsNot Like Mod Or OrElse TypeOf Xor ) end def self.builtins @builtins ||= Set.new %w( Console ConsoleColor ) end id = /[a-z_]\w*/i upper_id = /[A-Z]\w*/ state :whitespace do rule /\s+/, Text rule /\n/, Text, :bol rule /rem\b.*?$/i, Comment::Single rule %r(%\{.*?%\})m, Comment::Multiline rule /'.*$/, Comment::Single end state :bol do rule /\s+/, Text rule /<.*?>/, Name::Attribute rule(//) { :pop! } end state :root do mixin :whitespace rule %r{ [#]If\b .*? \bThen | [#]ElseIf\b .*? \bThen | [#]End \s+ If | [#]Const | [#]ExternalSource .*? \n | [#]End \s+ ExternalSource | [#]Region .*? \n | [#]End \s+ Region | [#]ExternalChecksum }x, Comment::Preproc rule /[.]/, Punctuation, :dotted rule /[(){}!#,:]/, Punctuation rule /Option\s+(Strict|Explicit|Compare)\s+(On|Off|Binary|Text)/, Keyword::Declaration rule /End\b/, Keyword, :end rule /(Dim|Const)\b/, Keyword, :dim rule /(Function|Sub|Property)\b/, Keyword, :funcname rule /(Class|Structure|Enum)\b/, Keyword, :classname rule /(Module|Namespace|Imports)\b/, Keyword, :namespace rule upper_id do |m| match = m[0] if self.class.keywords.include? match token Keyword elsif self.class.keywords_type.include? match token Keyword::Type elsif self.class.operator_words.include? match token Operator::Word elsif self.class.builtins.include? match token Name::Builtin else token Name end end rule( %r{&=|[*]=|/=|\\=|\^=|\+=|-=|<<=|>>=|<<|>>|:=|<=|>=|<>|[-&*/\\^+=<>.]}, Operator ) rule /"/, Str, :string rule /#{id}[%&@!#\$]?/, Name rule /#.*?#/, Literal::Date rule /(\d+\.\d*|\d*\.\d+)(f[+-]?\d+)?/i, Num::Float rule /\d+([SILDFR]|US|UI|UL)?/, Num::Integer rule /&H[0-9a-f]+([SILDFR]|US|UI|UL)?/, Num::Integer rule /&O[0-7]+([SILDFR]|US|UI|UL)?/, Num::Integer rule /_\n/, Keyword end state :dotted do mixin :whitespace rule id, Name, :pop! end state :string do rule /""/, Str::Escape rule /"C?/, Str, :pop! rule /[^"]+/, Str end state :dim do mixin :whitespace rule id, Name::Variable, :pop! rule(//) { pop! } end state :funcname do mixin :whitespace rule id, Name::Function, :pop! end state :classname do mixin :whitespace rule id, Name::Class, :pop! end state :namespace do mixin :whitespace rule /#{id}([.]#{id})*/, Name::Namespace, :pop! end state :end do mixin :whitespace rule /(Function|Sub|Property|Class|Structure|Enum|Module|Namespace)\b/, Keyword, :pop! rule(//) { pop! } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/scheme.rb0000644000076400007640000000776012544707752021146 0ustar pravipravimodule Rugments module Lexers class Scheme < RegexLexer title 'Scheme' desc 'The Scheme variant of Lisp' tag 'scheme' filenames '*.scm', '*.ss' mimetypes 'text/x-scheme', 'application/x-scheme' def self.keywords @keywords ||= Set.new %w( lambda define if else cond and or case let let* letrec begin do delay set! => quote quasiquote unquote unquote-splicing define-syntax let-syntax letrec-syntax syntax-rules ) end def self.builtins @builtins ||= Set.new %w( * + - / < <= = > >= abs acos angle append apply asin assoc assq assv atan boolean? caaaar caaadr caaar caadar caaddr caadr caar cadaar cadadr cadar caddar cadddr caddr cadr call-with-current-continuation call-with-input-file call-with-output-file call-with-values call/cc car cdaaar cdaadr cdaar cdadar cdaddr cdadr cdar cddaar cddadr cddar cdddar cddddr cdddr cddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display dynamic-wind eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor for-each force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector map max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! vector? with-input-from-file with-output-to-file write write-char zero? ) end id = /[a-z0-9!$\%&*+,\/:<=>?@^_~|-]+/i state :root do # comments rule /;.*$/, Comment::Single rule /\s+/m, Text rule /-?\d+\.\d+/, Num::Float rule /-?\d+/, Num::Integer # Racket infinitites rule /[+-]inf[.][f0]/, Num rule /#b[01]+/, Num::Bin rule /#o[0-7]+/, Num::Oct rule /#d[0-9]+/, Num::Integer rule /#x[0-9a-f]+/i, Num::Hex rule /#[ei][\d.]+/, Num::Other rule /"(\\\\|\\"|[^"])*"/, Str rule /'#{id}/i, Str::Symbol rule /#\\([()\/'"._!\$%& ?=+-]{1}|[a-z0-9]+)/i, Str::Char rule /#t|#f/, Name::Constant rule /(?:'|#|`|,@|,|\.)/, Operator rule /(['#])(\s*)(\()/m do groups Str::Symbol, Text, Punctuation end rule /\(/, Punctuation, :command rule /\)/, Punctuation rule id, Name::Variable end state :command do rule id, Name::Function do |m| if self.class.keywords.include? m[0] token Keyword elsif self.class.builtins.include? m[0] token Name::Builtin else token Name::Function end pop! end rule(//) { pop! } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/erb.rb0000644000076400007640000000200712544707752020437 0ustar pravipravimodule Rugments module Lexers class ERB < TemplateLexer title 'ERB' desc 'Embedded ruby template files' tag 'erb' aliases 'eruby', 'rhtml' filenames '*.erb', '*.erubis', '*.rhtml', '*.eruby' def self.analyze_text(text) return 0.4 if text =~ /<%.*%>/ end def initialize(opts = {}) @ruby_lexer = Ruby.new(opts) super(opts) end start do parent.reset! @ruby_lexer.reset! end open = /<%%|<%=|<%#|<%-|<%/ close = /%%>|-%>|%>/ state :root do rule /<%#/, Comment, :comment rule open, Comment::Preproc, :ruby rule /.+?(?=#{open})|.+/m do delegate parent end end state :comment do rule close, Comment, :pop! rule /.+(?=#{close})|.+/m, Comment end state :ruby do rule close, Comment::Preproc, :pop! rule /.+?(?=#{close})|.+/m do delegate @ruby_lexer end end end end end rugments-1.0.0.beta8/lib/rugments/lexers/php/0000755000076400007640000000000012544707752020132 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/lexers/php/builtins.rb0000644000076400007640000025455712544707752022332 0ustar pravipravi# automatically generated by `rake builtins:php` module Rugments module Lexers class PHP def self.builtins @builtins ||= {}.tap do |b| b['Apache'] = Set.new %w(apache_child_terminate apache_child_terminate apache_get_modules apache_get_version apache_getenv apache_lookup_uri apache_note apache_request_headers apache_reset_timeout apache_response_headers apache_setenv getallheaders virtual apache_child_terminate) b['APC'] = Set.new %w(apc_add apc_add apc_bin_dump apc_bin_dumpfile apc_bin_load apc_bin_loadfile apc_cache_info apc_cas apc_clear_cache apc_compile_file apc_dec apc_define_constants apc_delete_file apc_delete apc_exists apc_fetch apc_inc apc_load_constants apc_sma_info apc_store apc_add) b['APD'] = Set.new %w(apd_breakpoint apd_breakpoint apd_callstack apd_clunk apd_continue apd_croak apd_dump_function_table apd_dump_persistent_resources apd_dump_regular_resources apd_echo apd_get_active_symbols apd_set_pprof_trace apd_set_session_trace_socket apd_set_session_trace apd_set_session override_function rename_function apd_breakpoint) b['Array'] = Set.new %w(array_change_key_case array_change_key_case array_chunk array_column array_combine array_count_values array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_diff array_fill_keys array_fill array_filter array_flip array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_intersect array_key_exists array_keys array_map array_merge_recursive array_merge array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace_recursive array_replace array_reverse array_search array_shift array_slice array_splice array_sum array_udiff_assoc array_udiff_uassoc array_udiff array_uintersect_assoc array_uintersect_uassoc array_uintersect array_unique array_unshift array_values array_walk_recursive array_walk array arsort asort compact count current each end extract in_array key_exists key krsort ksort list natcasesort natsort next pos prev range reset rsort shuffle sizeof sort uasort uksort usort array_change_key_case) b['BBCode'] = Set.new %w(bbcode_add_element bbcode_add_element bbcode_add_smiley bbcode_create bbcode_destroy bbcode_parse bbcode_set_arg_parser bbcode_set_flags bbcode_add_element) b['BC Math'] = Set.new %w(bcadd bcadd bccomp bcdiv bcmod bcmul bcpow bcpowmod bcscale bcsqrt bcsub bcadd) b['bcompiler'] = Set.new %w(bcompiler_load_exe bcompiler_load_exe bcompiler_load bcompiler_parse_class bcompiler_read bcompiler_write_class bcompiler_write_constant bcompiler_write_exe_footer bcompiler_write_file bcompiler_write_footer bcompiler_write_function bcompiler_write_functions_from_file bcompiler_write_header bcompiler_write_included_filename bcompiler_load_exe) b['Blenc'] = Set.new %w(blenc_encrypt blenc_encrypt blenc_encrypt) b['Bzip2'] = Set.new %w(bzclose bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite bzclose) b['Cairo'] = Set.new %w(cairo_create cairo_create cairo_font_face_get_type cairo_font_face_status cairo_font_options_create cairo_font_options_equal cairo_font_options_get_antialias cairo_font_options_get_hint_metrics cairo_font_options_get_hint_style cairo_font_options_get_subpixel_order cairo_font_options_hash cairo_font_options_merge cairo_font_options_set_antialias cairo_font_options_set_hint_metrics cairo_font_options_set_hint_style cairo_font_options_set_subpixel_order cairo_font_options_status cairo_format_stride_for_width cairo_image_surface_create_for_data cairo_image_surface_create_from_png cairo_image_surface_create cairo_image_surface_get_data cairo_image_surface_get_format cairo_image_surface_get_height cairo_image_surface_get_stride cairo_image_surface_get_width cairo_matrix_create_scale cairo_matrix_create_translate cairo_matrix_invert cairo_matrix_multiply cairo_matrix_rotate cairo_matrix_transform_distance cairo_matrix_transform_point cairo_matrix_translate cairo_pattern_add_color_stop_rgb cairo_pattern_add_color_stop_rgba cairo_pattern_create_for_surface cairo_pattern_create_linear cairo_pattern_create_radial cairo_pattern_create_rgb cairo_pattern_create_rgba cairo_pattern_get_color_stop_count cairo_pattern_get_color_stop_rgba cairo_pattern_get_extend cairo_pattern_get_filter cairo_pattern_get_linear_points cairo_pattern_get_matrix cairo_pattern_get_radial_circles cairo_pattern_get_rgba cairo_pattern_get_surface cairo_pattern_get_type cairo_pattern_set_extend cairo_pattern_set_filter cairo_pattern_set_matrix cairo_pattern_status cairo_pdf_surface_create cairo_pdf_surface_set_size cairo_ps_get_levels cairo_ps_level_to_string cairo_ps_surface_create cairo_ps_surface_dsc_begin_page_setup cairo_ps_surface_dsc_begin_setup cairo_ps_surface_dsc_comment cairo_ps_surface_get_eps cairo_ps_surface_restrict_to_level cairo_ps_surface_set_eps cairo_ps_surface_set_size cairo_scaled_font_create cairo_scaled_font_extents cairo_scaled_font_get_ctm cairo_scaled_font_get_font_face cairo_scaled_font_get_font_matrix cairo_scaled_font_get_font_options cairo_scaled_font_get_scale_matrix cairo_scaled_font_get_type cairo_scaled_font_glyph_extents cairo_scaled_font_status cairo_scaled_font_text_extents cairo_surface_copy_page cairo_surface_create_similar cairo_surface_finish cairo_surface_flush cairo_surface_get_content cairo_surface_get_device_offset cairo_surface_get_font_options cairo_surface_get_type cairo_surface_mark_dirty_rectangle cairo_surface_mark_dirty cairo_surface_set_device_offset cairo_surface_set_fallback_resolution cairo_surface_show_page cairo_surface_status cairo_surface_write_to_png cairo_svg_surface_create cairo_svg_surface_restrict_to_version cairo_svg_version_to_string cairo_create) b['Calendar'] = Set.new %w(cal_days_in_month cal_days_in_month cal_from_jd cal_info cal_to_jd easter_date easter_days FrenchToJD GregorianToJD JDDayOfWeek JDMonthName JDToFrench JDToGregorian jdtojewish JDToJulian jdtounix JewishToJD JulianToJD unixtojd cal_days_in_month) b['chdb'] = Set.new %w(chdb_create chdb_create chdb_create) b['Classkit'] = Set.new %w(classkit_import classkit_import classkit_method_add classkit_method_copy classkit_method_redefine classkit_method_remove classkit_method_rename classkit_import) b['Classes/Object'] = Set.new %w(__autoload __autoload call_user_method_array call_user_method class_alias class_exists get_called_class get_class_methods get_class_vars get_class get_declared_classes get_declared_interfaces get_declared_traits get_object_vars get_parent_class interface_exists is_a is_subclass_of method_exists property_exists trait_exists __autoload) b['COM'] = Set.new %w(com_create_guid com_create_guid com_event_sink com_get_active_object com_load_typelib com_message_pump com_print_typeinfo variant_abs variant_add variant_and variant_cast variant_cat variant_cmp variant_date_from_timestamp variant_date_to_timestamp variant_div variant_eqv variant_fix variant_get_type variant_idiv variant_imp variant_int variant_mod variant_mul variant_neg variant_not variant_or variant_pow variant_round variant_set_type variant_set variant_sub variant_xor com_create_guid) b['Crack'] = Set.new %w(crack_check crack_check crack_closedict crack_getlastmessage crack_opendict crack_check) b['Ctype'] = Set.new %w(ctype_alnum ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_graph ctype_lower ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit ctype_alnum) b['CUBRID'] = Set.new %w(cubrid_bind cubrid_bind cubrid_close_prepare cubrid_close_request cubrid_col_get cubrid_col_size cubrid_column_names cubrid_column_types cubrid_commit cubrid_connect_with_url cubrid_connect cubrid_current_oid cubrid_disconnect cubrid_drop cubrid_error_code_facility cubrid_error_code cubrid_error_msg cubrid_execute cubrid_fetch cubrid_free_result cubrid_get_autocommit cubrid_get_charset cubrid_get_class_name cubrid_get_client_info cubrid_get_db_parameter cubrid_get_query_timeout cubrid_get_server_info cubrid_get cubrid_insert_id cubrid_is_instance cubrid_lob_close cubrid_lob_export cubrid_lob_get cubrid_lob_send cubrid_lob_size cubrid_lob2_bind cubrid_lob2_close cubrid_lob2_export cubrid_lob2_import cubrid_lob2_new cubrid_lob2_read cubrid_lob2_seek64 cubrid_lob2_seek cubrid_lob2_size64 cubrid_lob2_size cubrid_lob2_tell64 cubrid_lob2_tell cubrid_lob2_write cubrid_lock_read cubrid_lock_write cubrid_move_cursor cubrid_next_result cubrid_num_cols cubrid_num_rows cubrid_pconnect_with_url cubrid_pconnect cubrid_prepare cubrid_put cubrid_rollback cubrid_schema cubrid_seq_drop cubrid_seq_insert cubrid_seq_put cubrid_set_add cubrid_set_autocommit cubrid_set_db_parameter cubrid_set_drop cubrid_set_query_timeout cubrid_version cubrid_bind) b['cURL'] = Set.new %w(curl_close curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version curl_close) b['Cyrus'] = Set.new %w(cyrus_authenticate cyrus_authenticate cyrus_bind cyrus_close cyrus_connect cyrus_query cyrus_unbind cyrus_authenticate) b['Date/Time'] = Set.new %w(checkdate checkdate date_add date_create_from_format date_create_immutable_from_format date_create_immutable date_create date_date_set date_default_timezone_get date_default_timezone_set date_diff date_format date_get_last_errors date_interval_create_from_date_string date_interval_format date_isodate_set date_modify date_offset_get date_parse_from_format date_parse date_sub date_sun_info date_sunrise date_sunset date_time_set date_timestamp_get date_timestamp_set date_timezone_get date_timezone_set date getdate gettimeofday gmdate gmmktime gmstrftime idate localtime microtime mktime strftime strptime strtotime time timezone_abbreviations_list timezone_identifiers_list timezone_location_get timezone_name_from_abbr timezone_name_get timezone_offset_get timezone_open timezone_transitions_get timezone_version_get checkdate) b['DBA'] = Set.new %w(dba_close dba_close dba_delete dba_exists dba_fetch dba_firstkey dba_handlers dba_insert dba_key_split dba_list dba_nextkey dba_open dba_optimize dba_popen dba_replace dba_sync dba_close) b['dBase'] = Set.new %w(dbase_add_record dbase_add_record dbase_close dbase_create dbase_delete_record dbase_get_header_info dbase_get_record_with_names dbase_get_record dbase_numfields dbase_numrecords dbase_open dbase_pack dbase_replace_record dbase_add_record) b['DB++'] = Set.new %w(dbplus_add dbplus_add dbplus_aql dbplus_chdir dbplus_close dbplus_curr dbplus_errcode dbplus_errno dbplus_find dbplus_first dbplus_flush dbplus_freealllocks dbplus_freelock dbplus_freerlocks dbplus_getlock dbplus_getunique dbplus_info dbplus_last dbplus_lockrel dbplus_next dbplus_open dbplus_prev dbplus_rchperm dbplus_rcreate dbplus_rcrtexact dbplus_rcrtlike dbplus_resolve dbplus_restorepos dbplus_rkeys dbplus_ropen dbplus_rquery dbplus_rrename dbplus_rsecindex dbplus_runlink dbplus_rzap dbplus_savepos dbplus_setindex dbplus_setindexbynumber dbplus_sql dbplus_tcl dbplus_tremove dbplus_undo dbplus_undoprepare dbplus_unlockrel dbplus_unselect dbplus_update dbplus_xlockrel dbplus_xunlockrel dbplus_add) b['dbx'] = Set.new %w(dbx_close dbx_close dbx_compare dbx_connect dbx_error dbx_escape_string dbx_fetch_row dbx_query dbx_sort dbx_close) b['Direct IO'] = Set.new %w(dio_close dio_close dio_fcntl dio_open dio_read dio_seek dio_stat dio_tcsetattr dio_truncate dio_write dio_close) b['Directory'] = Set.new %w(chdir chdir chroot closedir dir getcwd opendir readdir rewinddir scandir chdir) b['DOM'] = Set.new %w(dom_import_simplexml dom_import_simplexml dom_import_simplexml) b['Eio'] = Set.new %w(eio_busy eio_busy eio_cancel eio_chmod eio_chown eio_close eio_custom eio_dup2 eio_event_loop eio_fallocate eio_fchmod eio_fchown eio_fdatasync eio_fstat eio_fstatvfs eio_fsync eio_ftruncate eio_futime eio_get_event_stream eio_get_last_error eio_grp_add eio_grp_cancel eio_grp_limit eio_grp eio_init eio_link eio_lstat eio_mkdir eio_mknod eio_nop eio_npending eio_nready eio_nreqs eio_nthreads eio_open eio_poll eio_read eio_readahead eio_readdir eio_readlink eio_realpath eio_rename eio_rmdir eio_seek eio_sendfile eio_set_max_idle eio_set_max_parallel eio_set_max_poll_reqs eio_set_max_poll_time eio_set_min_parallel eio_stat eio_statvfs eio_symlink eio_sync_file_range eio_sync eio_syncfs eio_truncate eio_unlink eio_utime eio_write eio_busy) b['Enchant'] = Set.new %w(enchant_broker_describe enchant_broker_describe enchant_broker_dict_exists enchant_broker_free_dict enchant_broker_free enchant_broker_get_error enchant_broker_init enchant_broker_list_dicts enchant_broker_request_dict enchant_broker_request_pwl_dict enchant_broker_set_ordering enchant_dict_add_to_personal enchant_dict_add_to_session enchant_dict_check enchant_dict_describe enchant_dict_get_error enchant_dict_is_in_session enchant_dict_quick_check enchant_dict_store_replacement enchant_dict_suggest enchant_broker_describe) b['Error Handling'] = Set.new %w(debug_backtrace debug_backtrace debug_print_backtrace error_get_last error_log error_reporting restore_error_handler restore_exception_handler set_error_handler set_exception_handler trigger_error user_error debug_backtrace) b['Program execution'] = Set.new %w(escapeshellarg escapeshellarg escapeshellcmd exec passthru proc_close proc_get_status proc_nice proc_open proc_terminate shell_exec system escapeshellarg) b['Exif'] = Set.new %w(exif_imagetype exif_imagetype exif_read_data exif_tagname exif_thumbnail read_exif_data exif_imagetype) b['Expect'] = Set.new %w(expect_expectl expect_expectl expect_popen expect_expectl) b['FAM'] = Set.new %w(fam_cancel_monitor fam_cancel_monitor fam_close fam_monitor_collection fam_monitor_directory fam_monitor_file fam_next_event fam_open fam_pending fam_resume_monitor fam_suspend_monitor fam_cancel_monitor) b['Fann'] = Set.new %w(fann_cascadetrain_on_data fann_cascadetrain_on_data fann_cascadetrain_on_file fann_clear_scaling_params fann_copy fann_create_from_file fann_create_shortcut_array fann_create_shortcut fann_create_sparse_array fann_create_sparse fann_create_standard_array fann_create_standard fann_create_train_from_callback fann_create_train fann_descale_input fann_descale_output fann_descale_train fann_destroy_train fann_destroy fann_duplicate_train_data fann_get_activation_function fann_get_activation_steepness fann_get_bias_array fann_get_bit_fail_limit fann_get_bit_fail fann_get_cascade_activation_functions_count fann_get_cascade_activation_functions fann_get_cascade_activation_steepnesses_count fann_get_cascade_activation_steepnesses fann_get_cascade_candidate_change_fraction fann_get_cascade_candidate_limit fann_get_cascade_candidate_stagnation_epochs fann_get_cascade_max_cand_epochs fann_get_cascade_max_out_epochs fann_get_cascade_min_cand_epochs fann_get_cascade_min_out_epochs fann_get_cascade_num_candidate_groups fann_get_cascade_num_candidates fann_get_cascade_output_change_fraction fann_get_cascade_output_stagnation_epochs fann_get_cascade_weight_multiplier fann_get_connection_array fann_get_connection_rate fann_get_errno fann_get_errstr fann_get_layer_array fann_get_learning_momentum fann_get_learning_rate fann_get_MSE fann_get_network_type fann_get_num_input fann_get_num_layers fann_get_num_output fann_get_quickprop_decay fann_get_quickprop_mu fann_get_rprop_decrease_factor fann_get_rprop_delta_max fann_get_rprop_delta_min fann_get_rprop_delta_zero fann_get_rprop_increase_factor fann_get_sarprop_step_error_shift fann_get_sarprop_step_error_threshold_factor fann_get_sarprop_temperature fann_get_sarprop_weight_decay_shift fann_get_total_connections fann_get_total_neurons fann_get_train_error_function fann_get_train_stop_function fann_get_training_algorithm fann_init_weights fann_length_train_data fann_merge_train_data fann_num_input_train_data fann_num_output_train_data fann_print_error fann_randomize_weights fann_read_train_from_file fann_reset_errno fann_reset_errstr fann_reset_MSE fann_run fann_save_train fann_save fann_scale_input_train_data fann_scale_input fann_scale_output_train_data fann_scale_output fann_scale_train_data fann_scale_train fann_set_activation_function_hidden fann_set_activation_function_layer fann_set_activation_function_output fann_set_activation_function fann_set_activation_steepness_hidden fann_set_activation_steepness_layer fann_set_activation_steepness_output fann_set_activation_steepness fann_set_bit_fail_limit fann_set_callback fann_set_cascade_activation_functions fann_set_cascade_activation_steepnesses fann_set_cascade_candidate_change_fraction fann_set_cascade_candidate_limit fann_set_cascade_candidate_stagnation_epochs fann_set_cascade_max_cand_epochs fann_set_cascade_max_out_epochs fann_set_cascade_min_cand_epochs fann_set_cascade_min_out_epochs fann_set_cascade_num_candidate_groups fann_set_cascade_output_change_fraction fann_set_cascade_output_stagnation_epochs fann_set_cascade_weight_multiplier fann_set_error_log fann_set_input_scaling_params fann_set_learning_momentum fann_set_learning_rate fann_set_output_scaling_params fann_set_quickprop_decay fann_set_quickprop_mu fann_set_rprop_decrease_factor fann_set_rprop_delta_max fann_set_rprop_delta_min fann_set_rprop_delta_zero fann_set_rprop_increase_factor fann_set_sarprop_step_error_shift fann_set_sarprop_step_error_threshold_factor fann_set_sarprop_temperature fann_set_sarprop_weight_decay_shift fann_set_scaling_params fann_set_train_error_function fann_set_train_stop_function fann_set_training_algorithm fann_set_weight_array fann_set_weight fann_shuffle_train_data fann_subset_train_data fann_test_data fann_test fann_train_epoch fann_train_on_data fann_train_on_file fann_train fann_cascadetrain_on_data) b['FrontBase'] = Set.new %w(fbsql_affected_rows fbsql_affected_rows fbsql_autocommit fbsql_blob_size fbsql_change_user fbsql_clob_size fbsql_close fbsql_commit fbsql_connect fbsql_create_blob fbsql_create_clob fbsql_create_db fbsql_data_seek fbsql_database_password fbsql_database fbsql_db_query fbsql_db_status fbsql_drop_db fbsql_errno fbsql_error fbsql_fetch_array fbsql_fetch_assoc fbsql_fetch_field fbsql_fetch_lengths fbsql_fetch_object fbsql_fetch_row fbsql_field_flags fbsql_field_len fbsql_field_name fbsql_field_seek fbsql_field_table fbsql_field_type fbsql_free_result fbsql_get_autostart_info fbsql_hostname fbsql_insert_id fbsql_list_dbs fbsql_list_fields fbsql_list_tables fbsql_next_result fbsql_num_fields fbsql_num_rows fbsql_password fbsql_pconnect fbsql_query fbsql_read_blob fbsql_read_clob fbsql_result fbsql_rollback fbsql_rows_fetched fbsql_select_db fbsql_set_characterset fbsql_set_lob_mode fbsql_set_password fbsql_set_transaction fbsql_start_db fbsql_stop_db fbsql_table_name fbsql_tablename fbsql_username fbsql_warnings fbsql_affected_rows) b['FDF'] = Set.new %w(fdf_add_doc_javascript fdf_add_doc_javascript fdf_add_template fdf_close fdf_create fdf_enum_values fdf_errno fdf_error fdf_get_ap fdf_get_attachment fdf_get_encoding fdf_get_file fdf_get_flags fdf_get_opt fdf_get_status fdf_get_value fdf_get_version fdf_header fdf_next_field_name fdf_open_string fdf_open fdf_remove_item fdf_save_string fdf_save fdf_set_ap fdf_set_encoding fdf_set_file fdf_set_flags fdf_set_javascript_action fdf_set_on_import_javascript fdf_set_opt fdf_set_status fdf_set_submit_form_action fdf_set_target_frame fdf_set_value fdf_set_version fdf_add_doc_javascript) b['Fileinfo'] = Set.new %w(finfo_buffer finfo_buffer finfo_close finfo_file finfo_open finfo_set_flags mime_content_type finfo_buffer) b['filePro'] = Set.new %w(filepro_fieldcount filepro_fieldcount filepro_fieldname filepro_fieldtype filepro_fieldwidth filepro_retrieve filepro_rowcount filepro filepro_fieldcount) b['Filesystem'] = Set.new %w(basename basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputcsv fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable lchgrp lchown link linkinfo lstat mkdir move_uploaded_file parse_ini_file parse_ini_string pathinfo pclose popen readfile readlink realpath_cache_get realpath_cache_size realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink basename) b['Filter'] = Set.new %w(filter_has_var filter_has_var filter_id filter_input_array filter_input filter_list filter_var_array filter_var filter_has_var) b['FPM'] = Set.new %w(fastcgi_finish_request fastcgi_finish_request fastcgi_finish_request) b['FriBiDi'] = Set.new %w(fribidi_log2vis fribidi_log2vis fribidi_log2vis) b['FTP'] = Set.new %w(ftp_alloc ftp_alloc ftp_cdup ftp_chdir ftp_chmod ftp_close ftp_connect ftp_delete ftp_exec ftp_fget ftp_fput ftp_get_option ftp_get ftp_login ftp_mdtm ftp_mkdir ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_nlist ftp_pasv ftp_put ftp_pwd ftp_quit ftp_raw ftp_rawlist ftp_rename ftp_rmdir ftp_set_option ftp_site ftp_size ftp_ssl_connect ftp_systype ftp_alloc) b['Function handling'] = Set.new %w(call_user_func_array call_user_func_array call_user_func create_function forward_static_call_array forward_static_call func_get_arg func_get_args func_num_args function_exists get_defined_functions register_shutdown_function register_tick_function unregister_tick_function call_user_func_array) b['GeoIP'] = Set.new %w(geoip_asnum_by_name geoip_asnum_by_name geoip_continent_code_by_name geoip_country_code_by_name geoip_country_code3_by_name geoip_country_name_by_name geoip_database_info geoip_db_avail geoip_db_filename geoip_db_get_all_info geoip_domain_by_name geoip_id_by_name geoip_isp_by_name geoip_netspeedcell_by_name geoip_org_by_name geoip_record_by_name geoip_region_by_name geoip_region_name_by_code geoip_setup_custom_directory geoip_time_zone_by_country_and_region geoip_asnum_by_name) b['Gettext'] = Set.new %w(bind_textdomain_codeset bind_textdomain_codeset bindtextdomain dcgettext dcngettext dgettext dngettext gettext ngettext textdomain bind_textdomain_codeset) b['GMP'] = Set.new %w(gmp_abs gmp_abs gmp_add gmp_and gmp_clrbit gmp_cmp gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_export gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_import gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul gmp_neg gmp_nextprime gmp_or gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random_bits gmp_random_range gmp_random gmp_root gmp_rootrem gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_strval gmp_sub gmp_testbit gmp_xor gmp_abs) b['GnuPG'] = Set.new %w(gnupg_adddecryptkey gnupg_adddecryptkey gnupg_addencryptkey gnupg_addsignkey gnupg_cleardecryptkeys gnupg_clearencryptkeys gnupg_clearsignkeys gnupg_decrypt gnupg_decryptverify gnupg_encrypt gnupg_encryptsign gnupg_export gnupg_geterror gnupg_getprotocol gnupg_import gnupg_init gnupg_keyinfo gnupg_setarmor gnupg_seterrormode gnupg_setsignmode gnupg_sign gnupg_verify gnupg_adddecryptkey) b['Gupnp'] = Set.new %w(gupnp_context_get_host_ip gupnp_context_get_host_ip gupnp_context_get_port gupnp_context_get_subscription_timeout gupnp_context_host_path gupnp_context_new gupnp_context_set_subscription_timeout gupnp_context_timeout_add gupnp_context_unhost_path gupnp_control_point_browse_start gupnp_control_point_browse_stop gupnp_control_point_callback_set gupnp_control_point_new gupnp_device_action_callback_set gupnp_device_info_get_service gupnp_device_info_get gupnp_root_device_get_available gupnp_root_device_get_relative_location gupnp_root_device_new gupnp_root_device_set_available gupnp_root_device_start gupnp_root_device_stop gupnp_service_action_get gupnp_service_action_return_error gupnp_service_action_return gupnp_service_action_set gupnp_service_freeze_notify gupnp_service_info_get_introspection gupnp_service_info_get gupnp_service_introspection_get_state_variable gupnp_service_notify gupnp_service_proxy_action_get gupnp_service_proxy_action_set gupnp_service_proxy_add_notify gupnp_service_proxy_callback_set gupnp_service_proxy_get_subscribed gupnp_service_proxy_remove_notify gupnp_service_proxy_set_subscribed gupnp_service_thaw_notify gupnp_context_get_host_ip) b['Hash'] = Set.new %w(hash_algos hash_algos hash_copy hash_equals hash_file hash_final hash_hmac_file hash_hmac hash_init hash_pbkdf2 hash_update_file hash_update_stream hash_update hash hash_algos) b['HTTP'] = Set.new %w(http_cache_etag http_cache_etag http_cache_last_modified http_chunked_decode http_deflate http_inflate http_build_cookie http_date http_get_request_body_stream http_get_request_body http_get_request_headers http_match_etag http_match_modified http_match_request_header http_support http_negotiate_charset http_negotiate_content_type http_negotiate_language ob_deflatehandler ob_etaghandler ob_inflatehandler http_parse_cookie http_parse_headers http_parse_message http_parse_params http_persistent_handles_clean http_persistent_handles_count http_persistent_handles_ident http_get http_head http_post_data http_post_fields http_put_data http_put_file http_put_stream http_request_body_encode http_request_method_exists http_request_method_name http_request_method_register http_request_method_unregister http_request http_redirect http_send_content_disposition http_send_content_type http_send_data http_send_file http_send_last_modified http_send_status http_send_stream http_throttle http_build_str http_build_url http_cache_etag) b['Hyperwave API'] = Set.new %w(hwapi_attribute_new hwapi_content_new hwapi_hgcsp hwapi_object_new) b['Firebird/InterBase'] = Set.new %w(ibase_add_user ibase_add_user ibase_affected_rows ibase_backup ibase_blob_add ibase_blob_cancel ibase_blob_close ibase_blob_create ibase_blob_echo ibase_blob_get ibase_blob_import ibase_blob_info ibase_blob_open ibase_close ibase_commit_ret ibase_commit ibase_connect ibase_db_info ibase_delete_user ibase_drop_db ibase_errcode ibase_errmsg ibase_execute ibase_fetch_assoc ibase_fetch_object ibase_fetch_row ibase_field_info ibase_free_event_handler ibase_free_query ibase_free_result ibase_gen_id ibase_maintain_db ibase_modify_user ibase_name_result ibase_num_fields ibase_num_params ibase_param_info ibase_pconnect ibase_prepare ibase_query ibase_restore ibase_rollback_ret ibase_rollback ibase_server_info ibase_service_attach ibase_service_detach ibase_set_event_handler ibase_trans ibase_wait_event ibase_add_user) b['IBM DB2'] = Set.new %w(db2_autocommit db2_autocommit db2_bind_param db2_client_info db2_close db2_column_privileges db2_columns db2_commit db2_conn_error db2_conn_errormsg db2_connect db2_cursor_type db2_escape_string db2_exec db2_execute db2_fetch_array db2_fetch_assoc db2_fetch_both db2_fetch_object db2_fetch_row db2_field_display_size db2_field_name db2_field_num db2_field_precision db2_field_scale db2_field_type db2_field_width db2_foreign_keys db2_free_result db2_free_stmt db2_get_option db2_last_insert_id db2_lob_read db2_next_result db2_num_fields db2_num_rows db2_pclose db2_pconnect db2_prepare db2_primary_keys db2_procedure_columns db2_procedures db2_result db2_rollback db2_server_info db2_set_option db2_special_columns db2_statistics db2_stmt_error db2_stmt_errormsg db2_table_privileges db2_tables db2_autocommit) b['iconv'] = Set.new %w(iconv_get_encoding iconv_get_encoding iconv_mime_decode_headers iconv_mime_decode iconv_mime_encode iconv_set_encoding iconv_strlen iconv_strpos iconv_strrpos iconv_substr iconv ob_iconv_handler iconv_get_encoding) b['ID3'] = Set.new %w(id3_get_frame_long_name id3_get_frame_long_name id3_get_frame_short_name id3_get_genre_id id3_get_genre_list id3_get_genre_name id3_get_tag id3_get_version id3_remove_tag id3_set_tag id3_get_frame_long_name) b['Informix'] = Set.new %w(ifx_affected_rows ifx_affected_rows ifx_blobinfile_mode ifx_byteasvarchar ifx_close ifx_connect ifx_copy_blob ifx_create_blob ifx_create_char ifx_do ifx_error ifx_errormsg ifx_fetch_row ifx_fieldproperties ifx_fieldtypes ifx_free_blob ifx_free_char ifx_free_result ifx_get_blob ifx_get_char ifx_getsqlca ifx_htmltbl_result ifx_nullformat ifx_num_fields ifx_num_rows ifx_pconnect ifx_prepare ifx_query ifx_textasvarchar ifx_update_blob ifx_update_char ifxus_close_slob ifxus_create_slob ifxus_free_slob ifxus_open_slob ifxus_read_slob ifxus_seek_slob ifxus_tell_slob ifxus_write_slob ifx_affected_rows) b['IIS'] = Set.new %w(iis_add_server iis_add_server iis_get_dir_security iis_get_script_map iis_get_server_by_comment iis_get_server_by_path iis_get_server_rights iis_get_service_state iis_remove_server iis_set_app_settings iis_set_dir_security iis_set_script_map iis_set_server_rights iis_start_server iis_start_service iis_stop_server iis_stop_service iis_add_server) b['GD and Image'] = Set.new %w(gd_info gd_info getimagesize getimagesizefromstring image_type_to_extension image_type_to_mime_type image2wbmp imageaffine imageaffinematrixconcat imageaffinematrixget imagealphablending imageantialias imagearc imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imageconvolution imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgd imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromwebp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagecrop imagecropauto imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefilter imageflip imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrect imagegd2 imagegd imagegif imagegrabscreen imagegrabwindow imageinterlace imageistruecolor imagejpeg imagelayereffect imageline imageloadfont imagepalettecopy imagepalettetotruecolor imagepng imagepolygon imagepsbbox imagepsencodefont imagepsextendfont imagepsfreefont imagepsloadfont imagepsslantfont imagepstext imagerectangle imagerotate imagesavealpha imagescale imagesetbrush imagesetinterpolation imagesetpixel imagesetstyle imagesetthickness imagesettile imagestring imagestringup imagesx imagesy imagetruecolortopalette imagettfbbox imagettftext imagetypes imagewbmp imagewebp imagexbm iptcembed iptcparse jpeg2wbmp png2wbmp gd_info) b['IMAP'] = Set.new %w(imap_8bit imap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_create imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchmime imap_fetchstructure imap_fetchtext imap_gc imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_rename imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_savebody imap_scan imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 imap_8bit) b['inclued'] = Set.new %w(inclued_get_data inclued_get_data inclued_get_data) b['PHP Options/Info'] = Set.new %w(assert_options assert_options assert cli_get_process_title cli_set_process_title dl extension_loaded gc_collect_cycles gc_disable gc_enable gc_enabled get_cfg_var get_current_user get_defined_constants get_extension_funcs get_include_path get_included_files get_loaded_extensions get_magic_quotes_gpc get_magic_quotes_runtime get_required_files getenv getlastmod getmygid getmyinode getmypid getmyuid getopt getrusage ini_alter ini_get_all ini_get ini_restore ini_set magic_quotes_runtime main memory_get_peak_usage memory_get_usage php_ini_loaded_file php_ini_scanned_files php_logo_guid php_sapi_name php_uname phpcredits phpinfo phpversion putenv restore_include_path set_include_path set_magic_quotes_runtime set_time_limit sys_get_temp_dir version_compare zend_logo_guid zend_thread_id zend_version assert_options) b['Ingres'] = Set.new %w(ingres_autocommit_state ingres_autocommit_state ingres_autocommit ingres_charset ingres_close ingres_commit ingres_connect ingres_cursor ingres_errno ingres_error ingres_errsqlstate ingres_escape_string ingres_execute ingres_fetch_array ingres_fetch_assoc ingres_fetch_object ingres_fetch_proc_return ingres_fetch_row ingres_field_length ingres_field_name ingres_field_nullable ingres_field_precision ingres_field_scale ingres_field_type ingres_free_result ingres_next_error ingres_num_fields ingres_num_rows ingres_pconnect ingres_prepare ingres_query ingres_result_seek ingres_rollback ingres_set_environment ingres_unbuffered_query ingres_autocommit_state) b['Inotify'] = Set.new %w(inotify_add_watch inotify_add_watch inotify_init inotify_queue_len inotify_read inotify_rm_watch inotify_add_watch) b['Grapheme'] = Set.new %w(grapheme_extract grapheme_extract grapheme_stripos grapheme_stristr grapheme_strlen grapheme_strpos grapheme_strripos grapheme_strrpos grapheme_strstr grapheme_substr grapheme_extract) b['intl'] = Set.new %w(intl_error_name intl_error_name intl_get_error_code intl_get_error_message intl_is_failure intl_error_name) b['IDN'] = Set.new %w(grapheme_substr idn_to_ascii idn_to_ascii idn_to_unicode idn_to_utf8 grapheme_substr idn_to_ascii) b['JSON'] = Set.new %w(json_decode json_decode json_encode json_last_error_msg json_last_error json_decode) b['Judy'] = Set.new %w(judy_type judy_type judy_version judy_type) b['KADM5'] = Set.new %w(kadm5_chpass_principal kadm5_chpass_principal kadm5_create_principal kadm5_delete_principal kadm5_destroy kadm5_flush kadm5_get_policies kadm5_get_principal kadm5_get_principals kadm5_init_with_password kadm5_modify_principal kadm5_chpass_principal) b['LDAP'] = Set.new %w(ldap_8859_to_t61 ldap_8859_to_t61 ldap_add ldap_bind ldap_close ldap_compare ldap_connect ldap_control_paged_result_response ldap_control_paged_result ldap_count_entries ldap_delete ldap_dn2ufn ldap_err2str ldap_errno ldap_error ldap_escape ldap_explode_dn ldap_first_attribute ldap_first_entry ldap_first_reference ldap_free_result ldap_get_attributes ldap_get_dn ldap_get_entries ldap_get_option ldap_get_values_len ldap_get_values ldap_list ldap_mod_add ldap_mod_del ldap_mod_replace ldap_modify_batch ldap_modify ldap_next_attribute ldap_next_entry ldap_next_reference ldap_parse_reference ldap_parse_result ldap_read ldap_rename ldap_sasl_bind ldap_search ldap_set_option ldap_set_rebind_proc ldap_sort ldap_start_tls ldap_t61_to_8859 ldap_unbind ldap_8859_to_t61) b['Libevent'] = Set.new %w(event_add event_add event_base_free event_base_loop event_base_loopbreak event_base_loopexit event_base_new event_base_priority_init event_base_reinit event_base_set event_buffer_base_set event_buffer_disable event_buffer_enable event_buffer_fd_set event_buffer_free event_buffer_new event_buffer_priority_set event_buffer_read event_buffer_set_callback event_buffer_timeout_set event_buffer_watermark_set event_buffer_write event_del event_free event_new event_priority_set event_set event_timer_add event_timer_del event_timer_new event_timer_set event_add) b['libxml'] = Set.new %w(libxml_clear_errors libxml_clear_errors libxml_disable_entity_loader libxml_get_errors libxml_get_last_error libxml_set_external_entity_loader libxml_set_streams_context libxml_use_internal_errors libxml_clear_errors) b['LZF'] = Set.new %w(lzf_compress lzf_compress lzf_decompress lzf_optimized_for lzf_compress) b['Mail'] = Set.new %w(ezmlm_hash ezmlm_hash mail ezmlm_hash) b['Mailparse'] = Set.new %w(mailparse_determine_best_xfer_encoding mailparse_determine_best_xfer_encoding mailparse_msg_create mailparse_msg_extract_part_file mailparse_msg_extract_part mailparse_msg_extract_whole_part_file mailparse_msg_free mailparse_msg_get_part_data mailparse_msg_get_part mailparse_msg_get_structure mailparse_msg_parse_file mailparse_msg_parse mailparse_rfc822_parse_addresses mailparse_stream_encode mailparse_uudecode_all mailparse_determine_best_xfer_encoding) b['Math'] = Set.new %w(abs abs acos acosh asin asinh atan2 atan atanh base_convert bindec ceil cos cosh decbin dechex decoct deg2rad exp expm1 floor fmod getrandmax hexdec hypot is_finite is_infinite is_nan lcg_value log10 log1p log max min mt_getrandmax mt_rand mt_srand octdec pi pow rad2deg rand round sin sinh sqrt srand tan tanh abs) b['MaxDB'] = Set.new %w(maxdb_affected_rows maxdb_affected_rows maxdb_autocommit maxdb_bind_param maxdb_bind_result maxdb_change_user maxdb_character_set_name maxdb_client_encoding maxdb_close_long_data maxdb_close maxdb_commit maxdb_connect_errno maxdb_connect_error maxdb_connect maxdb_data_seek maxdb_debug maxdb_disable_reads_from_master maxdb_disable_rpl_parse maxdb_dump_debug_info maxdb_embedded_connect maxdb_enable_reads_from_master maxdb_enable_rpl_parse maxdb_errno maxdb_error maxdb_escape_string maxdb_execute maxdb_fetch_array maxdb_fetch_assoc maxdb_fetch_field_direct maxdb_fetch_field maxdb_fetch_fields maxdb_fetch_lengths maxdb_fetch_object maxdb_fetch_row maxdb_fetch maxdb_field_count maxdb_field_seek maxdb_field_tell maxdb_free_result maxdb_get_client_info maxdb_get_client_version maxdb_get_host_info maxdb_get_metadata maxdb_get_proto_info maxdb_get_server_info maxdb_get_server_version maxdb_info maxdb_init maxdb_insert_id maxdb_kill maxdb_master_query maxdb_more_results maxdb_multi_query maxdb_next_result maxdb_num_fields maxdb_num_rows maxdb_options maxdb_param_count maxdb_ping maxdb_prepare maxdb_query maxdb_real_connect maxdb_real_escape_string maxdb_real_query maxdb_report maxdb_rollback maxdb_rpl_parse_enabled maxdb_rpl_probe maxdb_rpl_query_type maxdb_select_db maxdb_send_long_data maxdb_send_query maxdb_server_end maxdb_server_init maxdb_set_opt maxdb_sqlstate maxdb_ssl_set maxdb_stat maxdb_stmt_affected_rows maxdb_stmt_bind_param maxdb_stmt_bind_result maxdb_stmt_close_long_data maxdb_stmt_close maxdb_stmt_data_seek maxdb_stmt_errno maxdb_stmt_error maxdb_stmt_execute maxdb_stmt_fetch maxdb_stmt_free_result maxdb_stmt_init maxdb_stmt_num_rows maxdb_stmt_param_count maxdb_stmt_prepare maxdb_stmt_reset maxdb_stmt_result_metadata maxdb_stmt_send_long_data maxdb_stmt_sqlstate maxdb_stmt_store_result maxdb_store_result maxdb_thread_id maxdb_thread_safe maxdb_use_result maxdb_warning_count maxdb_affected_rows) b['Multibyte String'] = Set.new %w(mb_check_encoding mb_check_encoding mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_encoding_aliases mb_ereg_match mb_ereg_replace_callback mb_ereg_replace mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_ereg_search mb_ereg mb_eregi_replace mb_eregi mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_list_encodings mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_send_mail mb_split mb_strcut mb_strimwidth mb_stripos mb_stristr mb_strlen mb_strpos mb_strrchr mb_strrichr mb_strripos mb_strrpos mb_strstr mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr_count mb_substr mb_check_encoding) b['Mcrypt'] = Set.new %w(mcrypt_cbc mcrypt_cbc mcrypt_cfb mcrypt_create_iv mcrypt_decrypt mcrypt_ecb mcrypt_enc_get_algorithms_name mcrypt_enc_get_block_size mcrypt_enc_get_iv_size mcrypt_enc_get_key_size mcrypt_enc_get_modes_name mcrypt_enc_get_supported_key_sizes mcrypt_enc_is_block_algorithm_mode mcrypt_enc_is_block_algorithm mcrypt_enc_is_block_mode mcrypt_enc_self_test mcrypt_encrypt mcrypt_generic_deinit mcrypt_generic_end mcrypt_generic_init mcrypt_generic mcrypt_get_block_size mcrypt_get_cipher_name mcrypt_get_iv_size mcrypt_get_key_size mcrypt_list_algorithms mcrypt_list_modes mcrypt_module_close mcrypt_module_get_algo_block_size mcrypt_module_get_algo_key_size mcrypt_module_get_supported_key_sizes mcrypt_module_is_block_algorithm_mode mcrypt_module_is_block_algorithm mcrypt_module_is_block_mode mcrypt_module_open mcrypt_module_self_test mcrypt_ofb mdecrypt_generic mcrypt_cbc) b['MCVE'] = Set.new %w(m_checkstatus m_checkstatus m_completeauthorizations m_connect m_connectionerror m_deletetrans m_destroyconn m_destroyengine m_getcell m_getcellbynum m_getcommadelimited m_getheader m_initconn m_initengine m_iscommadelimited m_maxconntimeout m_monitor m_numcolumns m_numrows m_parsecommadelimited m_responsekeys m_responseparam m_returnstatus m_setblocking m_setdropfile m_setip m_setssl_cafile m_setssl_files m_setssl m_settimeout m_sslcert_gen_hash m_transactionssent m_transinqueue m_transkeyval m_transnew m_transsend m_uwait m_validateidentifier m_verifyconnection m_verifysslcert m_checkstatus) b['Memcache'] = Set.new %w(memcache_debug memcache_debug memcache_debug) b['Mhash'] = Set.new %w(mhash_count mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k mhash mhash_count) b['Ming'] = Set.new %w(ming_keypress ming_keypress ming_setcubicthreshold ming_setscale ming_setswfcompression ming_useconstants ming_useswfversion ming_keypress) b['Misc.'] = Set.new %w(connection_aborted connection_aborted connection_status constant define defined die eval exit get_browser __halt_compiler highlight_file highlight_string ignore_user_abort pack php_check_syntax php_strip_whitespace show_source sleep sys_getloadavg time_nanosleep time_sleep_until uniqid unpack usleep connection_aborted) b['mnoGoSearch'] = Set.new %w(udm_add_search_limit udm_add_search_limit udm_alloc_agent_array udm_alloc_agent udm_api_version udm_cat_list udm_cat_path udm_check_charset udm_clear_search_limits udm_crc32 udm_errno udm_error udm_find udm_free_agent udm_free_ispell_data udm_free_res udm_get_doc_count udm_get_res_field udm_get_res_param udm_hash32 udm_load_ispell_data udm_set_agent_param udm_add_search_limit) b['Mongo'] = Set.new %w(bson_decode bson_decode bson_encode bson_decode) b['mqseries'] = Set.new %w(mqseries_back mqseries_back mqseries_begin mqseries_close mqseries_cmit mqseries_conn mqseries_connx mqseries_disc mqseries_get mqseries_inq mqseries_open mqseries_put1 mqseries_put mqseries_set mqseries_strerror mqseries_back) b['Msession'] = Set.new %w(msession_connect msession_connect msession_count msession_create msession_destroy msession_disconnect msession_find msession_get_array msession_get_data msession_get msession_inc msession_list msession_listvar msession_lock msession_plugin msession_randstr msession_set_array msession_set_data msession_set msession_timeout msession_uniq msession_unlock msession_connect) b['mSQL'] = Set.new %w(msql_affected_rows msql_affected_rows msql_close msql_connect msql_create_db msql_createdb msql_data_seek msql_db_query msql_dbname msql_drop_db msql_error msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_flags msql_field_len msql_field_name msql_field_seek msql_field_table msql_field_type msql_fieldflags msql_fieldlen msql_fieldname msql_fieldtable msql_fieldtype msql_free_result msql_list_dbs msql_list_fields msql_list_tables msql_num_fields msql_num_rows msql_numfields msql_numrows msql_pconnect msql_query msql_regcase msql_result msql_select_db msql_tablename msql msql_affected_rows) b['Mssql'] = Set.new %w(mssql_bind mssql_bind mssql_close mssql_connect mssql_data_seek mssql_execute mssql_fetch_array mssql_fetch_assoc mssql_fetch_batch mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_free_result mssql_free_statement mssql_get_last_message mssql_guid_string mssql_init mssql_min_error_severity mssql_min_message_severity mssql_next_result mssql_num_fields mssql_num_rows mssql_pconnect mssql_query mssql_result mssql_rows_affected mssql_select_db mssql_bind) b['MySQL'] = Set.new %w(mysql_affected_rows mysql_affected_rows mysql_client_encoding mysql_close mysql_connect mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_escape_string mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_field_flags mysql_field_len mysql_field_name mysql_field_seek mysql_field_table mysql_field_type mysql_free_result mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_num_fields mysql_num_rows mysql_pconnect mysql_ping mysql_query mysql_real_escape_string mysql_result mysql_select_db mysql_set_charset mysql_stat mysql_tablename mysql_thread_id mysql_unbuffered_query mysql_affected_rows) b['Aliases and deprecated Mysqli'] = Set.new %w(mysqli_bind_param mysqli_bind_param mysqli_bind_result mysqli_client_encoding mysqli_connect mysqli::disable_reads_from_master mysqli_disable_rpl_parse mysqli_enable_reads_from_master mysqli_enable_rpl_parse mysqli_escape_string mysqli_execute mysqli_fetch mysqli_get_cache_stats mysqli_get_links_stats mysqli_get_metadata mysqli_master_query mysqli_param_count mysqli_report mysqli_rpl_parse_enabled mysqli_rpl_probe mysqli_send_long_data mysqli::set_opt mysqli_slave_query mysqli_bind_param) b['Mysqlnd_memcache'] = Set.new %w(mysqlnd_memcache_get_config mysqlnd_memcache_get_config mysqlnd_memcache_set mysqlnd_memcache_get_config) b['Mysqlnd_ms'] = Set.new %w(mysqlnd_ms_dump_servers mysqlnd_ms_dump_servers mysqlnd_ms_fabric_select_global mysqlnd_ms_fabric_select_shard mysqlnd_ms_get_last_gtid mysqlnd_ms_get_last_used_connection mysqlnd_ms_get_stats mysqlnd_ms_match_wild mysqlnd_ms_query_is_select mysqlnd_ms_set_qos mysqlnd_ms_set_user_pick_server mysqlnd_ms_xa_begin mysqlnd_ms_xa_commit mysqlnd_ms_xa_gc mysqlnd_ms_xa_rollback mysqlnd_ms_dump_servers) b['mysqlnd_qc'] = Set.new %w(mysqlnd_qc_clear_cache mysqlnd_qc_clear_cache mysqlnd_qc_get_available_handlers mysqlnd_qc_get_cache_info mysqlnd_qc_get_core_stats mysqlnd_qc_get_normalized_query_trace_log mysqlnd_qc_get_query_trace_log mysqlnd_qc_set_cache_condition mysqlnd_qc_set_is_select mysqlnd_qc_set_storage_handler mysqlnd_qc_set_user_handlers mysqlnd_qc_clear_cache) b['Mysqlnd_uh'] = Set.new %w(mysqlnd_uh_convert_to_mysqlnd mysqlnd_uh_convert_to_mysqlnd mysqlnd_uh_set_connection_proxy mysqlnd_uh_set_statement_proxy mysqlnd_uh_convert_to_mysqlnd) b['Ncurses'] = Set.new %w(ncurses_addch ncurses_addch ncurses_addchnstr ncurses_addchstr ncurses_addnstr ncurses_addstr ncurses_assume_default_colors ncurses_attroff ncurses_attron ncurses_attrset ncurses_baudrate ncurses_beep ncurses_bkgd ncurses_bkgdset ncurses_border ncurses_bottom_panel ncurses_can_change_color ncurses_cbreak ncurses_clear ncurses_clrtobot ncurses_clrtoeol ncurses_color_content ncurses_color_set ncurses_curs_set ncurses_def_prog_mode ncurses_def_shell_mode ncurses_define_key ncurses_del_panel ncurses_delay_output ncurses_delch ncurses_deleteln ncurses_delwin ncurses_doupdate ncurses_echo ncurses_echochar ncurses_end ncurses_erase ncurses_erasechar ncurses_filter ncurses_flash ncurses_flushinp ncurses_getch ncurses_getmaxyx ncurses_getmouse ncurses_getyx ncurses_halfdelay ncurses_has_colors ncurses_has_ic ncurses_has_il ncurses_has_key ncurses_hide_panel ncurses_hline ncurses_inch ncurses_init_color ncurses_init_pair ncurses_init ncurses_insch ncurses_insdelln ncurses_insertln ncurses_insstr ncurses_instr ncurses_isendwin ncurses_keyok ncurses_keypad ncurses_killchar ncurses_longname ncurses_meta ncurses_mouse_trafo ncurses_mouseinterval ncurses_mousemask ncurses_move_panel ncurses_move ncurses_mvaddch ncurses_mvaddchnstr ncurses_mvaddchstr ncurses_mvaddnstr ncurses_mvaddstr ncurses_mvcur ncurses_mvdelch ncurses_mvgetch ncurses_mvhline ncurses_mvinch ncurses_mvvline ncurses_mvwaddstr ncurses_napms ncurses_new_panel ncurses_newpad ncurses_newwin ncurses_nl ncurses_nocbreak ncurses_noecho ncurses_nonl ncurses_noqiflush ncurses_noraw ncurses_pair_content ncurses_panel_above ncurses_panel_below ncurses_panel_window ncurses_pnoutrefresh ncurses_prefresh ncurses_putp ncurses_qiflush ncurses_raw ncurses_refresh ncurses_replace_panel ncurses_reset_prog_mode ncurses_reset_shell_mode ncurses_resetty ncurses_savetty ncurses_scr_dump ncurses_scr_init ncurses_scr_restore ncurses_scr_set ncurses_scrl ncurses_show_panel ncurses_slk_attr ncurses_slk_attroff ncurses_slk_attron ncurses_slk_attrset ncurses_slk_clear ncurses_slk_color ncurses_slk_init ncurses_slk_noutrefresh ncurses_slk_refresh ncurses_slk_restore ncurses_slk_set ncurses_slk_touch ncurses_standend ncurses_standout ncurses_start_color ncurses_termattrs ncurses_termname ncurses_timeout ncurses_top_panel ncurses_typeahead ncurses_ungetch ncurses_ungetmouse ncurses_update_panels ncurses_use_default_colors ncurses_use_env ncurses_use_extended_names ncurses_vidattr ncurses_vline ncurses_waddch ncurses_waddstr ncurses_wattroff ncurses_wattron ncurses_wattrset ncurses_wborder ncurses_wclear ncurses_wcolor_set ncurses_werase ncurses_wgetch ncurses_whline ncurses_wmouse_trafo ncurses_wmove ncurses_wnoutrefresh ncurses_wrefresh ncurses_wstandend ncurses_wstandout ncurses_wvline ncurses_addch) b['Gopher'] = Set.new %w(gopher_parsedir gopher_parsedir gopher_parsedir) b['Network'] = Set.new %w(checkdnsrr checkdnsrr closelog define_syslog_variables dns_check_record dns_get_mx dns_get_record fsockopen gethostbyaddr gethostbyname gethostbynamel gethostname getmxrr getprotobyname getprotobynumber getservbyname getservbyport header_register_callback header_remove header headers_list headers_sent http_response_code inet_ntop inet_pton ip2long long2ip openlog pfsockopen setcookie setrawcookie socket_get_status socket_set_blocking socket_set_timeout syslog checkdnsrr) b['Newt'] = Set.new %w(newt_bell newt_bell newt_button_bar newt_button newt_centered_window newt_checkbox_get_value newt_checkbox_set_flags newt_checkbox_set_value newt_checkbox_tree_add_item newt_checkbox_tree_find_item newt_checkbox_tree_get_current newt_checkbox_tree_get_entry_value newt_checkbox_tree_get_multi_selection newt_checkbox_tree_get_selection newt_checkbox_tree_multi newt_checkbox_tree_set_current newt_checkbox_tree_set_entry_value newt_checkbox_tree_set_entry newt_checkbox_tree_set_width newt_checkbox_tree newt_checkbox newt_clear_key_buffer newt_cls newt_compact_button newt_component_add_callback newt_component_takes_focus newt_create_grid newt_cursor_off newt_cursor_on newt_delay newt_draw_form newt_draw_root_text newt_entry_get_value newt_entry_set_filter newt_entry_set_flags newt_entry_set newt_entry newt_finished newt_form_add_component newt_form_add_components newt_form_add_hot_key newt_form_destroy newt_form_get_current newt_form_run newt_form_set_background newt_form_set_height newt_form_set_size newt_form_set_timer newt_form_set_width newt_form_watch_fd newt_form newt_get_screen_size newt_grid_add_components_to_form newt_grid_basic_window newt_grid_free newt_grid_get_size newt_grid_h_close_stacked newt_grid_h_stacked newt_grid_place newt_grid_set_field newt_grid_simple_window newt_grid_v_close_stacked newt_grid_v_stacked newt_grid_wrapped_window_at newt_grid_wrapped_window newt_init newt_label_set_text newt_label newt_listbox_append_entry newt_listbox_clear_selection newt_listbox_clear newt_listbox_delete_entry newt_listbox_get_current newt_listbox_get_selection newt_listbox_insert_entry newt_listbox_item_count newt_listbox_select_item newt_listbox_set_current_by_key newt_listbox_set_current newt_listbox_set_data newt_listbox_set_entry newt_listbox_set_width newt_listbox newt_listitem_get_data newt_listitem_set newt_listitem newt_open_window newt_pop_help_line newt_pop_window newt_push_help_line newt_radio_get_current newt_radiobutton newt_redraw_help_line newt_reflow_text newt_refresh newt_resize_screen newt_resume newt_run_form newt_scale_set newt_scale newt_scrollbar_set newt_set_help_callback newt_set_suspend_callback newt_suspend newt_textbox_get_num_lines newt_textbox_reflowed newt_textbox_set_height newt_textbox_set_text newt_textbox newt_vertical_scrollbar newt_wait_for_key newt_win_choice newt_win_entries newt_win_menu newt_win_message newt_win_messagev newt_win_ternary newt_bell) b['YP/NIS'] = Set.new %w(yp_all yp_all yp_cat yp_err_string yp_errno yp_first yp_get_default_domain yp_master yp_match yp_next yp_order yp_all) b['NSAPI'] = Set.new %w(nsapi_request_headers nsapi_request_headers nsapi_response_headers nsapi_virtual nsapi_request_headers) b['OAuth'] = Set.new %w(oauth_get_sbs oauth_get_sbs oauth_urlencode oauth_get_sbs) b['OCI8'] = Set.new %w(oci_bind_array_by_name oci_bind_array_by_name oci_bind_by_name oci_cancel oci_client_version oci_close oci_commit oci_connect oci_define_by_name oci_error oci_execute oci_fetch_all oci_fetch_array oci_fetch_assoc oci_fetch_object oci_fetch_row oci_fetch oci_field_is_null oci_field_name oci_field_precision oci_field_scale oci_field_size oci_field_type_raw oci_field_type oci_free_descriptor oci_free_statement oci_get_implicit_resultset oci_internal_debug oci_lob_copy oci_lob_is_equal oci_new_collection oci_new_connect oci_new_cursor oci_new_descriptor oci_num_fields oci_num_rows oci_parse oci_password_change oci_pconnect oci_result oci_rollback oci_server_version oci_set_action oci_set_client_identifier oci_set_client_info oci_set_edition oci_set_module_name oci_set_prefetch oci_statement_type oci_bind_array_by_name) b['OPcache'] = Set.new %w(opcache_compile_file opcache_compile_file opcache_get_configuration opcache_get_status opcache_invalidate opcache_reset opcache_compile_file) b['OpenAL'] = Set.new %w(openal_buffer_create openal_buffer_create openal_buffer_data openal_buffer_destroy openal_buffer_get openal_buffer_loadwav openal_context_create openal_context_current openal_context_destroy openal_context_process openal_context_suspend openal_device_close openal_device_open openal_listener_get openal_listener_set openal_source_create openal_source_destroy openal_source_get openal_source_pause openal_source_play openal_source_rewind openal_source_set openal_source_stop openal_stream openal_buffer_create) b['OpenSSL'] = Set.new %w(openssl_cipher_iv_length openssl_cipher_iv_length openssl_csr_export_to_file openssl_csr_export openssl_csr_get_public_key openssl_csr_get_subject openssl_csr_new openssl_csr_sign openssl_decrypt openssl_dh_compute_key openssl_digest openssl_encrypt openssl_error_string openssl_free_key openssl_get_cert_locations openssl_get_cipher_methods openssl_get_md_methods openssl_get_privatekey openssl_get_publickey openssl_open openssl_pbkdf2 openssl_pkcs12_export_to_file openssl_pkcs12_export openssl_pkcs12_read openssl_pkcs7_decrypt openssl_pkcs7_encrypt openssl_pkcs7_sign openssl_pkcs7_verify openssl_pkey_export_to_file openssl_pkey_export openssl_pkey_free openssl_pkey_get_details openssl_pkey_get_private openssl_pkey_get_public openssl_pkey_new openssl_private_decrypt openssl_private_encrypt openssl_public_decrypt openssl_public_encrypt openssl_random_pseudo_bytes openssl_seal openssl_sign openssl_spki_export_challenge openssl_spki_export openssl_spki_new openssl_spki_verify openssl_verify openssl_x509_check_private_key openssl_x509_checkpurpose openssl_x509_export_to_file openssl_x509_export openssl_x509_fingerprint openssl_x509_free openssl_x509_parse openssl_x509_read openssl_cipher_iv_length) b['Output Control'] = Set.new %w(flush flush ob_clean ob_end_clean ob_end_flush ob_flush ob_get_clean ob_get_contents ob_get_flush ob_get_length ob_get_level ob_get_status ob_gzhandler ob_implicit_flush ob_list_handlers ob_start output_add_rewrite_var output_reset_rewrite_vars flush) b['Paradox'] = Set.new %w(px_close px_close px_create_fp px_date2string px_delete_record px_delete px_get_field px_get_info px_get_parameter px_get_record px_get_schema px_get_value px_insert_record px_new px_numfields px_numrecords px_open_fp px_put_record px_retrieve_record px_set_blob_file px_set_parameter px_set_tablename px_set_targetencoding px_set_value px_timestamp2string px_update_record px_close) b['Parsekit'] = Set.new %w(parsekit_compile_file parsekit_compile_file parsekit_compile_string parsekit_func_arginfo parsekit_compile_file) b['Password Hashing'] = Set.new %w(password_get_info password_get_info password_hash password_needs_rehash password_verify password_get_info) b['PCNTL'] = Set.new %w(pcntl_alarm pcntl_alarm pcntl_errno pcntl_exec pcntl_fork pcntl_get_last_error pcntl_getpriority pcntl_setpriority pcntl_signal_dispatch pcntl_signal pcntl_sigprocmask pcntl_sigtimedwait pcntl_sigwaitinfo pcntl_strerror pcntl_wait pcntl_waitpid pcntl_wexitstatus pcntl_wifexited pcntl_wifsignaled pcntl_wifstopped pcntl_wstopsig pcntl_wtermsig pcntl_alarm) b['PCRE'] = Set.new %w(preg_filter preg_filter preg_grep preg_last_error preg_match_all preg_match preg_quote preg_replace_callback preg_replace preg_split preg_filter) b['PDF'] = Set.new %w(PDF_activate_item PDF_activate_item PDF_add_annotation PDF_add_bookmark PDF_add_launchlink PDF_add_locallink PDF_add_nameddest PDF_add_note PDF_add_outline PDF_add_pdflink PDF_add_table_cell PDF_add_textflow PDF_add_thumbnail PDF_add_weblink PDF_arc PDF_arcn PDF_attach_file PDF_begin_document PDF_begin_font PDF_begin_glyph PDF_begin_item PDF_begin_layer PDF_begin_page_ext PDF_begin_page PDF_begin_pattern PDF_begin_template_ext PDF_begin_template PDF_circle PDF_clip PDF_close_image PDF_close_pdi_page PDF_close_pdi PDF_close PDF_closepath_fill_stroke PDF_closepath_stroke PDF_closepath PDF_concat PDF_continue_text PDF_create_3dview PDF_create_action PDF_create_annotation PDF_create_bookmark PDF_create_field PDF_create_fieldgroup PDF_create_gstate PDF_create_pvf PDF_create_textflow PDF_curveto PDF_define_layer PDF_delete_pvf PDF_delete_table PDF_delete_textflow PDF_delete PDF_encoding_set_char PDF_end_document PDF_end_font PDF_end_glyph PDF_end_item PDF_end_layer PDF_end_page_ext PDF_end_page PDF_end_pattern PDF_end_template PDF_endpath PDF_fill_imageblock PDF_fill_pdfblock PDF_fill_stroke PDF_fill_textblock PDF_fill PDF_findfont PDF_fit_image PDF_fit_pdi_page PDF_fit_table PDF_fit_textflow PDF_fit_textline PDF_get_apiname PDF_get_buffer PDF_get_errmsg PDF_get_errnum PDF_get_font PDF_get_fontname PDF_get_fontsize PDF_get_image_height PDF_get_image_width PDF_get_majorversion PDF_get_minorversion PDF_get_parameter PDF_get_pdi_parameter PDF_get_pdi_value PDF_get_value PDF_info_font PDF_info_matchbox PDF_info_table PDF_info_textflow PDF_info_textline PDF_initgraphics PDF_lineto PDF_load_3ddata PDF_load_font PDF_load_iccprofile PDF_load_image PDF_makespotcolor PDF_moveto PDF_new PDF_open_ccitt PDF_open_file PDF_open_gif PDF_open_image_file PDF_open_image PDF_open_jpeg PDF_open_memory_image PDF_open_pdi_document PDF_open_pdi_page PDF_open_pdi PDF_open_tiff PDF_pcos_get_number PDF_pcos_get_stream PDF_pcos_get_string PDF_place_image PDF_place_pdi_page PDF_process_pdi PDF_rect PDF_restore PDF_resume_page PDF_rotate PDF_save PDF_scale PDF_set_border_color PDF_set_border_dash PDF_set_border_style PDF_set_char_spacing PDF_set_duration PDF_set_gstate PDF_set_horiz_scaling PDF_set_info_author PDF_set_info_creator PDF_set_info_keywords PDF_set_info_subject PDF_set_info_title PDF_set_info PDF_set_layer_dependency PDF_set_leading PDF_set_parameter PDF_set_text_matrix PDF_set_text_pos PDF_set_text_rendering PDF_set_text_rise PDF_set_value PDF_set_word_spacing PDF_setcolor PDF_setdash PDF_setdashpattern PDF_setflat PDF_setfont PDF_setgray_fill PDF_setgray_stroke PDF_setgray PDF_setlinecap PDF_setlinejoin PDF_setlinewidth PDF_setmatrix PDF_setmiterlimit PDF_setpolydash PDF_setrgbcolor_fill PDF_setrgbcolor_stroke PDF_setrgbcolor PDF_shading_pattern PDF_shading PDF_shfill PDF_show_boxed PDF_show_xy PDF_show PDF_skew PDF_stringwidth PDF_stroke PDF_suspend_page PDF_translate PDF_utf16_to_utf8 PDF_utf32_to_utf16 PDF_utf8_to_utf16 PDF_activate_item) b['PostgreSQL'] = Set.new %w(pg_affected_rows pg_affected_rows pg_cancel_query pg_client_encoding pg_close pg_connect_poll pg_connect pg_connection_busy pg_connection_reset pg_connection_status pg_consume_input pg_convert pg_copy_from pg_copy_to pg_dbname pg_delete pg_end_copy pg_escape_bytea pg_escape_identifier pg_escape_literal pg_escape_string pg_execute pg_fetch_all_columns pg_fetch_all pg_fetch_array pg_fetch_assoc pg_fetch_object pg_fetch_result pg_fetch_row pg_field_is_null pg_field_name pg_field_num pg_field_prtlen pg_field_size pg_field_table pg_field_type_oid pg_field_type pg_flush pg_free_result pg_get_notify pg_get_pid pg_get_result pg_host pg_insert pg_last_error pg_last_notice pg_last_oid pg_lo_close pg_lo_create pg_lo_export pg_lo_import pg_lo_open pg_lo_read_all pg_lo_read pg_lo_seek pg_lo_tell pg_lo_truncate pg_lo_unlink pg_lo_write pg_meta_data pg_num_fields pg_num_rows pg_options pg_parameter_status pg_pconnect pg_ping pg_port pg_prepare pg_put_line pg_query_params pg_query pg_result_error_field pg_result_error pg_result_seek pg_result_status pg_select pg_send_execute pg_send_prepare pg_send_query_params pg_send_query pg_set_client_encoding pg_set_error_verbosity pg_socket pg_trace pg_transaction_status pg_tty pg_unescape_bytea pg_untrace pg_update pg_version pg_affected_rows) b['POSIX'] = Set.new %w(posix_access posix_access posix_ctermid posix_errno posix_get_last_error posix_getcwd posix_getegid posix_geteuid posix_getgid posix_getgrgid posix_getgrnam posix_getgroups posix_getlogin posix_getpgid posix_getpgrp posix_getpid posix_getppid posix_getpwnam posix_getpwuid posix_getrlimit posix_getsid posix_getuid posix_initgroups posix_isatty posix_kill posix_mkfifo posix_mknod posix_setegid posix_seteuid posix_setgid posix_setpgid posix_setsid posix_setuid posix_strerror posix_times posix_ttyname posix_uname posix_access) b['Proctitle'] = Set.new %w(setproctitle setproctitle setthreadtitle setproctitle) b['PS'] = Set.new %w(ps_add_bookmark ps_add_bookmark ps_add_launchlink ps_add_locallink ps_add_note ps_add_pdflink ps_add_weblink ps_arc ps_arcn ps_begin_page ps_begin_pattern ps_begin_template ps_circle ps_clip ps_close_image ps_close ps_closepath_stroke ps_closepath ps_continue_text ps_curveto ps_delete ps_end_page ps_end_pattern ps_end_template ps_fill_stroke ps_fill ps_findfont ps_get_buffer ps_get_parameter ps_get_value ps_hyphenate ps_include_file ps_lineto ps_makespotcolor ps_moveto ps_new ps_open_file ps_open_image_file ps_open_image ps_open_memory_image ps_place_image ps_rect ps_restore ps_rotate ps_save ps_scale ps_set_border_color ps_set_border_dash ps_set_border_style ps_set_info ps_set_parameter ps_set_text_pos ps_set_value ps_setcolor ps_setdash ps_setflat ps_setfont ps_setgray ps_setlinecap ps_setlinejoin ps_setlinewidth ps_setmiterlimit ps_setoverprintmode ps_setpolydash ps_shading_pattern ps_shading ps_shfill ps_show_boxed ps_show_xy2 ps_show_xy ps_show2 ps_show ps_string_geometry ps_stringwidth ps_stroke ps_symbol_name ps_symbol_width ps_symbol ps_translate ps_add_bookmark) b['Pspell'] = Set.new %w(pspell_add_to_personal pspell_add_to_personal pspell_add_to_session pspell_check pspell_clear_session pspell_config_create pspell_config_data_dir pspell_config_dict_dir pspell_config_ignore pspell_config_mode pspell_config_personal pspell_config_repl pspell_config_runtogether pspell_config_save_repl pspell_new_config pspell_new_personal pspell_new pspell_save_wordlist pspell_store_replacement pspell_suggest pspell_add_to_personal) b['Radius'] = Set.new %w(radius_acct_open radius_acct_open radius_add_server radius_auth_open radius_close radius_config radius_create_request radius_cvt_addr radius_cvt_int radius_cvt_string radius_demangle_mppe_key radius_demangle radius_get_attr radius_get_tagged_attr_data radius_get_tagged_attr_tag radius_get_vendor_attr radius_put_addr radius_put_attr radius_put_int radius_put_string radius_put_vendor_addr radius_put_vendor_attr radius_put_vendor_int radius_put_vendor_string radius_request_authenticator radius_salt_encrypt_attr radius_send_request radius_server_secret radius_strerror radius_acct_open) b['Rar'] = Set.new %w(rar_wrapper_cache_stats rar_wrapper_cache_stats rar_wrapper_cache_stats) b['Readline'] = Set.new %w(readline_add_history readline_add_history readline_callback_handler_install readline_callback_handler_remove readline_callback_read_char readline_clear_history readline_completion_function readline_info readline_list_history readline_on_new_line readline_read_history readline_redisplay readline_write_history readline readline_add_history) b['Recode'] = Set.new %w(recode_file recode_file recode_string recode recode_file) b['POSIX Regex'] = Set.new %w(ereg_replace ereg_replace ereg eregi_replace eregi split spliti sql_regcase ereg_replace) b['RPM Reader'] = Set.new %w(rpm_close rpm_close rpm_get_tag rpm_is_valid rpm_open rpm_version rpm_close) b['RRD'] = Set.new %w(rrd_create rrd_create rrd_error rrd_fetch rrd_first rrd_graph rrd_info rrd_last rrd_lastupdate rrd_restore rrd_tune rrd_update rrd_version rrd_xport rrdc_disconnect rrd_create) b['runkit'] = Set.new %w(runkit_class_adopt runkit_class_emancipate runkit_constant_add runkit_constant_redefine runkit_constant_remove runkit_function_add runkit_function_copy runkit_function_redefine runkit_function_remove runkit_function_rename runkit_import runkit_lint_file runkit_lint runkit_method_add runkit_method_copy runkit_method_redefine runkit_method_remove runkit_method_rename runkit_return_value_used runkit_sandbox_output_handler runkit_superglobals) b['SAM'] = Set.new %w() b['SCA'] = Set.new %w() b['SDO DAS XML'] = Set.new %w() b['SDO'] = Set.new %w() b['SDO-DAS-Relational'] = Set.new %w() b['Semaphore'] = Set.new %w(ftok ftok msg_get_queue msg_queue_exists msg_receive msg_remove_queue msg_send msg_set_queue msg_stat_queue sem_acquire sem_get sem_release sem_remove shm_attach shm_detach shm_get_var shm_has_var shm_put_var shm_remove_var shm_remove ftok) b['Session PgSQL'] = Set.new %w(session_pgsql_add_error session_pgsql_add_error session_pgsql_get_error session_pgsql_get_field session_pgsql_reset session_pgsql_set_field session_pgsql_status session_pgsql_add_error) b['Session'] = Set.new %w(session_abort session_abort session_cache_expire session_cache_limiter session_commit session_decode session_destroy session_encode session_get_cookie_params session_id session_is_registered session_module_name session_name session_regenerate_id session_register_shutdown session_register session_reset session_save_path session_set_cookie_params session_set_save_handler session_start session_status session_unregister session_unset session_write_close session_abort) b['Shared Memory'] = Set.new %w(shmop_close shmop_close shmop_delete shmop_open shmop_read shmop_size shmop_write shmop_close) b['SimpleXML'] = Set.new %w(simplexml_import_dom simplexml_import_dom simplexml_load_file simplexml_load_string simplexml_import_dom) b['SNMP'] = Set.new %w(snmp_get_quick_print snmp_get_quick_print snmp_get_valueretrieval snmp_read_mib snmp_set_enum_print snmp_set_oid_numeric_print snmp_set_oid_output_format snmp_set_quick_print snmp_set_valueretrieval snmp2_get snmp2_getnext snmp2_real_walk snmp2_set snmp2_walk snmp3_get snmp3_getnext snmp3_real_walk snmp3_set snmp3_walk snmpget snmpgetnext snmprealwalk snmpset snmpwalk snmpwalkoid snmp_get_quick_print) b['SOAP'] = Set.new %w(is_soap_fault is_soap_fault use_soap_error_handler is_soap_fault) b['Socket'] = Set.new %w(socket_accept socket_accept socket_bind socket_clear_error socket_close socket_cmsg_space socket_connect socket_create_listen socket_create_pair socket_create socket_get_option socket_getpeername socket_getsockname socket_import_stream socket_last_error socket_listen socket_read socket_recv socket_recvfrom socket_recvmsg socket_select socket_send socket_sendmsg socket_sendto socket_set_block socket_set_nonblock socket_set_option socket_shutdown socket_strerror socket_write socket_accept) b['Solr'] = Set.new %w(solr_get_version solr_get_version solr_get_version) b['SPL'] = Set.new %w(class_implements class_implements class_parents class_uses iterator_apply iterator_count iterator_to_array spl_autoload_call spl_autoload_extensions spl_autoload_functions spl_autoload_register spl_autoload_unregister spl_autoload spl_classes spl_object_hash class_implements) b['SPPLUS'] = Set.new %w(calcul_hmac calcul_hmac calculhmac nthmac signeurlpaiement calcul_hmac) b['SQLite'] = Set.new %w(sqlite_array_query sqlite_array_query sqlite_busy_timeout sqlite_changes sqlite_close sqlite_column sqlite_create_aggregate sqlite_create_function sqlite_current sqlite_error_string sqlite_escape_string sqlite_exec sqlite_factory sqlite_fetch_all sqlite_fetch_array sqlite_fetch_column_types sqlite_fetch_object sqlite_fetch_single sqlite_fetch_string sqlite_field_name sqlite_has_more sqlite_has_prev sqlite_key sqlite_last_error sqlite_last_insert_rowid sqlite_libencoding sqlite_libversion sqlite_next sqlite_num_fields sqlite_num_rows sqlite_open sqlite_popen sqlite_prev sqlite_query sqlite_rewind sqlite_seek sqlite_single_query sqlite_udf_decode_binary sqlite_udf_encode_binary sqlite_unbuffered_query sqlite_valid sqlite_array_query) b['SQLSRV'] = Set.new %w(sqlsrv_begin_transaction sqlsrv_begin_transaction sqlsrv_cancel sqlsrv_client_info sqlsrv_close sqlsrv_commit sqlsrv_configure sqlsrv_connect sqlsrv_errors sqlsrv_execute sqlsrv_fetch_array sqlsrv_fetch_object sqlsrv_fetch sqlsrv_field_metadata sqlsrv_free_stmt sqlsrv_get_config sqlsrv_get_field sqlsrv_has_rows sqlsrv_next_result sqlsrv_num_fields sqlsrv_num_rows sqlsrv_prepare sqlsrv_query sqlsrv_rollback sqlsrv_rows_affected sqlsrv_send_stream_data sqlsrv_server_info sqlsrv_begin_transaction) b['ssdeep'] = Set.new %w(ssdeep_fuzzy_compare ssdeep_fuzzy_compare ssdeep_fuzzy_hash_filename ssdeep_fuzzy_hash ssdeep_fuzzy_compare) b['SSH2'] = Set.new %w(ssh2_auth_agent ssh2_auth_agent ssh2_auth_hostbased_file ssh2_auth_none ssh2_auth_password ssh2_auth_pubkey_file ssh2_connect ssh2_exec ssh2_fetch_stream ssh2_fingerprint ssh2_methods_negotiated ssh2_publickey_add ssh2_publickey_init ssh2_publickey_list ssh2_publickey_remove ssh2_scp_recv ssh2_scp_send ssh2_sftp_chmod ssh2_sftp_lstat ssh2_sftp_mkdir ssh2_sftp_readlink ssh2_sftp_realpath ssh2_sftp_rename ssh2_sftp_rmdir ssh2_sftp_stat ssh2_sftp_symlink ssh2_sftp_unlink ssh2_sftp ssh2_shell ssh2_tunnel ssh2_auth_agent) b['Statistic'] = Set.new %w(stats_absolute_deviation stats_absolute_deviation stats_cdf_beta stats_cdf_binomial stats_cdf_cauchy stats_cdf_chisquare stats_cdf_exponential stats_cdf_f stats_cdf_gamma stats_cdf_laplace stats_cdf_logistic stats_cdf_negative_binomial stats_cdf_noncentral_chisquare stats_cdf_noncentral_f stats_cdf_poisson stats_cdf_t stats_cdf_uniform stats_cdf_weibull stats_covariance stats_den_uniform stats_dens_beta stats_dens_cauchy stats_dens_chisquare stats_dens_exponential stats_dens_f stats_dens_gamma stats_dens_laplace stats_dens_logistic stats_dens_negative_binomial stats_dens_normal stats_dens_pmf_binomial stats_dens_pmf_hypergeometric stats_dens_pmf_poisson stats_dens_t stats_dens_weibull stats_harmonic_mean stats_kurtosis stats_rand_gen_beta stats_rand_gen_chisquare stats_rand_gen_exponential stats_rand_gen_f stats_rand_gen_funiform stats_rand_gen_gamma stats_rand_gen_ibinomial_negative stats_rand_gen_ibinomial stats_rand_gen_int stats_rand_gen_ipoisson stats_rand_gen_iuniform stats_rand_gen_noncenral_chisquare stats_rand_gen_noncentral_f stats_rand_gen_noncentral_t stats_rand_gen_normal stats_rand_gen_t stats_rand_get_seeds stats_rand_phrase_to_seeds stats_rand_ranf stats_rand_setall stats_skew stats_standard_deviation stats_stat_binomial_coef stats_stat_correlation stats_stat_gennch stats_stat_independent_t stats_stat_innerproduct stats_stat_noncentral_t stats_stat_paired_t stats_stat_percentile stats_stat_powersum stats_variance stats_absolute_deviation) b['Stomp'] = Set.new %w(stomp_connect_error stomp_connect_error stomp_version stomp_connect_error) b['Stream'] = Set.new %w(set_socket_blocking set_socket_blocking stream_bucket_append stream_bucket_make_writeable stream_bucket_new stream_bucket_prepend stream_context_create stream_context_get_default stream_context_get_options stream_context_get_params stream_context_set_default stream_context_set_option stream_context_set_params stream_copy_to_stream stream_encoding stream_filter_append stream_filter_prepend stream_filter_register stream_filter_remove stream_get_contents stream_get_filters stream_get_line stream_get_meta_data stream_get_transports stream_get_wrappers stream_is_local stream_notification_callback stream_register_wrapper stream_resolve_include_path stream_select stream_set_blocking stream_set_chunk_size stream_set_read_buffer stream_set_timeout stream_set_write_buffer stream_socket_accept stream_socket_client stream_socket_enable_crypto stream_socket_get_name stream_socket_pair stream_socket_recvfrom stream_socket_sendto stream_socket_server stream_socket_shutdown stream_supports_lock stream_wrapper_register stream_wrapper_restore stream_wrapper_unregister set_socket_blocking) b['String'] = Set.new %w(addcslashes addcslashes addslashes bin2hex chop chr chunk_split convert_cyr_string convert_uudecode convert_uuencode count_chars crc32 crypt echo explode fprintf get_html_translation_table hebrev hebrevc hex2bin html_entity_decode htmlentities htmlspecialchars_decode htmlspecialchars implode join lcfirst levenshtein localeconv ltrim md5_file md5 metaphone money_format nl_langinfo nl2br number_format ord parse_str print printf quoted_printable_decode quoted_printable_encode quotemeta rtrim setlocale sha1_file sha1 similar_text soundex sprintf sscanf str_getcsv str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn strip_tags stripcslashes stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk strpos strrchr strrev strripos strrpos strspn strstr strtok strtolower strtoupper strtr substr_compare substr_count substr_replace substr trim ucfirst ucwords vfprintf vprintf vsprintf wordwrap addcslashes) b['SVN'] = Set.new %w(svn_add svn_add svn_auth_get_parameter svn_auth_set_parameter svn_blame svn_cat svn_checkout svn_cleanup svn_client_version svn_commit svn_delete svn_diff svn_export svn_fs_abort_txn svn_fs_apply_text svn_fs_begin_txn2 svn_fs_change_node_prop svn_fs_check_path svn_fs_contents_changed svn_fs_copy svn_fs_delete svn_fs_dir_entries svn_fs_file_contents svn_fs_file_length svn_fs_is_dir svn_fs_is_file svn_fs_make_dir svn_fs_make_file svn_fs_node_created_rev svn_fs_node_prop svn_fs_props_changed svn_fs_revision_prop svn_fs_revision_root svn_fs_txn_root svn_fs_youngest_rev svn_import svn_log svn_ls svn_mkdir svn_repos_create svn_repos_fs_begin_txn_for_commit svn_repos_fs_commit_txn svn_repos_fs svn_repos_hotcopy svn_repos_open svn_repos_recover svn_revert svn_status svn_update svn_add) b['Swish'] = Set.new %w() b['Sybase'] = Set.new %w(sybase_affected_rows sybase_affected_rows sybase_close sybase_connect sybase_data_seek sybase_deadlock_retry_count sybase_fetch_array sybase_fetch_assoc sybase_fetch_field sybase_fetch_object sybase_fetch_row sybase_field_seek sybase_free_result sybase_get_last_message sybase_min_client_severity sybase_min_error_severity sybase_min_message_severity sybase_min_server_severity sybase_num_fields sybase_num_rows sybase_pconnect sybase_query sybase_result sybase_select_db sybase_set_message_handler sybase_unbuffered_query sybase_affected_rows) b['Taint'] = Set.new %w(is_tainted is_tainted taint untaint is_tainted) b['TCP'] = Set.new %w(tcpwrap_check tcpwrap_check tcpwrap_check) b['Tidy'] = Set.new %w(ob_tidyhandler ob_tidyhandler tidy_access_count tidy_config_count tidy_error_count tidy_get_output tidy_load_config tidy_reset_config tidy_save_config tidy_set_encoding tidy_setopt tidy_warning_count ob_tidyhandler) b['Tokenizer'] = Set.new %w(token_get_all token_get_all token_name token_get_all) b['Trader'] = Set.new %w(trader_acos trader_acos trader_ad trader_add trader_adosc trader_adx trader_adxr trader_apo trader_aroon trader_aroonosc trader_asin trader_atan trader_atr trader_avgprice trader_bbands trader_beta trader_bop trader_cci trader_cdl2crows trader_cdl3blackcrows trader_cdl3inside trader_cdl3linestrike trader_cdl3outside trader_cdl3starsinsouth trader_cdl3whitesoldiers trader_cdlabandonedbaby trader_cdladvanceblock trader_cdlbelthold trader_cdlbreakaway trader_cdlclosingmarubozu trader_cdlconcealbabyswall trader_cdlcounterattack trader_cdldarkcloudcover trader_cdldoji trader_cdldojistar trader_cdldragonflydoji trader_cdlengulfing trader_cdleveningdojistar trader_cdleveningstar trader_cdlgapsidesidewhite trader_cdlgravestonedoji trader_cdlhammer trader_cdlhangingman trader_cdlharami trader_cdlharamicross trader_cdlhighwave trader_cdlhikkake trader_cdlhikkakemod trader_cdlhomingpigeon trader_cdlidentical3crows trader_cdlinneck trader_cdlinvertedhammer trader_cdlkicking trader_cdlkickingbylength trader_cdlladderbottom trader_cdllongleggeddoji trader_cdllongline trader_cdlmarubozu trader_cdlmatchinglow trader_cdlmathold trader_cdlmorningdojistar trader_cdlmorningstar trader_cdlonneck trader_cdlpiercing trader_cdlrickshawman trader_cdlrisefall3methods trader_cdlseparatinglines trader_cdlshootingstar trader_cdlshortline trader_cdlspinningtop trader_cdlstalledpattern trader_cdlsticksandwich trader_cdltakuri trader_cdltasukigap trader_cdlthrusting trader_cdltristar trader_cdlunique3river trader_cdlupsidegap2crows trader_cdlxsidegap3methods trader_ceil trader_cmo trader_correl trader_cos trader_cosh trader_dema trader_div trader_dx trader_ema trader_errno trader_exp trader_floor trader_get_compat trader_get_unstable_period trader_ht_dcperiod trader_ht_dcphase trader_ht_phasor trader_ht_sine trader_ht_trendline trader_ht_trendmode trader_kama trader_linearreg_angle trader_linearreg_intercept trader_linearreg_slope trader_linearreg trader_ln trader_log10 trader_ma trader_macd trader_macdext trader_macdfix trader_mama trader_mavp trader_max trader_maxindex trader_medprice trader_mfi trader_midpoint trader_midprice trader_min trader_minindex trader_minmax trader_minmaxindex trader_minus_di trader_minus_dm trader_mom trader_mult trader_natr trader_obv trader_plus_di trader_plus_dm trader_ppo trader_roc trader_rocp trader_rocr100 trader_rocr trader_rsi trader_sar trader_sarext trader_set_compat trader_set_unstable_period trader_sin trader_sinh trader_sma trader_sqrt trader_stddev trader_stoch trader_stochf trader_stochrsi trader_sub trader_sum trader_t3 trader_tan trader_tanh trader_tema trader_trange trader_trima trader_trix trader_tsf trader_typprice trader_ultosc trader_var trader_wclprice trader_willr trader_wma trader_acos) b['ODBC'] = Set.new %w(odbc_autocommit odbc_autocommit odbc_binmode odbc_close_all odbc_close odbc_columnprivileges odbc_columns odbc_commit odbc_connect odbc_cursor odbc_data_source odbc_do odbc_error odbc_errormsg odbc_exec odbc_execute odbc_fetch_array odbc_fetch_into odbc_fetch_object odbc_fetch_row odbc_field_len odbc_field_name odbc_field_num odbc_field_precision odbc_field_scale odbc_field_type odbc_foreignkeys odbc_free_result odbc_gettypeinfo odbc_longreadlen odbc_next_result odbc_num_fields odbc_num_rows odbc_pconnect odbc_prepare odbc_primarykeys odbc_procedurecolumns odbc_procedures odbc_result_all odbc_result odbc_rollback odbc_setoption odbc_specialcolumns odbc_statistics odbc_tableprivileges odbc_tables odbc_autocommit) b['Uopz'] = Set.new %w(uopz_backup uopz_backup uopz_compose uopz_copy uopz_delete uopz_extend uopz_flags uopz_function uopz_implement uopz_overload uopz_redefine uopz_rename uopz_restore uopz_undefine uopz_backup) b['URL'] = Set.new %w(base64_decode base64_decode base64_encode get_headers get_meta_tags http_build_query parse_url rawurldecode rawurlencode urldecode urlencode base64_decode) b['Variable handling'] = Set.new %w(boolval boolval debug_zval_dump doubleval empty floatval get_defined_vars get_resource_type gettype import_request_variables intval is_array is_bool is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string isset print_r serialize settype strval unserialize unset var_dump var_export boolval) b['vpopmail'] = Set.new %w(vpopmail_add_alias_domain_ex vpopmail_add_alias_domain_ex vpopmail_add_alias_domain vpopmail_add_domain_ex vpopmail_add_domain vpopmail_add_user vpopmail_alias_add vpopmail_alias_del_domain vpopmail_alias_del vpopmail_alias_get_all vpopmail_alias_get vpopmail_auth_user vpopmail_del_domain_ex vpopmail_del_domain vpopmail_del_user vpopmail_error vpopmail_passwd vpopmail_set_user_quota vpopmail_add_alias_domain_ex) b['WDDX'] = Set.new %w(wddx_add_vars wddx_add_vars wddx_deserialize wddx_packet_end wddx_packet_start wddx_serialize_value wddx_serialize_vars wddx_add_vars) b['win32ps'] = Set.new %w(win32_ps_list_procs win32_ps_list_procs win32_ps_stat_mem win32_ps_stat_proc win32_ps_list_procs) b['win32service'] = Set.new %w(win32_continue_service win32_continue_service win32_create_service win32_delete_service win32_get_last_control_message win32_pause_service win32_query_service_status win32_set_service_status win32_start_service_ctrl_dispatcher win32_start_service win32_stop_service win32_continue_service) b['WinCache'] = Set.new %w(wincache_fcache_fileinfo wincache_fcache_fileinfo wincache_fcache_meminfo wincache_lock wincache_ocache_fileinfo wincache_ocache_meminfo wincache_refresh_if_changed wincache_rplist_fileinfo wincache_rplist_meminfo wincache_scache_info wincache_scache_meminfo wincache_ucache_add wincache_ucache_cas wincache_ucache_clear wincache_ucache_dec wincache_ucache_delete wincache_ucache_exists wincache_ucache_get wincache_ucache_inc wincache_ucache_info wincache_ucache_meminfo wincache_ucache_set wincache_unlock wincache_fcache_fileinfo) b['xattr'] = Set.new %w(xattr_get xattr_get xattr_list xattr_remove xattr_set xattr_supported xattr_get) b['xdiff'] = Set.new %w(xdiff_file_bdiff_size xdiff_file_bdiff_size xdiff_file_bdiff xdiff_file_bpatch xdiff_file_diff_binary xdiff_file_diff xdiff_file_merge3 xdiff_file_patch_binary xdiff_file_patch xdiff_file_rabdiff xdiff_string_bdiff_size xdiff_string_bdiff xdiff_string_bpatch xdiff_string_diff_binary xdiff_string_diff xdiff_string_merge3 xdiff_string_patch_binary xdiff_string_patch xdiff_string_rabdiff xdiff_file_bdiff_size) b['Xhprof'] = Set.new %w(xhprof_disable xhprof_disable xhprof_enable xhprof_sample_disable xhprof_sample_enable xhprof_disable) b['XML Parser'] = Set.new %w(utf8_decode utf8_decode utf8_encode xml_error_string xml_get_current_byte_index xml_get_current_column_number xml_get_current_line_number xml_get_error_code xml_parse_into_struct xml_parse xml_parser_create_ns xml_parser_create xml_parser_free xml_parser_get_option xml_parser_set_option xml_set_character_data_handler xml_set_default_handler xml_set_element_handler xml_set_end_namespace_decl_handler xml_set_external_entity_ref_handler xml_set_notation_decl_handler xml_set_object xml_set_processing_instruction_handler xml_set_start_namespace_decl_handler xml_set_unparsed_entity_decl_handler utf8_decode) b['XML-RPC'] = Set.new %w(xmlrpc_decode_request xmlrpc_decode_request xmlrpc_decode xmlrpc_encode_request xmlrpc_encode xmlrpc_get_type xmlrpc_is_fault xmlrpc_parse_method_descriptions xmlrpc_server_add_introspection_data xmlrpc_server_call_method xmlrpc_server_create xmlrpc_server_destroy xmlrpc_server_register_introspection_callback xmlrpc_server_register_method xmlrpc_set_type xmlrpc_decode_request) b['XMLWriter'] = Set.new %w(XMLWriter::endAttribute XMLWriter::endAttribute XMLWriter::endCData XMLWriter::endComment XMLWriter::endDocument XMLWriter::endDTDAttlist XMLWriter::endDTDElement XMLWriter::endDTDEntity XMLWriter::endDTD XMLWriter::endElement XMLWriter::endPI XMLWriter::flush XMLWriter::fullEndElement XMLWriter::openMemory XMLWriter::openURI XMLWriter::outputMemory XMLWriter::setIndentString XMLWriter::setIndent XMLWriter::startAttributeNS XMLWriter::startAttribute XMLWriter::startCData XMLWriter::startComment XMLWriter::startDocument XMLWriter::startDTDAttlist XMLWriter::startDTDElement XMLWriter::startDTDEntity XMLWriter::startDTD XMLWriter::startElementNS XMLWriter::startElement XMLWriter::startPI XMLWriter::text XMLWriter::writeAttributeNS XMLWriter::writeAttribute XMLWriter::writeCData XMLWriter::writeComment XMLWriter::writeDTDAttlist XMLWriter::writeDTDElement XMLWriter::writeDTDEntity XMLWriter::writeDTD XMLWriter::writeElementNS XMLWriter::writeElement XMLWriter::writePI XMLWriter::writeRaw XMLWriter::endAttribute) b['Yaml'] = Set.new %w(yaml_emit_file yaml_emit_file yaml_emit yaml_parse_file yaml_parse_url yaml_parse yaml_emit_file) b['YAZ'] = Set.new %w(yaz_addinfo yaz_addinfo yaz_ccl_conf yaz_ccl_parse yaz_close yaz_connect yaz_database yaz_element yaz_errno yaz_error yaz_es_result yaz_es yaz_get_option yaz_hits yaz_itemorder yaz_present yaz_range yaz_record yaz_scan_result yaz_scan yaz_schema yaz_search yaz_set_option yaz_sort yaz_syntax yaz_wait yaz_addinfo) b['Zip'] = Set.new %w(zip_close zip_close zip_entry_close zip_entry_compressedsize zip_entry_compressionmethod zip_entry_filesize zip_entry_name zip_entry_open zip_entry_read zip_open zip_read zip_close) b['Zlib'] = Set.new %w(gzclose gzclose gzcompress gzdecode gzdeflate gzencode gzeof gzfile gzgetc gzgets gzgetss gzinflate gzopen gzpassthru gzputs gzread gzrewind gzseek gztell gzuncompress gzwrite readgzfile zlib_decode zlib_encode zlib_get_coding_type gzclose) end end end end end rugments-1.0.0.beta8/lib/rugments/lexers/toml.rb0000644000076400007640000000277012544707752020651 0ustar pravipravimodule Rugments module Lexers class TOML < RegexLexer title 'TOML' desc 'the TOML configuration format (https://github.com/mojombo/toml)' tag 'toml' filenames '*.toml' mimetypes 'text/x-toml' def self.analyze_text(text) return 0.1 if text =~ /\A\[[\w.]+\]\s*\w+\s*=\s*("\w+")+/ end identifier = /[\w.\S]+/ state :basic do rule /\s+/, Text rule /#.*?$/, Comment rule /(true|false)/, Keyword::Constant rule /(? >= - / /= * + 1- 1+ abort abs acons acos acosh add-method adjoin adjustable-array-p adjust-array allocate-instance alpha-char-p alphanumericp append apply apropos apropos-list aref arithmetic-error-operands arithmetic-error-operation array-dimension array-dimensions array-displacement array-element-type array-has-fill-pointer-p array-in-bounds-p arrayp array-rank array-row-major-index array-total-size ash asin asinh assoc assoc-if assoc-if-not atan atanh atom bit bit-and bit-andc1 bit-andc2 bit-eqv bit-ior bit-nand bit-nor bit-not bit-orc1 bit-orc2 bit-vector-p bit-xor boole both-case-p boundp break broadcast-stream-streams butlast byte byte-position byte-size caaaar caaadr caaar caadar caaddr caadr caar cadaar cadadr cadar caddar cadddr caddr cadr call-next-method car cdaaar cdaadr cdaar cdadar cdaddr cdadr cdar cddaar cddadr cddar cdddar cddddr cdddr cddr cdr ceiling cell-error-name cerror change-class char char< char<= char= char> char>= char/= character characterp char-code char-downcase char-equal char-greaterp char-int char-lessp char-name char-not-equal char-not-greaterp char-not-lessp char-upcase cis class-name class-of clear-input clear-output close clrhash code-char coerce compile compiled-function-p compile-file compile-file-pathname compiler-macro-function complement complex complexp compute-applicable-methods compute-restarts concatenate concatenated-stream-streams conjugate cons consp constantly constantp continue copy-alist copy-list copy-pprint-dispatch copy-readtable copy-seq copy-structure copy-symbol copy-tree cos cosh count count-if count-if-not decode-float decode-universal-time delete delete-duplicates delete-file delete-if delete-if-not delete-package denominator deposit-field describe describe-object digit-char digit-char-p directory directory-namestring disassemble documentation dpb dribble echo-stream-input-stream echo-stream-output-stream ed eighth elt encode-universal-time endp enough-namestring ensure-directories-exist ensure-generic-function eq eql equal equalp error eval evenp every exp export expt fboundp fceiling fdefinition ffloor fifth file-author file-error-pathname file-length file-namestring file-position file-string-length file-write-date fill fill-pointer find find-all-symbols find-class find-if find-if-not find-method find-package find-restart find-symbol finish-output first float float-digits floatp float-precision float-radix float-sign floor fmakunbound force-output format fourth fresh-line fround ftruncate funcall function-keywords function-lambda-expression functionp gcd gensym gentemp get get-decoded-time get-dispatch-macro-character getf gethash get-internal-real-time get-internal-run-time get-macro-character get-output-stream-string get-properties get-setf-expansion get-universal-time graphic-char-p hash-table-count hash-table-p hash-table-rehash-size hash-table-rehash-threshold hash-table-size hash-table-test host-namestring identity imagpart import initialize-instance input-stream-p inspect integer-decode-float integer-length integerp interactive-stream-p intern intersection invalid-method-error invoke-debugger invoke-restart invoke-restart-interactively isqrt keywordp last lcm ldb ldb-test ldiff length lisp-implementation-type lisp-implementation-version list list* list-all-packages listen list-length listp load load-logical-pathname-translations log logand logandc1 logandc2 logbitp logcount logeqv logical-pathname logical-pathname-translations logior lognand lognor lognot logorc1 logorc2 logtest logxor long-site-name lower-case-p machine-instance machine-type machine-version macroexpand macroexpand-1 macro-function make-array make-broadcast-stream make-concatenated-stream make-condition make-dispatch-macro-character make-echo-stream make-hash-table make-instance make-instances-obsolete make-list make-load-form make-load-form-saving-slots make-package make-pathname make-random-state make-sequence make-string make-string-input-stream make-string-output-stream make-symbol make-synonym-stream make-two-way-stream makunbound map mapc mapcan mapcar mapcon maphash map-into mapl maplist mask-field max member member-if member-if-not merge merge-pathnames method-combination-error method-qualifiers min minusp mismatch mod muffle-warning name-char namestring nbutlast nconc next-method-p nintersection ninth no-applicable-method no-next-method not notany notevery nreconc nreverse nset-difference nset-exclusive-or nstring-capitalize nstring-downcase nstring-upcase nsublis nsubst nsubst-if nsubst-if-not nsubstitute nsubstitute-if nsubstitute-if-not nth nthcdr null numberp numerator nunion oddp open open-stream-p output-stream-p package-error-package package-name package-nicknames packagep package-shadowing-symbols package-used-by-list package-use-list pairlis parse-integer parse-namestring pathname pathname-device pathname-directory pathname-host pathname-match-p pathname-name pathnamep pathname-type pathname-version peek-char phase plusp position position-if position-if-not pprint pprint-dispatch pprint-fill pprint-indent pprint-linear pprint-newline pprint-tab pprint-tabular prin1 prin1-to-string princ princ-to-string print print-object probe-file proclaim provide random random-state-p rassoc rassoc-if rassoc-if-not rational rationalize rationalp read read-byte read-char read-char-no-hang read-delimited-list read-from-string read-line read-preserving-whitespace read-sequence readtable-case readtablep realp realpart reduce reinitialize-instance rem remhash remove remove-duplicates remove-if remove-if-not remove-method remprop rename-file rename-package replace require rest restart-name revappend reverse room round row-major-aref rplaca rplacd sbit scale-float schar search second set set-difference set-dispatch-macro-character set-exclusive-or set-macro-character set-pprint-dispatch set-syntax-from-char seventh shadow shadowing-import shared-initialize short-site-name signal signum simple-bit-vector-p simple-condition-format-arguments simple-condition-format-control simple-string-p simple-vector-p sin sinh sixth sleep slot-boundp slot-exists-p slot-makunbound slot-missing slot-unbound slot-value software-type software-version some sort special-operator-p sqrt stable-sort standard-char-p store-value stream-element-type stream-error-stream stream-external-format streamp string string< string<= string= string> string>= string/= string-capitalize string-downcase string-equal string-greaterp string-left-trim string-lessp string-not-equal string-not-greaterp string-not-lessp stringp string-right-trim string-trim string-upcase sublis subseq subsetp subst subst-if subst-if-not substitute substitute-if substitute-if-not subtypepsvref sxhash symbol-function symbol-name symbolp symbol-package symbol-plist symbol-value synonym-stream-symbol syntax: tailp tan tanh tenth terpri third translate-logical-pathname translate-pathname tree-equal truename truncate two-way-stream-input-stream two-way-stream-output-stream type-error-datum type-error-expected-type type-of typep unbound-slot-instance unexport unintern union unread-char unuse-package update-instance-for-different-class update-instance-for-redefined-class upgraded-array-element-type upgraded-complex-part-type upper-case-p use-package user-homedir-pathname use-value values values-list vector vectorp vector-pop vector-push vector-push-extend warn wild-pathname-p write write-byte write-char write-line write-sequence write-string write-to-string yes-or-no-p y-or-n-p zerop ).freeze SPECIAL_FORMS = Set.new %w( block catch declare eval-when flet function go if labels lambda let let* load-time-value locally macrolet multiple-value-call multiple-value-prog1 progn progv quote return-from setq symbol-macrolet tagbody the throw unwind-protect ) MACROS = Set.new %w( and assert call-method case ccase check-type cond ctypecase decf declaim defclass defconstant defgeneric define-compiler-macro define-condition define-method-combination define-modify-macro define-setf-expander define-symbol-macro defmacro defmethod defpackage defparameter defsetf defstruct deftype defun defvar destructuring-bind do do* do-all-symbols do-external-symbols dolist do-symbols dotimes ecase etypecase formatter handler-bind handler-case ignore-errors incf in-package lambda loop loop-finish make-method multiple-value-bind multiple-value-list multiple-value-setq nth-value or pop pprint-exit-if-list-exhausted pprint-logical-block pprint-pop print-unreadable-object prog prog* prog1 prog2 psetf psetq push pushnew remf restart-bind restart-case return rotatef setf shiftf step time trace typecase unless untrace when with-accessors with-compilation-unit with-condition-restarts with-hash-table-iterator with-input-from-string with-open-file with-open-stream with-output-to-string with-package-iterator with-simple-restart with-slots with-standard-io-syntax ) LAMBDA_LIST_KEYWORDS = Set.new %w( &allow-other-keys &aux &body &environment &key &optional &rest &whole ) DECLARATIONS = Set.new %w( dynamic-extent ignore optimize ftype inline special ignorable notinline type ) BUILTIN_TYPES = Set.new %w( atom boolean base-char base-string bignum bit compiled-function extended-char fixnum keyword nil signed-byte short-float single-float double-float long-float simple-array simple-base-string simple-bit-vector simple-string simple-vector standard-char unsigned-byte arithmetic-error cell-error condition control-error division-by-zero end-of-file error file-error floating-point-inexact floating-point-overflow floating-point-underflow floating-point-invalid-operation parse-error package-error print-not-readable program-error reader-error serious-condition simple-condition simple-error simple-type-error simple-warning stream-error storage-condition style-warning type-error unbound-variable unbound-slot undefined-function warning ) BUILTIN_CLASSES = Set.new %w( array broadcast-stream bit-vector built-in-class character class complex concatenated-stream cons echo-stream file-stream float function generic-function hash-table integer list logical-pathname method-combination method null number package pathname ratio rational readtable real random-state restart sequence standard-class standard-generic-function standard-method standard-object string-stream stream string structure-class structure-object symbol synonym-stream t two-way-stream vector ) nonmacro = /\\.|[a-zA-Z0-9!$%&*+-\/<=>?@\[\]^_{}~]/ constituent = /#{nonmacro}|[#.:]/ terminated = /(?=[ "'()\n,;`])/ # whitespace or terminating macro chars symbol = /(\|[^\|]+\||#{nonmacro}#{constituent}*)/ state :root do rule /\s+/m, Text rule /;.*$/, Comment::Single rule /#\|/, Comment::Multiline, :multiline_comment # encoding comment rule /#\d*Y.*$/, Comment::Special rule /"(\\.|[^"\\])*"/, Str rule /[:']#{symbol}/, Str::Symbol rule /['`]/, Operator # numbers rule /[-+]?\d+\.?#{terminated}/, Num::Integer rule %r{[-+]?\d+/\d+#{terminated}}, Num::Integer rule %r{ [-+]? (\d*\.\d+([defls][-+]?\d+)? |\d+(\.\d*)?[defls][-+]?\d+) #{terminated} }x, Num::Float # sharpsign strings and characters rule /#\\.#{terminated}/, Str::Char rule /#\\#{symbol}/, Str::Char rule /#\(/, Operator, :root # bitstring rule /#\d*\*[01]*/, Other # uninterned symbol rule /#:#{symbol}/, Str::Symbol # read-time and load-time evaluation rule /#[.,]/, Operator # function shorthand rule /#'/, Name::Function # binary rational rule /#b[+-]?[01]+(\/[01]+)?/i, Num # octal rational rule /#o[+-]?[0-7]+(\/[0-7]+)?/i, Num::Oct # hex rational rule /#x[+-]?[0-9a-f]+(\/[0-9a-f]+)?/i, Num # complex rule /(#c)(\()/i do groups Num, Punctuation push :root end # arrays and structures rule /(#(?:\d+a|s))(\()/i do groups Literal::Other, Punctuation push :root end # path rule /#p?"(\\.|[^"])*"/i, Str::Symbol # reference rule /#\d+[=#]/, Operator # read-time comment rule /#+nil#{terminated}\s*\(/, Comment, :commented_form # read-time conditional rule /#[+-]/, Operator # special operators that should have been parsed already rule /(,@|,|\.)/, Operator # special constants rule /(t|nil)#{terminated}/, Name::Constant # functions and variables # note that these get filtered through in stream_tokens rule /\*#{symbol}\*/, Name::Variable::Global rule symbol do |m| sym = m[0] if BUILTIN_FUNCTIONS.include? sym token Name::Builtin elsif SPECIAL_FORMS.include? sym token Keyword elsif MACROS.include? sym token Name::Builtin elsif LAMBDA_LIST_KEYWORDS.include? sym token Keyword elsif DECLARATIONS.include? sym token Keyword elsif BUILTIN_TYPES.include? sym token Keyword::Type elsif BUILTIN_CLASSES.include? sym token Name::Class else token Name::Variable end end rule /\(/, Punctuation, :root rule /\)/, Punctuation do if stack.empty? token Error else token Punctuation pop! end end end state :multiline_comment do rule /#\|/, Comment::Multiline, :multiline_comment rule /\|#/, Comment::Multiline, :pop! rule /[^\|#]+/, Comment::Multiline rule /[\|#]/, Comment::Multiline end state :commented_form do rule /\(/, Comment, :commented_form rule /\)/, Comment, :pop! rule /[^()]+/, Comment end end end end rugments-1.0.0.beta8/lib/rugments/lexers/sql.rb0000644000076400007640000001511612544707752020473 0ustar pravipravimodule Rugments module Lexers class SQL < RegexLexer title 'SQL' desc 'Structured Query Language, for relational databases' tag 'sql' filenames '*.sql' mimetypes 'text/x-sql' def self.keywords @keywords ||= Set.new %w( ABORT ABS ABSOLUTE ACCESS ADA ADD ADMIN AFTER AGGREGATE ALIAS ALL ALLOCATE ALTER ANALYSE ANALYZE AND ANY ARE AS ASC ASENSITIVE ASSERTION ASSIGNMENT ASYMMETRIC AT ATOMIC AUTHORIZATION AVG BACKWARD BEFORE BEGIN BETWEEN BITVAR BIT_LENGTH BOTH BREADTH BY C CACHE CALL CALLED CARDINALITY CASCADE CASCADED CASE CAST CATALOG CATALOG_NAME CHAIN CHARACTERISTICS CHARACTER_LENGTH CHARACTER_SET_CATALOG CHARACTER_SET_NAME CHARACTER_SET_SCHEMA CHAR_LENGTH CHECK CHECKED CHECKPOINT CLASS CLASS_ORIGIN CLOB CLOSE CLUSTER COALSECE COBOL COLLATE COLLATION COLLATION_CATALOG COLLATION_NAME COLLATION_SCHEMA COLUMN COLUMN_NAME COMMAND_FUNCTION COMMAND_FUNCTION_CODE COMMENT COMMIT COMMITTED COMPLETION CONDITION_NUMBER CONNECT CONNECTION CONNECTION_NAME CONSTRAINT CONSTRAINTS CONSTRAINT_CATALOG CONSTRAINT_NAME CONSTRAINT_SCHEMA CONSTRUCTOR CONTAINS CONTINUE CONVERSION CONVERT COPY CORRESPONTING COUNT CREATE CREATEDB CREATEUSER CROSS CUBE CURRENT CURRENT_DATE CURRENT_PATH CURRENT_ROLE CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CURSOR_NAME CYCLE DATA DATABASE DATETIME_INTERVAL_CODE DATETIME_INTERVAL_PRECISION DAY DEALLOCATE DECLARE DEFAULT DEFAULTS DEFERRABLE DEFERRED DEFINED DEFINER DELETE DELIMITER DELIMITERS DEREF DESC DESCRIBE DESCRIPTOR DESTROY DESTRUCTOR DETERMINISTIC DIAGNOSTICS DICTIONARY DISCONNECT DISPATCH DISTINCT DO DOMAIN DROP DYNAMIC DYNAMIC_FUNCTION DYNAMIC_FUNCTION_CODE EACH ELSE ENCODING ENCRYPTED END END-EXEC EQUALS ESCAPE EVERY EXCEPT ESCEPTION EXCLUDING EXCLUSIVE EXEC EXECUTE EXISTING EXISTS EXPLAIN EXTERNAL EXTRACT FALSE FETCH FINAL FIRST FOR FORCE FOREIGN FORTRAN FORWARD FOUND FREE FREEZE FROM FULL FUNCTION G GENERAL GENERATED GET GLOBAL GO GOTO GRANT GRANTED GROUP GROUPING HANDLER HAVING HIERARCHY HOLD HOST IDENTITY IGNORE ILIKE IMMEDIATE IMMUTABLE IMPLEMENTATION IMPLICIT IN INCLUDING INCREMENT INDEX INDITCATOR INFIX INHERITS INITIALIZE INITIALLY INNER INOUT INPUT INSENSITIVE INSERT INSTANTIABLE INSTEAD INTERSECT INTO INVOKER IS ISNULL ISOLATION ITERATE JOIN KEY KEY_MEMBER KEY_TYPE LANCOMPILER LANGUAGE LARGE LAST LATERAL LEADING LEFT LENGTH LESS LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LOCATION LOCATOR LOCK LOWER MAP MATCH MAX MAXVALUE MESSAGE_LENGTH MESSAGE_OCTET_LENGTH MESSAGE_TEXT METHOD MIN MINUTE MINVALUE MOD MODE MODIFIES MODIFY MONTH MORE MOVE MUMPS NAMES NATIONAL NATURAL NCHAR NCLOB NEW NEXT NO NOCREATEDB NOCREATEUSER NONE NOT NOTHING NOTIFY NOTNULL NULL NULLABLE NULLIF OBJECT OCTET_LENGTH OF OFF OFFSET OIDS OLD ON ONLY OPEN OPERATION OPERATOR OPTION OPTIONS OR ORDER ORDINALITY OUT OUTER OUTPUT OVERLAPS OVERLAY OVERRIDING OWNER PAD PARAMETER PARAMETERS PARAMETER_MODE PARAMATER_NAME PARAMATER_ORDINAL_POSITION PARAMETER_SPECIFIC_CATALOG PARAMETER_SPECIFIC_NAME PARAMATER_SPECIFIC_SCHEMA PARTIAL PASCAL PENDANT PLACING PLI POSITION POSTFIX PRECISION PREFIX PREORDER PREPARE PRESERVE PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE PUBLIC READ READS RECHECK RECURSIVE REF REFERENCES REFERENCING REINDEX RELATIVE RENAME REPEATABLE REPLACE RESET RESTART RESTRICT RESULT RETURN RETURNED_LENGTH RETURNED_OCTET_LENGTH RETURNED_SQLSTATE RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP ROUTINE ROUTINE_CATALOG ROUTINE_NAME ROUTINE_SCHEMA ROW ROWS ROW_COUNT RULE SAVE_POINT SCALE SCHEMA SCHEMA_NAME SCOPE SCROLL SEARCH SECOND SECURITY SELECT SELF SENSITIVE SERIALIZABLE SERVER_NAME SESSION SESSION_USER SET SETOF SETS SHARE SHOW SIMILAR SIMPLE SIZE SOME SOURCE SPACE SPECIFIC SPECIFICTYPE SPECIFIC_NAME SQL SQLCODE SQLERROR SQLEXCEPTION SQLSTATE SQLWARNINIG STABLE START STATE STATEMENT STATIC STATISTICS STDIN STDOUT STORAGE STRICT STRUCTURE STYPE SUBCLASS_ORIGIN SUBLIST SUBSTRING SUM SYMMETRIC SYSID SYSTEM SYSTEM_USER TABLE TABLE_NAME TEMP TEMPLATE TEMPORARY TERMINATE THAN THEN TIMESTAMP TIMEZONE_HOUR TIMEZONE_MINUTE TO TOAST TRAILING TRANSATION TRANSACTIONS_COMMITTED TRANSACTIONS_ROLLED_BACK TRANSATION_ACTIVE TRANSFORM TRANSFORMS TRANSLATE TRANSLATION TREAT TRIGGER TRIGGER_CATALOG TRIGGER_NAME TRIGGER_SCHEMA TRIM TRUE TRUNCATE TRUSTED TYPE UNCOMMITTED UNDER UNENCRYPTED UNION UNIQUE UNKNOWN UNLISTEN UNNAMED UNNEST UNTIL UPDATE UPPER USAGE USER USER_DEFINED_TYPE_CATALOG USER_DEFINED_TYPE_NAME USER_DEFINED_TYPE_SCHEMA USING VACUUM VALID VALIDATOR VALUES VARIABLE VERBOSE VERSION VIEW VOLATILE WHEN WHENEVER WHERE WITH WITHOUT WORK WRITE YEAR ZONE ) end state :root do rule /\s+/m, Text rule /--.*?\n/, Comment::Single rule %r{/\*}, Comment::Multiline, :multiline_comments rule /\d+/, Num::Integer rule /'/, Str::Single, :single_string rule /"/, Name::Variable, :double_string rule /`/, Name::Variable, :backtick rule /\w[\w\d]*/ do |m| if self.class.keywords.include? m[0].upcase token Keyword else token Name end end rule %r{[+*/<>=~!@#%^&|?^-]}, Operator rule /[;:()\[\],.]/, Punctuation end state :multiline_comments do rule %r{/[*]}, Comment::Multiline, :multiline_comments rule %r{[*]/}, Comment::Multiline, :pop! rule %r{[^/*]+}, Comment::Multiline rule %r{[/*]}, Comment::Multiline end state :backtick do rule /\\./, Str::Escape rule /``/, Str::Escape rule /`/, Name::Variable, :pop! rule /[^\\`]+/, Name::Variable end state :single_string do rule /\\./, Str::Escape rule /''/, Str::Escape rule /'/, Str::Single, :pop! rule /[^\\']+/, Str::Single end state :double_string do rule /\\./, Str::Escape rule /""/, Str::Escape rule /"/, Name::Variable, :pop! rule /[^\\"]+/, Name::Variable end end end end rugments-1.0.0.beta8/lib/rugments/lexers/coffeescript.rb0000644000076400007640000001051612544707752022347 0ustar pravipravimodule Rugments module Lexers class Coffeescript < RegexLexer tag 'coffeescript' aliases 'coffee', 'coffee-script' filenames '*.coffee', 'Cakefile' mimetypes 'text/coffeescript' title 'CoffeeScript' desc 'The Coffeescript programming language (coffeescript.org)' def self.analyze_text(text) return 1 if text.shebang? 'coffee' end def self.keywords @keywords ||= Set.new %w( for in of while break return continue switch when then if else throw try catch finally new delete typeof instanceof super extends this class by ) end def self.constants @constants ||= Set.new %w( true false yes no on off null NaN Infinity undefined ) end def self.builtins @builtins ||= Set.new %w( Array Boolean Date Error Function Math netscape Number Object Packages RegExp String sun decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt document window ) end id = /[$a-zA-Z_][a-zA-Z0-9_]*/ state :comments_and_whitespace do rule /\s+/m, Text rule /###.*?###/m, Comment::Multiline rule /#.*?\n/, Comment::Single end state :multiline_regex do # this order is important, so that #{ isn't interpreted # as a comment mixin :has_interpolation mixin :comments_and_whitespace rule %r{///([gim]+\b|\B)}, Str::Regex, :pop! rule %r{/}, Str::Regex rule %r{[^/#]+}, Str::Regex end state :slash_starts_regex do mixin :comments_and_whitespace rule %r{///} do token Str::Regex goto :multiline_regex end rule %r{ /(\\.|[^\[/\\\n]|\[(\\.|[^\]\\\n])*\])+/ # a regex ([gim]+\b|\B) }x, Str::Regex, :pop! rule(//) { pop! } end state :root do rule(%r{^(?=\s|/|/, Punctuation rule /"[^"]*"/, Str::Double rule /\d+\.\d+/, Num::Float rule /\d+/, Num end state :atoms do rule /[[:lower:]]([_[:lower:][:digit:]])*/, Str::Symbol rule /'[^']*'/, Str::Symbol end state :operators do rule /(<|>|=<|>=|==|=:=|=|\/|\/\/|\*|\+|-)(?=\s|[a-zA-Z0-9\[])/, Operator rule /is/, Operator rule /(mod|div|not)/, Operator rule /[#&*+-.\/:<=>?@^~]+/, Operator end state :variables do rule /[A-Z]+\w*/, Name::Variable rule /_[[:word:]]*/, Name::Variable end state :root do mixin :basic mixin :atoms mixin :variables mixin :operators end state :nested_comment do rule /\/\*/, Comment::Multiline, :push rule /\s*\*[^*\/]+/, Comment::Multiline rule /\*\//, Comment::Multiline, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/groovy.rb0000644000076400007640000000563612544707752021227 0ustar pravipravimodule Rugments module Lexers class Groovy < RegexLexer title 'Groovy' desc 'The Groovy programming language (groovy.codehaus.org)' tag 'groovy' filenames '*.groovy' mimetypes 'text/x-groovy' ws = %r{(?:\s|//.*?\n|/[*].*?[*]/)+} def self.keywords @keywords ||= Set.new %w( assert break case catch continue default do else finally for if goto instanceof new return switch this throw try while in as ) end def self.declarations @declarations ||= Set.new %w( abstract const enum extends final implements native private protected public static strictfp super synchronized throws transient volatile ) end def self.types @types ||= Set.new %w( def boolean byte char double float int long short void ) end def self.constants @constants ||= Set.new %w(true false null) end state :root do rule %r{^ (\s*(?:\w[\w\d.\[\]]*\s+)+?) # return arguments (\w[\w\d]*) # method name (\s*) (\() # signature start }x do |m| delegate clone, m[1] token Name::Function, m[2] token Text, m[3] token Operator, m[4] end # whitespace rule /[^\S\n]+/, Text rule %r{//.*?\n}, Comment::Single rule %r{/[*].*?[*]/}m, Comment::Multiline rule /@\w[\w\d.]*/, Name::Decorator rule /(class|interface)\b/, Keyword::Declaration, :class rule /package\b/, Keyword::Namespace, :import rule /import\b/, Keyword::Namespace, :import rule /"(\\\\|\\"|[^"])*"/, Str::Double rule /'(\\\\|\\'|[^'])*'/, Str::Single rule %r{\$/((?!/\$).)*/\$}, Str rule %r{/(\\\\|\\"|[^/])*/}, Str rule /'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'/, Str::Char rule /(\.)([a-zA-Z_][a-zA-Z0-9_]*)/ do groups Operator, Name::Attribute end rule /[a-zA-Z_][a-zA-Z0-9_]*:/, Name::Label rule /[a-zA-Z_\$][a-zA-Z0-9_]*/ do |m| if self.class.keywords.include? m[0] token Keyword elsif self.class.declarations.include? m[0] token Keyword::Declaration elsif self.class.types.include? m[0] token Keyword::Type elsif self.class.constants.include? m[0] token Keyword::Constant else token Name end end rule %r([~^*!%&\[\](){}<>\|+=:;,./?-]), Operator # numbers rule /\d+\.\d+([eE]\d+)?[fd]?/, Num::Float rule /0x[0-9a-f]+/, Num::Hex rule /[0-9]+L?/, Num::Integer rule /\n/, Text end state :class do rule /\s+/, Text rule /\w[\w\d]*/, Name::Class, :pop! end state :import do rule /\s+/, Text rule /[\w\d.]+[*]?/, Name::Namespace, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/elixir.rb0000644000076400007640000000700512544707752021166 0ustar pravipravimodule Rugments module Lexers # Direct port of pygments Lexer. # See: https://bitbucket.org/birkenfeld/pygments-main/src/7304e4759ae65343d89a51359ca538912519cc31/pygments/lexers/functional.py?at=default#cl-2362 class Elixir < RegexLexer title 'Elixir' desc 'Elixir language (elixir-lang.org)' tag 'elixir' filenames '*.ex', '*.exs' mimetypes 'text/x-elixir', 'application/x-elixir' BRACES = [ ['\{', '\}', 'cb'], ['\[', '\]', 'sb'], ['\(', '\)', 'pa'], ['\<', '\>', 'lt'] ] state :root do rule /\s+/m, Text rule /#.*$/, Comment::Single rule %r{\b(case|cond|end|bc|lc|if|unless|try|loop|receive|fn|defmodule| defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate| defexception|exit|raise|throw|unless|after|rescue|catch|else)\b(?![?!])| (?)\b}x, Keyword rule /\b(import|require|use|recur|quote|unquote|super|refer)\b(?![?!])/, Keyword::Namespace rule /(?|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?=[\s\t])\?| (?<=[\s\t])!+|&(&&?|(?!\d))|\|\||\^|\*|\+|\-|/| \||\+\+|\-\-|\*\*|\/\/|\<\-|\<\>|<<|>>|=|\.|~~~}x, Operator rule %r{(?=]))?|\<\>|===?|>=?|<=?| <=>|&&?|%\(\)|%\[\]|%\{\}|\+\+?|\-\-?|\|\|?|\!|//|[%&`/\|]| \*\*?|=?~|<\-)|([a-zA-Z_]\w*([?!])?)(:)(?!:)}, Str::Symbol rule /:"/, Str::Symbol, :interpoling_symbol rule /\b(nil|true|false)\b(?![?!])|\b[A-Z]\w*\b/, Name::Constant rule /\b(__(FILE|LINE|MODULE|MAIN|FUNCTION)__)\b(?![?!])/, Name::Builtin::Pseudo rule /[a-zA-Z_!][\w_]*[!\?]?/, Name rule %r{::|[%(){};,/\|:\\\[\]]}, Punctuation rule /@[a-zA-Z_]\w*|&\d/, Name::Variable rule %r{\b(0[xX][0-9A-Fa-f]+|\d(_?\d)*(\.(?![^\d\s]) (_?\d)*)?([eE][-+]?\d(_?\d)*)?|0[bB][01]+)\b}x, Num rule %r{~r\/.*\/}, Str::Regex mixin :strings end state :strings do rule /(%[A-Ba-z])?"""(?:.|\n)*?"""/, Str::Doc rule /'''(?:.|\n)*?'''/, Str::Doc rule /"/, Str::Doc, :dqs rule /'.*?'/, Str::Single rule %r{(?array both? hashcode die dupd callstack callstack? 3dup tri@ pick curry build ?execute 3bi prepose >boolean if clone eq? tri* ? = swapd 2over 2keep 3keep clear 2dup when not tuple? dup 2bi* 2tri* call tri-curry object bi@ do unless* if* loop bi-curry* drop when* assert= retainstack assert? -rot execute 2bi@ 2tri@ boa with either? 3drop bi curry? datastack until 3dip over 3curry tri-curry* tri-curry@ swap and 2nip throw bi-curry (clone) hashcode* compose 2dip if 3tri unless compose? tuple keep 2curry equal? assert tri 2drop most boolean? identity-hashcode identity-tuple? null new dip bi-curry@ rot xor identity-tuple boolean ) builtins[:assocs] = Set.new %w( ?at assoc? assoc-clone-like assoc= delete-at* assoc-partition extract-keys new-assoc value? assoc-size map>assoc push-at assoc-like key? assoc-intersect assoc-refine update assoc-union assoc-combine at* assoc-empty? at+ set-at assoc-all? assoc-subset? assoc-hashcode change-at assoc-each assoc-diff zip values value-at rename-at inc-at enum? at cache assoc>map assoc assoc-map enum value-at* assoc-map-as >alist assoc-filter-as clear-assoc assoc-stack maybe-set-at substitute assoc-filter 2cache delete-at assoc-find keys assoc-any? unzip ) builtins[:combinators] = Set.new %w( case execute-effect no-cond no-case? 3cleave>quot 2cleave cond>quot wrong-values? no-cond? cleave>quot no-case case>quot 3cleave wrong-values to-fixed-point alist>quot case-find cond cleave call-effect 2cleave>quot recursive-hashcode linear-case-quot spread spread>quot ) builtins[:math] = Set.new %w( number= if-zero next-power-of-2 each-integer ?1+ fp-special? imaginary-part unless-zero float>bits number? fp-infinity? bignum? fp-snan? denominator fp-bitwise= * + power-of-2? - u>= / >= bitand log2-expects-positive < log2 > integer? number bits>double 2/ zero? (find-integer) bits>float float? shift ratio? even? ratio fp-sign bitnot >fixnum complex? /i /f byte-array>bignum when-zero sgn >bignum next-float u< u> mod recip rational find-last-integer >float (all-integers?) 2^ times integer fixnum? neg fixnum sq bignum (each-integer) bit? fp-qnan? find-integer complex real double>bits bitor rem fp-nan-payload all-integers? real-part log2-expects-positive? prev-float align unordered? float fp-nan? abs bitxor u<= odd? <= /mod rational? >integer real? numerator ) builtins[:sequences] = Set.new %w( member-eq? append assert-sequence= find-last-from trim-head-slice clone-like 3sequence assert-sequence? map-as last-index-from reversed index-from cut* pad-tail remove-eq! concat-as but-last snip trim-tail nths nth 2selector sequence slice? partition remove-nth tail-slice empty? tail* if-empty find-from virtual-sequence? member? set-length drop-prefix unclip unclip-last-slice iota map-sum bounds-error? sequence-hashcode-step selector-for accumulate-as map start midpoint@ (accumulate) rest-slice prepend fourth sift accumulate! new-sequence follow map! like first4 1sequence reverse slice unless-empty padding virtual@ repetition? set-last index 4sequence max-length set-second immutable-sequence first2 first3 replicate-as reduce-index unclip-slice supremum suffix! insert-nth trim-tail-slice tail 3append short count suffix concat flip filter sum immutable? reverse! 2sequence map-integers delete-all start* indices snip-slice check-slice sequence? head map-find filter! append-as reduce sequence= halves collapse-slice interleave 2map filter-as binary-reduce slice-error? product bounds-check? bounds-check harvest immutable virtual-exemplar find produce remove pad-head last replicate set-fourth remove-eq shorten reversed? map-find-last 3map-as 2unclip-slice shorter? 3map find-last head-slice pop* 2map-as tail-slice* but-last-slice 2map-reduce iota? collector-for accumulate each selector append! new-resizable cut-slice each-index head-slice* 2reverse-each sequence-hashcode pop set-nth ?nth second join when-empty collector immutable-sequence? all? 3append-as virtual-sequence subseq? remove-nth! push-either new-like length last-index push-if 2all? lengthen assert-sequence copy map-reduce move third first 3each tail? set-first prefix bounds-error any? trim-slice exchange surround 2reduce cut change-nth min-length set-third produce-as push-all head? delete-slice rest sum-lengths 2each head* infimum remove! glue slice-error subseq trim replace-slice push repetition map-index trim-head unclip-last mismatch ) builtins[:namespaces] = Set.new %w( global +@ change set-namestack change-global init-namespaces on off set-global namespace set with-scope bind with-variable inc dec counter initialize namestack get get-global make-assoc ) builtins[:arrays] = Set.new %w( 2array 3array pair >array 1array 4array pair? array resize-array array? ) builtins[:io] = Set.new %w( +character+ bad-seek-type? readln each-morsel stream-seek read print with-output-stream contents write1 stream-write1 stream-copy stream-element-type with-input-stream stream-print stream-read stream-contents stream-tell tell-output bl seek-output bad-seek-type nl stream-nl write flush stream-lines +byte+ stream-flush read1 seek-absolute? stream-read1 lines stream-readln stream-read-until each-line seek-end with-output-stream* seek-absolute with-streams seek-input seek-relative? input-stream stream-write read-partial seek-end? seek-relative error-stream read-until with-input-stream* with-streams* tell-input each-block output-stream stream-read-partial each-stream-block each-stream-line ) builtins[:strings] = Set.new %w( resize-string >string 1string string string? ) builtins[:vectors] = Set.new %w( with-return restarts return-continuation with-datastack recover rethrow-restarts ifcc set-catchstack >continuation< cleanup ignore-errors restart? compute-restarts attempt-all-error error-thread continue attempt-all-error? condition? throw-restarts error catchstack continue-with thread-error-hook continuation rethrow callcc1 error-continuation callcc0 attempt-all condition continuation? restart return ) builtins[:continuations] = Set.new %w( with-return restarts return-continuation with-datastack recover rethrow-restarts ifcc set-catchstack >continuation< cleanup ignore-errors restart? compute-restarts attempt-all-error error-thread continue attempt-all-error? condition? throw-restarts error catchstack continue-with thread-error-hook continuation rethrow callcc1 error-continuation callcc0 attempt-all condition continuation? restart return ) end end state :root do rule /\s+/m, Text rule /(:|::|MACRO:|MEMO:|GENERIC:|HELP:)(\s+)(\S+)/m do groups Keyword, Text, Name::Function end rule /(M:|HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)/m do groups Keyword, Text, Name::Class, Text, Name::Function end rule /\((?=\s)/, Name::Function, :stack_effect rule /;(?=\s)/, Keyword rule /(USING:)((?:\s|\\\s)+)/m do groups Keyword::Namespace, Text push :import end rule /(IN:|USE:|UNUSE:|QUALIFIED:|QUALIFIED-WITH:)(\s+)(\S+)/m do groups Keyword::Namespace, Text, Name::Namespace end rule /(FROM:|EXCLUDE:)(\s+)(\S+)(\s+)(=>)/m do groups Keyword::Namespace, Text, Name::Namespace, Text, Punctuation end rule /(?:ALIAS|DEFER|FORGET|POSTPONE):/, Keyword::Namespace rule /(TUPLE:)(\s+)(\S+)(\s+)(<)(\s+)(\S+)/m do groups( Keyword, Text, Name::Class, Text, Punctuation, Text, Name::Class ) push :slots end rule /(TUPLE:)(\s+)(\S+)/m do groups Keyword, Text, Name::Class push :slots end rule /(UNION:|INTERSECTION:)(\s+)(\S+)/m do groups Keyword, Text, Name::Class end rule /(PREDICATE:)(\s+)(\S+)(\s+)(<)(\s+)(\S+)/m do groups( Keyword, Text, Name::Class, Text, Punctuation, Text, Name::Class ) end rule /(C:)(\s+)(\S+)(\s+)(\S+)/m do groups( Keyword, Text, Name::Function, Text, Name::Class ) end rule %r{ (INSTANCE|SLOT|MIXIN|SINGLETONS?|CONSTANT|SYMBOLS?|ERROR|SYNTAX |ALIEN|TYPEDEF|FUNCTION|STRUCT): }x, Keyword rule /(?:)/, Keyword::Namespace rule /(MAIN:)(\s+)(\S+)/ do groups Keyword::Namespace, Text, Name::Function end # strings rule /"""\s+.*?\s+"""/, Str rule /"(\\.|[^\\])*?"/, Str rule /(CHAR:)(\s+)(\\[\\abfnrstv]*|\S)(?=\s)/, Str::Char # comments rule /!\s+.*$/, Comment rule /#!\s+.*$/, Comment # booleans rule /[tf](?=\s)/, Name::Constant # numbers rule /-?\d+\.\d+(?=\s)/, Num::Float rule /-?\d+(?=\s)/, Num::Integer rule /HEX:\s+[a-fA-F\d]+(?=\s)/m, Num::Hex rule /BIN:\s+[01]+(?=\s)/, Num::Bin rule /OCT:\s+[0-7]+(?=\s)/, Num::Oct rule %r{[-+/*=<>^](?=\s)}, Operator rule /(?:deprecated|final|foldable|flushable|inline|recursive)(?=\s)/, Keyword rule /\S+/ do |m| name = m[0] if self.class.builtins.values.any? { |b| b.include? name } token Name::Builtin else token Name end end end state :stack_effect do rule /\s+/, Text rule /\(/, Name::Function, :stack_effect rule /\)/, Name::Function, :pop! rule /--/, Name::Function rule /\S+/, Name::Variable end state :slots do rule /\s+/, Text rule /;(?=\s)/, Keyword, :pop! rule /\S+/, Name::Variable end state :import do rule /;(?=\s)/, Keyword, :pop! rule /\s+/, Text rule /\S+/, Name::Namespace end end end end rugments-1.0.0.beta8/lib/rugments/lexers/c.rb0000644000076400007640000001362612544707752020122 0ustar pravipravimodule Rugments module Lexers class C < RegexLexer tag 'c' filenames '*.c', '*.h', '*.idc' mimetypes 'text/x-chdr', 'text/x-csrc' title 'C' desc 'The C programming language' # optional comment or whitespace ws = %r{(?:\s|//.*?\n|/[*].*?[*]/)+} id = /[a-zA-Z_][a-zA-Z0-9_]*/ def self.keywords @keywords ||= Set.new %w( auto break case const continue default do else enum extern for goto if register restricted return sizeof static struct switch typedef union volatile virtual while ) end def self.keywords_type @keywords_type ||= Set.new %w( int long float short double char unsigned signed void jmp_buf FILE DIR div_t ldiv_t mbstate_t sig_atomic_t fpos_t clock_t time_t va_list size_t ssize_t off_t wchar_t ptrdiff_t wctrans_t wint_t wctype_t _Bool _Complex int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t int_least8_t int_least16_t int_least32_t int_least64_t uint_least8_t uint_least16_t uint_least32_t uint_least64_t int_fast8_t int_fast16_t int_fast32_t int_fast64_t uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t intptr_t uintptr_t intmax_t uintmax_t ) end def self.reserved @reserved ||= Set.new %w( __asm __int8 __based __except __int16 __stdcall __cdecl __fastcall __int32 __declspec __finally __int61 __try __leave inline _inline __inline naked _naked __naked restrict _restrict __restrict thread _thread __thread typename _typename __typename ) end # high priority for filename matches def self.analyze_text(*) 0.3 end def self.builtins @builtins ||= [] end start { push :bol } state :expr_bol do mixin :inline_whitespace rule /#if\s0/, Comment, :if_0 rule /#/, Comment::Preproc, :macro rule(//) { pop! } end # :expr_bol is the same as :bol but without labels, since # labels can only appear at the beginning of a statement. state :bol do rule /#{id}:(?!:)/, Name::Label mixin :expr_bol end state :inline_whitespace do rule /[ \t\r]+/, Text rule /\\\n/, Text # line continuation rule %r{/(\\\n)?[*].*?[*](\\\n)?/}m, Comment::Multiline end state :whitespace do rule /\n+/m, Text, :bol rule %r{//(\\.|.)*?\n}, Comment::Single, :bol mixin :inline_whitespace end state :expr_whitespace do rule /\n+/m, Text, :expr_bol mixin :whitespace end state :statements do mixin :whitespace rule /L?"/, Str, :string rule %r(L?'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\'\n])')i, Str::Char rule %r{(\d+[.]\d*|[.]?\d+)e[+-]?\d+[lu]*}i, Num::Float rule %r{\d+e[+-]?\d+[lu]*}i, Num::Float rule /0x[0-9a-f]+[lu]*/i, Num::Hex rule /0[0-7]+[lu]*/i, Num::Oct rule /\d+[lu]*/i, Num::Integer rule %r{\*/}, Error rule %r{[~!%^&*+=\|?:<>/-]}, Operator rule /[()\[\],.]/, Punctuation rule /\bcase\b/, Keyword, :case rule /(?:true|false|NULL)\b/, Name::Builtin rule id do |m| name = m[0] if self.class.keywords.include? name token Keyword elsif self.class.keywords_type.include? name token Keyword::Type elsif self.class.reserved.include? name token Keyword::Reserved elsif self.class.builtins.include? name token Name::Builtin else token Name end end end state :case do rule /:/, Punctuation, :pop! mixin :statements end state :root do mixin :expr_whitespace # functions rule %r( ([\w*\s]+?[\s*]) # return arguments (#{id}) # function name (\s*\([^;]*?\)) # signature (#{ws})({) # open brace )mx do |m| # TODO: do this better. recurse m[1] token Name::Function, m[2] recurse m[3] recurse m[4] token Punctuation, m[5] push :function end # function declarations rule %r{ ([\w*\s]+?[\s*]) # return arguments (#{id}) # function name (\s*\([^;]*?\)) # signature (#{ws})(;) # semicolon }mx do |m| # TODO: do this better. recurse m[1] token Name::Function, m[2] recurse m[3] recurse m[4] token Punctuation, m[5] push :statement end rule(//) { push :statement } end state :statement do rule /;/, Punctuation, :pop! mixin :expr_whitespace mixin :statements rule /[{}]/, Punctuation end state :function do mixin :whitespace mixin :statements rule /;/, Punctuation rule /{/, Punctuation, :function rule /}/, Punctuation, :pop! end state :string do rule /"/, Str, :pop! rule /\\([\\abfnrtv"']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})/, Str::Escape rule /[^\\"\n]+/, Str rule /\\\n/, Str rule /\\/, Str # stray backslash end state :macro do # NB: pop! goes back to :bol rule /\n/, Comment::Preproc, :pop! rule %r{[^/\n\\]+}, Comment::Preproc rule /\\./m, Comment::Preproc mixin :inline_whitespace rule %r{/}, Comment::Preproc end state :if_0 do # NB: no \b here, to cover #ifdef and #ifndef rule /^\s*#if/, Comment, :if_0 rule /^\s*#\s*el(?:se|if)/, Comment, :pop! rule /^\s*#\s*endif\b.*?(?/, Keyword rule /[~!%^&*()+=|\[\]{}:;,.<>\/?-]/, Punctuation rule /@"(\\.|.)*?"/, Str rule /"(\\.|.)*?["\n]/, Str rule /'(\\.|.)'/, Str::Char rule /0x[0-9a-f]+[lu]?/i, Num rule %r{ [0-9] ([.][0-9]*)? # decimal (e[+-][0-9]+)? # exponent [fldu]? # type }ix, Num rule /^#[ \t]*(#{cpp_keywords.join('|')})\b.*?\n/, Comment::Preproc rule /\b(#{keywords.join('|')})\b/, Keyword rule /\b(#{keywords_type.join('|')})\b/, Keyword::Type rule /class|struct/, Keyword, :class rule /namespace|using/, Keyword, :namespace rule /#{id}(?=\s*[(])/, Name::Function rule id, Name end state :class do mixin :whitespace rule id, Name::Class, :pop! end state :namespace do mixin :whitespace rule /(?=[(])/, Text, :pop! rule /(#{id}|[.])+/, Name::Namespace, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/tcl.rb0000644000076400007640000001253412544707752020457 0ustar pravipravimodule Rugments module Lexers class TCL < RegexLexer title 'Tcl' desc 'The Tool Command Language (tcl.tk)' tag 'tcl' filenames '*.tcl' mimetypes 'text/x-tcl', 'text/x-script.tcl', 'application/x-tcl' def self.analyze_text(text) return 1 if text.shebang? 'tclsh' return 1 if text.shebang? 'wish' return 1 if text.shebang? 'jimsh' end KEYWORDS = %w( after apply array break catch continue elseif else error eval expr for foreach global if namespace proc rename return set switch then trace unset update uplevel upvar variable vwait while ) BUILTINS = %w( append bgerror binary cd chan clock close concat dde dict encoding eof exec exit fblocked fconfigure fcopy file fileevent flush format gets glob history http incr info interp join lappend lassign lindex linsert list llength load loadTk lrange lrepeat lreplace lreverse lsearch lset lsort mathfunc mathop memory msgcat open package pid pkg::create pkg_mkIndex platform platform::shell puts pwd re_syntax read refchan regexp registry regsub scan seek socket source split string subst tell time tm unknown unload ) OPEN = %w| \( \[ \{ " | CLOSE = %w| \) \] \} | ALL = OPEN + CLOSE END_LINE = CLOSE + %w(; \n) END_WORD = END_LINE + %w(\s) CHARS = lambda { |list| Regexp.new %([#{list.join}]) } NOT_CHARS = lambda { |list| Regexp.new %([^#{list.join}]) } state :word do rule /\{\*\}/, Keyword mixin :brace_abort mixin :interp rule /\{/, Punctuation, :brace rule /\(/, Punctuation, :paren rule /"/, Str::Double, :string rule /#{NOT_CHARS[END_WORD]}+?(?=#{CHARS[OPEN + ['\\\\']]})/, Text end def self.gen_command_state(name = '') state(:"command#{name}") do mixin :word rule /##{NOT_CHARS[END_LINE]}+/, Comment::Single rule /(?=#{CHARS[END_WORD]})/ do push :"params#{name}" end rule /#{NOT_CHARS[END_WORD]}+/ do |m| if KEYWORDS.include? m[0] token Keyword elsif BUILTINS.include? m[0] token Name::Builtin else token Text end end mixin :whitespace end end def self.gen_delimiter_states(name, close, opts = {}) gen_command_state("_in_#{name}") state :"params_in_#{name}" do rule close do token Punctuation pop! 2 end # mismatched delimiters. Braced strings with mismatched # closing delimiters should be okay, since this is standard # practice, like {]]]]} if opts[:strict] rule CHARS[CLOSE - [close]], Error else rule CHARS[CLOSE - [close]], Text end mixin :params end state name do rule close, Punctuation, :pop! mixin :"command_in_#{name}" end end # tcl is freaking impossible. If we're in braces and we encounter # a close brace, we have to drop everything and close the brace. # This is so silly things like {abc"def} and {abc]def} don't b0rk # everything after them. # TODO: TCL seems to have this aborting behavior quite a lot. # such things as [ abc" ] are a runtime error, but will still # parse. Currently something like this will muck up the lex. state :brace_abort do rule /}/ do if in_state? :brace pop! until state? :brace pop! token Punctuation else token Error end end end state :params do rule /;/, Punctuation, :pop! rule /\n/, Text, :pop! rule /else|elseif|then/, Keyword mixin :word mixin :whitespace rule /#{NOT_CHARS[END_WORD]}+/, Text end gen_delimiter_states :brace, /\}/, strict: false gen_delimiter_states :paren, /\)/, strict: true gen_delimiter_states :bracket, /\]/, strict: true gen_command_state state :root do mixin :command end state :whitespace do # not a multiline regex because we want to capture \n sometimes rule /\s+/, Text end state :interp do rule /\[/, Punctuation, :bracket rule /\$[a-z0-9.:-]+/, Name::Variable rule /\$\{.*?\}/m, Name::Variable rule /\$/, Text # escape sequences rule /\\[0-7]{3}/, Str::Escape rule /\\x[0-9a-f]{2}/i, Str::Escape rule /\\u[0-9a-f]{4}/i, Str::Escape rule /\\./m, Str::Escape end state :string do rule /"/, Str::Double, :pop! mixin :interp rule /[^\\\[\$"{}]+/m, Str::Double # strings have to keep count of their internal braces, to support # for example { "{ }" }. rule /{/ do @brace_count ||= 0 @brace_count += 1 token Str::Double end rule /}/ do if in_state?(:brace) && @brace_count.to_i == 0 pop! until state? :brace pop! token Punctuation else @brace_count -= 1 token Str::Double end end end end end end rugments-1.0.0.beta8/lib/rugments/lexers/sed.rb0000644000076400007640000000751312544707752020451 0ustar pravipravimodule Rugments module Lexers class Sed < RegexLexer title 'sed' desc 'sed, the ultimate stream editor' tag 'sed' filenames '*.sed' mimetypes 'text/x-sed' def self.analyze_text(text) return 1 if text.shebang? 'sed' end class Regex < RegexLexer state :root do rule /\\./, Str::Escape rule /\[/, Punctuation, :brackets rule /[$^.*]/, Operator rule /[()]/, Punctuation rule /./, Str::Regex end state :brackets do rule /\^?/ do token Punctuation goto :brackets_int end end state :brackets_int do # ranges rule /.-./, Name::Variable rule /\]/, Punctuation, :pop! rule /./, Str::Regex end end class Replacement < RegexLexer state :root do rule /\\./m, Str::Escape rule /&/, Operator rule /[^\\&]+/m, Text end end def regex @regex ||= Regex.new(options) end def replacement @replacement ||= Replacement.new(options) end start { regex.reset!; replacement.reset! } state :whitespace do rule /\s+/m, Text rule(/#.*?\n/) { token Comment; reset_stack } rule(/\n/) { token Text; reset_stack } rule(/;/) { token Punctuation; reset_stack } end state :root do mixin :addr_range end edot = /\\.|./m state :command do mixin :whitespace # subst and transliteration rule /(s)(.)(#{edot}*?)(\2)(#{edot}*?)(\2)/m do |m| token Keyword, m[1] token Punctuation, m[2] delegate regex, m[3] token Punctuation, m[4] delegate replacement, m[5] token Punctuation, m[6] goto :flags end rule /(y)(.)(#{edot}*?)(\2)(#{edot}*?)(\2)/m do |m| token Keyword, m[1] token Punctuation, m[2] delegate replacement, m[3] token Punctuation, m[4] delegate replacement, m[5] token Punctuation, m[6] pop! end # commands that take a text segment as an argument rule /([aic])(\s*)/ do groups Keyword, Text; goto :text end rule /[pd]/, Keyword # commands that take a number argument rule /([qQl])(\s+)(\d+)/i do groups Keyword, Text, Num pop! end # no-argument commands rule /[={}dDgGhHlnpPqx]/, Keyword, :pop! # commands that take a filename argument rule /([rRwW])(\s+)(\S+)/ do groups Keyword, Text, Name pop! end # commands that take a label argument rule /([:btT])(\s+)(\S+)/ do groups Keyword, Text, Name::Label pop! end end state :addr_range do mixin :whitespace ### address ranges ### addr_tok = Keyword::Namespace rule /\d+/, addr_tok rule /[$,~+!]/, addr_tok rule %r{(/)(\\.|.)*?(/)} do |m| token addr_tok, m[1]; delegate regex, m[2]; token addr_tok, m[3] end # alternate regex rage delimiters rule %r{(\\)(.)(\\.|.)*?(\2)} do |m| token addr_tok, m[1] + m[2] delegate regex, m[3] token addr_tok, m[4] end rule(//) { push :command } end state :text do rule /[^\\\n]+/, Str rule /\\\n/, Str::Escape rule /\\/, Str rule /\n/, Text, :pop! end state :flags do rule /[gp]+/, Keyword, :pop! # writing to a file with the subst command. # who'da thunk...? rule /([wW])(\s+)(\S+)/ do token Keyword; token Text; token Name end rule(//) { pop! } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/python.rb0000644000076400007640000001466512544707752021225 0ustar pravipravimodule Rugments module Lexers class Python < RegexLexer title 'Python' desc 'The Python programming language (python.org)' tag 'python' aliases 'py' filenames '*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac' mimetypes 'text/x-python', 'application/x-python' def self.analyze_text(text) return 1 if text.shebang?(/pythonw?(3|2(\.\d)?)?/) end def self.keywords @keywords ||= %w( assert break continue del elif else except exec finally for global if lambda pass print raise return try while yield as with ) end def self.builtins @builtins ||= %w( __import__ abs all any apply basestring bin bool buffer bytearray bytes callable chr classmethod cmp coerce compile complex delattr dict dir divmod enumerate eval execfile exit file filter float frozenset getattr globals hasattr hash hex id input int intern isinstance issubclass iter len list locals long map max min next object oct open ord pow property range raw_input reduce reload repr reversed round set setattr slice sorted staticmethod str sum super tuple type unichr unicode vars xrange zip ) end def self.builtins_pseudo @builtins_pseudo ||= %w(self None Ellipsis NotImplemented False True) end def self.exceptions @exceptions ||= %w( ArithmeticError AssertionError AttributeError BaseException DeprecationWarning EOFError EnvironmentError Exception FloatingPointError FutureWarning GeneratorExit IOError ImportError ImportWarning IndentationError IndexError KeyError KeyboardInterrupt LookupError MemoryError NameError NotImplemented NotImplementedError OSError OverflowError OverflowWarning PendingDeprecationWarning ReferenceError RuntimeError RuntimeWarning StandardError StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError TypeError UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning ValueError VMSError Warning WindowsError ZeroDivisionError ) end identifier = /[a-z_][a-z0-9_]*/i dotted_identifier = /[a-z_.][a-z0-9_.]*/i state :root do rule /\n+/m, Text rule /^(:)(\s*)([ru]{,2}""".*?""")/mi do groups Punctuation, Text, Str::Doc end rule /[^\S\n]+/, Text rule /#.*$/, Comment rule /[\[\]{}:(),;]/, Punctuation rule /\\\n/, Text rule /\\/, Text rule /(in|is|and|or|not)\b/, Operator::Word rule /!=|==|<<|>>|[-~+\/*%=<>&^|.]/, Operator rule /(def)((?:\s|\\\s)+)/ do groups Keyword, Text push :funcname end rule /(class)((?:\s|\\\s)+)/ do groups Keyword, Text push :classname end rule /(from)((?:\s|\\\s)+)/ do groups Keyword::Namespace, Text push :fromimport end rule /(import)((?:\s|\\\s)+)/ do groups Keyword::Namespace, Text push :import end # TODO: not in python 3 rule /`.*?`/, Str::Backtick rule /(?:r|ur|ru)"""/i, Str, :tdqs rule /(?:r|ur|ru)'''/i, Str, :tsqs rule /(?:r|ur|ru)"/i, Str, :dqs rule /(?:r|ur|ru)'/i, Str, :sqs rule /u?"""/i, Str, :escape_tdqs rule /u?'''/i, Str, :escape_tsqs rule /u?"/i, Str, :escape_dqs rule /u?'/i, Str, :escape_sqs rule /@#{dotted_identifier}/i, Name::Decorator # using negative lookbehind so we don't match property names rule /(? go back end state :fromimport do # non-line-terminating whitespace rule /(?:[ \t]|\\\n)+/, Text rule /import\b/, Keyword::Namespace, :pop! rule dotted_identifier, Name::Namespace end state :strings do rule /%(\([a-z0-9_]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?/i, Str::Interpol end state :strings_double do rule /[^\\"%\n]+/, Str mixin :strings end state :strings_single do rule /[^\\'%\n]+/, Str mixin :strings end state :nl do rule /\n/, Str end state :escape do rule %r(\\ ( [\\abfnrtv"'] | \n | N{.*?} | u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} | x[a-fA-F0-9]{2} | [0-7]{1,3} ) )x, Str::Escape end state :dqs do rule /"/, Str, :pop! rule /\\\\|\\"|\\\n/, Str::Escape mixin :strings_double end state :sqs do rule /'/, Str, :pop! rule /\\\\|\\'|\\\n/, Str::Escape mixin :strings_single end state :tdqs do rule /"""/, Str, :pop! rule /"/, Str mixin :strings_double mixin :nl end state :tsqs do rule /'''/, Str, :pop! rule /'/, Str mixin :strings_single mixin :nl end %w(tdqs tsqs dqs sqs).each do |qtype| state :"escape_#{qtype}" do mixin :escape mixin :"#{qtype}" end end end end end rugments-1.0.0.beta8/lib/rugments/lexers/viml/0000755000076400007640000000000012544707752020312 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/lexers/viml/keywords.rb0000644000076400007640000002676212544707752022523 0ustar pravipravi# DO NOT EDIT: automatically generated by `rake builtins:vim`. # see tasks/vim.rake for more info. module Rugments module Lexers class VimL def self.keywords @keywords ||= { command: [%w(a a), %w(ab ab), %w(abc abclear), %w(abo aboveleft), %w(al all), %w(ar ar), %w(ar args), %w(arga argadd), %w(argd argdelete), %w(argdo argdo), %w(arge argedit), %w(argg argglobal), %w(argl arglocal), %w(argu argument), %w(as ascii), %w(au au), %w(b buffer), %w(bN bNext), %w(ba ball), %w(bad badd), %w(bd bdelete), %w(bel belowright), %w(bf bfirst), %w(bl blast), %w(bm bmodified), %w(bn bnext), %w(bo botright), %w(bp bprevious), %w(br br), %w(br brewind), %w(brea break), %w(breaka breakadd), %w(breakd breakdel), %w(breakl breaklist), %w(bro browse), %w(bu bu), %w(buf buf), %w(bufdo bufdo), %w(buffers buffers), %w(bun bunload), %w(bw bwipeout), %w(c c), %w(c change), %w(cN cN), %w(cN cNext), %w(cNf cNf), %w(cNf cNfile), %w(cabc cabclear), %w(cad cad), %w(cad caddexpr), %w(caddb caddbuffer), %w(caddf caddfile), %w(cal call), %w(cat catch), %w(cb cbuffer), %w(cc cc), %w(ccl cclose), %w(cd cd), %w(ce center), %w(cex cexpr), %w(cf cfile), %w(cfir cfirst), %w(cg cgetfile), %w(cgetb cgetbuffer), %w(cgete cgetexpr), %w(changes changes), %w(chd chdir), %w(che checkpath), %w(checkt checktime), %w(cl cl), %w(cl clist), %w(cla clast), %w(clo close), %w(cmapc cmapclear), %w(cn cn), %w(cn cnext), %w(cnew cnewer), %w(cnf cnf), %w(cnf cnfile), %w(co copy), %w(col colder), %w(colo colorscheme), %w(com com), %w(comc comclear), %w(comp compiler), %w(con con), %w(con continue), %w(conf confirm), %w(cope copen), %w(cp cprevious), %w(cpf cpfile), %w(cq cquit), %w(cr crewind), %w(cs cs), %w(cscope cscope), %w(cstag cstag), %w(cuna cunabbrev), %w(cw cwindow), %w(d d), %w(d delete), %w(de de), %w(debug debug), %w(debugg debuggreedy), %w(del del), %w(delc delcommand), %w(delel delel), %w(delep delep), %w(deletel deletel), %w(deletep deletep), %w(deletl deletl), %w(deletp deletp), %w(delf delf), %w(delf delfunction), %w(dell dell), %w(delm delmarks), %w(delp delp), %w(dep dep), %w(di di), %w(di display), %w(diffg diffget), %w(diffo diffoff), %w(diffp diffpatch), %w(diffpu diffput), %w(diffs diffsplit), %w(difft diffthis), %w(diffu diffupdate), %w(dig dig), %w(dig digraphs), %w(dir dir), %w(dj djump), %w(dl dl), %w(dli dlist), %w(do do), %w(doau doau), %w(dp dp), %w(dr drop), %w(ds dsearch), %w(dsp dsplit), %w(e e), %w(e edit), %w(ea ea), %w(earlier earlier), %w(ec ec), %w(echoe echoerr), %w(echom echomsg), %w(echon echon), %w(el else), %w(elsei elseif), %w(em emenu), %w(en en), %w(en endif), %w(endf endf), %w(endf endfunction), %w(endfo endfor), %w(endfun endfun), %w(endt endtry), %w(endw endwhile), %w(ene enew), %w(ex ex), %w(exi exit), %w(exu exusage), %w(f f), %w(f file), %w(files files), %w(filet filet), %w(filetype filetype), %w(fin fin), %w(fin find), %w(fina finally), %w(fini finish), %w(fir first), %w(fix fixdel), %w(fo fold), %w(foldc foldclose), %w(foldd folddoopen), %w(folddoc folddoclosed), %w(foldo foldopen), %w(for for), %w(fu fu), %w(fu function), %w(fun fun), %w(g g), %w(go goto), %w(gr grep), %w(grepa grepadd), %w(gui gui), %w(gvim gvim), %w(h h), %w(h help), %w(ha hardcopy), %w(helpf helpfind), %w(helpg helpgrep), %w(helpt helptags), %w(hi hi), %w(hid hide), %w(his history), %w(i i), %w(ia ia), %w(iabc iabclear), %w(if if), %w(ij ijump), %w(il ilist), %w(imapc imapclear), %w(in in), %w(intro intro), %w(is isearch), %w(isp isplit), %w(iuna iunabbrev), %w(j join), %w(ju jumps), %w(k k), %w(kee keepmarks), %w(keepa keepa), %w(keepalt keepalt), %w(keepj keepjumps), %w(keepp keeppatterns), %w(l l), %w(l list), %w(lN lN), %w(lN lNext), %w(lNf lNf), %w(lNf lNfile), %w(la la), %w(la last), %w(lad lad), %w(lad laddexpr), %w(laddb laddbuffer), %w(laddf laddfile), %w(lan lan), %w(lan language), %w(lat lat), %w(later later), %w(lb lbuffer), %w(lc lcd), %w(lch lchdir), %w(lcl lclose), %w(lcs lcs), %w(lcscope lcscope), %w(le left), %w(lefta leftabove), %w(lex lexpr), %w(lf lfile), %w(lfir lfirst), %w(lg lgetfile), %w(lgetb lgetbuffer), %w(lgete lgetexpr), %w(lgr lgrep), %w(lgrepa lgrepadd), %w(lh lhelpgrep), %w(ll ll), %w(lla llast), %w(lli llist), %w(lmak lmake), %w(lmapc lmapclear), %w(lne lne), %w(lne lnext), %w(lnew lnewer), %w(lnf lnf), %w(lnf lnfile), %w(lo lo), %w(lo loadview), %w(loadk loadk), %w(loadkeymap loadkeymap), %w(loc lockmarks), %w(lockv lockvar), %w(lol lolder), %w(lop lopen), %w(lp lprevious), %w(lpf lpfile), %w(lr lrewind), %w(ls ls), %w(lt ltag), %w(lua lua), %w(luado luado), %w(luafile luafile), %w(lv lvimgrep), %w(lvimgrepa lvimgrepadd), %w(lw lwindow), %w(m move), %w(ma ma), %w(ma mark), %w(mak make), %w(marks marks), %w(mat match), %w(menut menut), %w(menut menutranslate), %w(mes mes), %w(messages messages), %w(mk mk), %w(mk mkexrc), %w(mks mksession), %w(mksp mkspell), %w(mkv mkv), %w(mkv mkvimrc), %w(mkvie mkview), %w(mo mo), %w(mod mode), %w(mz mz), %w(mz mzscheme), %w(mzf mzfile), %w(n n), %w(n next), %w(nb nbkey), %w(nbc nbclose), %w(nbs nbstart), %w(ne ne), %w(new new), %w(nmapc nmapclear), %w(noa noa), %w(noautocmd noautocmd), %w(noh nohlsearch), %w(nu number), %w(o o), %w(o open), %w(ol oldfiles), %w(omapc omapclear), %w(on only), %w(opt options), %w(ownsyntax ownsyntax), %w(p p), %w(p print), %w(pc pclose), %w(pe pe), %w(pe perl), %w(ped pedit), %w(perld perldo), %w(po pop), %w(popu popu), %w(popu popup), %w(pp ppop), %w(pr pr), %w(pre preserve), %w(prev previous), %w(pro pro), %w(prof profile), %w(profd profdel), %w(promptf promptfind), %w(promptr promptrepl), %w(ps psearch), %w(ptN ptN), %w(ptN ptNext), %w(pta ptag), %w(ptf ptfirst), %w(ptj ptjump), %w(ptl ptlast), %w(ptn ptn), %w(ptn ptnext), %w(ptp ptprevious), %w(ptr ptrewind), %w(pts ptselect), %w(pu put), %w(pw pwd), %w(py py), %w(py python), %w(py3 py3), %w(py3 py3), %w(py3do py3do), %w(pydo pydo), %w(pyf pyfile), %w(python3 python3), %w(q q), %w(q quit), %w(qa qall), %w(quita quitall), %w(r r), %w(r read), %w(re re), %w(rec recover), %w(red red), %w(red redo), %w(redi redir), %w(redr redraw), %w(redraws redrawstatus), %w(reg registers), %w(res resize), %w(ret retab), %w(retu return), %w(rew rewind), %w(ri right), %w(rightb rightbelow), %w(ru ru), %w(ru runtime), %w(rub ruby), %w(rubyd rubydo), %w(rubyf rubyfile), %w(rundo rundo), %w(rv rviminfo), %w(sN sNext), %w(sa sargument), %w(sal sall), %w(san sandbox), %w(sav saveas), %w(sb sbuffer), %w(sbN sbNext), %w(sba sball), %w(sbf sbfirst), %w(sbl sblast), %w(sbm sbmodified), %w(sbn sbnext), %w(sbp sbprevious), %w(sbr sbrewind), %w(scrip scrip), %w(scrip scriptnames), %w(scripte scriptencoding), %w(scs scs), %w(scscope scscope), %w(se set), %w(setf setfiletype), %w(setg setglobal), %w(setl setlocal), %w(sf sfind), %w(sfir sfirst), %w(sh shell), %w(si si), %w(sig sig), %w(sign sign), %w(sil silent), %w(sim simalt), %w(sl sl), %w(sl sleep), %w(sla slast), %w(sm smagic), %w(sm smap), %w(sme sme), %w(smenu smenu), %w(sn snext), %w(sni sniff), %w(sno snomagic), %w(snoreme snoreme), %w(snoremenu snoremenu), %w(so so), %w(so source), %w(sor sort), %w(sp split), %w(spe spe), %w(spe spellgood), %w(spelld spelldump), %w(spelli spellinfo), %w(spellr spellrepall), %w(spellu spellundo), %w(spellw spellwrong), %w(spr sprevious), %w(sre srewind), %w(st st), %w(st stop), %w(sta stag), %w(star star), %w(star startinsert), %w(start start), %w(startg startgreplace), %w(startr startreplace), %w(stj stjump), %w(stopi stopinsert), %w(sts stselect), %w(sun sunhide), %w(sunme sunme), %w(sunmenu sunmenu), %w(sus suspend), %w(sv sview), %w(sw swapname), %w(sy sy), %w(syn syn), %w(sync sync), %w(syncbind syncbind), %w(syntime syntime), %w(t t), %w(tN tN), %w(tN tNext), %w(ta ta), %w(ta tag), %w(tab tab), %w(tabN tabN), %w(tabN tabNext), %w(tabc tabclose), %w(tabd tabdo), %w(tabe tabedit), %w(tabf tabfind), %w(tabfir tabfirst), %w(tabl tablast), %w(tabm tabmove), %w(tabn tabnext), %w(tabnew tabnew), %w(tabo tabonly), %w(tabp tabprevious), %w(tabr tabrewind), %w(tabs tabs), %w(tags tags), %w(tc tcl), %w(tcld tcldo), %w(tclf tclfile), %w(te tearoff), %w(tf tfirst), %w(th throw), %w(tj tjump), %w(tl tlast), %w(tm tm), %w(tm tmenu), %w(tn tn), %w(tn tnext), %w(to topleft), %w(tp tprevious), %w(tr tr), %w(tr trewind), %w(try try), %w(ts tselect), %w(tu tu), %w(tu tunmenu), %w(u u), %w(u undo), %w(un un), %w(una unabbreviate), %w(undoj undojoin), %w(undol undolist), %w(unh unhide), %w(unl unl), %w(unlo unlockvar), %w(uns unsilent), %w(up update), %w(v v), %w(ve ve), %w(ve version), %w(verb verbose), %w(vert vertical), %w(vi vi), %w(vi visual), %w(vie view), %w(vim vimgrep), %w(vimgrepa vimgrepadd), %w(viu viusage), %w(vmapc vmapclear), %w(vne vnew), %w(vs vsplit), %w(w w), %w(w write), %w(wN wNext), %w(wa wall), %w(wh while), %w(win win), %w(win winsize), %w(winc wincmd), %w(windo windo), %w(winp winpos), %w(wn wnext), %w(wp wprevious), %w(wq wq), %w(wqa wqall), %w(ws wsverb), %w(wundo wundo), %w(wv wviminfo), %w(x x), %w(x xit), %w(xa xall), %w(xmapc xmapclear), %w(xme xme), %w(xmenu xmenu), %w(xnoreme xnoreme), %w(xnoremenu xnoremenu), %w(xunme xunme), %w(xunmenu xunmenu), %w(xwininfo xwininfo), %w(y yank)], option: [], auto: [%w(BufAdd BufAdd), %w(BufCreate BufCreate), %w(BufDelete BufDelete), %w(BufEnter BufEnter), %w(BufFilePost BufFilePost), %w(BufFilePre BufFilePre), %w(BufHidden BufHidden), %w(BufLeave BufLeave), %w(BufNew BufNew), %w(BufNewFile BufNewFile), %w(BufRead BufRead), %w(BufReadCmd BufReadCmd), %w(BufReadPost BufReadPost), %w(BufReadPre BufReadPre), %w(BufUnload BufUnload), %w(BufWinEnter BufWinEnter), %w(BufWinLeave BufWinLeave), %w(BufWipeout BufWipeout), %w(BufWrite BufWrite), %w(BufWriteCmd BufWriteCmd), %w(BufWritePost BufWritePost), %w(BufWritePre BufWritePre), %w(Cmd Cmd), %w(CmdwinEnter CmdwinEnter), %w(CmdwinLeave CmdwinLeave), %w(ColorScheme ColorScheme), %w(CompleteDone CompleteDone), %w(CursorHold CursorHold), %w(CursorHoldI CursorHoldI), %w(CursorMoved CursorMoved), %w(CursorMovedI CursorMovedI), %w(EncodingChanged EncodingChanged), %w(FileAppendCmd FileAppendCmd), %w(FileAppendPost FileAppendPost), %w(FileAppendPre FileAppendPre), %w(FileChangedRO FileChangedRO), %w(FileChangedShell FileChangedShell), %w(FileChangedShellPost FileChangedShellPost), %w(FileEncoding FileEncoding), %w(FileReadCmd FileReadCmd), %w(FileReadPost FileReadPost), %w(FileReadPre FileReadPre), %w(FileType FileType), %w(FileWriteCmd FileWriteCmd), %w(FileWritePost FileWritePost), %w(FileWritePre FileWritePre), %w(FilterReadPost FilterReadPost), %w(FilterReadPre FilterReadPre), %w(FilterWritePost FilterWritePost), %w(FilterWritePre FilterWritePre), %w(FocusGained FocusGained), %w(FocusLost FocusLost), %w(FuncUndefined FuncUndefined), %w(GUIEnter GUIEnter), %w(GUIFailed GUIFailed), %w(InsertChange InsertChange), %w(InsertCharPre InsertCharPre), %w(InsertEnter InsertEnter), %w(InsertLeave InsertLeave), %w(MenuPopup MenuPopup), %w(QuickFixCmdPost QuickFixCmdPost), %w(QuickFixCmdPre QuickFixCmdPre), %w(QuitPre QuitPre), %w(RemoteReply RemoteReply), %w(SessionLoadPost SessionLoadPost), %w(ShellCmdPost ShellCmdPost), %w(ShellFilterPost ShellFilterPost), %w(SourceCmd SourceCmd), %w(SourcePre SourcePre), %w(SpellFileMissing SpellFileMissing), %w(StdinReadPost StdinReadPost), %w(StdinReadPre StdinReadPre), %w(SwapExists SwapExists), %w(Syntax Syntax), %w(TabEnter TabEnter), %w(TabLeave TabLeave), %w(TermChanged TermChanged), %w(TermResponse TermResponse), %w(TextChanged TextChanged), %w(TextChangedI TextChangedI), %w(User User), %w(UserGettingBored UserGettingBored), %w(VimEnter VimEnter), %w(VimLeave VimLeave), %w(VimLeavePre VimLeavePre), %w(VimResized VimResized), %w(WinEnter WinEnter), %w(WinLeave WinLeave), %w(event event)] } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/nginx.rb0000644000076400007640000000266412544707752021023 0ustar pravipravimodule Rugments module Lexers class Nginx < RegexLexer title 'nginx' desc 'configuration files for the nginx web server (nginx.org)' tag 'nginx' mimetypes 'text/x-nginx-conf' filenames 'nginx.conf' id = /[^\s$;{}()#]+/ state :root do rule /(include)(\s+)([^\s;]+)/ do groups Keyword, Text, Name end rule id, Keyword, :statement mixin :base end state :block do rule /}/, Punctuation, :pop! rule id, Keyword::Namespace, :statement mixin :base end state :statement do rule /{/ do token Punctuation; pop!; push :block end rule /;/, Punctuation, :pop! mixin :base end state :base do rule /\s+/, Text rule /#.*?\n/, Comment::Single rule /(?:on|off)\b/, Name::Constant rule /[$][\w-]+/, Name::Variable # host/port rule /([a-z0-9.-]+)(:)([0-9]+)/i do groups Name::Function, Punctuation, Num::Integer end # mimetype rule %r{[a-z-]+/[a-z-]+}i, Name::Class rule /[0-9]+[kmg]?\b/i, Num::Integer rule /(~)(\s*)([^\s{]+)/ do groups Punctuation, Text, Str::Regex end rule /[:=~]/, Punctuation # pathname rule %r{/#{id}?}, Name rule /[^#\s;{}$\\]+/, Str # catchall rule /[$;]/, Text end end end end rugments-1.0.0.beta8/lib/rugments/lexers/sass/0000755000076400007640000000000012544707752020314 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/lexers/sass/common.rb0000644000076400007640000001007312544707752022132 0ustar pravipravimodule Rugments module Lexers # shared states with SCSS class SassCommon < RegexLexer id = /[\w-]+/ state :content_common do rule /@for\b/, Keyword, :for rule /@(debug|warn|if|while)/, Keyword, :value rule /(@mixin)(\s+)(#{id})/ do groups Keyword, Text, Name::Function push :value end rule /@extend\b/, Keyword, :selector rule /(@include)(\s+)(#{id})/ do groups Keyword, Text, Name::Decorator push :value end rule /@#{id}/, Keyword, :selector # $variable: assignment rule /([$]#{id})([ \t]*)(:)/ do groups Name::Variable, Text, Punctuation push :value end end state :value do mixin :end_section rule /[ \t]+/, Text rule /[$]#{id}/, Name::Variable rule /url[(]/, Str::Other, :string_url rule /#{id}(?=\s*[(])/, Name::Function rule /%#{id}/, Name::Decorator # named literals rule /(true|false)\b/, Name::Builtin::Pseudo rule /(and|or|not)\b/, Operator::Word # colors and numbers rule /#[a-z0-9]{1,6}/i, Num::Hex rule /-?\d+(%|[a-z]+)?/, Num rule /-?\d*\.\d+(%|[a-z]+)?/, Num::Integer mixin :has_strings mixin :has_interp rule /[~^*!&%<>\|+=@:,.\/?-]+/, Operator rule /[\[\]()]+/, Punctuation rule %r{/[*]}, Comment::Multiline, :inline_comment rule %r{//[^\n]*}, Comment::Single # identifiers rule(id) do |m| if CSS.builtins.include? m[0] token Name::Builtin elsif CSS.constants.include? m[0] token Name::Constant else token Name end end end state :has_interp do rule /[#][{]/, Str::Interpol, :interpolation end state :has_strings do rule /"/, Str::Double, :dq rule /'/, Str::Single, :sq end state :interpolation do rule /}/, Str::Interpol, :pop! mixin :value end state :selector do mixin :end_section mixin :has_strings mixin :has_interp rule /[ \t]+/, Text rule /:/, Name::Decorator, :pseudo_class rule /[.]/, Name::Class, :class rule /#/, Name::Namespace, :id rule /%/, Name::Variable, :placeholder rule id, Name::Tag rule /&/, Keyword rule /[~^*!&\[\]()<>\|+=@:;,.\/?-]/, Operator end state :dq do rule /"/, Str::Double, :pop! mixin :has_interp rule /(\\.|#(?![{])|[^\n"#])+/, Str::Double end state :sq do rule /'/, Str::Single, :pop! mixin :has_interp rule /(\\.|#(?![{])|[^\n'#])+/, Str::Single end state :string_url do rule /[)]/, Str::Other, :pop! rule /(\\.|#(?![{])|[^\n)#])+/, Str::Other mixin :has_interp end state :selector_piece do mixin :has_interp rule(//) { pop! } end state :pseudo_class do rule id, Name::Decorator mixin :selector_piece end state :class do rule id, Name::Class mixin :selector_piece end state :id do rule id, Name::Namespace mixin :selector_piece end state :placeholder do rule id, Name::Variable mixin :selector_piece end state :for do rule /(from|to|through)/, Operator::Word mixin :value end state :attr_common do mixin :has_interp rule id do |m| if CSS.attributes.include? m[0] token Name::Label else token Name::Attribute end end end state :attribute do mixin :attr_common rule /([ \t]*)(:)/ do groups Text, Punctuation push :value end end state :inline_comment do rule /(\\#|#(?=[^\n{])|\*(?=[^\n\/])|[^\n#*])+/, Comment::Multiline mixin :has_interp rule %r{[*]/}, Comment::Multiline, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/sass.rb0000644000076400007640000000303012544707752020635 0ustar pravipravimodule Rugments module Lexers load_const :SassCommon, 'sass/common.rb' class Sass < SassCommon include Indentation title 'Sass' desc 'The Sass stylesheet language language (sass-lang.com)' tag 'sass' filenames '*.sass' mimetypes 'text/x-sass' id = /[\w-]+/ state :root do rule /[ \t]*\n/, Text rule(/[ \t]*/) { |m| token Text; indentation(m[0]) } end state :content do # block comments rule %r{//.*?\n} do token Comment::Single pop!; starts_block :single_comment end rule %r{/[*].*?\n} do token Comment::Multiline pop!; starts_block :multi_comment end rule /@import\b/, Keyword, :import mixin :content_common rule %r{=#{id}}, Name::Function, :value rule %r{[+]#{id}}, Name::Decorator, :value rule /:/, Name::Attribute, :old_style_attr rule(/(?=.+?:([^a-z]|$))/) { push :attribute } rule(//) { push :selector } end state :single_comment do rule /.*?\n/, Comment::Single, :pop! end state :multi_comment do rule /.*?\n/, Comment::Multiline, :pop! end state :import do rule /[ \t]+/, Text rule /\S+/, Str rule /\n/, Text, :pop! end state :old_style_attr do mixin :attr_common rule(//) { pop!; push :value } end state :end_section do rule(/\n/) { token Text; reset_stack } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/conf.rb0000644000076400007640000000075712544707752020626 0ustar pravipravimodule Rugments module Lexers class Conf < RegexLexer tag 'conf' aliases 'config', 'configuration' title 'Config File' desc 'A generic lexer for configuration files' filenames '*.conf', '*.config' # short and sweet state :root do rule /#.*?\n/, Comment rule /".*?"/, Str::Double rule /'.*?'/, Str::Single rule /[a-z]\w*/i, Name rule /\d+/, Num rule /[^\d\w#"']+/, Text end end end end rugments-1.0.0.beta8/lib/rugments/lexers/matlab/0000755000076400007640000000000012544707752020603 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/lexers/matlab/builtins.rb0000644000076400007640000003131612544707752022765 0ustar pravipravi# automatically generated by `rake builtins:matlab` module Rugments module Lexers class Matlab def self.builtins @builtins ||= Set.new %w(ans clc diary format home iskeyword more accumarray blkdiag diag eye false freqspace linspace logspace meshgrid ndgrid ones rand true zeros cat horzcat vertcat colon end ind2sub sub2ind length ndims numel size height width iscolumn isempty ismatrix isrow isscalar isvector blkdiag circshift ctranspose diag flip fliplr flipud ipermute permute repmat reshape rot90 shiftdim issorted sort sortrows squeeze transpose vectorize plus uplus minus uminus times rdivide ldivide power mtimes mrdivide mldivide mpower cumprod cumsum diff prod sum ceil fix floor idivide mod rem round relationaloperators eq ge gt le lt ne isequal isequaln logicaloperatorsshortcircuit and not or xor all any false find islogical logical true intersect ismember issorted setdiff setxor union unique join innerjoin outerjoin bitand bitcmp bitget bitor bitset bitshift bitxor swapbytes specialcharacters colon double single int8 int16 int32 int64 uint8 uint16 uint32 uint64 cast typecast isinteger isfloat isnumeric isreal isfinite isinf isnan eps flintmax inf intmax intmin nan realmax realmin blanks cellstr char iscellstr ischar sprintf strcat strjoin ischar isletter isspace isstrprop sscanf strfind strrep strsplit strtok validatestring symvar regexp regexpi regexprep regexptranslate strcmp strcmpi strncmp strncmpi blanks deblank strtrim lower upper strjust datetime years days hours minutes seconds duration calyears calquarters calmonths calweeks caldays calendarduration exceltime juliandate posixtime yyyymmdd year quarter month week day hour minute second ymd hms split time timeofday isdst isweekend tzoffset between caldiff dateshift isbetween isdatetime isduration iscalendarduration isnat datenum datevec datestr now clock date calendar eomday weekday addtodate etime categorical iscategorical categories iscategory isordinal isprotected addcats mergecats removecats renamecats reordercats setcats summary countcats isundefined table array2table cell2table struct2table table2array table2cell table2struct readtable writetable istable height width summary intersect ismember setdiff setxor unique union join innerjoin outerjoin sortrows stack unstack ismissing standardizemissing varfun rowfun struct fieldnames getfield isfield isstruct orderfields rmfield setfield arrayfun structfun table2struct struct2table cell2struct struct2cell cell cell2mat cell2struct cell2table celldisp cellfun cellplot cellstr iscell iscellstr mat2cell num2cell strjoin strsplit struct2cell table2cell function_handle feval func2str str2func localfunctions functions addevent delevent gettsafteratevent gettsafterevent gettsatevent gettsbeforeatevent gettsbeforeevent gettsbetweenevents gettscollection isemptytscollection lengthtscollection settscollection sizetscollection tscollection addsampletocollection addts delsamplefromcollection getabstimetscollection getsampleusingtimetscollection gettimeseriesnames horzcattscollection removets resampletscollection setabstimetscollection settimeseriesnames vertcattscollection isa iscalendarduration iscategorical iscell iscellstr ischar isdatetime isduration isfield isfloat ishghandle isinteger isjava islogical isnumeric isobject isreal isstr isstruct istable is class validateattributes whos char cellstr int2str mat2str num2str str2double str2num native2unicode unicode2native base2dec bin2dec dec2base dec2bin dec2hex hex2dec hex2num num2hex table2array table2cell table2struct array2table cell2table struct2table cell2mat cell2struct mat2cell num2cell struct2cell plus uplus minus uminus times rdivide ldivide power mtimes mrdivide mldivide mpower cumprod cumsum diff prod sum ceil fix floor idivide mod rem round sin sind asin asind sinh asinh cos cosd acos acosd cosh acosh tan tand atan atand atan2 atan2d tanh atanh csc cscd acsc acscd csch acsch sec secd asec asecd sech asech cot cotd acot acotd coth acoth hypot exp expm1 log log10 log1p log2 nextpow2 nthroot pow2 reallog realpow realsqrt sqrt abs angle complex conj cplxpair i imag isreal j real sign unwrap factor factorial gcd isprime lcm nchoosek perms primes rat rats poly polyder polyeig polyfit polyint polyval polyvalm residue roots airy besselh besseli besselj besselk bessely beta betainc betaincinv betaln ellipj ellipke erf erfc erfcinv erfcx erfinv expint gamma gammainc gammaincinv gammaln legendre psi cart2pol cart2sph pol2cart sph2cart eps flintmax i j inf pi nan isfinite isinf isnan compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson cross dot kron surfnorm tril triu transpose cond condest inv linsolve lscov lsqnonneg pinv rcond sylvester mldivide mrdivide chol ichol cholupdate ilu lu qr qrdelete qrinsert qrupdate planerot ldl cdf2rdf rsf2csf gsvd svd balance cdf2rdf condeig eig eigs gsvd hess ordeig ordqz ordschur poly polyeig qz rsf2csf schur sqrtm ss2tf svd svds bandwidth cond condeig det isbanded isdiag ishermitian issymmetric istril istriu norm normest null orth rank rcond rref subspace trace expm logm sqrtm bsxfun funm arrayfun accumarray mpower corrcoef cov max cummax mean median min cummin mode std var rand randn randi randperm rng interp1 pchip spline ppval mkpp unmkpp padecoef interpft interp2 interp3 interpn ndgrid meshgrid griddata griddatan fminbnd fminsearch fzero lsqnonneg optimget optimset ode45 ode15s ode23 ode113 ode23t ode23tb ode23s ode15i decic odextend odeget odeset deval bvp4c bvp5c bvpinit bvpxtend bvpget bvpset deval dde23 ddesd ddensd ddeget ddeset deval pdepe pdeval integral integral2 integral3 quadgk quad2d cumtrapz trapz polyint del2 diff gradient polyder abs angle cplxpair fft fft2 fftn fftshift fftw ifft ifft2 ifftn ifftshift nextpow2 unwrap conv conv2 convn deconv detrend filter filter2 spdiags speye sprand sprandn sprandsym sparse spconvert issparse nnz nonzeros nzmax spalloc spfun spones spparms spy find full amd colamd colperm dmperm randperm symamd symrcm condest eigs ichol ilu normest spaugment sprank svds bicg bicgstab bicgstabl cgs gmres lsqr minres pcg qmr symmlq tfqmr etree etreeplot gplot symbfact treelayout treeplot unmesh tetramesh trimesh triplot trisurf delaunay delaunayn tetramesh trimesh triplot trisurf dsearchn tsearchn delaunay delaunayn boundary alphashape convhull convhulln patch voronoi voronoin polyarea inpolygon rectint plot plotyy plot3 loglog semilogx semilogy errorbar fplot ezplot ezplot3 linespec colorspec bar bar3 barh bar3h histogram histcounts rose pareto area pie pie3 stem stairs stem3 scatter scatter3 spy plotmatrix polar rose compass ezpolar linespec colorspec contour contourf contourc contour3 contourslice ezcontour ezcontourf feather quiver compass quiver3 streamslice streamline surf surfc surface surfl surfnorm mesh meshc meshz waterfall ribbon contour3 peaks cylinder ellipsoid sphere pcolor surf2patch ezsurf ezsurfc ezmesh ezmeshc contourslice flow isocaps isocolors isonormals isosurface reducepatch reducevolume shrinkfaces slice smooth3 subvolume volumebounds coneplot curl divergence interpstreamspeed stream2 stream3 streamline streamparticles streamribbon streamslice streamtube fill fill3 patch surf2patch movie getframe frame2im im2frame animatedline comet comet3 drawnow refreshdata title xlabel ylabel zlabel clabel datetick texlabel legend colorbar xlim ylim zlim box grid daspect pbaspect axes axis subplot hold gca cla annotation text line rectangle legend title xlabel ylabel zlabel datacursormode ginput gtext colormap colormapeditor colorbar brighten contrast shading graymon caxis hsv2rgb rgb2hsv rgbplot spinmap colordef whitebg hidden pan reset rotate rotate3d zoom datacursormode figurepalette plotbrowser plotedit plottools propertyeditor showplottool brush datacursormode linkdata linkaxes linkprop refreshdata view makehgtform viewmtx cameratoolbar campan camzoom camdolly camlookat camorbit campos camproj camroll camtarget camup camva camlight light lightangle lighting diffuse material specular alim alpha alphamap imshow image imagesc imread imwrite imfinfo imformats frame2im im2frame im2java im2double ind2rgb rgb2gray rgb2ind imapprox dither cmpermute cmunique print printopt printdlg printpreview orient savefig openfig hgexport hgsave hgload saveas axes figure groot get set inspect propedit gca gcf gcbf gcbo gco groot ancestor allchild findall findobj findfigs gobjects ishghandle ishandle copyobj delete gobjects isgraphics isempty isequal isa clf cla close set get groot uicontextmenu uimenu function_handle dragrect rbbox refresh shg hggroup hgtransform makehgtform eye hold ishold newplot clf cla drawnow opengl if for parfor switch try while break continue end pause return edit input publish notebook grabcode snapnow function nargin nargout varargin varargout narginchk nargoutchk validateattributes validatestring inputname persistent isvarname namelengthmax assignin global try error warning lastwarn assert oncleanup dbclear dbcont dbdown dbquit dbstack dbstatus dbstep dbstop dbtype dbup checkcode keyboard mlintrpt edit echo eval evalc evalin feval run builtin mfilename pcode clear clearvars disp openvar who whos load save matfile importdata uiimport csvread csvwrite dlmread dlmwrite textscan readtable writetable type xlsfinfo xlsread xlswrite readtable writetable fclose feof ferror fgetl fgets fileread fopen fprintf fread frewind fscanf fseek ftell fwrite im2java imfinfo imread imwrite nccreate ncdisp ncinfo ncread ncreadatt ncwrite ncwriteatt ncwriteschema netcdf h5create h5disp h5info h5read h5readatt h5write h5writeatt hdfinfo hdfread hdftool imread imwrite hdfan hdfhx hdfh hdfhd hdfhe hdfml hdfpt hdfv hdfvf hdfvh hdfvs hdfdf24 hdfdfr8 fitsdisp fitsinfo fitsread fitswrite multibandread multibandwrite cdfepoch cdfinfo cdfread cdfwrite todatenum cdflib audioinfo audioread audiowrite mmfileinfo audiodevinfo audioplayer audiorecorder sound soundsc beep lin2mu mu2lin xmlread xmlwrite xslt tcpclient datastore mapreduce datastore mapreducer matfile memmapfile dir ls pwd fileattrib exist isdir type visdiff what which cd copyfile delete recycle mkdir movefile rmdir open winopen fileparts fullfile filemarker filesep tempdir tempname matlabroot toolboxdir zip unzip gzip gunzip tar untar addpath rmpath path savepath userpath genpath pathsep pathtool restoredefaultpath clipboard computer dos getenv perl setenv system unix winqueryreg web webread websave weboptions urlread urlwrite sendmail instrcallback instrfind instrfindall readasync record serial serialbreak stopasync guide inspect figure axes uicontrol uitable uipanel uibuttongroup actxcontrol uitab uitabgroup uimenu uicontextmenu uitoolbar uipushtool uitoggletool dialog errordlg helpdlg msgbox questdlg uigetpref uisetpref waitbar warndlg export2wsdlg inputdlg listdlg uisetcolor uisetfont printdlg printpreview uigetdir uigetfile uiopen uiputfile uisave menu align movegui getpixelposition setpixelposition listfonts textwrap uistack uiwait uiresume waitfor waitforbuttonpress getappdata setappdata isappdata rmappdata guidata guihandles closereq classdef class isa isequal isobject enumeration events methods properties edit clear classdef import properties isprop dynamicprops methods ismethod handle dynamicprops isa events empty superclasses enumeration save load saveobj loadobj cat horzcat vertcat empty disp display numel size end subsref subsasgn subsindex substruct disp display details metaclass mexext inmem loadlibrary unloadlibrary libisloaded calllib libfunctions libfunctionsview libstruct libpointer javaarray javaclasspath javaaddpath javarmpath javachk isjava usejava javamethod javamethodedt javaobject javaobjectedt cell class clear depfun exist fieldnames im2java import inmem inspect isa methods methodsview which net enablenetfromnetworkdrive cell begininvoke endinvoke combine remove removeall bitand bitor bitxor bitnot actxserver actxcontrol actxcontrollist actxcontrolselect iscom addproperty deleteproperty inspect fieldnames methods methodsview invoke isevent eventlisteners registerevent unregisterallevents unregisterevent isinterface interfaces release move pyversion pyargs createclassfromwsdl createsoapmessage callsoapservice parsesoapresponse builddocsearchdb try functiontests runtests checkin checkout cmopts customverctrl undocheckout verctrl bench cputime memory profile profsave tic timeit toc clear inmem memory pack whos commandhistory commandwindow filebrowser workspace getpref setpref addpref rmpref ispref mex execute getchararray putchararray getfullmatrix putfullmatrix getvariable getworkspacedata putworkspacedata maximizecommandwindow minimizecommandwindow actxgetrunningserver enableservice mex dbmex mexext inmem ver computer mexext dbmex inmem mex mexext matlabwindows matlabunix exit quit matlabrc startup finish prefdir preferences ismac ispc isstudent isunix javachk license usejava ver verlessthan version doc help docsearch lookfor demo echodemo supportpackageinstaller targetupdater) end end end end rugments-1.0.0.beta8/lib/rugments/lexers/html.rb0000644000076400007640000000423312544707752020636 0ustar pravipravimodule Rugments module Lexers class HTML < RegexLexer title 'HTML' desc 'HTML, the markup language of the web' tag 'html' filenames '*.htm', '*.html', '*.xhtml' mimetypes 'text/html', 'application/xhtml+xml' def self.analyze_text(text) return 1 if text.doctype?(/\bhtml\b/i) return 1 if text =~ /<\s*html\b/ end state :root do rule /[^<&]+/m, Text rule /&\S*?;/, Name::Entity rule //im, Comment::Preproc rule //m, Comment::Preproc rule //, Comment, :pop! rule /-/, Comment end state :tag do rule /\s+/m, Text rule /[a-zA-Z0-9_:-]+\s*=/m, Name::Attribute, :attr rule /[a-zA-Z0-9_:-]+/, Name::Attribute rule %r{/?\s*>}m, Name::Tag, :pop! end state :attr do # TODO: are backslash escapes valid here? rule /"/ do token Str goto :dq end rule /'/ do token Str goto :sq end rule /[^\s>]+/, Str, :pop! end state :dq do rule /"/, Str, :pop! rule /[^"]+/, Str end state :sq do rule /'/, Str, :pop! rule /[^']+/, Str end state :script_content do rule %r{<\s*/\s*script\s*>}m, Name::Tag, :pop! rule %r{.*?(?=<\s*/\s*script\s*>)}m do delegate Javascript end end state :style_content do rule %r{<\s*/\s*style\s*>}m, Name::Tag, :pop! rule %r{.*(?=<\s*/\s*style\s*>)}m do delegate CSS end end end end end rugments-1.0.0.beta8/lib/rugments/lexers/xml.rb0000644000076400007640000000261312544707752020472 0ustar pravipravimodule Rugments module Lexers class XML < RegexLexer title 'XML' desc 'XML' tag 'xml' filenames *%w(*.xml *.xsl *.rss *.xslt *.xsd *.wsdl) mimetypes *%w( text/xml application/xml image/svg+xml application/rss+xml application/atom+xml ) def self.analyze_text(text) return 0.9 if text.doctype? return 0.8 if text =~ /\A<\?xml\b/ start = text[0..1000] return 0.6 if start =~ %r{.*?}m end state :root do rule /[^<&]+/, Text rule /&\S*?;/, Name::Entity rule //, Comment::Preproc rule //, Comment, :pop! rule /-/, Comment end state :tag do rule /\s+/m, Text rule /[\w.:-]+\s*=/m, Name::Attribute, :attr rule %r{/?\s*>}, Name::Tag, :pop! end state :attr do rule /\s+/m, Text rule /".*?"|'.*?'|[^\s>]+/, Str, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/perl.rb0000644000076400007640000001632612544707752020642 0ustar pravipravimodule Rugments module Lexers class Perl < RegexLexer title 'Perl' desc 'The Perl scripting language (perl.org)' tag 'perl' aliases 'pl' filenames '*.pl', '*.pm' mimetypes 'text/x-perl', 'application/x-perl' def self.analyze_text(text) return 1 if text.shebang? 'perl' return 0.4 if text.include? 'my $' end keywords = %w( case continue do else elsif for foreach if last my next our redo reset then unless until while use print new BEGIN CHECK INIT END return ) builtins = %w( abs accept alarm atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die dump each endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime goto grep hex import index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat map mkdir msgctl msgget msgrcv msgsnd my next no oct open opendir ord our pack package pipe pop pos printf prototype push quotemeta rand read readdir readline readlink readpipe recv redo ref rename require reverse rewinddir rindex rmdir scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unlink unpack unshift untie utime values vec wait waitpid wantarray warn write ) re_tok = Str::Regex state :balanced_regex do rule %r{/(\\\\|\\/|[^/])*/[egimosx]*}m, re_tok, :pop! rule %r{!(\\\\|\\!|[^!])*![egimosx]*}m, re_tok, :pop! rule %r{\\(\\\\|[^\\])*\\[egimosx]*}m, re_tok, :pop! rule %r({(\\\\|\\}|[^}])*}[egimosx]*), re_tok, :pop! rule %r{<(\\\\|\\>|[^>])*>[egimosx]*}, re_tok, :pop! rule %r{\[(\\\\|\\\]|[^\]])*\][egimosx]*}, re_tok, :pop! rule %r{\((\\\\|\\\)|[^\)])*\)[egimosx]*}, re_tok, :pop! rule %r{@(\\\\|\\\@|[^\@])*@[egimosx]*}, re_tok, :pop! rule %r{%(\\\\|\\\%|[^\%])*%[egimosx]*}, re_tok, :pop! rule %r{\$(\\\\|\\\$|[^\$])*\$[egimosx]*}, re_tok, :pop! end state :root do rule /#.*?$/, Comment::Single rule /^=[a-zA-Z0-9]+\s+.*?\n=cut/, Comment::Multiline rule /(?:#{keywords.join('|')})\b/, Keyword rule /(format)(\s+)([a-zA-Z0-9_]+)(\s*)(=)(\s*\n)/ do groups Keyword, Text, Name, Text, Punctuation, Text push :format end rule /(?:eq|lt|gt|le|ge|ne|not|and|or|cmp)\b/, Operator::Word # common delimiters rule %r{s/(\\\\|\\/|[^/])*/(\\\\|\\/|[^/])*/[egimosx]*}, re_tok rule %r{s!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*}, re_tok rule %r{s\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*}, re_tok rule %r{s@(\\\\|\\@|[^@])*@(\\\\|\\@|[^@])*@[egimosx]*}, re_tok rule %r{s%(\\\\|\\%|[^%])*%(\\\\|\\%|[^%])*%[egimosx]*}, re_tok # balanced delimiters rule %r(s{(\\\\|\\}|[^}])*}\s*), re_tok, :balanced_regex rule %r{s<(\\\\|\\>|[^>])*>\s*}, re_tok, :balanced_regex rule %r{s\[(\\\\|\\\]|[^\]])*\]\s*}, re_tok, :balanced_regex rule %r{s\((\\\\|\\\)|[^\)])*\)\s*}, re_tok, :balanced_regex rule %r{m?/(\\\\|\\/|[^/\n])*/[gcimosx]*}, re_tok rule %r(m(?=[/!\\{<\[\(@%\$])), re_tok, :balanced_regex rule %r{((?<==~)|(?<=\())\s*/(\\\\|\\/|[^/])*/[gcimosx]*}, re_tok, :balanced_regex rule /\s+/, Text rule /(?:#{builtins.join('|')})\b/, Name::Builtin rule /((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b/, Name::Builtin::Pseudo rule /<<([\'"]?)([a-zA-Z_][a-zA-Z0-9_]*)\1;?\n.*?\n\2\n/m, Str rule /__END__\b/, Comment::Preproc, :end_part rule /\$\^[ADEFHILMOPSTWX]/, Name::Variable::Global rule /\$[\\"'\[\]&`+*.,;=%~?@$!<>(^\|\/-](?!\w)/, Name::Variable::Global rule /[$@%#]+/, Name::Variable, :varname rule /0_?[0-7]+(_[0-7]+)*/, Num::Oct rule /0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*/, Num::Hex rule /0b[01]+(_[01]+)*/, Num::Bin rule /(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?/i, Num::Float rule /\d+(_\d*)*e[+-]?\d+(_\d*)*/i, Num::Float rule /\d+(_\d+)*/, Num::Integer rule /'(\\\\|\\'|[^'])*'/, Str rule /"(\\\\|\\"|[^"])*"/, Str rule /`(\\\\|\\`|[^`])*`/, Str::Backtick rule /<([^\s>]+)>/, re_tok rule /(q|qq|qw|qr|qx)\{/, Str::Other, :cb_string rule /(q|qq|qw|qr|qx)\(/, Str::Other, :rb_string rule /(q|qq|qw|qr|qx)\[/, Str::Other, :sb_string rule /(q|qq|qw|qr|qx)>|>=|<=|<=>|={3}|!=|=~|!~|&&?|\|\||\.{1,3}/, Operator rule /[-+\/*%=<>&^\|!\\~]=?/, Operator rule /[()\[\]:;,<>\/?{}]/, Punctuation rule(/(?=\w)/) { push :name } end state :format do rule /\.\n/, Str::Interpol, :pop! rule /.*?\n/, Str::Interpol end state :name_common do rule /\w+::/, Name::Namespace rule /[\w:]+/, Name::Variable, :pop! end state :varname do rule /\s+/, Text rule /\{/, Punctuation, :pop! # hash syntax rule /\)|,/, Punctuation, :pop! # arg specifier mixin :name_common end state :name do mixin :name_common rule /[A-Z_]+(?=[^a-zA-Z0-9_])/, Name::Constant, :pop! rule(/(?=\W)/) { pop! } end state :modulename do rule /[a-z_]\w*/i, Name::Namespace, :pop! end state :funcname do rule /[a-zA-Z_]\w*[!?]?/, Name::Function rule /\s+/, Text # argument declaration rule /(\([$@%]*\))(\s*)/ do groups Punctuation, Text end rule /.*?{/, Punctuation, :pop! rule /;/, Punctuation, :pop! end [[:cb, '\{', '\}'], [:rb, '\(', '\)'], [:sb, '\[', '\]'], [:lt, '<', '>']].each do |name, open, close| tok = Str::Other state :"#{name}_string" do rule /\\[#{open}#{close}\\]/, tok rule /\\/, tok rule(/#{open}/) { token tok; push } rule /#{close}/, tok, :pop! rule /[^#{open}#{close}\\]+/, tok end end state :end_part do # eat the rest of the stream rule /.+/m, Comment::Preproc, :pop! end end end end rugments-1.0.0.beta8/lib/rugments/lexers/rust.rb0000644000076400007640000001162112544707752020666 0ustar pravipravimodule Rugments module Lexers class Rust < RegexLexer title 'Rust' desc 'The Rust programming language (rust-lang.org)' tag 'rust' aliases 'rs' # TODO: *.rc conflicts with the rc shell... filenames '*.rs', '*.rc' mimetypes 'text/x-rust' def self.analyze_text(text) return 1 if text.shebang? 'rustc' end def self.keywords @keywords ||= %w( as assert break const copy do drop else enum extern fail false fn for if impl let log loop match mod move mut priv pub pure ref return self static struct true trait type unsafe use while box ) end def self.builtins @builtins ||= Set.new %w( Add BitAnd BitOr BitXor bool c_char c_double c_float char c_int clock_t c_long c_longlong Cons Const Copy c_schar c_short c_uchar c_uint c_ulong c_ulonglong c_ushort c_void dev_t DIR dirent Div Either Eq Err f32 f64 Failure FILE float fpos_t i16 i32 i64 i8 Index ino_t int intptr_t Left mode_t Modulo Mul Neg Nil None Num off_t Ok Option Ord Owned pid_t Ptr ptrdiff_t Right Send Shl Shr size_t Some ssize_t str Sub Success time_t u16 u32 u64 u8 uint uintptr_t Box Vec String Gc Rc Arc ) end def macro_closed? @macro_delims.values.all?(&:zero?) end start do @macro_delims = { ']' => 0, ')' => 0, '}' => 0 } end delim_map = { '[' => ']', '(' => ')', '{' => '}' } id = /[a-z_]\w*/i hex = /[0-9a-f]/i escapes = %r( \\ ([nrt'\\] | x#{hex}{2} | u#{hex}{4} | U#{hex}{8}) )x size = /8|16|32|64/ state :start_line do mixin :whitespace rule /\s+/, Text rule /#\[/ do token Comment::Preproc; push :attribute end rule(//) { pop! } end state :attribute do mixin :whitespace mixin :has_literals rule /[(,)=]/, Comment::Preproc rule /\]/, Comment::Preproc, :pop! rule id, Comment::Preproc end state :whitespace do rule /\s+/, Text rule %r{//[^\n]*}, Comment rule %r{/[*].*?[*]/}m, Comment::Multiline end state :root do rule /\n/, Text, :start_line mixin :whitespace rule /\b(?:#{Rust.keywords.join('|')})\b/, Keyword mixin :has_literals rule %r{[=-]>}, Keyword rule %r{<->}, Keyword rule /[()\[\]{}|,:;]/, Punctuation rule /[*!@~&+%^<>=-]/, Operator rule /([.]\s*)?#{id}(?=\s*[(])/m, Name::Function rule /[.]\s*#{id}/, Name::Property rule /(#{id})(::)/m do groups Name::Namespace, Punctuation end # macros rule /\bmacro_rules!/, Name::Decorator, :macro_rules rule /#{id}!/, Name::Decorator, :macro rule /#{id}/ do |m| name = m[0] if self.class.builtins.include? name token Name::Builtin else token Name end end end state :macro do mixin :has_literals rule /[\[{(]/ do |m| @macro_delims[delim_map[m[0]]] += 1 puts " macro_delims: #{@macro_delims.inspect}" if @debug token Punctuation end rule /[\]})]/ do |m| @macro_delims[m[0]] -= 1 puts " macro_delims: #{@macro_delims.inspect}" if @debug pop! if macro_closed? token Punctuation end # same as the rule in root, but don't push another macro state rule /#{id}!/, Name::Decorator mixin :root # No syntax errors in macros rule /./, Text end state :macro_rules do rule /[$]#{id}(:#{id})?/, Name::Variable rule /[$]/, Name::Variable mixin :macro end state :has_literals do # constants rule /\b(?:true|false|nil)\b/, Keyword::Constant # characters rule %r{ ' (?: #{escapes} | [^\\] ) ' }x, Str::Char rule /"/, Str, :string # numbers dot = /[.][0-9_]+/ exp = /e[-+]?[0-9_]+/ flt = /f32|f64/ rule %r{ [0-9]+ (#{dot} #{exp}? #{flt}? |#{dot}? #{exp} #{flt}? |#{dot}? #{exp}? #{flt} ) }x, Num::Float rule %r{ ( 0b[10_]+ | 0x[0-9a-fA-F-]+ | [0-9]+ ) (u#{size}?|i#{size})? }x, Num::Integer end state :string do rule /"/, Str, :pop! rule escapes, Str::Escape rule /%%/, Str::Interpol rule %r{ % ( [0-9]+ [$] )? # Parameter [0#+-]* # Flag ( [0-9]+ [$]? )? # Width ( [.] [0-9]+ )? # Precision [bcdfiostuxX?] # Type }x, Str::Interpol rule /[^%"\\]+/m, Str end end end end rugments-1.0.0.beta8/lib/rugments/lexers/racket.rb0000644000076400007640000007145412544707752021154 0ustar pravipravimodule Rugments module Lexers class Racket < RegexLexer title 'Racket' desc 'Racket is a Lisp descended from Scheme (racket-lang.org)' tag 'racket' filenames '*.rkt', '*.rktd', '*.rktl' mimetypes 'text/x-racket', 'application/x-racket' def self.analyze_text(text) text = text.strip return 1 if text.start_with? '#lang racket' return 0.6 if text =~ %r{\A#lang [a-z/-]+$}i end def self.keywords @keywords ||= Set.new %w( ... and begin begin-for-syntax begin0 case case-lambda cond datum->syntax-object define define-for-syntax define-logger define-struct define-syntax define-syntax-rule define-syntaxes define-values define-values-for-syntax delay do expand-path fluid-let force hash-table-copy hash-table-count hash-table-for-each hash-table-get hash-table-iterate-first hash-table-iterate-key hash-table-iterate-next hash-table-iterate-value hash-table-map hash-table-put! hash-table-remove! hash-table? if lambda let let* let*-values let-struct let-syntax let-syntaxes let-values let/cc let/ec letrec letrec-syntax letrec-syntaxes letrec-syntaxes+values letrec-values list-immutable make-hash-table make-immutable-hash-table make-namespace module module* module-identifier=? module-label-identifier=? module-template-identifier=? module-transformer-identifier=? namespace-transformer-require or parameterize parameterize* parameterize-break promise? prop:method-arity-error provide provide-for-label provide-for-syntax quasiquote quasisyntax quasisyntax/loc quote quote-syntax quote-syntax/prune require require-for-label require-for-syntax require-for-template set! set!-values syntax syntax-case syntax-case* syntax-id-rules syntax-object->datum syntax-rules syntax/loc tcp-abandon-port tcp-accept tcp-accept-evt tcp-accept-ready? tcp-accept/enable-break tcp-addresses tcp-close tcp-connect tcp-connect/enable-break tcp-listen tcp-listener? tcp-port? time transcript-off transcript-on udp-addresses udp-bind! udp-bound? udp-close udp-connect! udp-connected? udp-multicast-interface udp-multicast-join-group! udp-multicast-leave-group! udp-multicast-loopback? udp-multicast-set-interface! udp-multicast-set-loopback! udp-multicast-set-ttl! udp-multicast-ttl udp-open-socket udp-receive! udp-receive!* udp-receive!-evt udp-receive!/enable-break udp-receive-ready-evt udp-send udp-send* udp-send-evt udp-send-ready-evt udp-send-to udp-send-to* udp-send-to-evt udp-send-to/enable-break udp-send/enable-break udp? unless unquote unquote-splicing unsyntax unsyntax-splicing when with-continuation-mark with-handlers with-handlers* with-syntax λ) end def self.builtins @builtins ||= Set.new %w( * + - / < <= = > >= abort-current-continuation abs absolute-path? acos add1 alarm-evt always-evt andmap angle append apply arithmetic-shift arity-at-least arity-at-least-value arity-at-least? asin assoc assq assv atan banner bitwise-and bitwise-bit-field bitwise-bit-set? bitwise-ior bitwise-not bitwise-xor boolean? bound-identifier=? box box-cas! box-immutable box? break-enabled break-thread build-path build-path/convention-type byte-pregexp byte-pregexp? byte-ready? byte-regexp byte-regexp? byte? bytes bytes->immutable-bytes bytes->list bytes->path bytes->path-element bytes->string/latin-1 bytes->string/locale bytes->string/utf-8 bytes-append bytes-close-converter bytes-convert bytes-convert-end bytes-converter? bytes-copy bytes-copy! bytes-environment-variable-name? bytes-fill! bytes-length bytes-open-converter bytes-ref bytes-set! bytes-utf-8-index bytes-utf-8-length bytes-utf-8-ref bytes? bytes? caaaar caaadr caaar caadar caaddr caadr caar cadaar cadadr cadar caddar cadddr caddr cadr call-in-nested-thread call-with-break-parameterization call-with-composable-continuation call-with-continuation-barrier call-with-continuation-prompt call-with-current-continuation call-with-default-reading-parameterization call-with-escape-continuation call-with-exception-handler call-with-immediate-continuation-mark call-with-input-file call-with-output-file call-with-parameterization call-with-semaphore call-with-semaphore/enable-break call-with-values call/cc call/ec car cdaaar cdaadr cdaar cdadar cdaddr cdadr cdar cddaar cddadr cddar cdddar cddddr cdddr cddr cdr ceiling channel-get channel-put channel-put-evt channel-put-evt? channel-try-get channel? chaperone-box chaperone-continuation-mark-key chaperone-evt chaperone-hash chaperone-of? chaperone-procedure chaperone-prompt-tag chaperone-struct chaperone-struct-type chaperone-vector chaperone? char->integer char-alphabetic? char-blank? char-ci<=? char-ci=? char-ci>? char-downcase char-foldcase char-general-category char-graphic? char-iso-control? char-lower-case? char-numeric? char-punctuation? char-ready? char-symbolic? char-title-case? char-titlecase char-upcase char-upper-case? char-utf-8-length char-whitespace? char<=? char=? char>? char? check-duplicate-identifier checked-procedure-check-and-extract choice-evt cleanse-path close-input-port close-output-port collect-garbage collection-file-path collection-path compile compile-allow-set!-undefined compile-context-preservation-enabled compile-enforce-module-constants compile-syntax compiled-expression? compiled-module-expression? complete-path? complex? cons continuation-mark-key? continuation-mark-set->context continuation-mark-set->list continuation-mark-set->list* continuation-mark-set-first continuation-mark-set? continuation-marks continuation-prompt-available? continuation-prompt-tag? continuation? copy-file cos current-break-parameterization current-code-inspector current-command-line-arguments current-compile current-compiled-file-roots current-continuation-marks current-custodian current-directory current-directory-for-user current-drive current-environment-variables current-error-port current-eval current-evt-pseudo-random-generator current-gc-milliseconds current-get-interaction-input-port current-inexact-milliseconds current-input-port current-inspector current-library-collection-paths current-load current-load-extension current-load-relative-directory current-load/use-compiled current-locale current-memory-use current-milliseconds current-module-declare-name current-module-declare-source current-module-name-resolver current-module-path-for-load current-namespace current-output-port current-parameterization current-preserved-thread-cell-values current-print current-process-milliseconds current-prompt-read current-pseudo-random-generator current-read-interaction current-reader-guard current-readtable current-seconds current-security-guard current-subprocess-custodian-mode current-thread current-thread-group current-thread-initial-stack-size current-write-relative-directory custodian-box-value custodian-box? custodian-limit-memory custodian-managed-list custodian-memory-accounting-available? custodian-require-memory custodian-shutdown-all custodian? custom-print-quotable-accessor custom-print-quotable? custom-write-accessor custom-write? date date* date*-nanosecond date*-time-zone-name date*? date-day date-dst? date-hour date-minute date-month date-second date-time-zone-offset date-week-day date-year date-year-day date? datum-intern-literal default-continuation-prompt-tag delete-directory delete-file denominator directory-exists? directory-list display displayln dump-memory-stats dynamic-require dynamic-require-for-syntax dynamic-wind environment-variables-copy environment-variables-names environment-variables-ref environment-variables-set! environment-variables? eof eof-object? ephemeron-value ephemeron? eprintf eq-hash-code eq? equal-hash-code equal-secondary-hash-code equal? equal?/recur eqv-hash-code eqv? error error-display-handler error-escape-handler error-print-context-length error-print-source-location error-print-width error-value->string-handler eval eval-jit-enabled eval-syntax even? evt? exact->inexact exact-integer? exact-nonnegative-integer? exact-positive-integer? exact? executable-yield-handler exit exit-handler exn exn-continuation-marks exn-message exn:break exn:break-continuation exn:break:hang-up exn:break:hang-up? exn:break:terminate exn:break:terminate? exn:break? exn:fail exn:fail:contract exn:fail:contract:arity exn:fail:contract:arity? exn:fail:contract:continuation exn:fail:contract:continuation? exn:fail:contract:divide-by-zero exn:fail:contract:divide-by-zero? exn:fail:contract:non-fixnum-result exn:fail:contract:non-fixnum-result? exn:fail:contract:variable exn:fail:contract:variable-id exn:fail:contract:variable? exn:fail:contract? exn:fail:filesystem exn:fail:filesystem:errno exn:fail:filesystem:errno-errno exn:fail:filesystem:errno? exn:fail:filesystem:exists exn:fail:filesystem:exists? exn:fail:filesystem:missing-module exn:fail:filesystem:missing-module-path exn:fail:filesystem:missing-module? exn:fail:filesystem:version exn:fail:filesystem:version? exn:fail:filesystem? exn:fail:network exn:fail:network:errno exn:fail:network:errno-errno exn:fail:network:errno? exn:fail:network? exn:fail:out-of-memory exn:fail:out-of-memory? exn:fail:read exn:fail:read-srclocs exn:fail:read:eof exn:fail:read:eof? exn:fail:read:non-char exn:fail:read:non-char? exn:fail:read? exn:fail:syntax exn:fail:syntax-exprs exn:fail:syntax:missing-module exn:fail:syntax:missing-module-path exn:fail:syntax:missing-module? exn:fail:syntax:unbound exn:fail:syntax:unbound? exn:fail:syntax? exn:fail:unsupported exn:fail:unsupported? exn:fail:user exn:fail:user? exn:fail? exn:missing-module-accessor exn:missing-module? exn:srclocs-accessor exn:srclocs? exn? exp expand expand-once expand-syntax expand-syntax-once expand-syntax-to-top-form expand-to-top-form expand-user-path explode-path expt file-exists? file-or-directory-identity file-or-directory-modify-seconds file-or-directory-permissions file-position file-position* file-size file-stream-buffer-mode file-stream-port? file-truncate filesystem-change-evt filesystem-change-evt-cancel filesystem-change-evt? filesystem-root-list find-executable-path find-library-collection-paths find-system-path fixnum? floating-point-bytes->real flonum? floor flush-output for-each format fprintf free-identifier=? gcd generate-temporaries gensym get-output-bytes get-output-string getenv global-port-print-handler guard-evt handle-evt handle-evt? hash hash-equal? hash-eqv? hash-has-key? hash-placeholder? hash-ref! hasheq hasheqv identifier-binding identifier-binding-symbol identifier-label-binding identifier-prune-lexical-context identifier-prune-to-source-module identifier-remove-from-definition-context identifier-template-binding identifier-transformer-binding identifier? imag-part immutable? impersonate-box impersonate-continuation-mark-key impersonate-hash impersonate-procedure impersonate-prompt-tag impersonate-struct impersonate-vector impersonator-ephemeron impersonator-of? impersonator-prop:application-mark impersonator-property-accessor-procedure? impersonator-property? impersonator? inexact->exact inexact-real? inexact? input-port? inspector? integer->char integer->integer-bytes integer-bytes->integer integer-length integer-sqrt integer-sqrt/remainder integer? internal-definition-context-seal internal-definition-context? keyword->string keywordbytes list->string list->vector list-ref list-tail list? load load-extension load-on-demand-enabled load-relative load-relative-extension load/cd load/use-compiled local-expand local-expand/capture-lifts local-transformer-expand local-transformer-expand/capture-lifts locale-string-encoding log log-max-level magnitude make-arity-at-least make-bytes make-channel make-continuation-mark-key make-continuation-prompt-tag make-custodian make-custodian-box make-date make-date* make-derived-parameter make-directory make-environment-variables make-ephemeron make-exn make-exn:break make-exn:break:hang-up make-exn:break:terminate make-exn:fail make-exn:fail:contract make-exn:fail:contract:arity make-exn:fail:contract:continuation make-exn:fail:contract:divide-by-zero make-exn:fail:contract:non-fixnum-result make-exn:fail:contract:variable make-exn:fail:filesystem make-exn:fail:filesystem:errno make-exn:fail:filesystem:exists make-exn:fail:filesystem:missing-module make-exn:fail:filesystem:version make-exn:fail:network make-exn:fail:network:errno make-exn:fail:out-of-memory make-exn:fail:read make-exn:fail:read:eof make-exn:fail:read:non-char make-exn:fail:syntax make-exn:fail:syntax:missing-module make-exn:fail:syntax:unbound make-exn:fail:unsupported make-exn:fail:user make-file-or-directory-link make-hash-placeholder make-hasheq-placeholder make-hasheqv make-hasheqv-placeholder make-immutable-hasheqv make-impersonator-property make-input-port make-inspector make-known-char-range-list make-output-port make-parameter make-phantom-bytes make-pipe make-placeholder make-polar make-prefab-struct make-pseudo-random-generator make-reader-graph make-readtable make-rectangular make-rename-transformer make-resolved-module-path make-security-guard make-semaphore make-set!-transformer make-shared-bytes make-sibling-inspector make-special-comment make-srcloc make-string make-struct-field-accessor make-struct-field-mutator make-struct-type make-struct-type-property make-syntax-delta-introducer make-syntax-introducer make-thread-cell make-thread-group make-vector make-weak-box make-weak-hasheqv make-will-executor map max mcar mcdr mcons member memq memv min module->exports module->imports module->language-info module->namespace module-compiled-cross-phase-persistent? module-compiled-exports module-compiled-imports module-compiled-language-info module-compiled-name module-compiled-submodules module-declared? module-path-index-join module-path-index-resolve module-path-index-split module-path-index-submodule module-path-index? module-path? module-predefined? module-provide-protected? modulo mpair? nack-guard-evt namespace-attach-module namespace-attach-module-declaration namespace-base-phase namespace-mapped-symbols namespace-module-identifier namespace-module-registry namespace-require namespace-require/constant namespace-require/copy namespace-require/expansion-time namespace-set-variable-value! namespace-symbol->identifier namespace-syntax-introduce namespace-undefine-variable! namespace-unprotect-module namespace-variable-value namespace? negative? never-evt newline normal-case-path not null null? number->string number? numerator object-name odd? open-input-bytes open-input-file open-input-output-file open-input-string open-output-bytes open-output-file open-output-string ormap output-port? pair? parameter-procedure=? parameter? parameterization? path->bytes path->complete-path path->directory-path path->string path-add-suffix path-convention-type path-element->bytes path-element->string path-for-some-system? path-list-string->path-list path-replace-suffix path-string? path? peek-byte peek-byte-or-special peek-bytes peek-bytes! peek-bytes-avail! peek-bytes-avail!* peek-bytes-avail!/enable-break peek-char peek-char-or-special peek-string peek-string! phantom-bytes? pipe-content-length placeholder-get placeholder-set! placeholder? poll-guard-evt port-closed-evt port-closed? port-commit-peeked port-count-lines! port-count-lines-enabled port-counts-lines? port-display-handler port-file-identity port-file-unlock port-next-location port-print-handler port-progress-evt port-provides-progress-evts? port-read-handler port-try-file-lock? port-write-handler port-writes-atomic? port-writes-special? port? positive? prefab-key->struct-type prefab-key? prefab-struct-key pregexp pregexp? primitive-closure? primitive-result-arity primitive? print print-as-expression print-boolean-long-form print-box print-graph print-hash-table print-mpair-curly-braces print-pair-curly-braces print-reader-abbreviations print-struct print-syntax-width print-unreadable print-vector-length printf procedure->method procedure-arity procedure-arity-includes? procedure-arity? procedure-closure-contents-eq? procedure-extract-target procedure-reduce-arity procedure-rename procedure-struct-type? procedure? progress-evt? prop:arity-string prop:checked-procedure prop:custom-print-quotable prop:custom-write prop:equal+hash prop:evt prop:exn:missing-module prop:exn:srclocs prop:impersonator-of prop:input-port prop:liberal-define-context prop:output-port prop:procedure prop:rename-transformer prop:set!-transformer pseudo-random-generator->vector pseudo-random-generator-vector? pseudo-random-generator? putenv quotient quotient/remainder raise raise-argument-error raise-arguments-error raise-arity-error raise-mismatch-error raise-range-error raise-result-error raise-syntax-error raise-type-error raise-user-error random random-seed rational? rationalize read read-accept-bar-quote read-accept-box read-accept-compiled read-accept-dot read-accept-graph read-accept-infix-dot read-accept-lang read-accept-quasiquote read-accept-reader read-byte read-byte-or-special read-bytes read-bytes! read-bytes-avail! read-bytes-avail!* read-bytes-avail!/enable-break read-bytes-line read-case-sensitive read-char read-char-or-special read-curly-brace-as-paren read-decimal-as-inexact read-eval-print-loop read-language read-line read-on-demand-source read-square-bracket-as-paren read-string read-string! read-syntax read-syntax/recursive read/recursive readtable-mapping readtable? real->double-flonum real->floating-point-bytes real->single-flonum real-part real? regexp regexp-match regexp-match-peek regexp-match-peek-immediate regexp-match-peek-positions regexp-match-peek-positions-immediate regexp-match-peek-positions-immediate/end regexp-match-peek-positions/end regexp-match-positions regexp-match-positions/end regexp-match/end regexp-match? regexp-max-lookbehind regexp-replace regexp-replace* regexp? relative-path? remainder rename-file-or-directory rename-transformer-target rename-transformer? reroot-path resolve-path resolved-module-path-name resolved-module-path? reverse round seconds->date security-guard? semaphore-peek-evt semaphore-peek-evt? semaphore-post semaphore-try-wait? semaphore-wait semaphore-wait/enable-break semaphore? set!-transformer-procedure set!-transformer? set-box! set-mcar! set-mcdr! set-phantom-bytes! set-port-next-location! shared-bytes shell-execute simplify-path sin single-flonum? sleep special-comment-value special-comment? split-path sqrt srcloc srcloc->string srcloc-column srcloc-line srcloc-position srcloc-source srcloc-span srcloc? string string->bytes/latin-1 string->bytes/locale string->bytes/utf-8 string->immutable-string string->keyword string->list string->number string->path string->path-element string->symbol string->uninterned-symbol string->unreadable-symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-copy! string-downcase string-environment-variable-name? string-fill! string-foldcase string-length string-locale-ci? string-locale-downcase string-locale-upcase string-locale? string-normalize-nfc string-normalize-nfd string-normalize-nfkc string-normalize-nfkd string-ref string-set! string-titlecase string-upcase string-utf-8-length string<=? string=? string>? string? struct->vector struct-accessor-procedure? struct-constructor-procedure? struct-info struct-mutator-procedure? struct-predicate-procedure? struct-type-info struct-type-make-constructor struct-type-make-predicate struct-type-property-accessor-procedure? struct-type-property? struct-type? struct:arity-at-least struct:date struct:date* struct:exn struct:exn:break struct:exn:break:hang-up struct:exn:break:terminate struct:exn:fail struct:exn:fail:contract struct:exn:fail:contract:arity struct:exn:fail:contract:continuation struct:exn:fail:contract:divide-by-zero struct:exn:fail:contract:non-fixnum-result struct:exn:fail:contract:variable struct:exn:fail:filesystem struct:exn:fail:filesystem:errno struct:exn:fail:filesystem:exists struct:exn:fail:filesystem:missing-module struct:exn:fail:filesystem:version struct:exn:fail:network struct:exn:fail:network:errno struct:exn:fail:out-of-memory struct:exn:fail:read struct:exn:fail:read:eof struct:exn:fail:read:non-char struct:exn:fail:syntax struct:exn:fail:syntax:missing-module struct:exn:fail:syntax:unbound struct:exn:fail:unsupported struct:exn:fail:user struct:srcloc struct? sub1 subbytes subprocess subprocess-group-enabled subprocess-kill subprocess-pid subprocess-status subprocess-wait subprocess? substring symbol->string symbol-interned? symbol-unreadable? symbol? sync sync/enable-break sync/timeout sync/timeout/enable-break syntax->list syntax-arm syntax-column syntax-disarm syntax-e syntax-line syntax-local-bind-syntaxes syntax-local-certifier syntax-local-context syntax-local-expand-expression syntax-local-get-shadower syntax-local-introduce syntax-local-lift-context syntax-local-lift-expression syntax-local-lift-module-end-declaration syntax-local-lift-provide syntax-local-lift-require syntax-local-lift-values-expression syntax-local-make-definition-context syntax-local-make-delta-introducer syntax-local-module-defined-identifiers syntax-local-module-exports syntax-local-module-required-identifiers syntax-local-name syntax-local-phase-level syntax-local-submodules syntax-local-transforming-module-provides? syntax-local-value syntax-local-value/immediate syntax-original? syntax-position syntax-property syntax-property-symbol-keys syntax-protect syntax-rearm syntax-recertify syntax-shift-phase-level syntax-source syntax-source-module syntax-span syntax-taint syntax-tainted? syntax-track-origin syntax-transforming-module-expression? syntax-transforming? syntax? system-big-endian? system-idle-evt system-language+country system-library-subpath system-path-convention-type system-type tan terminal-port? thread thread-cell-ref thread-cell-set! thread-cell-values? thread-cell? thread-dead-evt thread-dead? thread-group? thread-resume thread-resume-evt thread-rewind-receive thread-running? thread-suspend thread-suspend-evt thread-wait thread/suspend-to-kill thread? time-apply truncate unbox uncaught-exception-handler use-collection-link-paths use-compiled-file-paths use-user-specific-search-paths values variable-reference->empty-namespace variable-reference->module-base-phase variable-reference->module-declaration-inspector variable-reference->module-path-index variable-reference->module-source variable-reference->namespace variable-reference->phase variable-reference->resolved-module-path variable-reference-constant? variable-reference? vector vector->immutable-vector vector->list vector->pseudo-random-generator vector->pseudo-random-generator! vector->values vector-fill! vector-immutable vector-length vector-ref vector-set! vector-set-performance-stats! vector? version void void? weak-box-value weak-box? will-execute will-executor? will-register will-try-execute with-input-from-file with-output-to-file wrap-evt write write-byte write-bytes write-bytes-avail write-bytes-avail* write-bytes-avail-evt write-bytes-avail/enable-break write-char write-special write-special-avail* write-special-evt write-string zero? ) end # Since Racket allows identifiers to consist of nearly anything, # it's simpler to describe what an ID is _not_. id = /[^\s\(\)\[\]\{\}'`,.]+/i state :root do # comments rule /;.*$/, Comment::Single rule /\s+/m, Text rule /[+-]inf[.][f0]/, Num::Float rule /[+-]nan[.]0/, Num::Float rule /[-]min[.]0/, Num::Float rule /[+]max[.]0/, Num::Float rule /-?\d+\.\d+/, Num::Float rule /-?\d+/, Num::Integer rule /#:#{id}+/, Name::Tag # keyword rule /#b[01]+/, Num::Bin rule /#o[0-7]+/, Num::Oct rule /#d[0-9]+/, Num::Integer rule /#x[0-9a-f]+/i, Num::Hex rule /#[ei][\d.]+/, Num::Other rule /"(\\\\|\\"|[^"])*"/, Str rule /['`]#{id}/i, Str::Symbol rule /#\\([()\/'"._!\$%& ?=+-]{1}|[a-z0-9]+)/i, Str::Char rule /#t|#f/, Name::Constant rule /(?:'|#|`|,@|,|\.)/, Operator rule /(['#])(\s*)(\()/m do groups Str::Symbol, Text, Punctuation end # () [] {} are all permitted as like pairs rule /\(|\[|\{/, Punctuation, :command rule /\)|\]|\}/, Punctuation rule id, Name::Variable end state :command do rule id, Name::Function do |m| if self.class.keywords.include? m[0] token Keyword elsif self.class.builtins.include? m[0] token Name::Builtin else token Name::Function end pop! end rule(//) { pop! } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/gherkin/0000755000076400007640000000000012544707752020772 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/lexers/gherkin/keywords.rb0000644000076400007640000002621712544707752023176 0ustar pravipravi# automatically generated by `rake builtins:gherkin` module Rugments module Lexers def Gherkin.keywords @keywords ||= {}.tap do |k| k[:feature] = Set.new ["Ability", "Ahoy matey!", "Arwedd", "Aspekt", "Besigheid Behoefte", "Business Need", "Caracteristica", "Característica", "Egenskab", "Egenskap", "Eiginleiki", "Feature", "Fitur", "Fonctionnalité", "Fonksyonalite", "Funcionalidade", "Funcionalitat", "Functionalitate", "Functionaliteit", "Funcţionalitate", "Funcționalitate", "Fungsi", "Funkcia", "Funkcija", "Funkcionalitāte", "Funkcionalnost", "Funkcja", "Funksie", "Funktionalität", "Funktionalitéit", "Funzionalità", "Fīča", "Hwaet", "Hwæt", "Jellemző", "Karakteristik", "Lastnost", "Mak", "Mogucnost", "Mogućnost", "Moznosti", "Možnosti", "OH HAI", "Omadus", "Ominaisuus", "Osobina", "Potrzeba biznesowa", "Požadavek", "Požiadavka", "Pretty much", "Qap", "Qu'meH 'ut", "Savybė", "Trajto", "Tính năng", "Vermoë", "Vlastnosť", "Właściwość", "Značilnost", "laH", "perbogh", "poQbogh malja'", "Özellik", "Δυνατότητα", "Λειτουργία", "Могућност", "Мөмкинлек", "Особина", "Свойство", "Функционал", "Функционалност", "Функция", "Функціонал", "Үзенчәлеклелек", "תכונה", "خاصية", "خصوصیت", "صلاحیت", "وِیژگی", "کاروبار کی ضرورت", "रूप लेख", "ਖਾਸੀਅਤ", "ਨਕਸ਼ ਨੁਹਾਰ", "ਮੁਹਾਂਦਰਾ", "గుణము", "ಹೆಚ್ಚಳ", "ความต้องการทางธุรกิจ", "ความสามารถ", "โครงหลัก", "フィーチャ", "功能", "機能", "기능"] k[:element] = Set.new ["Abstract Scenario", "Abstrakt Scenario", "Achtergrond", "Aer", "Agtergrond", "All y'all", "Antecedentes", "Antecedents", "Atburðarás", "Awww, look mate", "B4", "Background", "Baggrund", "Bakgrund", "Bakgrunn", "Bakgrunnur", "Bối cảnh", "Cefndir", "Cenario", "Cenario de Fundo", "Cenário", "Cenário de Fundo", "Contesto", "Context", "Contexte", "Contexto", "Dasar", "Delineacao do Cenario", "Delineação do Cenário", "Dis is what went down", "Dyagram Senaryo", "Dyagram senaryo", "Esbozo do escenario", "Escenari", "Escenario", "Esquema de l'escenari", "Esquema del escenario", "Esquema do Cenario", "Esquema do Cenário", "First off", "Fono", "Forgatókönyv", "Forgatókönyv vázlat", "Fundo", "Geçmiş", "Grundlage", "Hannergrond", "Heave to", "Háttér", "Istorik", "Keadaan", "Khung kịch bản", "Khung tình huống", "Koncept", "Konsep skenario", "Kontekst", "Kontekstas", "Konteksts", "Kontext", "Konturo de la scenaro", "Kontèks", "Kịch bản", "Latar Belakang", "Lýsing Atburðarásar", "Lýsing Dæma", "MISHUN", "MISHUN SRSLY", "Menggariskan Senario", "Náčrt Scenára", "Náčrt Scenáru", "Náčrt Scénáře", "Oris scenarija", "Osnova", "Osnova Scenára", "Osnova scénáře", "Osnutek", "Ozadje", "Plan Senaryo", "Plan du Scénario", "Plan du scénario", "Plan senaryo", "Plang vum Szenario", "Pozadie", "Pozadina", "Pozadí", "Primer", "Raamstsenaarium", "Reckon it's like", "Rerefons", "Scenarie", "Scenarij", "Scenarijaus šablonas", "Scenarijus", "Scenario", "Scenario Amlinellol", "Scenario Outline", "Scenario Template", "Scenariomal", "Scenariomall", "Scenariu", "Scenariusz", "Scenaro", "Scenár", "Scenārijs", "Scenārijs pēc parauga", "Schema dello scenario", "Scénario", "Scénář", "Senario", "Senaryo", "Senaryo Deskripsyon", "Senaryo deskripsyon", "Senaryo taslağı", "Shiver me timbers", "Situai", "Situasie", "Situasie Uiteensetting", "Situācija", "Skenario", "Skenario konsep", "Skica", "Structura scenariu", "Structură scenariu", "Struktura scenarija", "Stsenaarium", "Swa", "Swa hwaer swa", "Swa hwær swa", "Szablon scenariusza", "Szenario", "Szenariogrundriss", "Tapaus", "Tapausaihio", "Taust", "Tausta", "Template Keadaan", "Template Senario", "Template Situai", "The thing of it is", "Tình huống", "Wharrimean is", "Yo-ho-ho", "Założenia", "lut", "lut chovnatlh", "mo'", "Ær", "Περιγραφή Σεναρίου", "Σενάριο", "Υπόβαθρο", "Кереш", "Контекст", "Концепт", "Основа", "Передумова", "Позадина", "Предистория", "Предыстория", "Пример", "Рамка на сценарий", "Скица", "Структура сценария", "Структура сценарија", "Структура сценарію", "Сценарий", "Сценарий структураси", "Сценарийның төзелеше", "Сценарио", "Сценарій", "Тарих", "רקע", "תבנית תרחיש", "תרחיש", "الخلفية", "الگوی سناریو", "زمینه", "سناریو", "سيناريو", "سيناريو مخطط", "منظر نامے کا خاکہ", "منظرنامہ", "پس منظر", "परिदृश्य", "परिदृश्य रूपरेखा", "पृष्ठभूमि", "ਪਟਕਥਾ", "ਪਟਕਥਾ ਢਾਂਚਾ", "ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ", "ਪਿਛੋਕੜ", "కథనం", "నేపథ్యం", "సన్నివేశం", "ಕಥಾಸಾರಾಂಶ", "ವಿವರಣೆ", "ಹಿನ್ನೆಲೆ", "สรุปเหตุการณ์", "เหตุการณ์", "แนวคิด", "โครงสร้างของเหตุการณ์", "シナリオ", "シナリオアウトライン", "シナリオテンプレ", "シナリオテンプレート", "テンプレ", "剧本", "剧本大纲", "劇本", "劇本大綱", "场景", "场景大纲", "場景", "場景大綱", "背景", "배경", "시나리오", "시나리오 개요"] k[:examples] = Set.new ["Atburðarásir", "Beispiele", "Beispiller", "Cenarios", "Cenários", "Conto", "Contoh", "Contone", "Dead men tell no tales", "Dæmi", "Dữ liệu", "EXAMPLZ", "Egzanp", "Ejemplos", "Eksempler", "Ekzemploj", "Enghreifftiau", "Esempi", "Examples", "Exempel", "Exemple", "Exemples", "Exemplos", "Juhtumid", "Paraugs", "Pavyzdžiai", "Piemēri", "Primeri", "Primjeri", "Przykłady", "Príklady", "Példák", "Příklady", "Scenarijai", "Scenariji", "Scenarios", "Se the", "Se ðe", "Se þe", "Tapaukset", "Variantai", "Voorbeelde", "Voorbeelden", "You'll wanna", "ghantoH", "lutmey", "Örnekler", "Παραδείγματα", "Σενάρια", "Мисаллар", "Мисоллар", "Приклади", "Примери", "Примеры", "Сценарији", "Үрнәкләр", "דוגמאות", "امثلة", "مثالیں", "نمونه ها", "उदाहरण", "ਉਦਾਹਰਨਾਂ", "ఉదాహరణలు", "ಉದಾಹರಣೆಗಳು", "ชุดของตัวอย่าง", "ชุดของเหตุการณ์", "サンプル", "例", "例子", "예"] k[:step] = Set.new ["'a", "'ach", "'ej", "*", "7", "A", "A taktiež", "A také", "A tiež", "A zároveň", "AN", "Aber", "Ac", "Adott", "Ak", "Akkor", "Ale", "Aleshores", "Ali", "Allora", "Alors", "Als", "Ama", "Amennyiben", "Amikor", "Ampak", "An", "Ananging", "And", "And y'all", "Angenommen", "Anrhegedig a", "Apabila", "Atesa", "Atunci", "Atès", "Avast!", "Aye", "BUT", "Bagi", "Banjur", "Bet", "Biết", "Blimey!", "Buh", "But", "But at the end of the day I reckon", "But y'all", "Cal", "Cand", "Cando", "Ce", "Cho", "Cuando", "Când", "DEN", "DaH ghu' bejlu'", "Dada", "Dadas", "Dado", "Dados", "Dan", "Dann", "Dano", "Dar", "Dat fiind", "Data", "Date", "Date fiind", "Dati", "Dati fiind", "Dato", "Daţi fiind", "Dați fiind", "De", "Den youse gotta", "Dengan", "Diberi", "Diyelim ki", "Do", "Donada", "Donat", "Donitaĵo", "Dun", "Duota", "E", "Eeldades", "Ef", "En", "Entao", "Entonces", "Então", "Entón", "Epi", "Et", "Etant donné", "Etant donnée", "Etant données", "Etant donnés", "Eğer ki", "Fakat", "Gangway!", "Gdy", "Gegeben sei", "Gegeben seien", "Gegeven", "Gegewe", "Gitt", "Given", "Given y'all", "Givet", "Givun", "Ha", "I", "I CAN HAZ", "In", "Ir", "It's just unbelievable", "Ja", "Jeśli", "Jeżeli", "Kad", "Kada", "Kadar", "Kai", "Kaj", "Když", "Kemudian", "Ketika", "Keď", "Khi", "Kiedy", "Ko", "Kui", "Kuid", "Kun", "Lan", "Le", "Le sa a", "Let go and haul", "Logo", "Lorsqu'<", "Lorsque", "Lè", "Lè sa a", "Ma", "Maar", "Mais", "Majd", "Mając", "Maka", "Manawa", "Mas", "Men", "Menawa", "Mutta", "Nalika", "Nalikaning", "Nanging", "Nato", "Nhưng", "Niin", "Njuk", "När", "Når", "O zaman", "Och", "Og", "Oletetaan", "Ond", "Onda", "Oraz", "Pak", "Pero", "Però", "Podano", "Pokiaľ", "Pokud", "Potem", "Potom", "Privzeto", "Pryd", "Quan", "Quand", "Quando", "Se", "Sed", "Si", "Siis", "Sipoze", "Sipoze Ke", "Sipoze ke", "Soit", "Stel", "Så", "Tad", "Tada", "Tak", "Takrat", "Tapi", "Ter", "Tetapi", "Tha", "Tha the", "Then", "Then y'all", "Thurh", "Thì", "Toda", "Too right", "Un", "Und", "Ve", "Vendar", "Và", "WEN", "Wanneer", "Wenn", "When", "When y'all", "Wtedy", "Wun", "Y", "Y'know", "Yeah nah", "Yna", "Youse know like when", "Youse know when youse got", "Za predpokladu", "Za předpokladu", "Zadan", "Zadani", "Zadano", "Zadate", "Zadato", "Zakładając", "Zaradi", "Zatati", "a", "an", "awer", "dann", "ghu' noblu'", "latlh", "mä", "qaSDI'", "ugeholl", "vaj", "wann", "És", "Étant donné", "Étant donnée", "Étant données", "Étant donnés", "Ða", "Ða ðe", "Ðurh", "Þa", "Þa þe", "Þegar", "Þurh", "Þá", "Če", "Şi", "Și", "Όταν", "Αλλά", "Δεδομένου", "Και", "Τότε", "І", "А", "А також", "Агар", "Але", "Али", "Аммо", "Бирок", "Ва", "Вә", "Дадено", "Дано", "Допустим", "Если", "Задате", "Задати", "Задато", "И", "К тому же", "Кад", "Када", "Когато", "Когда", "Коли", "Лекин", "Ләкин", "Нехай", "Но", "Нәтиҗәдә", "Онда", "Припустимо", "Припустимо, що", "Пусть", "Та", "Также", "То", "Тогда", "Тоді", "Унда", "Якщо", "Һәм", "Әгәр", "Әйтик", "Әмма", "אבל", "אז", "אזי", "בהינתן", "וגם", "כאשר", "آنگاه", "اذاً", "اما", "اور", "اگر", "با فرض", "بالفرض", "بفرض", "تب", "ثم", "جب", "عندما", "فرض کیا", "لكن", "لیکن", "متى", "هنگامی", "و", "پھر", "अगर", "और", "कदा", "किन्तु", "चूंकि", "जब", "तथा", "तदा", "तब", "पर", "परन्तु", "यदि", "ਅਤੇ", "ਜਦੋਂ", "ਜਿਵੇਂ ਕਿ", "ਜੇਕਰ", "ਤਦ", "ਪਰ", "అప్పుడు", "ఈ పరిస్థితిలో", "కాని", "చెప్పబడినది", "మరియు", "ಆದರೆ", "ನಂತರ", "ನೀಡಿದ", "ಮತ್ತು", "ಸ್ಥಿತಿಯನ್ನು", "กำหนดให้", "ดังนั้น", "เมื่อ", "แต่", "และ", "かつ<", "しかし<", "ただし<", "ならば<", "もし<", "並且<", "但し<", "但是<", "假如<", "假定<", "假設<", "假设<", "前提<", "同时<", "同時<", "并且<", "当<", "當<", "而且<", "那么<", "那麼<", "그러면<", "그리고<", "단<", "만약<", "만일<", "먼저<", "조건<", "하지만<"] end end end end rugments-1.0.0.beta8/lib/rugments/lexers/moonscript.rb0000644000076400007640000000605612544707752022074 0ustar pravipravimodule Rugments module Lexers load_const :Lua, 'lua.rb' class Moonscript < RegexLexer title 'MoonScript' desc 'Moonscript (http://www.moonscript.org)' tag 'moonscript' aliases 'moon' filenames '*.moon' mimetypes 'text/x-moonscript', 'application/x-moonscript' def initialize(opts = {}) @function_highlighting = opts.delete(:function_highlighting) { true } @disabled_modules = opts.delete(:disabled_modules) { [] } super(opts) end def self.analyze_text(text) return 1 if text.shebang? 'moon' end def builtins return [] unless @function_highlighting @builtins ||= Set.new.tap do |builtins| Rouge::Lexers::Lua.builtins.each do |mod, fns| next if @disabled_modules.include? mod builtins.merge(fns) end end end state :root do rule %r{#!(.*?)$}, Comment::Preproc # shebang rule //, Text, :main end state :base do ident = '(?:[\w_][\w\d_]*)' rule %r{(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?'}, Num::Float rule %r{(?i)\d+e[+-]?\d+}, Num::Float rule %r{(?i)0x[0-9a-f]*}, Num::Hex rule %r{\d+}, Num::Integer rule %r{@#{ident}*}, Name::Variable::Instance rule %r{[A-Z][\w\d_]*}, Name::Class rule %r{"?[^"]+":}, Literal::String::Symbol rule %r{#{ident}:}, Literal::String::Symbol rule %r{:#{ident}}, Literal::String::Symbol rule %r{\s+}, Text::Whitespace rule %r{(==|~=|!=|<=|>=|\.\.\.|\.\.|->|=>|[=+\-*/%^<>#!\\])}, Operator rule %r([\[\]\{\}\(\)\.,:;]), Punctuation rule %r{(and|or|not)\b}, Operator::Word keywords = %w( break class continue do else elseif end extends for if import in repeat return switch super then unless until using when with while ) rule %r{(#{keywords.join('|')})\b}, Keyword rule %r{(local|export)\b}, Keyword::Declaration rule %r{(true|false|nil)\b}, Keyword::Constant rule %r{[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?} do |m| name = m[0] if self.builtins.include?(name) token Name::Builtin elsif name =~ /\./ a, b = name.split('.', 2) token Name, a token Punctuation, '.' token Name, b else token Name end end end state :main do rule %r{--.*$}, Comment::Single rule %r{\[(=*)\[.*?\]\1\]}m, Str::Heredoc mixin :base rule %r{'}, Str::Single, :sqs rule %r{"}, Str::Double, :dqs end state :sqs do rule %r{'}, Str::Single, :pop! rule %r{[^']+}, Str::Single end state :interpolation do rule %r(\}), Str::Interpol, :pop! mixin :base end state :dqs do rule %r(#\{), Str::Interpol, :interpolation rule %r{"}, Str::Double, :pop! rule %r(#[^{]), Str::Double rule %r{[^"#]+}, Str::Double end end end end rugments-1.0.0.beta8/lib/rugments/lexers/tex.rb0000644000076400007640000000341212544707752020470 0ustar pravipravimodule Rugments module Lexers class TeX < RegexLexer title 'TeX' desc 'The TeX typesetting system' tag 'tex' aliases 'TeX', 'LaTeX', 'latex' filenames '*.tex', '*.aux', '*.toc' mimetypes 'text/x-tex', 'text/x-latex' def self.analyze_text(text) return 1 if text =~ /\A\s*\\documentclass/ return 1 if text =~ /\A\s*\\input/ return 1 if text =~ /\A\s*\\documentstyle/ return 1 if text =~ /\A\s*\\relax/ end command = /\\([a-z]+|\s+|.)/i state :general do rule /%.*$/, Comment rule /[{}&_^]/, Punctuation end state :root do rule /\\\[/, Punctuation, :displaymath rule /\\\(/, Punctuation, :inlinemath rule /\$\$/, Punctuation, :displaymath rule /\$/, Punctuation, :inlinemath rule /\\(begin|end)\{.*?\}/, Name::Tag rule /(\\verb)\b(\S)(.*?)(\2)/ do |_m| groups Name::Builtin, Keyword::Pseudo, Str::Other, Keyword::Pseudo end rule command, Keyword, :command mixin :general rule /[^\\$%&_^{}]+/, Text end state :math do rule command, Name::Variable mixin :general rule /[0-9]+/, Num rule /[-=!+*\/()\[\]]/, Operator rule /[^=!+*\/()\[\]\\$%&_^{}0-9-]+/, Name::Builtin end state :inlinemath do rule /\\\)/, Punctuation, :pop! rule /\$/, Punctuation, :pop! mixin :math end state :displaymath do rule /\\\]/, Punctuation, :pop! rule /\$\$/, Punctuation, :pop! rule /\$/, Name::Builtin mixin :math end state :command do rule /\[.*?\]/, Name::Attribute rule /\*/, Keyword rule(//) { pop! } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/haml.rb0000644000076400007640000001325412544707752020616 0ustar pravipravimodule Rugments module Lexers # A lexer for the Haml templating system for Ruby. # @see http://haml.info class Haml < RegexLexer include Indentation title 'Haml' desc 'The Haml templating system for Ruby (haml.info)' tag 'haml' aliases 'HAML' filenames '*.haml' mimetypes 'text/x-haml' def self.analyze_text(text) return 0.1 if text.start_with? '!!!' end # @option opts :filters # A hash of filter name to lexer of how various filters should be # highlighted. By default, :javascript, :css, :ruby, and :erb # are supported. def initialize(opts = {}) (opts.delete(:filters) || {}).each do |name, lexer| unless lexer.respond_to? :lex lexer = Lexer.find(lexer) or fail "unknown lexer: #{lexer}" lexer = lexer.new(options) end filters[name.to_s] = lexer end super(opts) end def ruby @ruby ||= Ruby.new(options) end def html @html ||= HTML.new(options) end def filters @filters ||= { 'javascript' => Javascript.new(options), 'css' => CSS.new(options), 'ruby' => ruby, 'erb' => ERB.new(options), 'markdown' => Markdown.new(options), # TODO # 'sass' => Sass.new(options), # 'textile' => Textile.new(options), # 'maruku' => Maruku.new(options), } end start { ruby.reset!; html.reset! } identifier = /[\w:-]+/ ruby_var = /[a-z]\w*/ # Haml can include " |\n" anywhere, # which is ignored and used to wrap long lines. # To accomodate this, use this custom faux dot instead. dot = /[ ]\|\n(?=.*[ ]\|)|./ # In certain places, a comma at the end of the line # allows line wrapping as well. comma_dot = /,\s*\n|#{dot}/ state :root do rule /\s*\n/, Text rule(/\s*/) { |m| token Text; indentation(m[0]) } end state :content do mixin :css rule(/%#{identifier}/) { token Name::Tag; goto :tag } rule /!!!#{dot}*\n/, Name::Namespace, :pop! rule %r{ (/) (\[#{dot}*?\]) (#{dot}*\n) }x do groups Comment, Comment::Special, Comment pop! end rule %r{/#{dot}*\n} do token Comment pop! starts_block :html_comment_block end rule /-##{dot}*\n/ do token Comment pop! starts_block :haml_comment_block end rule /-/ do token Punctuation reset_stack push :ruby_line end # filters rule /:(#{dot}*)\n/ do |m| token Name::Decorator pop! starts_block :filter_block filter_name = m[1].strip @filter_lexer = filters[filter_name] @filter_lexer.reset! unless @filter_lexer.nil? puts " haml: filter #{filter_name.inspect} #{@filter_lexer.inspect}" if @debug end mixin :eval_or_plain end state :css do rule(/\.#{identifier}/) { token Name::Class; goto :tag } rule(/##{identifier}/) { token Name::Function; goto :tag } end state :tag do mixin :css rule(/\{#{comma_dot}*?\}/) { delegate ruby } rule(/\[#{dot}*?\]/) { delegate ruby } rule /\(/, Punctuation, :html_attributes rule /\s*\n/, Text, :pop! # whitespace chompers rule /[<>]{1,2}(?=[ \t=])/, Punctuation mixin :eval_or_plain end state :plain do rule(/([^#\n]|#[^{\n]|(\\\\)*\\#\{)+/) { delegate html } mixin :interpolation rule(/\n/) { token Text; reset_stack } end state :eval_or_plain do rule /[&!]?==/, Punctuation, :plain rule /[&!]?[=!]/ do token Punctuation reset_stack push :ruby_line end rule(//) { push :plain } end state :ruby_line do rule /\n/, Text, :pop! rule(/,[ \t]*\n/) { delegate ruby } rule /[ ]\|[ \t]*\n/, Str::Escape rule(/.*?(?=(,$| \|)?[ \t]*$)/) { delegate ruby } end state :html_attributes do rule /\s+/, Text rule /#{identifier}\s*=/, Name::Attribute, :html_attribute_value rule identifier, Name::Attribute rule /\)/, Text, :pop! end state :html_attribute_value do rule /\s+/, Text rule ruby_var, Name::Variable, :pop! rule /@#{ruby_var}/, Name::Variable::Instance, :pop! rule /\$#{ruby_var}/, Name::Variable::Global, :pop! rule /'(\\\\|\\'|[^'\n])*'/, Str, :pop! rule /"(\\\\|\\"|[^"\n])*"/, Str, :pop! end state :html_comment_block do rule /#{dot}+/, Comment mixin :indented_block end state :haml_comment_block do rule /#{dot}+/, Comment::Preproc mixin :indented_block end state :filter_block do rule /([^#\n]|#[^{\n]|(\\\\)*\\#\{)+/ do if @filter_lexer delegate @filter_lexer else token Name::Decorator end end mixin :interpolation mixin :indented_block end state :interpolation do rule /#[{]/, Str::Interpol, :ruby end state :ruby do rule /[}]/, Str::Interpol, :pop! mixin :ruby_inner end state :ruby_inner do rule(/[{]/) { delegate ruby; push :ruby_inner } rule(/[}]/) { delegate ruby; pop! } rule(/[^{}]+/) { delegate ruby } end state :indented_block do rule(/\n/) { token Text; reset_stack } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/objective_c.rb0000644000076400007640000001062712544707752022152 0ustar pravipravimodule Rugments module Lexers load_const :C, 'c.rb' class ObjectiveC < C tag 'objective_c' title 'Objective-C' desc 'an extension of C commonly used to write Apple software' aliases 'objc' filenames '*.m', '*.h' mimetypes 'text/x-objective_c', 'application/x-objective_c' def self.at_keywords @at_keywords ||= %w( selector private protected public encode synchronized try throw catch finally end property synthesize dynamic optional interface implementation import ) end def self.at_builtins @at_builtins ||= %w(true false YES NO) end def self.builtins @builtins ||= %w(YES NO nil) end def self.analyze_text(text) return 1 if text =~ /@(end|implementation|protocol|property)\b/ id = /[a-z$_][a-z0-9$_]*/i return 0.4 if text =~ %r{ \[ \s* #{id} \s+ (?: #{id} \s* \] | #{id}? : ) }x return 0.4 if text.include? '@"' end id = /[a-z$_][a-z0-9$_]*/i prepend :statements do rule /@"/, Str, :string rule /@'(\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|\\.|[^\\'\n]')/, Str::Char rule /@(\d+[.]\d*|[.]\d+|\d+)e[+-]?\d+l?/i, Num::Float rule /@(\d+[.]\d*|[.]\d+|\d+f)f?/i, Num::Float rule /@0x\h+[lL]?/, Num::Hex rule /@0[0-7]+l?/i, Num::Oct rule /@\d+l?/, Num::Integer rule /\bin\b/, Keyword rule /@(?:interface|implementation)\b/ do token Keyword goto :classname end rule /@(?:class|protocol)\b/ do token Keyword goto :forward_classname end rule /@([[:alnum:]]+)/ do |m| if self.class.at_keywords.include? m[1] token Keyword elsif self.class.at_builtins.include? m[1] token Name::Builtin else token Error end end rule /[?]/, Punctuation, :ternary rule /\[/, Punctuation, :message end state :ternary do rule /:/, Punctuation, :pop! mixin :statements end state :message_shared do rule /\]/, Punctuation, :pop! rule /;/, Error mixin :statement end state :message do rule /(#{id})(\s*)(:)/ do groups(Name::Function, Text, Punctuation) goto :message_with_args end rule /(#{id})(\s*)(\])/ do groups(Name::Function, Text, Punctuation) pop! end mixin :message_shared end state :message_with_args do rule /(#{id})(\s*)(:)/ do groups(Name::Function, Text, Punctuation) end mixin :message_shared end state :classname do mixin :whitespace rule /(#{id})(\s*)(:)(\s*)(#{id})/ do groups(Name::Class, Text, Punctuation, Text, Name::Class) pop! end rule /(#{id})(\s*)([(])(\s*)(#{id})(\s*)([)])/ do groups(Name::Class, Text, Punctuation, Text, Name::Label, Text, Punctuation) end rule id, Name::Class, :pop! end state :forward_classname do mixin :whitespace rule /(#{id})(\s*)(,)(\s*)/ do groups(Name::Class, Text, Punctuation, Text) push end rule /(#{id})(\s*)(;?)/ do groups(Name::Class, Text, Punctuation) pop! end end prepend :root do rule %r{ ([-+])(\s*) ([(].*?[)])?(\s*) (?=#{id}:?) }ix do |m| token Keyword, m[1]; token Text, m[2] recurse m[3]; token Text, m[4] push :method_definition end end state :method_definition do rule /,/, Punctuation rule /[.][.][.]/, Punctuation rule /([(].*?[)])(#{id})/ do |m| recurse m[1]; token Name::Variable, m[2] end rule /(#{id})(\s*)(:)/m do groups(Name::Function, Text, Punctuation) end rule /;/, Punctuation, :pop! rule /{/ do token Punctuation goto :function end mixin :inline_whitespace rule %r{//.*?\n}, Comment::Single rule /\s+/m, Text rule(//) { pop! } end end end end rugments-1.0.0.beta8/lib/rugments/lexers/literate_coffeescript.rb0000644000076400007640000000117512544707752024241 0ustar pravipravimodule Rugments module Lexers class LiterateCoffeescript < RegexLexer tag 'literate_coffeescript' title 'Literate CoffeeScript' desc 'Literate coffeescript' aliases 'litcoffee' filenames '*.litcoffee' def markdown @markdown ||= Markdown.new(options) end def coffee @coffee ||= Coffeescript.new(options) end start { markdown.reset!; coffee.reset! } state :root do rule /^( .*?\n)+/m do delegate coffee end rule /^([ ]{0,3}(\S.*?|)\n)*/m do delegate markdown end end end end end rugments-1.0.0.beta8/lib/rugments/lexers/apache/0000755000076400007640000000000012544707752020564 5ustar pravipravirugments-1.0.0.beta8/lib/rugments/lexers/apache/keywords.yml0000644000076400007640000002121612544707752023160 0ustar pravipravi:sections: - "DirectoryMatch" - "Directory" - "FilesMatch" - "Files" - "IfDefine" - "IfModule" - "LimitExcept" - "Limit" - "LocationMatch" - "Location" - "ProxyMatch" - "Proxy" - "VirtualHost" :directives: - "AcceptMutex" - "AcceptPathInfo" - "AccessConfig" - "AccessFileName" - "Action" - "AddAlt" - "AddAltByEncoding" - "AddAltByType" - "AddCharset" - "AddDefaultCharset" - "AddDescription" - "AddEncoding" - "AddHandler" - "AddIcon" - "AddIconByEncoding" - "AddIconByType" - "AddInputFilter" - "AddLanguage" - "AddModule" - "AddModuleInfo" - "AddOutputFilter" - "AddOutputFilterByType" - "AddType" - "AgentLog" - "Alias" - "AliasMatch" - "Allow from" - "Allow" - "AllowCONNECT" - "AllowEncodedSlashes" - "AllowOverride" - "Anonymous" - "Anonymous_Authoritative" - "Anonymous_LogEmail" - "Anonymous_MustGiveEmail" - "Anonymous_NoUserID" - "Anonymous_VerifyEmail" - "AssignUserID" - "AuthAuthoritative" - "AuthDBAuthoritative" - "AuthDBGroupFile" - "AuthDBMAuthoritative" - "AuthDBMGroupFile" - "AuthDBMType" - "AuthDBMUserFile" - "AuthDBUserFile" - "AuthDigestAlgorithm" - "AuthDigestDomain" - "AuthDigestFile" - "AuthDigestGroupFile" - "AuthDigestNcCheck" - "AuthDigestNonceFormat" - "AuthDigestNonceLifetime" - "AuthDigestQop" - "AuthDigestShmemSize" - "AuthGroupFile" - "AuthLDAPAuthoritative" - "AuthLDAPBindDN" - "AuthLDAPBindPassword" - "AuthLDAPCharsetConfig" - "AuthLDAPCompareDNOnServer" - "AuthLDAPDereferenceAliases" - "AuthLDAPEnabled" - "AuthLDAPFrontPageHack" - "AuthLDAPGroupAttribute" - "AuthLDAPGroupAttributeIsDN" - "AuthLDAPRemoteUserIsDN" - "AuthLDAPUrl" - "AuthName" - "AuthType" - "AuthUserFile" - "BS2000Account" - "BindAddress" - "BrowserMatch" - "BrowserMatchNoCase" - "CGIMapExtension" - "CacheDefaultExpire" - "CacheDirLength" - "CacheDirLevels" - "CacheDisable" - "CacheEnable" - "CacheExpiryCheck" - "CacheFile" - "CacheForceCompletion" - "CacheGcClean" - "CacheGcDaily" - "CacheGcInterval" - "CacheGcMemUsage" - "CacheGcUnused" - "CacheIgnoreCacheControl" - "CacheIgnoreNoLastMod" - "CacheLastModifiedFactor" - "CacheMaxExpire" - "CacheMaxFileSize" - "CacheMinFileSize" - "CacheNegotiatedDocs" - "CacheRoot" - "CacheSize" - "CacheTimeMargin" - "CharsetDefault" - "CharsetOptions" - "CharsetSourceEnc" - "CheckSpelling" - "ChildPerUserID" - "ClearModuleList" - "ContentDigest" - "CookieDomain" - "CookieExpires" - "CookieLog" - "CookieName" - "CookieStyle" - "CookieTracking" - "CoreDumpDirectory" - "CustomLog" - "Dav" - "DavDepthInfinity" - "DavLockDB" - "DavMinTimeout" - "DefaultIcon" - "DefaultLanguage" - "DefaultMode" - "DefaultType" - "DeflateBufferSize" - "DeflateCompressionLevel" - "DeflateFilterNote" - "DeflateMemLevel" - "DeflateWindowSize" - "Deny" - "DirectoryIndex" - "DirectorySlash" - "DocTitle" - "DocTrailer" - "DocumentRoot" - "EnableExceptionHook" - "EnableMMAP" - "EnableSendfile" - "ErrorDocument" - "ErrorLog" - "Example" - "ExpiresActive" - "ExpiresByType" - "ExpiresDefault" - "ExtFilterDefine" - "ExtFilterOptions" - "ExtendedStatus" - "FancyIndexing" - "FileETag" - "ForceLanguagePriority" - "ForceType" - "ForensicLog" - "Group" - "HTMLDir" - "HTTPLogFile" - "HeadPrefix" - "HeadSuffix" - "Header" - "HeaderName" - "HideSys" - "HideURL" - "HostNameLookups" - "HostnameLookups" - "ISAPIAppendLogToErrors" - "ISAPIAppendLogToQuery" - "ISAPICacheFile" - "ISAPIFakeAsync" - "ISAPILogNotSupported" - "ISAPIReadAheadBuffer" - "IdentityCheck" - "ImapBase" - "ImapDefault" - "ImapMenu" - "Include" - "IndexIgnore" - "IndexOptions" - "IndexOrderDefault" - "KeepAlive" - "KeepAliveTimeout" - "LDAPCacheEntries" - "LDAPCacheTTL" - "LDAPOpCacheEntries" - "LDAPOpCacheTTL" - "LDAPSharedCacheFile" - "LDAPSharedCacheSize" - "LDAPTrustedCA" - "LDAPTrustedCAType" - "LanguagePriority" - "LastURLs" - "LimitInternalRecursion" - "LimitRequestBody" - "LimitRequestFields" - "LimitRequestFieldsize" - "LimitRequestLine" - "LimitXMLRequestBody" - "Listen" - "ListenBacklog" - "LoadFile" - "LoadModule" - "LockFile" - "LogFormat" - "LogLevel" - "MCacheMaxObjectCount" - "MCacheMaxObjectSize" - "MCacheMaxStreamingBuffer" - "MCacheMinObjectSize" - "MCacheRemovalAlgorithm" - "MCacheSize" - "MMapFile" - "MaxClients" - "MaxKeepAliveRequests" - "MaxMemFree" - "MaxRequestsPerChild" - "MaxRequestsPerThread" - "MaxSpareServers" - "MaxSpareThreads" - "MaxThreads" - "MaxThreadsPerChild" - "MetaDir" - "MetaFiles" - "MetaSuffix" - "MimeMagicFile" - "MinSpareServers" - "MinSpareThreads" - "ModMimeUsePathInfo" - "MultiviewsMatch" - "NWSSLTrustedCerts" - "NWSSLUpgradeable" - "NameVirtualHost" - "NoCache" - "NoProxy" - "NumServers" - "Options" - "Order" - "PassEnv" - "PidFile" - "Port" - "PrivateDir" - "ProtocolEcho" - "ProxyBadHeader" - "ProxyBlock" - "ProxyDomain" - "ProxyErrorOverride" - "ProxyIOBufferSize" - "ProxyMaxForwards" - "ProxyPass" - "ProxyPassReverse" - "ProxyPreserveHost" - "ProxyReceiveBufferSize" - "ProxyRemote" - "ProxyRemoteMatch" - "ProxyRequests" - "ProxyTimeout" - "ProxyVia" - "RLimitCPU" - "RLimitMEM" - "RLimitNPROC" - "ReadmeName" - "Redirect" - "RedirectMatch" - "RedirectPermanent" - "RedirectTemp" - "RefererIgnore" - "RefererLog" - "RemoveCharset" - "RemoveEncoding" - "RemoveHandler" - "RemoveInputFilter" - "RemoveLanguage" - "RemoveOutputFilter" - "RemoveType" - "RequestHeader" - "Require" - "ResourceConfig" - "RewriteBase" - "RewriteCond" - "RewriteEngine" - "RewriteLock" - "RewriteLog" - "RewriteLogLevel" - "RewriteMap" - "RewriteOptions" - "RewriteRule" - "SSIEndTag" - "SSIErrorMsg" - "SSIStartTag" - "SSITimeFormat" - "SSIUndefinedEcho" - "SSLCACertificateFile" - "SSLCACertificatePath" - "SSLCARevocationFile" - "SSLCARevocationPath" - "SSLCertificateChainFile" - "SSLCertificateFile" - "SSLCertificateKeyFile" - "SSLCipherSuite" - "SSLEngine" - "SSLMutex" - "SSLOptions" - "SSLPassPhraseDialog" - "SSLProtocol" - "SSLProxyCACertificateFile" - "SSLProxyCACertificatePath" - "SSLProxyCARevocationFile" - "SSLProxyCARevocationPath" - "SSLProxyCipherSuite" - "SSLProxyEngine" - "SSLProxyMachineCertificateFile" - "SSLProxyMachineCertificatePath" - "SSLProxyProtocol" - "SSLProxyVerify" - "SSLProxyVerifyDepth" - "SSLRandomSeed" - "SSLRequire" - "SSLRequireSSL" - "SSLSessionCache" - "SSLSessionCacheTimeout" - "SSLVerifyClient" - "SSLVerifyDepth" - "Satisfy" - "ScoreBoardFile" - "Script" - "ScriptAlias" - "ScriptAliasMatch" - "ScriptInterpreterSource" - "ScriptLog" - "ScriptLogBuffer" - "ScriptLogLength" - "ScriptSock" - "SecureListen" - "SendBufferSize" - "ServerAdmin" - "ServerAlias" - "ServerLimit" - "ServerName" - "ServerPath" - "ServerRoot" - "ServerSignature" - "ServerTokens" - "ServerType" - "SetEnv" - "SetEnvIf" - "SetEnvIfNoCase" - "SetHandler" - "SetInputFilter" - "SetOutputFilter" - "StartServers" - "StartThreads" - "SuexecUserGroup" - "ThreadLimit" - "ThreadStackSize" - "ThreadsPerChild" - "TimeOut" - "TopSites" - "TopURLs" - "TransferLog" - "TypesConfig" - "UnsetEnv" - "UseCanonicalName" - "User" - "UserDir" - "VirtualDocumentRoot" - "VirtualDocumentRootIP" - "VirtualScriptAlias" - "VirtualScriptAliasIP" - "Win32DisableAcceptEx" - "XBitHack" - "deny" - "order" - "require" :values: - "All" - "AuthConfig" - "Basic" - "CONNECT" - "DELETE" - "Digest" - "ExecCGI" - "FancyIndexing" - "FileInfo" - "FollowSymLinks" - "Full" - "GET" - "IconsAreLinks" - "Includes" - "IncludesNOEXEC" - "Indexes" - "Limit" - "Minimal" - "MultiViews" - "None" - "OPTIONS" - "OS" - "Options" - "Options" - "POST" - "PUT" - "ScanHTMLTitles" - "SuppressDescription" - "SuppressLastModified" - "SuppressSize" - "SymLinksIfOwnerMatch" - "URL" - "add" - "allow" - "any" - "append" - "deny" - "double" - "downgrade-1.0" - "email" - "env" - "error" - "force-response-1.0" - "formatted" - "from" - "full" - "gone" - "group" - "inetd" - "inherit" - "map" - "mutual-failure" - "nocontent" - "nokeepalive" - "none" - "off" - "on" - "permanent" - "referer" - "seeother" - "semi-formatted" - "set" - "standalone" - "temporary" - "unformatted" - "unset" - "user" - "valid-user"rugments-1.0.0.beta8/lib/rugments/lexers/javascript.rb0000644000076400007640000001550012544707752022037 0ustar pravipravimodule Rugments module Lexers class Javascript < RegexLexer title 'JavaScript' desc 'JavaScript, the browser scripting language' tag 'javascript' aliases 'js' filenames '*.js' mimetypes 'application/javascript', 'application/x-javascript', 'text/javascript', 'text/x-javascript' def self.analyze_text(text) return 1 if text.shebang?('node') return 1 if text.shebang?('jsc') # TODO: rhino, spidermonkey, etc end state :comments_and_whitespace do rule /\s+/, Text rule /