├── .gitignore ├── LICENSE ├── README.md ├── Rakefile ├── bin └── pygmentize ├── lib └── pygmentize.rb ├── pygmentize.gemspec ├── test └── pygmentize.rb └── vendor └── pygments ├── .hgignore ├── .hgtags ├── AUTHORS ├── CHANGES ├── LICENSE ├── MANIFEST.in ├── Makefile ├── TODO ├── docs ├── generate.py ├── pygmentize.1 └── src │ ├── api.txt │ ├── authors.txt │ ├── changelog.txt │ ├── cmdline.txt │ ├── filterdevelopment.txt │ ├── filters.txt │ ├── formatterdevelopment.txt │ ├── formatters.txt │ ├── index.txt │ ├── installation.txt │ ├── integrate.txt │ ├── java.txt │ ├── lexerdevelopment.txt │ ├── lexers.txt │ ├── moinmoin.txt │ ├── plugins.txt │ ├── quickstart.txt │ ├── rstdirective.txt │ ├── styles.txt │ ├── tokens.txt │ └── unicode.txt ├── external ├── autopygmentize ├── lasso-builtins-generator-9.lasso ├── markdown-processor.py ├── moin-parser.py ├── pygments.bashcomp ├── rst-directive-old.py └── rst-directive.py ├── ez_setup.py ├── pygmentize ├── pygments ├── __init__.py ├── cmdline.py ├── console.py ├── filter.py ├── filters │ └── __init__.py ├── formatter.py ├── formatters │ ├── __init__.py │ ├── _mapping.py │ ├── bbcode.py │ ├── html.py │ ├── img.py │ ├── latex.py │ ├── other.py │ ├── rtf.py │ ├── svg.py │ ├── terminal.py │ └── terminal256.py ├── lexer.py ├── lexers │ ├── __init__.py │ ├── _asybuiltins.py │ ├── _clbuiltins.py │ ├── _lassobuiltins.py │ ├── _luabuiltins.py │ ├── _mapping.py │ ├── _openedgebuiltins.py │ ├── _phpbuiltins.py │ ├── _postgres_builtins.py │ ├── _robotframeworklexer.py │ ├── _scilab_builtins.py │ ├── _sourcemodbuiltins.py │ ├── _stan_builtins.py │ ├── _vimbuiltins.py │ ├── agile.py │ ├── asm.py │ ├── compiled.py │ ├── dalvik.py │ ├── dotnet.py │ ├── foxpro.py │ ├── functional.py │ ├── hdl.py │ ├── jvm.py │ ├── math.py │ ├── other.py │ ├── parsers.py │ ├── shell.py │ ├── special.py │ ├── sql.py │ ├── templates.py │ ├── text.py │ └── web.py ├── modeline.py ├── plugin.py ├── scanner.py ├── style.py ├── styles │ ├── __init__.py │ ├── autumn.py │ ├── borland.py │ ├── bw.py │ ├── colorful.py │ ├── default.py │ ├── emacs.py │ ├── friendly.py │ ├── fruity.py │ ├── manni.py │ ├── monokai.py │ ├── murphy.py │ ├── native.py │ ├── pastie.py │ ├── perldoc.py │ ├── rrt.py │ ├── tango.py │ ├── trac.py │ ├── vim.py │ └── vs.py ├── token.py ├── unistring.py └── util.py ├── scripts ├── check_sources.py ├── detect_missing_analyse_text.py ├── epydoc.css ├── find_codetags.py ├── find_error.py ├── get_vimkw.py ├── pylintrc ├── reindent.py └── vim2pygments.py ├── setup.cfg ├── setup.py └── tests ├── dtds ├── HTML4-f.dtd ├── HTML4-s.dtd ├── HTML4.dcl ├── HTML4.dtd ├── HTML4.soc ├── HTMLlat1.ent ├── HTMLspec.ent └── HTMLsym.ent ├── examplefiles ├── ANTLRv3.g ├── AcidStateAdvanced.hs ├── AlternatingGroup.mu ├── BOM.js ├── CPDictionary.j ├── Config.in.cache ├── Constants.mo ├── DancingSudoku.lhs ├── Deflate.fs ├── Errors.scala ├── File.hy ├── Get-CommandDefinitionHtml.ps1 ├── IPDispatchC.nc ├── IPDispatchP.nc ├── Intro.java ├── Makefile ├── Object.st ├── OrderedMap.hx ├── RoleQ.pm6 ├── SmallCheck.hs ├── Sorting.mod ├── Sudoku.lhs ├── addressbook.proto ├── antlr_throws ├── apache2.conf ├── as3_test.as ├── as3_test2.as ├── as3_test3.as ├── aspx-cs_example ├── autoit_submit.au3 ├── badcase.java ├── batchfile.bat ├── bigtest.nsi ├── boot-9.scm ├── ca65_example ├── cbmbas_example ├── cells.ps ├── ceval.c ├── cheetah_example.html ├── classes.dylan ├── condensed_ruby.rb ├── coq_RelationClasses ├── database.pytb ├── de.MoinMoin.po ├── demo.ahk ├── demo.cfm ├── django_sample.html+django ├── dwarf.cw ├── erl_session ├── escape_semicolon.clj ├── evil_regex.js ├── example.Rd ├── example.bug ├── example.c ├── example.ceylon ├── example.clay ├── example.cls ├── example.cob ├── example.cpp ├── example.gs ├── example.gst ├── example.hx ├── example.jag ├── example.kt ├── example.lagda ├── example.lua ├── example.monkey ├── example.moo ├── example.moon ├── example.msc ├── example.nim ├── example.ns2 ├── example.p ├── example.pas ├── example.prg ├── example.rb ├── example.reg ├── example.rexx ├── example.rhtml ├── example.rkt ├── example.rpf ├── example.sh-session ├── example.shell-session ├── example.sml ├── example.snobol ├── example.stan ├── example.tea ├── example.ts ├── example.u ├── example.weechatlog ├── example.xhtml ├── example.xtend ├── example.yaml ├── example2.aspx ├── example2.msc ├── example_elixir.ex ├── example_file.fy ├── firefox.mak ├── flipflop.sv ├── foo.sce ├── format.ml ├── fucked_up.rb ├── function.mu ├── functional.rst ├── garcia-wachs.kk ├── genclass.clj ├── genshi_example.xml+genshi ├── genshitext_example.genshitext ├── glsl.frag ├── glsl.vert ├── grammar-test.p6 ├── hello.smali ├── hello.sp ├── html+php_faulty.php ├── http_request_example ├── http_response_example ├── import.hs ├── inet_pton6.dg ├── intro.ik ├── ints.php ├── intsyn.fun ├── intsyn.sig ├── irb_heredoc ├── irc.lsp ├── java.properties ├── jbst_example1.jbst ├── jbst_example2.jbst ├── jinjadesignerdoc.rst ├── json.lasso ├── json.lasso9 ├── lighttpd_config.conf ├── linecontinuation.py ├── livescript-demo.ls ├── logos_example.xm ├── ltmain.sh ├── main.cmake ├── markdown.lsp ├── matlab_noreturn ├── matlab_sample ├── matlabsession_sample.txt ├── metagrammar.treetop ├── mg_sample.pro ├── minehunt.qml ├── minimal.ns2 ├── moin_SyntaxReference.txt ├── multiline_regexes.rb ├── nanomsg.intr ├── nasm_aoutso.asm ├── nasm_objexe.asm ├── nemerle_sample.n ├── nginx_nginx.conf ├── numbers.c ├── objc_example.m ├── objc_example2.m ├── perl_misc ├── perl_perl5db ├── perl_regex-delims ├── perlfunc.1 ├── phpMyAdmin.spec ├── phpcomplete.vim ├── pleac.in.rb ├── postgresql_test.txt ├── pppoe.applescript ├── psql_session.txt ├── py3_test.txt ├── py3tb_test.py3tb ├── pycon_test.pycon ├── pytb_test2.pytb ├── pytb_test3.pytb ├── python25-bsd.mak ├── qsort.prolog ├── r-console-transcript.Rout ├── ragel-cpp_rlscan ├── ragel-cpp_snippet ├── regex.js ├── reversi.lsp ├── robotframework.txt ├── ruby_func_def.rb ├── rust_example.rs ├── scilab.sci ├── session.dylan-console ├── sibling.prolog ├── simple.md ├── smarty_example.html ├── source.lgt ├── sources.list ├── sphere.pov ├── sqlite3.sqlite3-console ├── squid.conf ├── string.jl ├── string_delimiters.d ├── stripheredoc.sh ├── swig_java.swg ├── swig_std_vector.i ├── test.R ├── test.adb ├── test.agda ├── test.asy ├── test.awk ├── test.bas ├── test.bb ├── test.bmx ├── test.boo ├── test.bro ├── test.cs ├── test.css ├── test.cu ├── test.d ├── test.dart ├── test.dtd ├── test.ebnf ├── test.ec ├── test.ecl ├── test.eh ├── test.erl ├── test.evoque ├── test.fan ├── test.flx ├── test.gdc ├── test.groovy ├── test.html ├── test.ini ├── test.java ├── test.jsp ├── test.maql ├── test.mod ├── test.moo ├── test.myt ├── test.nim ├── test.opa ├── test.p6 ├── test.pas ├── test.php ├── test.plot ├── test.ps1 ├── test.pypylog ├── test.r3 ├── test.rb ├── test.rhtml ├── test.scaml ├── test.ssp ├── test.tcsh ├── test.vb ├── test.vhdl ├── test.xqy ├── test.xsl ├── test2.pypylog ├── truncated.pytb ├── type.lisp ├── underscore.coffee ├── unicode.applescript ├── unicodedoc.py ├── unix-io.lid ├── webkit-transition.css ├── while.pov ├── wiki.factor ├── xml_example └── zmlrpc.f90 ├── old_run.py ├── run.py ├── support.py ├── support └── tags ├── test_basic_api.py ├── test_clexer.py ├── test_cmdline.py ├── test_examplefiles.py ├── test_html_formatter.py ├── test_latex_formatter.py ├── test_lexers_other.py ├── test_perllexer.py ├── test_regexlexer.py ├── test_token.py ├── test_using_api.py └── test_util.py /.gitignore: -------------------------------------------------------------------------------- 1 | /pkg 2 | *.pyc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Damian Janowski & Michel Martens 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Pygmentize 2 | ========== 3 | 4 | A standalone Pygments for Ruby. 5 | 6 | ```ruby 7 | require "pygmentize" 8 | 9 | source = "function foo() { return 'bar'; }" 10 | 11 | Pygmentize.process(source, :javascript) 12 | ``` 13 | 14 | Additional parameters will be passed as command line options, for example: 15 | 16 | ```ruby 17 | Pygmentize.process(source, :javascript, linenos: 'table') 18 | ``` 19 | 20 | You can also use the binary from the command line: 21 | 22 | $ pygmentize -l javascript somefile.js 23 | 24 | You need to have Python installed. 25 | 26 | License 27 | ------- 28 | 29 | Copyright (c) 2010 Damian Janowski & Michel Martens 30 | 31 | Permission is hereby granted, free of charge, to any person 32 | obtaining a copy of this software and associated documentation 33 | files (the "Software"), to deal in the Software without 34 | restriction, including without limitation the rights to use, 35 | copy, modify, merge, publish, distribute, sublicense, and/or sell 36 | copies of the Software, and to permit persons to whom the 37 | Software is furnished to do so, subject to the following 38 | conditions: 39 | 40 | The above copyright notice and this permission notice shall be 41 | included in all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 44 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 45 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 46 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 47 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 48 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 49 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 50 | OTHER DEALINGS IN THE SOFTWARE. 51 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | task :test do 2 | require "cutest" 3 | 4 | Cutest.run(Dir["test/pygmentize.rb"]) 5 | end 6 | 7 | task :cleanup do 8 | `find . -name "*.pyc" -delete` 9 | end 10 | 11 | task :default => :test 12 | -------------------------------------------------------------------------------- /bin/pygmentize: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env ruby 2 | 3 | require "pygmentize" 4 | 5 | exec("#{Pygmentize.bin} #{Shellwords.shelljoin(ARGV)}") 6 | -------------------------------------------------------------------------------- /lib/pygmentize.rb: -------------------------------------------------------------------------------- 1 | require "shellwords" 2 | 3 | class Pygmentize 4 | VERSION = "0.0.4" 5 | 6 | def self.bin 7 | "/usr/bin/env python #{File.expand_path("../vendor/pygments/pygmentize", File.dirname(__FILE__))}" 8 | end 9 | 10 | # generate string of additional options from hash 11 | def self.options_string(options) 12 | opts_string = options.to_a.reduce([]) { |a,i| 13 | a << "-O #{i.map { |i| Shellwords.escape(i.to_s) }.join('=')}" 14 | }.join(' ') 15 | 16 | opts_string 17 | end 18 | 19 | def self.process(source, lexer, options = {}) 20 | options[:encoding] = source.encoding 21 | 22 | args = [ 23 | "-l", lexer.to_s, 24 | "-f", "html" 25 | ] 26 | 27 | cmd = "#{bin} #{Shellwords.shelljoin args} #{options_string(options)}" 28 | IO.popen(cmd, "r+") do |io| 29 | io.write(source) 30 | io.close_write 31 | io.read 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /pygmentize.gemspec: -------------------------------------------------------------------------------- 1 | require "./lib/pygmentize" 2 | 3 | Gem::Specification.new do |s| 4 | s.name = "pygmentize" 5 | s.version = Pygmentize::VERSION 6 | s.summary = "A Ruby gem that vendors Pygments" 7 | s.description = "A Ruby gem that vendors Pygments" 8 | s.authors = ["Damian Janowski", "Michel Martens", "Eric Wood"] 9 | s.email = ["djanowski@dimaion.com", "michel@soveran.com", "eric@ericwood.org"] 10 | s.homepage = "http://github.com/djanowski/pygmentize" 11 | s.files = Dir[ 12 | "*.gemspec", 13 | "LICENSE", 14 | "README.markdown", 15 | "Rakefile", 16 | "lib/**/*.rb", 17 | "test/*.*", 18 | "vendor/**/*", 19 | ] 20 | 21 | s.executables.push("pygmentize") 22 | end 23 | -------------------------------------------------------------------------------- /test/pygmentize.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require File.expand_path("../lib/pygmentize", File.dirname(__FILE__)) 4 | require "nokogiri" 5 | require "shellwords" 6 | 7 | test "colorizes output" do 8 | output = Pygmentize.process(%Q[{foo: "bar"}], :javascript) 9 | 10 | doc = Nokogiri::HTML(output) 11 | 12 | assert doc.at_xpath(".//div[@class='highlight']") 13 | assert doc.at_xpath(".//div[@class='highlight']/pre/span[@class='nx' and text()='foo']") 14 | end 15 | 16 | test "handles encodings" do 17 | output = Pygmentize.process(%Q[{foo: "bar", baz: "qüx"}], :javascript) 18 | 19 | assert output.encoding == Encoding::UTF_8 20 | end 21 | 22 | test "handles command line options" do 23 | to_escape = "two words" 24 | options = {foo: "bar", bar: to_escape} 25 | 26 | opts = Pygmentize.options_string(options) 27 | 28 | assert opts.include?("-O foo=bar ") 29 | 30 | # ensure escaping of options 31 | assert opts.include?("-O bar=#{Shellwords.escape(to_escape)}") 32 | end 33 | 34 | -------------------------------------------------------------------------------- /vendor/pygments/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.pyc 3 | *.pyo 4 | *.egg 5 | build/* 6 | dist/* 7 | Pygments.egg-info/* 8 | .ropeproject 9 | tests/examplefiles/output 10 | -------------------------------------------------------------------------------- /vendor/pygments/.hgtags: -------------------------------------------------------------------------------- 1 | 634420aa4221cc1eb2b3753bd571166bd9e611d4 0.9 2 | 942ecbb5c84ca5d57ae82f5697775973f4e12717 0.10 3 | 63632d0340958d891176db20fe9a32a56abcd5ea 0.11 4 | 13834ec94d2c5a90a68bc2c2a327abd962c486bc 0.11.1 5 | a5748745272afffd725570e068a560d46e28dc1f 1.0 6 | 5a794a620dc711a219722a7af94d9d2e95cda26d 1.1 7 | dd81c35efd95292de4965153c66c8bbfe435f1c4 1.1.1 8 | e7691aa4f473a2cdaa2e5b7bfed8aec196719aca 0.5.1 9 | 6f53364d63ddb8bd9532bb6ea402e3af05275b03 0.5 10 | 11efe99c11e601071c3a77910b9fca769de66fbf 0.6 11 | 99df0a7404d168b05626ffced6fd16edcf58c145 0.7 12 | d0b08fd569d3d9dafec4c045a7d8876442b3ef64 0.7.1 13 | 1054522d1dda9c7899516ead3e65e5e363fdf30d 0.8 14 | 066e56d8f5caa31e15386fff6f938bedd85a8732 0.8.1 15 | bae0833cae75e5a641abe3c4b430fa384cd9d258 1.2 16 | f6e5acee4f761696676e05a9112c91a5a5670b49 1.2.1 17 | 580c5ce755486bc92c79c50f80cfc79924e15140 1.2.2 18 | c62867700c9e98cc2988c62f298ec54cee9b6927 1.3 19 | 3a3846c2503db85bb70a243c8bc702629c4bce57 1.3.1 20 | 8ad6d35dd2ab0530a1e2c088ab7fe0e00426b5f9 1.4 21 | eff3aee4abff2b72564ddfde77fcc82adbba52ad 1.5 22 | 2c262bfc66b05a8aecc1109c3acc5b9447a5213c 1.6rc1 23 | 7c962dcb484cb73394aec7f41709940340dc8a9c 1.6 24 | -------------------------------------------------------------------------------- /vendor/pygments/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2013 by the respective authors (see AUTHORS file). 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/pygments/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pygmentize 2 | include external/* 3 | include Makefile CHANGES LICENSE AUTHORS TODO ez_setup.py 4 | recursive-include tests * 5 | recursive-include docs * 6 | recursive-include scripts * 7 | -------------------------------------------------------------------------------- /vendor/pygments/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Pygments 3 | # ~~~~~~~~~~~~~~~~~~~~~ 4 | # 5 | # Combines scripts for common tasks. 6 | # 7 | # :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 8 | # :license: BSD, see LICENSE for details. 9 | # 10 | 11 | PYTHON ?= python 12 | 13 | export PYTHONPATH = $(shell echo "$$PYTHONPATH"):$(shell python -c 'import os; print ":".join(os.path.abspath(line.strip()) for line in file("PYTHONPATH"))' 2>/dev/null) 14 | 15 | .PHONY: all check clean clean-pyc codetags docs mapfiles \ 16 | pylint reindent test test-coverage 17 | 18 | all: clean-pyc check test 19 | 20 | check: 21 | @$(PYTHON) scripts/detect_missing_analyse_text.py || true 22 | @$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \ 23 | -i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py \ 24 | -i pygments/lexers/_vimbuiltins.py 25 | 26 | clean: clean-pyc 27 | -rm -rf build 28 | -rm -f codetags.html 29 | 30 | clean-pyc: 31 | find . -name '*.pyc' -exec rm -f {} + 32 | find . -name '*.pyo' -exec rm -f {} + 33 | find . -name '*~' -exec rm -f {} + 34 | 35 | codetags: 36 | @$(PYTHON) scripts/find_codetags.py -i tests/examplefiles -i scripts/pylintrc \ 37 | -i scripts/find_codetags.py -o codetags.html . 38 | 39 | docs: docs/build 40 | 41 | docs/build: docs/src/*.txt 42 | $(PYTHON) docs/generate.py html docs/build $? 43 | touch docs/build 44 | 45 | mapfiles: 46 | (cd pygments/lexers; $(PYTHON) _mapping.py) 47 | (cd pygments/formatters; $(PYTHON) _mapping.py) 48 | 49 | pylint: 50 | @pylint --rcfile scripts/pylintrc pygments 51 | 52 | reindent: 53 | @$(PYTHON) scripts/reindent.py -r -B . 54 | 55 | test: 56 | @$(PYTHON) tests/run.py $(TESTS) 57 | 58 | test-coverage: 59 | @$(PYTHON) tests/run.py -C $(TESTS) 60 | -------------------------------------------------------------------------------- /vendor/pygments/TODO: -------------------------------------------------------------------------------- 1 | Todo 2 | ==== 3 | 4 | - suggested new lexers 5 | * IPython sessions 6 | 7 | - lexers that need work: 8 | * review perl lexer (numerous bugs, but so far no one had complaints ;) 9 | * readd property support for C# lexer? that is, find a regex that doesn't 10 | backtrack to death... 11 | * add support for function name highlighting to C++ lexer 12 | 13 | - allow "overlay" token types to highlight specials: nth line, a word etc. 14 | 15 | - pygmentize option presets, more sophisticated method to output styles? 16 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/authors.txt: -------------------------------------------------------------------------------- 1 | ======= 2 | Authors 3 | ======= 4 | 5 | [authors] 6 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/changelog.txt: -------------------------------------------------------------------------------- 1 | ========= 2 | Changelog 3 | ========= 4 | 5 | [changelog] 6 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/filterdevelopment.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ===================== 4 | Write your own filter 5 | ===================== 6 | 7 | *New in Pygments 0.7.* 8 | 9 | Writing own filters is very easy. All you have to do is to subclass 10 | the `Filter` class and override the `filter` method. Additionally a 11 | filter is instanciated with some keyword arguments you can use to 12 | adjust the behavior of your filter. 13 | 14 | 15 | Subclassing Filters 16 | =================== 17 | 18 | As an example, we write a filter that converts all `Name.Function` tokens 19 | to normal `Name` tokens to make the output less colorful. 20 | 21 | .. sourcecode:: python 22 | 23 | from pygments.util import get_bool_opt 24 | from pygments.token import Name 25 | from pygments.filter import Filter 26 | 27 | class UncolorFilter(Filter): 28 | 29 | def __init__(self, **options): 30 | Filter.__init__(self, **options) 31 | self.class_too = get_bool_opt(options, 'classtoo') 32 | 33 | def filter(self, lexer, stream): 34 | for ttype, value in stream: 35 | if ttype is Name.Function or (self.class_too and 36 | ttype is Name.Class): 37 | ttype = Name 38 | yield ttype, value 39 | 40 | Some notes on the `lexer` argument: that can be quite confusing since it doesn't 41 | need to be a lexer instance. If a filter was added by using the `add_filter()` 42 | function of lexers, that lexer is registered for the filter. In that case 43 | `lexer` will refer to the lexer that has registered the filter. It *can* be used 44 | to access options passed to a lexer. Because it could be `None` you always have 45 | to check for that case if you access it. 46 | 47 | 48 | Using a decorator 49 | ================= 50 | 51 | You can also use the `simplefilter` decorator from the `pygments.filter` module: 52 | 53 | .. sourcecode:: python 54 | 55 | from pygments.util import get_bool_opt 56 | from pygments.token import Name 57 | from pygments.filter import simplefilter 58 | 59 | 60 | @simplefilter 61 | def uncolor(lexer, stream, options): 62 | class_too = get_bool_opt(options, 'classtoo') 63 | for ttype, value in stream: 64 | if ttype is Name.Function or (class_too and 65 | ttype is Name.Class): 66 | ttype = Name 67 | yield ttype, value 68 | 69 | The decorator automatically subclasses an internal filter class and uses the 70 | decorated function for filtering. 71 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/filters.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ======= 4 | Filters 5 | ======= 6 | 7 | *New in Pygments 0.7.* 8 | 9 | You can filter token streams coming from lexers to improve or annotate the 10 | output. For example, you can highlight special words in comments, convert 11 | keywords to upper or lowercase to enforce a style guide etc. 12 | 13 | To apply a filter, you can use the `add_filter()` method of a lexer: 14 | 15 | .. sourcecode:: pycon 16 | 17 | >>> from pygments.lexers import PythonLexer 18 | >>> l = PythonLexer() 19 | >>> # add a filter given by a string and options 20 | >>> l.add_filter('codetagify', case='lower') 21 | >>> l.filters 22 | [] 23 | >>> from pygments.filters import KeywordCaseFilter 24 | >>> # or give an instance 25 | >>> l.add_filter(KeywordCaseFilter(case='lower')) 26 | 27 | The `add_filter()` method takes keyword arguments which are forwarded to 28 | the constructor of the filter. 29 | 30 | To get a list of all registered filters by name, you can use the 31 | `get_all_filters()` function from the `pygments.filters` module that returns an 32 | iterable for all known filters. 33 | 34 | If you want to write your own filter, have a look at `Write your own filter`_. 35 | 36 | .. _Write your own filter: filterdevelopment.txt 37 | 38 | 39 | Builtin Filters 40 | =============== 41 | 42 | [builtin_filter_docs] 43 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/formatters.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ==================== 4 | Available formatters 5 | ==================== 6 | 7 | This page lists all builtin formatters. 8 | 9 | Common options 10 | ============== 11 | 12 | All formatters support these options: 13 | 14 | `encoding` 15 | *New in Pygments 0.6.* 16 | 17 | If given, must be an encoding name (such as ``"utf-8"``). This will 18 | be used to convert the token strings (which are Unicode strings) 19 | to byte strings in the output (default: ``None``). 20 | It will also be written in an encoding declaration suitable for the 21 | document format if the `full` option is given (e.g. a ``meta 22 | content-type`` directive in HTML or an invocation of the `inputenc` 23 | package in LaTeX). 24 | 25 | If this is ``""`` or ``None``, Unicode strings will be written 26 | to the output file, which most file-like objects do not support. 27 | For example, `pygments.highlight()` will return a Unicode string if 28 | called with no `outfile` argument and a formatter that has `encoding` 29 | set to ``None`` because it uses a `StringIO.StringIO` object that 30 | supports Unicode arguments to `write()`. Using a regular file object 31 | wouldn't work. 32 | 33 | `outencoding` 34 | *New in Pygments 0.7.* 35 | 36 | When using Pygments from the command line, any `encoding` option given is 37 | passed to the lexer and the formatter. This is sometimes not desirable, 38 | for example if you want to set the input encoding to ``"guess"``. 39 | Therefore, `outencoding` has been introduced which overrides `encoding` 40 | for the formatter if given. 41 | 42 | 43 | Formatter classes 44 | ================= 45 | 46 | All these classes are importable from `pygments.formatters`. 47 | 48 | [builtin_formatter_docs] 49 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/index.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ======== 4 | Overview 5 | ======== 6 | 7 | Welcome to the Pygments documentation. 8 | 9 | - Starting with Pygments 10 | 11 | - `Installation `_ 12 | 13 | - `Introduction and Quickstart `_ 14 | 15 | - `Command line interface `_ 16 | 17 | - Builtin components 18 | 19 | - `Lexers `_ 20 | 21 | - `Formatters `_ 22 | 23 | - `Filters `_ 24 | 25 | - `Styles `_ 26 | 27 | - Reference 28 | 29 | - `Unicode and encodings `_ 30 | 31 | - `Builtin tokens `_ 32 | 33 | - `API documentation `_ 34 | 35 | - Hacking for Pygments 36 | 37 | - `Write your own lexer `_ 38 | 39 | - `Write your own formatter `_ 40 | 41 | - `Write your own filter `_ 42 | 43 | - `Register plugins `_ 44 | 45 | - Hints and Tricks 46 | 47 | - `Using Pygments in ReST documents `_ 48 | 49 | - `Using Pygments with MoinMoin `_ 50 | 51 | - `Using Pygments in other contexts `_ 52 | 53 | - About Pygments 54 | 55 | - `Changelog `_ 56 | 57 | - `Authors `_ 58 | 59 | 60 | -------------- 61 | 62 | If you find bugs or have suggestions for the documentation, please 63 | look `here`_ for info on how to contact the team. 64 | 65 | You can download an offline version of this documentation from the 66 | `download page`_. 67 | 68 | .. _here: http://pygments.org/contribute/ 69 | .. _download page: http://pygments.org/download/ 70 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/installation.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ============ 4 | Installation 5 | ============ 6 | 7 | Pygments requires at least Python 2.4 to work correctly. Just to clarify: 8 | there *won't* ever be support for Python versions below 2.4. However, there 9 | are no other dependencies. 10 | 11 | 12 | Installing a released version 13 | ============================= 14 | 15 | As a Python egg (via easy_install) 16 | ---------------------------------- 17 | 18 | You can install the most recent Pygments version using `easy_install`_:: 19 | 20 | sudo easy_install Pygments 21 | 22 | This will install a Pygments egg in your Python installation's site-packages 23 | directory. 24 | 25 | 26 | From the tarball release 27 | ------------------------- 28 | 29 | 1. Download the most recent tarball from the `download page`_ 30 | 2. Unpack the tarball 31 | 3. ``sudo python setup.py install`` 32 | 33 | Note that the last command will automatically download and install 34 | `setuptools`_ if you don't already have it installed. This requires a working 35 | internet connection. 36 | 37 | This will install Pygments into your Python installation's site-packages directory. 38 | 39 | 40 | Installing the development version 41 | ================================== 42 | 43 | If you want to play around with the code 44 | ---------------------------------------- 45 | 46 | 1. Install `Mercurial`_ 47 | 2. ``hg clone http://bitbucket.org/birkenfeld/pygments-main pygments`` 48 | 3. ``cd pygments`` 49 | 4. ``ln -s pygments /usr/lib/python2.X/site-packages`` 50 | 5. ``ln -s pygmentize /usr/local/bin`` 51 | 52 | As an alternative to steps 4 and 5 you can also do ``python setup.py develop`` 53 | which will install the package via setuptools in development mode. 54 | 55 | .. 56 | If you just want the latest features and use them 57 | ------------------------------------------------- 58 | 59 | :: 60 | 61 | sudo easy_install Pygments==dev 62 | 63 | This will install a Pygments egg containing the latest Subversion trunk code 64 | in your Python installation's site-packages directory. Every time the command 65 | is run, the sources are updated from Subversion. 66 | 67 | 68 | .. _download page: http://pygments.org/download/ 69 | .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools 70 | .. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall 71 | .. _Mercurial: http://selenic.com/mercurial/ 72 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/integrate.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | =================================== 4 | Using Pygments in various scenarios 5 | =================================== 6 | 7 | PyGtk 8 | ----- 9 | 10 | Armin has written a piece of sample code that shows how to create a Gtk 11 | `TextBuffer` object containing Pygments-highlighted text. 12 | 13 | See the article here: http://lucumr.pocoo.org/cogitations/2007/05/30/pygments-gtk-rendering/ 14 | 15 | Wordpress 16 | --------- 17 | 18 | He also has a snippet that shows how to use Pygments in WordPress: 19 | 20 | http://lucumr.pocoo.org/cogitations/2007/05/30/pygments-in-wordpress/ 21 | 22 | Markdown 23 | -------- 24 | 25 | Since Pygments 0.9, the distribution ships Markdown_ preprocessor sample code 26 | that uses Pygments to render source code in `external/markdown-processor.py`. 27 | You can copy and adapt it to your liking. 28 | 29 | .. _Markdown: http://www.freewisdom.org/projects/python-markdown/ 30 | 31 | TextMate 32 | -------- 33 | 34 | Antonio Cangiano has created a Pygments bundle for TextMate that allows to 35 | colorize code via a simple menu option. It can be found here_. 36 | 37 | .. _here: http://antoniocangiano.com/2008/10/28/pygments-textmate-bundle/ 38 | 39 | Bash completion 40 | --------------- 41 | 42 | The source distribution contains a file ``external/pygments.bashcomp`` that 43 | sets up completion for the ``pygmentize`` command in bash. 44 | 45 | Java 46 | ---- 47 | 48 | See the `Java quickstart `_ document. 49 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/java.txt: -------------------------------------------------------------------------------- 1 | ===================== 2 | Use Pygments in Java 3 | ===================== 4 | 5 | Thanks to `Jython `__ it is possible to use Pygments in 6 | Java. 7 | 8 | This page is a simple tutorial to get an idea of how this is working. You can 9 | then look at the `Jython documentation `__ for more 10 | advanced use. 11 | 12 | Since version 1.5, Pygments is deployed on `Maven Central 13 | `__ as a JAR so is Jython 14 | which makes it a lot easier to create the Java project. 15 | 16 | Here is an example of a `Maven `__ ``pom.xml`` file for a 17 | project running Pygments: 18 | 19 | .. sourcecode:: xml 20 | 21 | 22 | 23 | 27 | 4.0.0 28 | example 29 | example 30 | 1.0-SNAPSHOT 31 | 32 | 33 | org.python 34 | jython-standalone 35 | 2.5.3 36 | 37 | 38 | org.pygments 39 | pygments 40 | 1.5 41 | runtime 42 | 43 | 44 | 45 | 46 | The following Java example: 47 | 48 | .. sourcecode:: java 49 | 50 | PythonInterpreter interpreter = new PythonInterpreter(); 51 | 52 | // Set a variable with the content you want to work with 53 | interpreter.set("code", code); 54 | 55 | // Simple use Pygments as you would in Python 56 | interpreter.exec("from pygments import highlight\n" 57 | + "from pygments.lexers import PythonLexer\n" 58 | + "from pygments.formatters import HtmlFormatter\n" 59 | + "\nresult = highlight(code, PythonLexer(), HtmlFormatter())"); 60 | 61 | // Get the result that has been set in a variable 62 | System.out.println(interpreter.get("result", String.class)); 63 | 64 | will print something like: 65 | 66 | .. sourcecode:: html 67 | 68 |
69 |
print "Hello World"
70 |
71 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/lexers.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ================ 4 | Available lexers 5 | ================ 6 | 7 | This page lists all available builtin lexers and the options they take. 8 | 9 | Currently, **all lexers** support these options: 10 | 11 | `stripnl` 12 | Strip leading and trailing newlines from the input (default: ``True``) 13 | 14 | `stripall` 15 | Strip all leading and trailing whitespace from the input (default: 16 | ``False``). 17 | 18 | `ensurenl` 19 | Make sure that the input ends with a newline (default: ``True``). This 20 | is required for some lexers that consume input linewise. 21 | *New in Pygments 1.3.* 22 | 23 | `tabsize` 24 | If given and greater than 0, expand tabs in the input (default: ``0``). 25 | 26 | `encoding` 27 | *New in Pygments 0.6.* 28 | 29 | If given, must be an encoding name (such as ``"utf-8"``). This encoding 30 | will be used to convert the input string to Unicode (if it is not already 31 | a Unicode string). The default is ``"latin1"``. 32 | 33 | If this option is set to ``"guess"``, a simple UTF-8 vs. Latin-1 34 | detection is used, if it is set to ``"chardet"``, the 35 | `chardet library `__ is used to 36 | guess the encoding of the input. 37 | 38 | 39 | The "Short Names" field lists the identifiers that can be used with the 40 | `get_lexer_by_name()` function. 41 | 42 | These lexers are builtin and can be imported from `pygments.lexers`: 43 | 44 | [builtin_lexer_docs] 45 | 46 | Iterating over all lexers 47 | ------------------------- 48 | 49 | *New in Pygments 0.6.* 50 | 51 | To get all lexers (both the builtin and the plugin ones), you can 52 | use the `get_all_lexers()` function from the `pygments.lexers` 53 | module: 54 | 55 | .. sourcecode:: pycon 56 | 57 | >>> from pygments.lexers import get_all_lexers 58 | >>> i = get_all_lexers() 59 | >>> i.next() 60 | ('Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')) 61 | >>> i.next() 62 | ('Delphi', ('delphi', 'objectpascal', 'pas', 'pascal'), ('*.pas',), ('text/x-pascal',)) 63 | >>> i.next() 64 | ('XML+Ruby', ('xml+erb', 'xml+ruby'), (), ()) 65 | 66 | As you can see, the return value is an iterator which yields tuples 67 | in the form ``(name, aliases, filetypes, mimetypes)``. 68 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/moinmoin.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ============================ 4 | Using Pygments with MoinMoin 5 | ============================ 6 | 7 | From Pygments 0.7, the source distribution ships a `Moin`_ parser plugin that 8 | can be used to get Pygments highlighting in Moin wiki pages. 9 | 10 | To use it, copy the file `external/moin-parser.py` from the Pygments 11 | distribution to the `data/plugin/parser` subdirectory of your Moin instance. 12 | Edit the options at the top of the file (currently ``ATTACHMENTS`` and 13 | ``INLINESTYLES``) and rename the file to the name that the parser directive 14 | should have. For example, if you name the file ``code.py``, you can get a 15 | highlighted Python code sample with this Wiki markup:: 16 | 17 | {{{ 18 | #!code python 19 | [...] 20 | }}} 21 | 22 | where ``python`` is the Pygments name of the lexer to use. 23 | 24 | Additionally, if you set the ``ATTACHMENTS`` option to True, Pygments will also 25 | be called for all attachments for whose filenames there is no other parser 26 | registered. 27 | 28 | You are responsible for including CSS rules that will map the Pygments CSS 29 | classes to colors. You can output a stylesheet file with `pygmentize`, put it 30 | into the `htdocs` directory of your Moin instance and then include it in the 31 | `stylesheets` configuration option in the Moin config, e.g.:: 32 | 33 | stylesheets = [('screen', '/htdocs/pygments.css')] 34 | 35 | If you do not want to do that and are willing to accept larger HTML output, you 36 | can set the ``INLINESTYLES`` option to True. 37 | 38 | 39 | .. _Moin: http://moinmoin.wikiwikiweb.de/ 40 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/rstdirective.txt: -------------------------------------------------------------------------------- 1 | .. -*- mode: rst -*- 2 | 3 | ================================ 4 | Using Pygments in ReST documents 5 | ================================ 6 | 7 | Many Python people use `ReST`_ for documentation their sourcecode, programs, 8 | scripts et cetera. This also means that documentation often includes sourcecode 9 | samples or snippets. 10 | 11 | You can easily enable Pygments support for your ReST texts using a custom 12 | directive -- this is also how this documentation displays source code. 13 | 14 | From Pygments 0.9, the directive is shipped in the distribution as 15 | `external/rst-directive.py`. You can copy and adapt this code to your liking. 16 | 17 | .. removed -- too confusing 18 | *Loosely related note:* The ReST lexer now recognizes ``.. sourcecode::`` and 19 | ``.. code::`` directives and highlights the contents in the specified language 20 | if the `handlecodeblocks` option is true. 21 | 22 | .. _ReST: http://docutils.sf.net/rst.html 23 | -------------------------------------------------------------------------------- /vendor/pygments/docs/src/unicode.txt: -------------------------------------------------------------------------------- 1 | ===================== 2 | Unicode and Encodings 3 | ===================== 4 | 5 | Since Pygments 0.6, all lexers use unicode strings internally. Because of that 6 | you might encounter the occasional `UnicodeDecodeError` if you pass strings with the 7 | wrong encoding. 8 | 9 | Per default all lexers have their input encoding set to `latin1`. 10 | If you pass a lexer a string object (not unicode), it tries to decode the data 11 | using this encoding. 12 | You can override the encoding using the `encoding` lexer option. If you have the 13 | `chardet`_ library installed and set the encoding to ``chardet`` if will ananlyse 14 | the text and use the encoding it thinks is the right one automatically: 15 | 16 | .. sourcecode:: python 17 | 18 | from pygments.lexers import PythonLexer 19 | lexer = PythonLexer(encoding='chardet') 20 | 21 | The best way is to pass Pygments unicode objects. In that case you can't get 22 | unexpected output. 23 | 24 | The formatters now send Unicode objects to the stream if you don't set the 25 | output encoding. You can do so by passing the formatters an `encoding` option: 26 | 27 | .. sourcecode:: python 28 | 29 | from pygments.formatters import HtmlFormatter 30 | f = HtmlFormatter(encoding='utf-8') 31 | 32 | **You will have to set this option if you have non-ASCII characters in the 33 | source and the output stream does not accept Unicode written to it!** 34 | This is the case for all regular files and for terminals. 35 | 36 | Note: The Terminal formatter tries to be smart: if its output stream has an 37 | `encoding` attribute, and you haven't set the option, it will encode any 38 | Unicode string with this encoding before writing it. This is the case for 39 | `sys.stdout`, for example. The other formatters don't have that behavior. 40 | 41 | Another note: If you call Pygments via the command line (`pygmentize`), 42 | encoding is handled differently, see `the command line docs `_. 43 | 44 | *New in Pygments 0.7*: the formatters now also accept an `outencoding` option 45 | which will override the `encoding` option if given. This makes it possible to 46 | use a single options dict with lexers and formatters, and still have different 47 | input and output encodings. 48 | 49 | .. _chardet: http://chardet.feedparser.org/ 50 | -------------------------------------------------------------------------------- /vendor/pygments/external/autopygmentize: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Best effort auto-pygmentization with transparent decompression 3 | # (c) Reuben Thomas 2012-2013 4 | # This program is in the public domain. 5 | 6 | # Strategy: first see if pygmentize can find a lexer; if not, ask file; if that finds nothing, fail 7 | # Set the environment variable PYGMENTIZE_OPTS to configure pygments. 8 | 9 | # This program can be used as a .lessfilter for the less pager to auto-color less's output 10 | 11 | lexer=`pygmentize -N "$1"` 12 | if [ "$lexer" = "text" ]; then 13 | file_common_opts="--brief --dereference --uncompress" 14 | 15 | unset lexer 16 | case `file --mime-type $file_common_opts "$1"` in 17 | application/xml|image/svg+xml) lexer=xml;; 18 | text/html) lexer=html;; 19 | text/troff) lexer=nroff;; 20 | text/x-asm) lexer=nasm;; 21 | text/x-awk) lexer=awk;; 22 | text/x-c) lexer=c;; 23 | text/x-c++) lexer=cpp;; 24 | text/x-diff) lexer=diff;; 25 | text/x-fortran) lexer=fortran;; 26 | text/x-gawk) lexer=gawk;; 27 | text/x-java) lexer=java;; 28 | text/x-lisp) lexer=common-lisp;; 29 | text/x-lua) lexer=lua;; 30 | text/x-makefile) lexer=make;; 31 | text/x-msdos-batch) lexer=bat;; 32 | text/x-nawk) lexer=nawk;; 33 | text/x-pascal) lexer=pascal;; 34 | text/x-perl) lexer=perl;; 35 | text/x-php) lexer=php;; 36 | text/x-po) lexer=po;; 37 | text/x-python) lexer=python;; 38 | text/x-ruby) lexer=ruby;; 39 | text/x-shellscript) lexer=sh;; 40 | text/x-tcl) lexer=tcl;; 41 | text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer 42 | 43 | # Types that file outputs which pygmentize didn't support as of file 5.11, pygments 1.6rc1 44 | # text/calendar 45 | # text/PGP 46 | # text/rtf 47 | # text/texmacs 48 | # text/x-bcpl 49 | # text/x-info 50 | # text/x-m4 51 | # text/x-vcard 52 | # text/x-xmcd 53 | esac 54 | fi 55 | 56 | encoding=`file --brief --mime-encoding $file_common_opts "$1"` 57 | 58 | if [ -n "$lexer" ]; then 59 | # FIXME: Specify input encoding rather than output encoding https://bitbucket.org/birkenfeld/pygments-main/issue/800 60 | zcat "$1" | pygmentize -O encoding=$encoding,outencoding=UTF-8 $PYGMENTIZE_OPTS -l $lexer 61 | exit 0 62 | fi 63 | 64 | exit 1 65 | -------------------------------------------------------------------------------- /vendor/pygments/external/markdown-processor.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | The Pygments Markdown Preprocessor 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | This fragment is a Markdown_ preprocessor that renders source code 7 | to HTML via Pygments. To use it, invoke Markdown like so:: 8 | 9 | from markdown import Markdown 10 | 11 | md = Markdown() 12 | md.textPreprocessors.insert(0, CodeBlockPreprocessor()) 13 | html = md.convert(someText) 14 | 15 | markdown is then a callable that can be passed to the context of 16 | a template and used in that template, for example. 17 | 18 | This uses CSS classes by default, so use 19 | ``pygmentize -S -f html > pygments.css`` 20 | to create a stylesheet to be added to the website. 21 | 22 | You can then highlight source code in your markdown markup:: 23 | 24 | [sourcecode:lexer] 25 | some code 26 | [/sourcecode] 27 | 28 | .. _Markdown: http://www.freewisdom.org/projects/python-markdown/ 29 | 30 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 31 | :license: BSD, see LICENSE for details. 32 | """ 33 | 34 | # Options 35 | # ~~~~~~~ 36 | 37 | # Set to True if you want inline CSS styles instead of classes 38 | INLINESTYLES = False 39 | 40 | 41 | import re 42 | 43 | from markdown import TextPreprocessor 44 | 45 | from pygments import highlight 46 | from pygments.formatters import HtmlFormatter 47 | from pygments.lexers import get_lexer_by_name, TextLexer 48 | 49 | 50 | class CodeBlockPreprocessor(TextPreprocessor): 51 | 52 | pattern = re.compile( 53 | r'\[sourcecode:(.+?)\](.+?)\[/sourcecode\]', re.S) 54 | 55 | formatter = HtmlFormatter(noclasses=INLINESTYLES) 56 | 57 | def run(self, lines): 58 | def repl(m): 59 | try: 60 | lexer = get_lexer_by_name(m.group(1)) 61 | except ValueError: 62 | lexer = TextLexer() 63 | code = highlight(m.group(2), lexer, self.formatter) 64 | code = code.replace('\n\n', '\n \n').replace('\n', '
') 65 | return '\n\n
%s
\n\n' % code 66 | return self.pattern.sub( 67 | repl, lines) 68 | -------------------------------------------------------------------------------- /vendor/pygments/external/pygments.bashcomp: -------------------------------------------------------------------------------- 1 | #!bash 2 | # 3 | # Bash completion support for Pygments (the 'pygmentize' command). 4 | # 5 | 6 | _pygmentize() 7 | { 8 | local cur prev 9 | 10 | COMPREPLY=() 11 | cur=`_get_cword` 12 | prev=${COMP_WORDS[COMP_CWORD-1]} 13 | 14 | case "$prev" in 15 | -f) 16 | FORMATTERS=`pygmentize -L formatters | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'` 17 | COMPREPLY=( $( compgen -W '$FORMATTERS' -- "$cur" ) ) 18 | return 0 19 | ;; 20 | -l) 21 | LEXERS=`pygmentize -L lexers | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'` 22 | COMPREPLY=( $( compgen -W '$LEXERS' -- "$cur" ) ) 23 | return 0 24 | ;; 25 | -S) 26 | STYLES=`pygmentize -L styles | grep '* ' | cut -c3- | sed s/:$//` 27 | COMPREPLY=( $( compgen -W '$STYLES' -- "$cur" ) ) 28 | return 0 29 | ;; 30 | esac 31 | 32 | if [[ "$cur" == -* ]]; then 33 | COMPREPLY=( $( compgen -W '-f -l -S -L -g -O -P -F \ 34 | -N -H -h -V -o' -- "$cur" ) ) 35 | return 0 36 | fi 37 | } 38 | complete -F _pygmentize -o default pygmentize 39 | -------------------------------------------------------------------------------- /vendor/pygments/pygmentize: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | import sys, pygments.cmdline 4 | try: 5 | sys.exit(pygments.cmdline.main(sys.argv)) 6 | except KeyboardInterrupt: 7 | sys.exit(1) 8 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/console.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.console 4 | ~~~~~~~~~~~~~~~~ 5 | 6 | Format colored console output. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | esc = "\x1b[" 13 | 14 | codes = {} 15 | codes[""] = "" 16 | codes["reset"] = esc + "39;49;00m" 17 | 18 | codes["bold"] = esc + "01m" 19 | codes["faint"] = esc + "02m" 20 | codes["standout"] = esc + "03m" 21 | codes["underline"] = esc + "04m" 22 | codes["blink"] = esc + "05m" 23 | codes["overline"] = esc + "06m" 24 | 25 | dark_colors = ["black", "darkred", "darkgreen", "brown", "darkblue", 26 | "purple", "teal", "lightgray"] 27 | light_colors = ["darkgray", "red", "green", "yellow", "blue", 28 | "fuchsia", "turquoise", "white"] 29 | 30 | x = 30 31 | for d, l in zip(dark_colors, light_colors): 32 | codes[d] = esc + "%im" % x 33 | codes[l] = esc + "%i;01m" % x 34 | x += 1 35 | 36 | del d, l, x 37 | 38 | codes["darkteal"] = codes["turquoise"] 39 | codes["darkyellow"] = codes["brown"] 40 | codes["fuscia"] = codes["fuchsia"] 41 | codes["white"] = codes["bold"] 42 | 43 | 44 | def reset_color(): 45 | return codes["reset"] 46 | 47 | 48 | def colorize(color_key, text): 49 | return codes[color_key] + text + codes["reset"] 50 | 51 | 52 | def ansiformat(attr, text): 53 | """ 54 | Format ``text`` with a color and/or some attributes:: 55 | 56 | color normal color 57 | *color* bold color 58 | _color_ underlined color 59 | +color+ blinking color 60 | """ 61 | result = [] 62 | if attr[:1] == attr[-1:] == '+': 63 | result.append(codes['blink']) 64 | attr = attr[1:-1] 65 | if attr[:1] == attr[-1:] == '*': 66 | result.append(codes['bold']) 67 | attr = attr[1:-1] 68 | if attr[:1] == attr[-1:] == '_': 69 | result.append(codes['underline']) 70 | attr = attr[1:-1] 71 | result.append(codes[attr]) 72 | result.append(text) 73 | result.append(codes['reset']) 74 | return ''.join(result) 75 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/filter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.filter 4 | ~~~~~~~~~~~~~~~ 5 | 6 | Module that implements the default filter. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | 13 | def apply_filters(stream, filters, lexer=None): 14 | """ 15 | Use this method to apply an iterable of filters to 16 | a stream. If lexer is given it's forwarded to the 17 | filter, otherwise the filter receives `None`. 18 | """ 19 | def _apply(filter_, stream): 20 | for token in filter_.filter(lexer, stream): 21 | yield token 22 | for filter_ in filters: 23 | stream = _apply(filter_, stream) 24 | return stream 25 | 26 | 27 | def simplefilter(f): 28 | """ 29 | Decorator that converts a function into a filter:: 30 | 31 | @simplefilter 32 | def lowercase(lexer, stream, options): 33 | for ttype, value in stream: 34 | yield ttype, value.lower() 35 | """ 36 | return type(f.__name__, (FunctionFilter,), { 37 | 'function': f, 38 | '__module__': getattr(f, '__module__'), 39 | '__doc__': f.__doc__ 40 | }) 41 | 42 | 43 | class Filter(object): 44 | """ 45 | Default filter. Subclass this class or use the `simplefilter` 46 | decorator to create own filters. 47 | """ 48 | 49 | def __init__(self, **options): 50 | self.options = options 51 | 52 | def filter(self, lexer, stream): 53 | raise NotImplementedError() 54 | 55 | 56 | class FunctionFilter(Filter): 57 | """ 58 | Abstract class used by `simplefilter` to create simple 59 | function filters on the fly. The `simplefilter` decorator 60 | automatically creates subclasses of this class for 61 | functions passed to it. 62 | """ 63 | function = None 64 | 65 | def __init__(self, **options): 66 | if not hasattr(self, 'function'): 67 | raise TypeError('%r used without bound function' % 68 | self.__class__.__name__) 69 | Filter.__init__(self, **options) 70 | 71 | def filter(self, lexer, stream): 72 | # pylint: disable-msg=E1102 73 | for ttype, value in self.function(lexer, stream, self.options): 74 | yield ttype, value 75 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/formatters/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.formatters 4 | ~~~~~~~~~~~~~~~~~~~ 5 | 6 | Pygments formatters. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | import os.path 12 | import fnmatch 13 | 14 | from pygments.formatters._mapping import FORMATTERS 15 | from pygments.plugin import find_plugin_formatters 16 | from pygments.util import ClassNotFound 17 | 18 | ns = globals() 19 | for fcls in FORMATTERS: 20 | ns[fcls.__name__] = fcls 21 | del fcls 22 | 23 | __all__ = ['get_formatter_by_name', 'get_formatter_for_filename', 24 | 'get_all_formatters'] + [cls.__name__ for cls in FORMATTERS] 25 | 26 | 27 | _formatter_alias_cache = {} 28 | _formatter_filename_cache = [] 29 | 30 | def _init_formatter_cache(): 31 | if _formatter_alias_cache: 32 | return 33 | for cls in get_all_formatters(): 34 | for alias in cls.aliases: 35 | _formatter_alias_cache[alias] = cls 36 | for fn in cls.filenames: 37 | _formatter_filename_cache.append((fn, cls)) 38 | 39 | 40 | def find_formatter_class(name): 41 | _init_formatter_cache() 42 | cls = _formatter_alias_cache.get(name, None) 43 | return cls 44 | 45 | 46 | def get_formatter_by_name(name, **options): 47 | _init_formatter_cache() 48 | cls = _formatter_alias_cache.get(name, None) 49 | if not cls: 50 | raise ClassNotFound("No formatter found for name %r" % name) 51 | return cls(**options) 52 | 53 | 54 | def get_formatter_for_filename(fn, **options): 55 | _init_formatter_cache() 56 | fn = os.path.basename(fn) 57 | for pattern, cls in _formatter_filename_cache: 58 | if fnmatch.fnmatch(fn, pattern): 59 | return cls(**options) 60 | raise ClassNotFound("No formatter found for file name %r" % fn) 61 | 62 | 63 | def get_all_formatters(): 64 | """Return a generator for all formatters.""" 65 | for formatter in FORMATTERS: 66 | yield formatter 67 | for _, formatter in find_plugin_formatters(): 68 | yield formatter 69 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/modeline.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.modeline 4 | ~~~~~~~~~~~~~~~~~ 5 | 6 | A simple modeline parser (based on pymodeline). 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | import re 13 | 14 | __all__ = ['get_filetype_from_buffer'] 15 | 16 | modeline_re = re.compile(r''' 17 | (?: vi | vim | ex ) (?: [<=>]? \d* )? : 18 | .* (?: ft | filetype | syn | syntax ) = ( [^:\s]+ ) 19 | ''', re.VERBOSE) 20 | 21 | def get_filetype_from_line(l): 22 | m = modeline_re.search(l) 23 | if m: 24 | return m.group(1) 25 | 26 | def get_filetype_from_buffer(buf, max_lines=5): 27 | """ 28 | Scan the buffer for modelines and return filetype if one is found. 29 | """ 30 | lines = buf.splitlines() 31 | for l in lines[-1:-max_lines-1:-1]: 32 | ret = get_filetype_from_line(l) 33 | if ret: 34 | return ret 35 | for l in lines[max_lines:0:-1]: 36 | ret = get_filetype_from_line(l) 37 | if ret: 38 | return ret 39 | 40 | return None 41 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/plugin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.plugin 4 | ~~~~~~~~~~~~~~~ 5 | 6 | Pygments setuptools plugin interface. The methods defined 7 | here also work if setuptools isn't installed but they just 8 | return nothing. 9 | 10 | lexer plugins:: 11 | 12 | [pygments.lexers] 13 | yourlexer = yourmodule:YourLexer 14 | 15 | formatter plugins:: 16 | 17 | [pygments.formatters] 18 | yourformatter = yourformatter:YourFormatter 19 | /.ext = yourformatter:YourFormatter 20 | 21 | As you can see, you can define extensions for the formatter 22 | with a leading slash. 23 | 24 | syntax plugins:: 25 | 26 | [pygments.styles] 27 | yourstyle = yourstyle:YourStyle 28 | 29 | filter plugin:: 30 | 31 | [pygments.filter] 32 | yourfilter = yourfilter:YourFilter 33 | 34 | 35 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 36 | :license: BSD, see LICENSE for details. 37 | """ 38 | try: 39 | import pkg_resources 40 | except ImportError: 41 | pkg_resources = None 42 | 43 | LEXER_ENTRY_POINT = 'pygments.lexers' 44 | FORMATTER_ENTRY_POINT = 'pygments.formatters' 45 | STYLE_ENTRY_POINT = 'pygments.styles' 46 | FILTER_ENTRY_POINT = 'pygments.filters' 47 | 48 | 49 | def find_plugin_lexers(): 50 | if pkg_resources is None: 51 | return 52 | for entrypoint in pkg_resources.iter_entry_points(LEXER_ENTRY_POINT): 53 | yield entrypoint.load() 54 | 55 | 56 | def find_plugin_formatters(): 57 | if pkg_resources is None: 58 | return 59 | for entrypoint in pkg_resources.iter_entry_points(FORMATTER_ENTRY_POINT): 60 | yield entrypoint.name, entrypoint.load() 61 | 62 | 63 | def find_plugin_styles(): 64 | if pkg_resources is None: 65 | return 66 | for entrypoint in pkg_resources.iter_entry_points(STYLE_ENTRY_POINT): 67 | yield entrypoint.name, entrypoint.load() 68 | 69 | 70 | def find_plugin_filters(): 71 | if pkg_resources is None: 72 | return 73 | for entrypoint in pkg_resources.iter_entry_points(FILTER_ENTRY_POINT): 74 | yield entrypoint.name, entrypoint.load() 75 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles 4 | ~~~~~~~~~~~~~~~ 5 | 6 | Contains built-in styles. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.plugin import find_plugin_styles 13 | from pygments.util import ClassNotFound 14 | 15 | 16 | #: Maps style names to 'submodule::classname'. 17 | STYLE_MAP = { 18 | 'default': 'default::DefaultStyle', 19 | 'emacs': 'emacs::EmacsStyle', 20 | 'friendly': 'friendly::FriendlyStyle', 21 | 'colorful': 'colorful::ColorfulStyle', 22 | 'autumn': 'autumn::AutumnStyle', 23 | 'murphy': 'murphy::MurphyStyle', 24 | 'manni': 'manni::ManniStyle', 25 | 'monokai': 'monokai::MonokaiStyle', 26 | 'perldoc': 'perldoc::PerldocStyle', 27 | 'pastie': 'pastie::PastieStyle', 28 | 'borland': 'borland::BorlandStyle', 29 | 'trac': 'trac::TracStyle', 30 | 'native': 'native::NativeStyle', 31 | 'fruity': 'fruity::FruityStyle', 32 | 'bw': 'bw::BlackWhiteStyle', 33 | 'vim': 'vim::VimStyle', 34 | 'vs': 'vs::VisualStudioStyle', 35 | 'tango': 'tango::TangoStyle', 36 | 'rrt': 'rrt::RrtStyle', 37 | } 38 | 39 | 40 | def get_style_by_name(name): 41 | if name in STYLE_MAP: 42 | mod, cls = STYLE_MAP[name].split('::') 43 | builtin = "yes" 44 | else: 45 | for found_name, style in find_plugin_styles(): 46 | if name == found_name: 47 | return style 48 | # perhaps it got dropped into our styles package 49 | builtin = "" 50 | mod = name 51 | cls = name.title() + "Style" 52 | 53 | try: 54 | mod = __import__('pygments.styles.' + mod, None, None, [cls]) 55 | except ImportError: 56 | raise ClassNotFound("Could not find style module %r" % mod + 57 | (builtin and ", though it should be builtin") + ".") 58 | try: 59 | return getattr(mod, cls) 60 | except AttributeError: 61 | raise ClassNotFound("Could not find style class %r in style module." % cls) 62 | 63 | 64 | def get_all_styles(): 65 | """Return an generator for all styles by name, 66 | both builtin and plugin.""" 67 | for name in STYLE_MAP: 68 | yield name 69 | for name, _ in find_plugin_styles(): 70 | yield name 71 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/autumn.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.autumn 4 | ~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | A colorful style, inspired by the terminal highlighting style. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Number, Operator, Generic, Whitespace 15 | 16 | 17 | class AutumnStyle(Style): 18 | """ 19 | A colorful style, inspired by the terminal highlighting style. 20 | """ 21 | 22 | default_style = "" 23 | 24 | styles = { 25 | Whitespace: '#bbbbbb', 26 | 27 | Comment: 'italic #aaaaaa', 28 | Comment.Preproc: 'noitalic #4c8317', 29 | Comment.Special: 'italic #0000aa', 30 | 31 | Keyword: '#0000aa', 32 | Keyword.Type: '#00aaaa', 33 | 34 | Operator.Word: '#0000aa', 35 | 36 | Name.Builtin: '#00aaaa', 37 | Name.Function: '#00aa00', 38 | Name.Class: 'underline #00aa00', 39 | Name.Namespace: 'underline #00aaaa', 40 | Name.Variable: '#aa0000', 41 | Name.Constant: '#aa0000', 42 | Name.Entity: 'bold #800', 43 | Name.Attribute: '#1e90ff', 44 | Name.Tag: 'bold #1e90ff', 45 | Name.Decorator: '#888888', 46 | 47 | String: '#aa5500', 48 | String.Symbol: '#0000aa', 49 | String.Regex: '#009999', 50 | 51 | Number: '#009999', 52 | 53 | Generic.Heading: 'bold #000080', 54 | Generic.Subheading: 'bold #800080', 55 | Generic.Deleted: '#aa0000', 56 | Generic.Inserted: '#00aa00', 57 | Generic.Error: '#aa0000', 58 | Generic.Emph: 'italic', 59 | Generic.Strong: 'bold', 60 | Generic.Prompt: '#555555', 61 | Generic.Output: '#888888', 62 | Generic.Traceback: '#aa0000', 63 | 64 | Error: '#F00 bg:#FAA' 65 | } 66 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/borland.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.borland 4 | ~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | Style similar to the style used in the Borland IDEs. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Number, Operator, Generic, Whitespace 15 | 16 | 17 | class BorlandStyle(Style): 18 | """ 19 | Style similar to the style used in the borland IDEs. 20 | """ 21 | 22 | default_style = '' 23 | 24 | styles = { 25 | Whitespace: '#bbbbbb', 26 | 27 | Comment: 'italic #008800', 28 | Comment.Preproc: 'noitalic #008080', 29 | Comment.Special: 'noitalic bold', 30 | 31 | String: '#0000FF', 32 | String.Char: '#800080', 33 | Number: '#0000FF', 34 | Keyword: 'bold #000080', 35 | Operator.Word: 'bold', 36 | Name.Tag: 'bold #000080', 37 | Name.Attribute: '#FF0000', 38 | 39 | Generic.Heading: '#999999', 40 | Generic.Subheading: '#aaaaaa', 41 | Generic.Deleted: 'bg:#ffdddd #000000', 42 | Generic.Inserted: 'bg:#ddffdd #000000', 43 | Generic.Error: '#aa0000', 44 | Generic.Emph: 'italic', 45 | Generic.Strong: 'bold', 46 | Generic.Prompt: '#555555', 47 | Generic.Output: '#888888', 48 | Generic.Traceback: '#aa0000', 49 | 50 | Error: 'bg:#e3d2d2 #a61717' 51 | } 52 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/bw.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.bw 4 | ~~~~~~~~~~~~~~~~~~ 5 | 6 | Simple black/white only style. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Operator, Generic 15 | 16 | 17 | class BlackWhiteStyle(Style): 18 | 19 | background_color = "#ffffff" 20 | default_style = "" 21 | 22 | styles = { 23 | Comment: "italic", 24 | Comment.Preproc: "noitalic", 25 | 26 | Keyword: "bold", 27 | Keyword.Pseudo: "nobold", 28 | Keyword.Type: "nobold", 29 | 30 | Operator.Word: "bold", 31 | 32 | Name.Class: "bold", 33 | Name.Namespace: "bold", 34 | Name.Exception: "bold", 35 | Name.Entity: "bold", 36 | Name.Tag: "bold", 37 | 38 | String: "italic", 39 | String.Interpol: "bold", 40 | String.Escape: "bold", 41 | 42 | Generic.Heading: "bold", 43 | Generic.Subheading: "bold", 44 | Generic.Emph: "italic", 45 | Generic.Strong: "bold", 46 | Generic.Prompt: "bold", 47 | 48 | Error: "border:#FF0000" 49 | } 50 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/emacs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.emacs 4 | ~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | A highlighting style for Pygments, inspired by Emacs. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Number, Operator, Generic, Whitespace 15 | 16 | 17 | class EmacsStyle(Style): 18 | """ 19 | The default style (inspired by Emacs 22). 20 | """ 21 | 22 | background_color = "#f8f8f8" 23 | default_style = "" 24 | 25 | styles = { 26 | Whitespace: "#bbbbbb", 27 | Comment: "italic #008800", 28 | Comment.Preproc: "noitalic", 29 | Comment.Special: "noitalic bold", 30 | 31 | Keyword: "bold #AA22FF", 32 | Keyword.Pseudo: "nobold", 33 | Keyword.Type: "bold #00BB00", 34 | 35 | Operator: "#666666", 36 | Operator.Word: "bold #AA22FF", 37 | 38 | Name.Builtin: "#AA22FF", 39 | Name.Function: "#00A000", 40 | Name.Class: "#0000FF", 41 | Name.Namespace: "bold #0000FF", 42 | Name.Exception: "bold #D2413A", 43 | Name.Variable: "#B8860B", 44 | Name.Constant: "#880000", 45 | Name.Label: "#A0A000", 46 | Name.Entity: "bold #999999", 47 | Name.Attribute: "#BB4444", 48 | Name.Tag: "bold #008000", 49 | Name.Decorator: "#AA22FF", 50 | 51 | String: "#BB4444", 52 | String.Doc: "italic", 53 | String.Interpol: "bold #BB6688", 54 | String.Escape: "bold #BB6622", 55 | String.Regex: "#BB6688", 56 | String.Symbol: "#B8860B", 57 | String.Other: "#008000", 58 | Number: "#666666", 59 | 60 | Generic.Heading: "bold #000080", 61 | Generic.Subheading: "bold #800080", 62 | Generic.Deleted: "#A00000", 63 | Generic.Inserted: "#00A000", 64 | Generic.Error: "#FF0000", 65 | Generic.Emph: "italic", 66 | Generic.Strong: "bold", 67 | Generic.Prompt: "bold #000080", 68 | Generic.Output: "#888", 69 | Generic.Traceback: "#04D", 70 | 71 | Error: "border:#FF0000" 72 | } 73 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/fruity.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.fruity 4 | ~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | pygments version of my "fruity" vim theme. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Token, Comment, Name, Keyword, \ 14 | Generic, Number, String, Whitespace 15 | 16 | class FruityStyle(Style): 17 | """ 18 | Pygments version of the "native" vim theme. 19 | """ 20 | 21 | background_color = '#111111' 22 | highlight_color = '#333333' 23 | 24 | styles = { 25 | Whitespace: '#888888', 26 | Token: '#ffffff', 27 | Generic.Output: '#444444 bg:#222222', 28 | Keyword: '#fb660a bold', 29 | Keyword.Pseudo: 'nobold', 30 | Number: '#0086f7 bold', 31 | Name.Tag: '#fb660a bold', 32 | Name.Variable: '#fb660a', 33 | Comment: '#008800 bg:#0f140f italic', 34 | Name.Attribute: '#ff0086 bold', 35 | String: '#0086d2', 36 | Name.Function: '#ff0086 bold', 37 | Generic.Heading: '#ffffff bold', 38 | Keyword.Type: '#cdcaa9 bold', 39 | Generic.Subheading: '#ffffff bold', 40 | Name.Constant: '#0086d2', 41 | Comment.Preproc: '#ff0007 bold' 42 | } 43 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/manni.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.manni 4 | ~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | A colorful style, inspired by the terminal highlighting style. 7 | 8 | This is a port of the style used in the `php port`_ of pygments 9 | by Manni. The style is called 'default' there. 10 | 11 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 12 | :license: BSD, see LICENSE for details. 13 | """ 14 | 15 | from pygments.style import Style 16 | from pygments.token import Keyword, Name, Comment, String, Error, \ 17 | Number, Operator, Generic, Whitespace 18 | 19 | 20 | class ManniStyle(Style): 21 | """ 22 | A colorful style, inspired by the terminal highlighting style. 23 | """ 24 | 25 | background_color = '#f0f3f3' 26 | 27 | styles = { 28 | Whitespace: '#bbbbbb', 29 | Comment: 'italic #0099FF', 30 | Comment.Preproc: 'noitalic #009999', 31 | Comment.Special: 'bold', 32 | 33 | Keyword: 'bold #006699', 34 | Keyword.Pseudo: 'nobold', 35 | Keyword.Type: '#007788', 36 | 37 | Operator: '#555555', 38 | Operator.Word: 'bold #000000', 39 | 40 | Name.Builtin: '#336666', 41 | Name.Function: '#CC00FF', 42 | Name.Class: 'bold #00AA88', 43 | Name.Namespace: 'bold #00CCFF', 44 | Name.Exception: 'bold #CC0000', 45 | Name.Variable: '#003333', 46 | Name.Constant: '#336600', 47 | Name.Label: '#9999FF', 48 | Name.Entity: 'bold #999999', 49 | Name.Attribute: '#330099', 50 | Name.Tag: 'bold #330099', 51 | Name.Decorator: '#9999FF', 52 | 53 | String: '#CC3300', 54 | String.Doc: 'italic', 55 | String.Interpol: '#AA0000', 56 | String.Escape: 'bold #CC3300', 57 | String.Regex: '#33AAAA', 58 | String.Symbol: '#FFCC33', 59 | String.Other: '#CC3300', 60 | 61 | Number: '#FF6600', 62 | 63 | Generic.Heading: 'bold #003300', 64 | Generic.Subheading: 'bold #003300', 65 | Generic.Deleted: 'border:#CC0000 bg:#FFCCCC', 66 | Generic.Inserted: 'border:#00CC00 bg:#CCFFCC', 67 | Generic.Error: '#FF0000', 68 | Generic.Emph: 'italic', 69 | Generic.Strong: 'bold', 70 | Generic.Prompt: 'bold #000099', 71 | Generic.Output: '#AAAAAA', 72 | Generic.Traceback: '#99CC66', 73 | 74 | Error: 'bg:#FFAAAA #AA0000' 75 | } 76 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/native.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.native 4 | ~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | pygments version of my "native" vim theme. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Number, Operator, Generic, Token, Whitespace 15 | 16 | 17 | class NativeStyle(Style): 18 | """ 19 | Pygments version of the "native" vim theme. 20 | """ 21 | 22 | background_color = '#202020' 23 | highlight_color = '#404040' 24 | 25 | styles = { 26 | Token: '#d0d0d0', 27 | Whitespace: '#666666', 28 | 29 | Comment: 'italic #999999', 30 | Comment.Preproc: 'noitalic bold #cd2828', 31 | Comment.Special: 'noitalic bold #e50808 bg:#520000', 32 | 33 | Keyword: 'bold #6ab825', 34 | Keyword.Pseudo: 'nobold', 35 | Operator.Word: 'bold #6ab825', 36 | 37 | String: '#ed9d13', 38 | String.Other: '#ffa500', 39 | 40 | Number: '#3677a9', 41 | 42 | Name.Builtin: '#24909d', 43 | Name.Variable: '#40ffff', 44 | Name.Constant: '#40ffff', 45 | Name.Class: 'underline #447fcf', 46 | Name.Function: '#447fcf', 47 | Name.Namespace: 'underline #447fcf', 48 | Name.Exception: '#bbbbbb', 49 | Name.Tag: 'bold #6ab825', 50 | Name.Attribute: '#bbbbbb', 51 | Name.Decorator: '#ffa500', 52 | 53 | Generic.Heading: 'bold #ffffff', 54 | Generic.Subheading: 'underline #ffffff', 55 | Generic.Deleted: '#d22323', 56 | Generic.Inserted: '#589819', 57 | Generic.Error: '#d22323', 58 | Generic.Emph: 'italic', 59 | Generic.Strong: 'bold', 60 | Generic.Prompt: '#aaaaaa', 61 | Generic.Output: '#cccccc', 62 | Generic.Traceback: '#d22323', 63 | 64 | Error: 'bg:#e3d2d2 #a61717' 65 | } 66 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/perldoc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.perldoc 4 | ~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | Style similar to the style used in the `perldoc`_ code blocks. 7 | 8 | .. _perldoc: http://perldoc.perl.org/ 9 | 10 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 11 | :license: BSD, see LICENSE for details. 12 | """ 13 | 14 | from pygments.style import Style 15 | from pygments.token import Keyword, Name, Comment, String, Error, \ 16 | Number, Operator, Generic, Whitespace 17 | 18 | 19 | class PerldocStyle(Style): 20 | """ 21 | Style similar to the style used in the perldoc code blocks. 22 | """ 23 | 24 | background_color = '#eeeedd' 25 | default_style = '' 26 | 27 | styles = { 28 | Whitespace: '#bbbbbb', 29 | Comment: '#228B22', 30 | Comment.Preproc: '#1e889b', 31 | Comment.Special: '#8B008B bold', 32 | 33 | String: '#CD5555', 34 | String.Heredoc: '#1c7e71 italic', 35 | String.Regex: '#B452CD', 36 | String.Other: '#cb6c20', 37 | String.Regex: '#1c7e71', 38 | 39 | Number: '#B452CD', 40 | 41 | Operator.Word: '#8B008B', 42 | 43 | Keyword: '#8B008B bold', 44 | Keyword.Type: '#a7a7a7', 45 | 46 | Name.Class: '#008b45 bold', 47 | Name.Exception: '#008b45 bold', 48 | Name.Function: '#008b45', 49 | Name.Namespace: '#008b45 underline', 50 | Name.Variable: '#00688B', 51 | Name.Constant: '#00688B', 52 | Name.Decorator: '#707a7c', 53 | Name.Tag: '#8B008B bold', 54 | Name.Attribute: '#658b00', 55 | Name.Builtin: '#658b00', 56 | 57 | Generic.Heading: 'bold #000080', 58 | Generic.Subheading: 'bold #800080', 59 | Generic.Deleted: '#aa0000', 60 | Generic.Inserted: '#00aa00', 61 | Generic.Error: '#aa0000', 62 | Generic.Emph: 'italic', 63 | Generic.Strong: 'bold', 64 | Generic.Prompt: '#555555', 65 | Generic.Output: '#888888', 66 | Generic.Traceback: '#aa0000', 67 | 68 | Error: 'bg:#e3d2d2 #a61717' 69 | } 70 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/rrt.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.rrt 4 | ~~~~~~~~~~~~~~~~~~~ 5 | 6 | pygments "rrt" theme, based on Zap and Emacs defaults. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Comment, Name, Keyword, String 14 | 15 | 16 | class RrtStyle(Style): 17 | """ 18 | Minimalistic "rrt" theme, based on Zap and Emacs defaults. 19 | """ 20 | 21 | background_color = '#000000' 22 | highlight_color = '#0000ff' 23 | 24 | styles = { 25 | Comment: '#00ff00', 26 | Name.Function: '#ffff00', 27 | Name.Variable: '#eedd82', 28 | Name.Constant: '#7fffd4', 29 | Keyword: '#ff0000', 30 | Comment.Preproc: '#e5e5e5', 31 | String: '#87ceeb', 32 | Keyword.Type: '#ee82ee', 33 | } 34 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/trac.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.trac 4 | ~~~~~~~~~~~~~~~~~~~~ 5 | 6 | Port of the default trac highlighter design. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Number, Operator, Generic, Whitespace 15 | 16 | 17 | class TracStyle(Style): 18 | """ 19 | Port of the default trac highlighter design. 20 | """ 21 | 22 | default_style = '' 23 | 24 | styles = { 25 | Whitespace: '#bbbbbb', 26 | Comment: 'italic #999988', 27 | Comment.Preproc: 'bold noitalic #999999', 28 | Comment.Special: 'bold #999999', 29 | 30 | Operator: 'bold', 31 | 32 | String: '#bb8844', 33 | String.Regex: '#808000', 34 | 35 | Number: '#009999', 36 | 37 | Keyword: 'bold', 38 | Keyword.Type: '#445588', 39 | 40 | Name.Builtin: '#999999', 41 | Name.Function: 'bold #990000', 42 | Name.Class: 'bold #445588', 43 | Name.Exception: 'bold #990000', 44 | Name.Namespace: '#555555', 45 | Name.Variable: '#008080', 46 | Name.Constant: '#008080', 47 | Name.Tag: '#000080', 48 | Name.Attribute: '#008080', 49 | Name.Entity: '#800080', 50 | 51 | Generic.Heading: '#999999', 52 | Generic.Subheading: '#aaaaaa', 53 | Generic.Deleted: 'bg:#ffdddd #000000', 54 | Generic.Inserted: 'bg:#ddffdd #000000', 55 | Generic.Error: '#aa0000', 56 | Generic.Emph: 'italic', 57 | Generic.Strong: 'bold', 58 | Generic.Prompt: '#555555', 59 | Generic.Output: '#888888', 60 | Generic.Traceback: '#aa0000', 61 | 62 | Error: 'bg:#e3d2d2 #a61717' 63 | } 64 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/vim.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.vim 4 | ~~~~~~~~~~~~~~~~~~~ 5 | 6 | A highlighting style for Pygments, inspired by vim. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Number, Operator, Generic, Whitespace, Token 15 | 16 | 17 | class VimStyle(Style): 18 | """ 19 | Styles somewhat like vim 7.0 20 | """ 21 | 22 | background_color = "#000000" 23 | highlight_color = "#222222" 24 | default_style = "#cccccc" 25 | 26 | styles = { 27 | Token: "#cccccc", 28 | Whitespace: "", 29 | Comment: "#000080", 30 | Comment.Preproc: "", 31 | Comment.Special: "bold #cd0000", 32 | 33 | Keyword: "#cdcd00", 34 | Keyword.Declaration: "#00cd00", 35 | Keyword.Namespace: "#cd00cd", 36 | Keyword.Pseudo: "", 37 | Keyword.Type: "#00cd00", 38 | 39 | Operator: "#3399cc", 40 | Operator.Word: "#cdcd00", 41 | 42 | Name: "", 43 | Name.Class: "#00cdcd", 44 | Name.Builtin: "#cd00cd", 45 | Name.Exception: "bold #666699", 46 | Name.Variable: "#00cdcd", 47 | 48 | String: "#cd0000", 49 | Number: "#cd00cd", 50 | 51 | Generic.Heading: "bold #000080", 52 | Generic.Subheading: "bold #800080", 53 | Generic.Deleted: "#cd0000", 54 | Generic.Inserted: "#00cd00", 55 | Generic.Error: "#FF0000", 56 | Generic.Emph: "italic", 57 | Generic.Strong: "bold", 58 | Generic.Prompt: "bold #000080", 59 | Generic.Output: "#888", 60 | Generic.Traceback: "#04D", 61 | 62 | Error: "border:#FF0000" 63 | } 64 | -------------------------------------------------------------------------------- /vendor/pygments/pygments/styles/vs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | pygments.styles.vs 4 | ~~~~~~~~~~~~~~~~~~ 5 | 6 | Simple style with MS Visual Studio colors. 7 | 8 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 9 | :license: BSD, see LICENSE for details. 10 | """ 11 | 12 | from pygments.style import Style 13 | from pygments.token import Keyword, Name, Comment, String, Error, \ 14 | Operator, Generic 15 | 16 | 17 | class VisualStudioStyle(Style): 18 | 19 | background_color = "#ffffff" 20 | default_style = "" 21 | 22 | styles = { 23 | Comment: "#008000", 24 | Comment.Preproc: "#0000ff", 25 | Keyword: "#0000ff", 26 | Operator.Word: "#0000ff", 27 | Keyword.Type: "#2b91af", 28 | Name.Class: "#2b91af", 29 | String: "#a31515", 30 | 31 | Generic.Heading: "bold", 32 | Generic.Subheading: "bold", 33 | Generic.Emph: "italic", 34 | Generic.Strong: "bold", 35 | Generic.Prompt: "bold", 36 | 37 | Error: "border:#FF0000" 38 | } 39 | -------------------------------------------------------------------------------- /vendor/pygments/scripts/detect_missing_analyse_text.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from pygments.lexers import get_all_lexers, find_lexer_class 4 | from pygments.lexer import Lexer 5 | 6 | def main(): 7 | uses = {} 8 | 9 | for name, aliases, filenames, mimetypes in get_all_lexers(): 10 | cls = find_lexer_class(name) 11 | if not cls.aliases: 12 | print cls, "has no aliases" 13 | for f in filenames: 14 | if f not in uses: 15 | uses[f] = [] 16 | uses[f].append(cls) 17 | 18 | ret = 0 19 | for k, v in uses.iteritems(): 20 | if len(v) > 1: 21 | #print "Multiple for", k, v 22 | for i in v: 23 | if i.analyse_text is None: 24 | print i, "has a None analyse_text" 25 | ret |= 1 26 | elif Lexer.analyse_text.__doc__ == i.analyse_text.__doc__: 27 | print i, "needs analyse_text, multiple lexers for", k 28 | ret |= 2 29 | return ret 30 | 31 | if __name__ == '__main__': 32 | sys.exit(main()) 33 | -------------------------------------------------------------------------------- /vendor/pygments/scripts/get_vimkw.py: -------------------------------------------------------------------------------- 1 | import re 2 | from pprint import pprint 3 | 4 | r_line = re.compile(r"^(syn keyword vimCommand contained|syn keyword vimOption " 5 | r"contained|syn keyword vimAutoEvent contained)\s+(.*)") 6 | r_item = re.compile(r"(\w+)(?:\[(\w+)\])?") 7 | 8 | def getkw(input, output): 9 | out = file(output, 'w') 10 | 11 | output_info = {'command': [], 'option': [], 'auto': []} 12 | for line in file(input): 13 | m = r_line.match(line) 14 | if m: 15 | # Decide which output gets mapped to d 16 | if 'vimCommand' in m.group(1): 17 | d = output_info['command'] 18 | elif 'AutoEvent' in m.group(1): 19 | d = output_info['auto'] 20 | else: 21 | d = output_info['option'] 22 | 23 | # Extract all the shortened versions 24 | for i in r_item.finditer(m.group(2)): 25 | d.append('(%r,%r)' % 26 | (i.group(1), "%s%s" % (i.group(1), i.group(2) or ''))) 27 | 28 | output_info['option'].append("('nnoremap','nnoremap')") 29 | output_info['option'].append("('inoremap','inoremap')") 30 | output_info['option'].append("('vnoremap','vnoremap')") 31 | 32 | for a, b in output_info.items(): 33 | b.sort() 34 | print >>out, '%s=[%s]' % (a, ','.join(b)) 35 | 36 | def is_keyword(w, keywords): 37 | for i in range(len(w), 0, -1): 38 | if w[:i] in keywords: 39 | return signals[w[:i]][:len(w)] == w 40 | return False 41 | 42 | if __name__ == "__main__": 43 | getkw("/usr/share/vim/vim73/syntax/vim.vim", "temp.py") 44 | -------------------------------------------------------------------------------- /vendor/pygments/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = dev 3 | tag_date = true 4 | 5 | [aliases] 6 | release = egg_info -RDb '' 7 | upload = upload --sign --identity=36580288 8 | -------------------------------------------------------------------------------- /vendor/pygments/tests/dtds/HTML4-f.dtd: -------------------------------------------------------------------------------- 1 | 20 | 25 | 26 | 27 | ... 28 | 29 | 30 | ... 31 | 32 | 33 | --> 34 | 35 | 36 | 37 | %HTML4.dtd; -------------------------------------------------------------------------------- /vendor/pygments/tests/dtds/HTML4.soc: -------------------------------------------------------------------------------- 1 | OVERRIDE YES 2 | SGMLDECL HTML4.dcl 3 | DOCTYPE HTML HTML4.dtd 4 | PUBLIC "-//W3C//DTD HTML 4.0//EN" HTML4-s.dtd 5 | PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTML4.dtd 6 | PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" HTML4-f.dtd 7 | PUBLIC "-//W3C//ENTITIES Latin1//EN//HTML" HTMLlat1.ent 8 | PUBLIC "-//W3C//ENTITIES Special//EN//HTML" HTMLspec.ent 9 | PUBLIC "-//W3C//ENTITIES Symbols//EN//HTML" HTMLsym.ent 10 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/AlternatingGroup.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djanowski/pygmentize/58b923066713abcf967a8836a7177193e64f96a3/vendor/pygments/tests/examplefiles/AlternatingGroup.mu -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/BOM.js: -------------------------------------------------------------------------------- 1 | /* There is a BOM at the beginning of this file. */ -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/Errors.scala: -------------------------------------------------------------------------------- 1 | /* This file /* which is totally legal scala */ will not be highlighted 2 | correcty by pygments */ 3 | 4 | object ⌘ { 5 | val `interface` = """ 6 | A 7 | "Multiline" 8 | String 9 | """ 10 | 11 | val foo_+ = "foo plus" 12 | val foo_⌬⌬ = "double benzene" 13 | 14 | def main(argv: Array[String]) { 15 | println(⌘.interface + " " + foo_+ + " " + foo_⌬⌬ ) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/Get-CommandDefinitionHtml.ps1: -------------------------------------------------------------------------------- 1 | 2 | function Get-CommandDefinitionHtml { 3 | 4 | # this tells powershell to allow advanced features, 5 | # like the [validatenotnullorempty()] attribute below. 6 | [CmdletBinding()] 7 | param( 8 | [ValidateNotNullOrEmpty()] 9 | [string]$name 10 | ) 11 | 12 | $command = get-command $name 13 | 14 | # Look mom! I'm a cmdlet! 15 | $PSCmdlet.WriteVerbose("Dumping HTML for " + $command) 16 | 17 | @" 18 | 19 | 20 | $($command.name) 21 | 22 | 23 | 24 | $( 25 | $command.parametersets | % { 26 | @" 27 | 28 | 29 | 30 | 53 | 54 | "@ 55 | } 56 | ) 57 |
$($_.name) 31 | 32 | 33 | 34 | 35 | $( 36 | $count = 0 37 | $_.parameters | % { 38 | if (0 -eq ($count % 8)) { 39 | @' 40 | 41 | 42 | '@ 43 | } 44 | @" 45 | 46 | "@ 47 | $count++ 48 | } 49 | ) 50 | 51 |
Parameters
$($_.name)
52 |
58 | 59 | 60 | "@ 61 | } 62 | 63 | Get-CommandDefinitionHtml get-item > out.html 64 | 65 | # show in browser 66 | invoke-item out.html 67 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/RoleQ.pm6: -------------------------------------------------------------------------------- 1 | role q { 2 | token stopper { \' } 3 | 4 | token escape:sym<\\> { } 5 | 6 | token backslash:sym { } 7 | token backslash:sym<\\> { } 8 | token backslash:sym { } 9 | 10 | token backslash:sym { {} . } 11 | 12 | method tweak_q($v) { self.panic("Too late for :q") } 13 | method tweak_qq($v) { self.panic("Too late for :qq") } 14 | } 15 | 16 | role qq does b1 does c1 does s1 does a1 does h1 does f1 { 17 | token stopper { \" } 18 | token backslash:sym { {} (\w) { self.throw_unrecog_backslash_seq: $/[0].Str } } 19 | token backslash:sym { \W } 20 | 21 | method tweak_q($v) { self.panic("Too late for :q") } 22 | method tweak_qq($v) { self.panic("Too late for :qq") } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/addressbook.proto: -------------------------------------------------------------------------------- 1 | // See README.txt for information and build instructions. 2 | 3 | package tutorial; 4 | 5 | option java_package = "com.example.tutorial"; 6 | option java_outer_classname = "AddressBookProtos"; 7 | 8 | message Person { 9 | required string name = 1; 10 | required int32 id = 2; // Unique ID number for this person. 11 | optional string email = 3; 12 | 13 | enum PhoneType { 14 | MOBILE = 0; 15 | HOME = 1; 16 | WORK = 2; 17 | } 18 | 19 | message PhoneNumber { 20 | required string number = 1; 21 | optional PhoneType type = 2 [default = HOME]; 22 | } 23 | 24 | repeated PhoneNumber phone = 4; 25 | } 26 | 27 | // Our address book file is just one of these. 28 | message AddressBook { 29 | repeated Person person = 1; 30 | } 31 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/antlr_throws: -------------------------------------------------------------------------------- 1 | public f throws a, b, c : x ; 2 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/as3_test2.as: -------------------------------------------------------------------------------- 1 | package ru.dfls.events { 2 | import flash.events.Event; 3 | import flash.events.ErrorEvent; 4 | 5 | /** 6 | * This event is usually dispatched if some error was thrown from an asynchronous code, i.e. there 7 | * is no relevant user stack part to process the error. There is only one type of such event: 8 | * ErrorEvent.ERROR which is same as flash.events.ErrorEvent.ERROR. 9 | * The only difference between flash.events.ErrorEvent and 10 | * ru.dfls.events.ErrorEvent is the capability of the latter to store the underlying cause 11 | * (the Error). 12 | * 13 | * @see flash.events.ErrorEvent 14 | * @see Error 15 | * @author dragonfly 16 | */ 17 | public class ErrorEvent extends flash.events.ErrorEvent { 18 | 19 | public static var ERROR : String = flash.events.ErrorEvent.ERROR; 20 | 21 | private var _error : Error; 22 | 23 | public function ErrorEvent(type : String, bubbles : Boolean = false, cancelable : Boolean = false, 24 | text : String = "", error : Error = null) { 25 | super(type, bubbles, cancelable, text); 26 | _error = error; 27 | } 28 | 29 | public function get error() : Error { 30 | return _error; 31 | } 32 | 33 | public function set error(value : Error) : void { 34 | _error = value; 35 | } 36 | 37 | public override function toString() : String { 38 | return formatToString("ErrorEvent", "type", "bubbles", "cancelable", "eventPhase", "text", "error"); 39 | } 40 | 41 | public override function clone() : Event { 42 | return new ru.dfls.events.ErrorEvent(type, bubbles, cancelable, text, error); 43 | } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/as3_test3.as: -------------------------------------------------------------------------------- 1 | protected function remote(method : String, ...args : Array) : Boolean { 2 | return true; 3 | } 4 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/aspx-cs_example: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" %> 2 | 3 | 5 | 6 | 14 | 15 | 16 | 17 | Sample page 18 | 19 | 20 |
21 |
22 | The current time is: 23 |
24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/autoit_submit.au3: -------------------------------------------------------------------------------- 1 | #include 2 | ;http://msdn.microsoft.com/en-us/library/Aa752084.aspx 3 | $ourl="http://localhost:5000/" 4 | 5 | $oIE = _IEAttach ($ourl,"url") 6 | If @error = $_IEStatus_NoMatch Then 7 | $oIE = _IECreate ($ourl & "sample.html") 8 | endIf 9 | 10 | $oForm = _IEFormGetObjByName ($oIE, "form1") 11 | ;username, call DOM directly 12 | $oIE.document.getElementById("username").value="helloAutoIT" 13 | ;state select 14 | $oSelect = _IEFormElementGetObjByName ($oForm, "state") 15 | _IEFormElementOptionSelect ($oSelect, "S2", 1, "byText") 16 | ;options raido 17 | _IEFormElementRadioSelect($oForm, "2nd", "type", 1, "byValue") 18 | 19 | ConsoleWrite(@Error) 20 | Sleep(10000) 21 | _IEFormSubmit($oForm, 0) 22 | _IELoadWait($oIE) 23 | Sleep(60000) 24 | _IEQuit($oIE) 25 | 26 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/badcase.java: -------------------------------------------------------------------------------- 1 | // this used to take ages 2 | void foo() throws xxxxxxxxxxxxxxxxxxxxxx{ } 3 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/batchfile.bat: -------------------------------------------------------------------------------- 1 | rem this is a demo file. 2 | @rem 3 | @echo off 4 | 5 | call c:\temp.bat somearg 6 | call :lab somearg 7 | rem This next one is wrong in the vim lexer! 8 | call c:temp.bat 9 | 10 | echo "Hi!" 11 | echo hi 12 | echo on 13 | echo off 14 | echo. 15 | @echo off 16 | if exist *.log echo The log file has arrived. 17 | rem These are all escapes, also done incorrectly by the vim lexer 18 | echo ^^ ^> ^< ^| 19 | 20 | x=beginning 21 | setlocal 22 | x = new text 23 | endlocal 24 | 25 | echo testrem x 26 | echo test rem x 27 | 28 | for %%var in (*.jpg) do echo %%var 29 | for /D %%var in (a b c) do echo %%var 30 | for /R C:\temp %%var in (*.jpg) do iexplore.exe %%var 31 | rem Vim has this one wrong too. 32 | for /L %%var in (10,-1,1) do echo %%var 33 | for /F %%var in ("hi!") do echo %%var 34 | for /F "eol=c,skip=1,usebackq" %%var in (`command`) do echo %%var %~l %~fl %~dl %~pl %~nl %~xl %~sl %~al %~tl %~zl %~$PATH:l %~dpl %~dp$PATH:l %~ftzal 35 | 36 | echo some file ?! > somefile.txt 37 | 38 | set PATH=%PATH%;c:\windows 39 | 40 | goto answer%errorlevel% 41 | :answer0 42 | echo Hi it's zero 43 | :answer1 44 | echo New 45 | 46 | if exist a del a 47 | else echo A is missing! 48 | 49 | 50 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/cbmbas_example: -------------------------------------------------------------------------------- 1 | 10 rem cbm basic v2 example 2 | 20 rem comment with keywords: for, data 3 | 30 dim a$(20) 4 | 35 rem the typical space efficient form of leaving spaces out: 5 | 40 fort=0to15:poke646,t:print"{revers on} ";:next 6 | 50 geta$:ifa$=chr$(0):goto40 7 | 55 rem it is legal to omit the closing " on line end 8 | 60 print"{white}":print"bye... 9 | 70 end 10 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/cheetah_example.html: -------------------------------------------------------------------------------- 1 | 2 | $title 3 | 4 | 5 | #for $client in $clients 6 | 7 | 8 | 9 | 10 | #end for 11 |
$client.surname, $client.firstname$client.email
12 | 13 | 14 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/condensed_ruby.rb: -------------------------------------------------------------------------------- 1 | # Server: ruby p2p.rb password server server-uri merge-servers 2 | # Sample: ruby p2p.rb foobar server druby://localhost:1337 druby://foo.bar:1337 3 | # Client: ruby p2p.rb password client server-uri download-pattern 4 | # Sample: ruby p2p.rb foobar client druby://localhost:1337 *.rb 5 | require'drb';F,D,C,P,M,U,*O=File,Class,Dir,*ARGV;def s(p)F.split(p[/[^|].*/])[-1 6 | ]end;def c(u);DRbObject.new((),u)end;def x(u)[P,u].hash;end;M=="client"&&c(U).f( 7 | x(U)).each{|n|p,c=x(n),c(n);(c.f(p,O[0],0).map{|f|s f}-D["*"]).each{|f|F.open(f, 8 | "w"){|o|o< 2 | 3 | 4 | 5 | Date Functions 6 | 7 | 8 | 9 | 10 | #RightNow#
11 | #DateFormat(RightNow)#
12 | #DateFormat(RightNow,"mm/dd/yy")#
13 | #TimeFormat(RightNow)#
14 | #TimeFormat(RightNow,"hh:mm tt")#
15 | #IsDate(RightNow)#
16 | #IsDate("January 31, 2007")#
17 | #IsDate("foo")#
18 | #DaysInMonth(RightNow)# 19 |
20 | 21 | #x# 22 | #y# 23 | #z# 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/dwarf.cw: -------------------------------------------------------------------------------- 1 | ;redcode 2 | ;name Dwarf 3 | ;author A. K. Dewdney 4 | ;version 94.1 5 | ;date April 29, 1993 6 | ;strategy Bombs every fourth instruction. 7 | ORG start ; Indicates the instruction with 8 | ; the label "start" should be the 9 | ; first to execute. 10 | step EQU 4 ; Replaces all occurrences of "step" 11 | ; with the character "4". 12 | target DAT.F #0, #0 ; Pointer to target instruction. 13 | start ADD.AB #step, target ; Increments pointer by step. 14 | MOV.AB #0, @target ; Bombs target instruction. 15 | JMP.A start ; Same as JMP.A -2. Loops back to 16 | ; the instruction labelled "start". 17 | END 18 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/erl_session: -------------------------------------------------------------------------------- 1 | 1> io:format("Hello\n"). 2 | Hello 3 | ok 4 | 2> fun(X) -> X + 1 end. 5 | #Fun 6 | 3> 123 + 234. 7 | 357 8 | 4> X = Y. 9 | * 1: variable 'Y' is unbound 10 | 5> 11 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/escape_semicolon.clj: -------------------------------------------------------------------------------- 1 | (= c (int \;)) (do (.readLine s) :line-start) 2 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/evil_regex.js: -------------------------------------------------------------------------------- 1 | /regexp/.test(foo) || x = [/regexp/,/regexp/, /regexp/, // comment 2 | // comment 3 | /regexp/]; 4 | if (/regexp/.test(string)) 5 | {/regexp/.test(string);}; 6 | x =/regexp/; 7 | x = /regexp/; 8 | if (0/regexp/.exec(string)) 9 | x = { u:/regexp/, v: /regexp/ }; 10 | foo();/regexp/.test(string); /regexp/.test(string); 11 | if (!/regexp/) foobar(); 12 | x = u %/regexp/.exec(string) */regexp/.exec(string) / /regexp/.exec(string); 13 | x = u?/regexp/.exec(string) : v +/regexp/.exec(string) -/regexp/.exec(string); 14 | a = u^/regexp/.exec(string) &/regexp/.exec(string) |/regexp/.exec(string) +~/regexp/.exec(string); 15 | x = /regexp/ /* a comment */ ; 16 | x = /[reg/exp]/; 17 | x = 4/2/i; 18 | x = (a == b) ?/* this is a comment */ c : d; 19 | /// a comment // 20 | a = /regex//2/1; //syntactically correct, returns NaN 21 | 22 | 23 | 24 | 25 | /* original examples */ 26 | 27 | // regex 28 | 29 | blah(/abc/); 30 | x = /abc/; 31 | x = /abc/.match; 32 | 33 | // math 34 | 35 | blah(1/2); //comment 36 | x = 1 / 2 / 3; 37 | x = 1/1/.1; 38 | 39 | // broken 40 | 41 | x=/1/; 42 | x=1/a/g; 43 | x=a/a/g; 44 | 45 | // real-world 46 | 47 | var x = 1/(1+Math.sqrt(sum)); // convert to number between 1-0 48 | return Math.round((num / den) * 100)/100; 49 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.Rd: -------------------------------------------------------------------------------- 1 | \name{foo} 2 | \alias{foo} 3 | % I'm a comment 4 | \title{The foo function} 5 | 6 | \description{It doesn't do much} 7 | 8 | \usage{ 9 | foo(x, y) 10 | } 11 | 12 | \arguments{ 13 | \item{x}{A number} 14 | \item{y}{Another number} 15 | } 16 | \details{ 17 | I just adds \code{x} and \code{y}, 18 | } 19 | \value{\code{numeric}. The sum of \code{x} and \code{y}.} 20 | \references{ 21 | \href{http://en.wikipedia.org/wiki/Sum}{Sum} 22 | } 23 | \author{ 24 | Anonymous 25 | } 26 | \note{ 27 | Lorem ipsum \dots \R \emph{emp}, \strong{strong}, \bold{bold}, 28 | \sQuote{single quotes}, \dQuote{double quotes}, \code{code}, 29 | \preformatted{x <- 2 + 2}, \kbd{type this}, \samp{literal seq}, 30 | \pkg{base}, \file{foo.txt}, \email{email@hostname}, 31 | \url{http://cran.r-project.org/}, \var{foo}, \env{HOME}, 32 | \option{-d}, \dfn{something new}, \acronym{GNU}. 33 | 34 | Escaped symbols: \\ \{ \} \% not comment. \\NotAMacro. 35 | 36 | \tabular{rlll}{ 37 | [,1] \tab alpha \tab numeric \tab A (ppb)\cr 38 | [,2] \tab bravo \tab integer \tab B \cr 39 | [,3] \tab charlie \tab character \tab C \cr 40 | } 41 | \enumerate{ 42 | \item delta 43 | \item echo 44 | } 45 | \itemize{ 46 | \item foxtrot 47 | \item golf 48 | } 49 | 50 | \deqn{p(x; \mu, \sigma^2) = \frac{1}{\sigma \sqrt{2 \pi}} \exp \frac{-(x - \mu)^2}{2 \sigma}{% 51 | p(\mu; x) = 1/\sigma (2 \pi)^(-1/2) exp( -(x - \mu)^2 / (2 \sigma)) } 52 | for \eqn{x = 0, 1, 2, \ldots}. 53 | 54 | \if{latex}{\out{\beta}}\ifelse{html}{\out{β}}{beta} 55 | 56 | #ifdef unix 57 | Now windows 58 | #endif 59 | #ifndef windows 60 | Using windows 61 | #endif 62 | 63 | } 64 | \section{Misc}{ 65 | Stuff. 66 | } 67 | 68 | \seealso{ 69 | \code{\link{sum}} 70 | } 71 | \examples{ 72 | x <- 1 73 | y <- 2 74 | z <- foo(x, y) 75 | \dontrun{plot(z)} 76 | \dontshow{log(x)} 77 | } 78 | \keyword{arith} 79 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.bug: -------------------------------------------------------------------------------- 1 | # Alligators: multinomial - logistic regression 2 | # http://www.openbugs.info/Examples/Aligators.html 3 | model { 4 | # PRIORS 5 | alpha[1] <- 0; # zero contrast for baseline food 6 | for (k in 2 : K) { 7 | alpha[k] ~ dnorm(0, 0.00001) # vague priors 8 | } 9 | # Loop around lakes: 10 | for (k in 1 : K){ 11 | beta[1, k] <- 0 12 | } # corner-point contrast with first lake 13 | for (i in 2 : I) { 14 | beta[i, 1] <- 0 ; # zero contrast for baseline food 15 | for (k in 2 : K){ 16 | beta[i, k] ~ dnorm(0, 0.00001) # vague priors 17 | } 18 | } 19 | # Loop around sizes: 20 | for (k in 1 : K){ 21 | gamma[1, k] <- 0 # corner-point contrast with first size 22 | } 23 | for (j in 2 : J) { 24 | gamma[j, 1] <- 0 ; # zero contrast for baseline food 25 | for ( k in 2 : K){ 26 | gamma[j, k] ~ dnorm(0, 0.00001) # vague priors 27 | } 28 | } 29 | 30 | # LIKELIHOOD 31 | for (i in 1 : I) { # loop around lakes 32 | for (j in 1 : J) { # loop around sizes 33 | 34 | # Fit standard Poisson regressions relative to baseline 35 | lambda[i, j] ~ dflat() # vague priors 36 | for (k in 1 : K) { # loop around foods 37 | X[i, j, k] ~ dpois(mu[i, j, k]) 38 | log(mu[i, j, k]) <- lambda[i, j] + alpha[k] + beta[i, k] + gamma[j, k] 39 | culmative.X[i, j, k] <- culmative(X[i, j, k], X[i, j, k]) 40 | } 41 | } 42 | } 43 | 44 | # TRANSFORM OUTPUT TO ENABLE COMPARISON 45 | # WITH AGRESTI'S RESULTS 46 | for (k in 1 : K) { # loop around foods 47 | for (i in 1 : I) { # loop around lakes 48 | b[i, k] <- beta[i, k] - mean(beta[, k]); # sum to zero constraint 49 | } 50 | for (j in 1 : J) { # loop around sizes 51 | g[j, k] <- gamma[j, k] - mean(gamma[, k]); # sum to zero constraint 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.ceylon: -------------------------------------------------------------------------------- 1 | import ceylon.language { parseInteger } 2 | 3 | doc "A top-level function, 4 | with multi-line documentation." 5 | void topLevel(String? a, Integer b=5, String* seqs) { 6 | function nested(String s) { 7 | print(s[1..2]); 8 | return true; 9 | } 10 | for (s in seqs.filter((String x) => x.size > 2)) { 11 | nested(s); 12 | } 13 | value uppers = seqs.map((String x) { 14 | return x.uppercased; 15 | }); 16 | String|Null z = a; 17 | {Integer+} ints = { 1, 2, 3, 4, 5 }; 18 | value numbers = [ 1, #ffff, #ffff_ffff, $10101010, $1010_1010_1010_1010, 19 | 123_456_789 ]; 20 | value chars = ['a', '\{#ffff}' ]; 21 | } 22 | 23 | shared class Example_1(name, element) satisfies Comparable> 24 | given Element satisfies Comparable { 25 | shared String name; 26 | shared Element element; 27 | shared [Integer,String] tuple = [1, "2"]; 28 | shared late String lastName; 29 | variable Integer cnt = 0; 30 | 31 | shared Integer count => cnt; 32 | assign count { 33 | assert(count >= cnt); 34 | cnt = count; 35 | } 36 | 37 | shared actual Comparison compare(Example_1 other) { 38 | return element <=> other.element; 39 | } 40 | 41 | shared actual String string { 42 | return "Example with ``element.string``"; 43 | } 44 | } 45 | 46 | Example_1 instance = Example_1 { 47 | element = 5; 48 | name = "Named args call \{#0060}"; 49 | }; 50 | 51 | object example1 extends Example_1("object", 5) { 52 | } -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.clay: -------------------------------------------------------------------------------- 1 | 2 | /// @section StringLiteralRef 3 | 4 | record StringLiteralRef ( 5 | sizep : Pointer[SizeT], 6 | ); 7 | 8 | 9 | /// @section predicates 10 | 11 | overload ContiguousSequence?(#StringLiteralRef) : Bool = true; 12 | [s when StringLiteral?(s)] 13 | overload ContiguousSequence?(#Static[s]) : Bool = true; 14 | 15 | 16 | 17 | /// @section size, begin, end, index 18 | 19 | forceinline overload size(a:StringLiteralRef) = a.sizep^; 20 | 21 | forceinline overload begin(a:StringLiteralRef) : Pointer[Char] = Pointer[Char](a.sizep + 1); 22 | forceinline overload end(a:StringLiteralRef) = begin(a) + size(a); 23 | 24 | [I when Integer?(I)] 25 | forceinline overload index(a:StringLiteralRef, i:I) : ByRef[Char] { 26 | assert["boundsChecks"](i >= 0 and i < size(a), "StringLiteralRef index out of bounds"); 27 | return ref (begin(a) + i)^; 28 | } 29 | 30 | foo() = """ 31 | long\tlong 32 | story 33 | """ 34 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.cls: -------------------------------------------------------------------------------- 1 | USING Progress.Lang.*. 2 | 3 | CLASS Test INHERITS Progress.Sucks: 4 | 5 | DEFINE PRIVATE VARIABLE cTest AS CHAR NO-UNDO. 6 | 7 | CONSTRUCTOR PUBLIC Test(): 8 | SUPER(). 9 | MESSAGE "Why are you punishing yourself by coding in this language?". 10 | END CONSTRUCTOR. 11 | 12 | METHOD PUBLIC LOGICAL Blowup(INPUT iTime AS INT): 13 | END. 14 | 15 | END CLASS. 16 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djanowski/pygmentize/58b923066713abcf967a8836a7177193e64f96a3/vendor/pygments/tests/examplefiles/example.cpp -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.gst: -------------------------------------------------------------------------------- 1 | <%!-- defined in example/PersonCSVTemplate.gst --%> 2 | 3 | <%@ params( users : Collection ) %> 4 | 5 | <% for( user in users ) { %> 6 | 7 | ${user.LastName}, ${user.FirstName}, ${user.Department} <% } %> -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.jag: -------------------------------------------------------------------------------- 1 | # lsat.jags example from classic-bugs examples in JAGS 2 | # See http://sourceforge.net/projects/mcmc-jags/files/Examples/2.x/ 3 | var 4 | response[R,T], m[R], culm[R], alpha[T], a[T], theta[N], r[N,T], 5 | p[N,T], beta, theta.new, p.theta[T], p.item[R,T], P.theta[R]; 6 | data { 7 | for (j in 1:culm[1]) { 8 | r[j, ] <- response[1, ]; 9 | } 10 | for (i in 2:R) { 11 | for (j in (culm[i - 1] + 1):culm[i]) { 12 | r[j, ] <- response[i, ]; 13 | } 14 | } 15 | } 16 | model { 17 | # 2-parameter Rasch model 18 | for (j in 1:N) { 19 | for (k in 1:T) { 20 | probit(p[j,k]) <- delta[k]*theta[j] - eta[k]; 21 | r[j,k] ~ dbern(p[j,k]); 22 | } 23 | theta[j] ~ dnorm(0,1); 24 | } 25 | 26 | # Priors 27 | for (k in 1:T) { 28 | eta[k] ~ dnorm(0,0.0001); 29 | e[k] <- eta[k] - mean(eta[]); # sum-to-zero constraint 30 | 31 | delta[k] ~ dnorm(0,1) T(0,); # constrain variance to 1, slope +ve 32 | d[k] <- delta[k]/pow(prod(delta), 1/T); # PRODUCT_k (d_k) = 1 33 | 34 | g[k] <- e[k]/d[k]; # equivalent to B&A's threshold parameters 35 | } 36 | 37 | # Compute probability of response pattern i, for later use in computing G^2 38 | theta.new ~ dnorm(0,1); # ability parameter for random student 39 | for(k in 1:T) { 40 | probit(p.theta[k]) <- delta[k]*theta.new - eta[k]; 41 | for(i in 1:R) { 42 | p.item[i,k] <- p.theta[k]^response[i,k] * (1-p.theta[k])^(1-response[i,k]); 43 | } 44 | } 45 | for(i in 1:R) { 46 | P.theta[i] <- prod(p.item[i,]) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.kt: -------------------------------------------------------------------------------- 1 | package addressbook 2 | 3 | class Contact( 4 | val name : String, 5 | val emails : List, 6 | val addresses : List, 7 | val phonenums : List 8 | ) 9 | 10 | class EmailAddress( 11 | val user : String, 12 | val host : String 13 | ) 14 | 15 | class PostalAddress( 16 | val streetAddress : String, 17 | val city : String, 18 | val zip : String, 19 | val state : USState?, 20 | val country : Country 21 | ) { 22 | assert {(state == null) xor (country == Countries["US"]) } 23 | } 24 | 25 | class PhoneNumber( 26 | val country : Country, 27 | val areaCode : Int, 28 | val number : Long 29 | ) 30 | 31 | object Countries { 32 | fun get(id : CountryID) : Country = countryTable[id] 33 | 34 | private var table : Map? = null 35 | private val countryTable : Map 36 | get() { 37 | if (table == null) { 38 | table = HashMap() 39 | for (line in TextFile("countries.txt").lines(stripWhiteSpace = true)) { 40 | table[line] = Country(line) 41 | } 42 | } 43 | return table 44 | } 45 | } 46 | 47 | class Country(val name : String) -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.lagda: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | % this is a LaTeX comment 3 | \usepackage{agda} 4 | 5 | \begin{document} 6 | 7 | Here's how you can define \emph{RGB} colors in Agda: 8 | 9 | \begin{code} 10 | module example where 11 | 12 | open import Data.Fin 13 | open import Data.Nat 14 | 15 | data Color : Set where 16 | RGB : Fin 256 → Fin 256 → Fin 256 → Color 17 | \end{code} 18 | 19 | \end{document} -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.moo: -------------------------------------------------------------------------------- 1 | if (this.running) 2 | player:tell("[Train] Error: already a jump in progress"); 3 | return; 4 | endif 5 | this.running = 1; 6 | this.aborted = 0; 7 | this:announce_all("[Train] departure in 20 seconds"); 8 | dest = this.targets[random(length(this.targets))]; 9 | this:announce_all("[Train] Next stop is '", dest:title(), "'"); 10 | this:announce_all("You hear the engines starting up"); 11 | this.location:announce("The MOOTrain starts up his engines"); 12 | suspend(20); 13 | if (this.aborted) 14 | this.running = 0; 15 | this.aborted = 0; 16 | return; 17 | endif 18 | this:announce_all("[Train] Departure!"); 19 | this.location:announce_all("The MOOTrain leaves into the 42th dimension!"); 20 | this:announce_all("Outside you see the lights of the 42th dimension"); 21 | this:moveto(dest); 22 | suspend(4); 23 | this:announce_all("The glowing gets less, until you can see the clear shape of the room, the MOOTrain has landed in"); 24 | this.location:announce_all("The MOOTrain arrives out of the 42th dimension!"); 25 | this:announce_all("[Train] arrived in '", dest:title(), "'"); 26 | this.running = 0; -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.msc: -------------------------------------------------------------------------------- 1 | msc { 2 | hscale=5; 3 | 4 | //test comment 5 | 6 | a,b,c,d; 7 | 8 | /* another 9 | comment 10 | goes here */ /* too */ // now 11 | 12 | ... [label="test1", id="1"]; 13 | --- [label="test2", id="2"]; 14 | ||| [label="test3", id="2"]; 15 | a ABOX b; 16 | a--b [label="test4", id="2"]; 17 | a == b [label="test5", id="2"]; 18 | a .. b [label="test6", id="2"]; 19 | a::b [label="test7", id="2"]; 20 | a<<=>> b [label="test8", id="2"], 21 | b <->c [label="test9", id="2"], 22 | b RBOX c; 23 | a BOX d; 24 | a<=> b [label="test10", id="2"]; 25 | a <<>> b [label="test11", id="2"]; 26 | a<:>b [label="test12", id="2"]; 27 | a->b [label="test13", id="2"]; 28 | a =>> b [label="test14", id="2"], 29 | b >> c [label="test15", id="2"], 30 | a=> b [label="test16", id="2"]; 31 | a :>b [label="test17", id="2"]; 32 | a-x b [label="test18", id="2"]; 33 | a -Xb [label="test19", id="2"]; 34 | a<- b [label="test20", id="2"]; 35 | a <<=b [label="test21", id="2"]; 36 | a<< b [label="test22", id="2"]; 37 | a <= b [label="test23", id="2"]; 38 | a<: b [label="test24", id="2"]; 39 | a -xb [label="test25", id="2"]; 40 | a-X b [ label="test26",id="2" ]; 41 | a->* [label="test27" , id="2"]; 42 | *<-b [label="test28",id="28"]; 43 | } 44 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.ns2: -------------------------------------------------------------------------------- 1 | Newsqueak2 2 | 'Langexplr 3 | ' 4 | 5 | class ShapesExperiment usingLib: platform = ( 6 | "A small experiment for using Hopscotch shape classes ." 7 | | 8 | CanvasDependent = platform CanvasDependent. 9 | Presenter = platform HPresenter. 10 | Subject = platform Subject. 11 | EllipseShape = platform EllipseShape. 12 | Color = platform Color. 13 | | 14 | ) 15 | ( 16 | 17 | class ShapesExperimentSubject = Subject( 18 | "Subject for shapes experiment" 19 | | 20 | 21 | | 22 | ) 23 | ('as yet unclassified' 24 | createPresenter = ( 25 | ^ShapesExperimentPresenter new subject: self. 26 | ) 27 | 28 | ) 29 | 30 | class ShapesExperimentPresenter = Presenter ( 31 | "A presenter for a small experiment of using shape classes" 32 | | 33 | | 34 | ) 35 | ('as yet unclassified' 36 | controlPoint = ( 37 | ^ControlPoint new. 38 | ) 39 | 40 | definition = ( 41 | ^ column: { 42 | canvas: { 43 | at: 10 @ 10 display: controlPoint. 44 | at: 15 @ 10 display: controlPoint. 45 | } 46 | } 47 | ) 48 | 49 | ) 50 | 51 | class ControlPoint = CanvasDependent( 52 | "A class that represents a small point in the screen" 53 | | 54 | | 55 | ) 56 | ('as yet unclassified' 57 | addVisualsTo: container = ( 58 | container add: visual. 59 | updateLayout. 60 | ) 61 | 62 | createVisual = ( 63 | | s | 64 | s:: EllipseShape new size: 5@5 . 65 | s color: Color red. 66 | ^ s 67 | ) 68 | 69 | )) 70 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.p: -------------------------------------------------------------------------------- 1 | {include.i} 2 | {nested.i {include.i}} 3 | 4 | &SCOPED-DEFINE MY_NAME "Abe" 5 | 6 | DEF VAR i AS INT NO-UNDO. 7 | i = 0xABE + 1337 / (1 * 1.00) 8 | 9 | def var clowercasetest as char no-undo. 10 | DEF VAR vardashtest AS DATETIME-TZ NO-UNDO. 11 | 12 | DEFINE TEMP-TABLE ttNames NO-UNDO 13 | FIELD cName AS CHAR 14 | INDEX IXPK_ttNames IS PRIMARY UNIQUE cName. 15 | 16 | /* One-line comment */ 17 | /* Two-line 18 | Comment */ 19 | /* 20 | Nested 21 | /* 22 | Multiline 23 | /* 24 | Comment 25 | */ 26 | */ 27 | */ 28 | 29 | CREATE ttNames. 30 | ASSIGN ttNames.cName = {&MY_NAME}. 31 | 32 | FOR EACH ttNames: 33 | MESSAGE "Hello, " + ttNames.cName + '!' VIEW-AS ALERT-BOX. 34 | END. 35 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djanowski/pygmentize/58b923066713abcf967a8836a7177193e64f96a3/vendor/pygments/tests/examplefiles/example.pas -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | ; comment 3 | 4 | [HKEY_CURRENT_USER\SOFTWARE\Pygments] 5 | @="Hello" 6 | "Key With Spaces"="Something" 7 | "Key With ="="With Quotes" 8 | "Key With = 2"=dword:123 9 | "Key" = "Value" 10 | "Hex"=hex(0):1,2,3,a,b,f 11 | "Hex 2"=hex(5):80,00,00,ff 12 | 13 | [-HKEY_CURRENT_USER\SOFTWARE\Pygments\Subkey] 14 | 15 | [HKEY_CURRENT_USER\SOFTWARE\Pygments\Subkey2] 16 | ; comment 17 | @=- 18 | "Foo"=- 19 | "Foo"="Value" 20 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.rexx: -------------------------------------------------------------------------------- 1 | /* REXX example. */ 2 | 3 | /* Some basic constructs. */ 4 | almost_pi = 0.1415 + 3 5 | if almost_pi < 3 then 6 | say 'huh?' 7 | else do 8 | say 'almost_pi=' almost_pi || " - ok" 9 | end 10 | x = '"' || "'" || '''' || """" /* quotes */ 11 | 12 | /* A comment 13 | * spawning multiple 14 | lines. /* / */ 15 | 16 | /* Built-in functions. */ 17 | line = 'line containing some short text' 18 | say WordPos(line, 'some') 19 | say Word(line, 4) 20 | 21 | /* Labels and procedures. */ 22 | some_label : 23 | 24 | divide: procedure 25 | parse arg some other 26 | return some / other 27 | 28 | call divide(5, 2) 29 | 30 | /* Loops */ 31 | do i = 1 to 5 32 | do j = -3 to -9 by -3 33 | say i '+' j '=' i + j 34 | end j 35 | end i 36 | 37 | do forever 38 | leave 39 | end 40 | 41 | /* Print a text file on MVS. */ 42 | ADDRESS TSO 43 | "ALLOC F(TEXTFILE) DSN('some.text.dsn') SHR REU" 44 | "EXECIO * DISKR TEXTFILE ( FINIS STEM LINES." 45 | "FREE F(TEXTFILE)" 46 | I = 1 47 | DO WHILE I <= LINES.0 48 | SAY ' LINE ' I ' : ' LINES.I 49 | I = I + 1 50 | END 51 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.rkt: -------------------------------------------------------------------------------- 1 | #lang racket 2 | 3 | ; Single-line comment style. 4 | 5 | ;; Single-line comment style. 6 | 7 | #| Multi-line comment style ... on one line |# 8 | 9 | #| 10 | Multi-line comment style ... 11 | ... on multiple lines 12 | |# 13 | 14 | (define (a-function x #:keyword [y 0]) 15 | (define foo0 'symbol) ; () 16 | [define foo1 'symbol] ; [] 17 | {define foo2 'symbol} ; {} 18 | (and (append (car '(1 2 3)))) 19 | (regexp-match? #rx"foobar" "foobar") 20 | (regexp-match? #px"foobar" "foobar") 21 | (define a 1)) 22 | (let ([b "foo"]) 23 | (displayln b)) 24 | (for/list ([x (in-list (list 1 2 (list 3 4)))]) 25 | (cond 26 | [(pair? x) (car x)] 27 | [else x]))) 28 | 29 | ;; Literal number examples 30 | (values 31 | ;; #b 32 | #b1.1 33 | #b-1.1 34 | #b1e1 35 | #b0/1 36 | #b1/1 37 | #b1e-1 38 | #b101 39 | 40 | ;; #d 41 | #d-1.23 42 | #d1.123 43 | #d1e3 44 | #d1e-22 45 | #d1/2 46 | #d-1/2 47 | #d1 48 | #d-1 49 | 50 | ;; No # reader prefix -- same as #d 51 | -1.23 52 | 1.123 53 | 1e3 54 | 1e-22 55 | 1/2 56 | -1/2 57 | 1 58 | -1 59 | 60 | ;; #e 61 | #e-1.23 62 | #e1.123 63 | #e1e3 64 | #e1e-22 65 | #e1 66 | #e-1 67 | #e1/2 68 | #e-1/2 69 | 70 | ;; #i always float 71 | #i-1.23 72 | #i1.123 73 | #i1e3 74 | #i1e-22 75 | #i1/2 76 | #i-1/2 77 | #i1 78 | #i-1 79 | 80 | ;; #o 81 | #o777.777 82 | #o-777.777 83 | #o777e777 84 | #o777e-777 85 | #o3/7 86 | #o-3/7 87 | #o777 88 | #o-777 89 | 90 | ;; #x 91 | #x-f.f 92 | #xf.f 93 | #x-f 94 | #xf 95 | ) 96 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.rpf: -------------------------------------------------------------------------------- 1 | declare xyz true 2 | declare s "some string" 3 | i = 2 4 | f = 0.2 5 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.sh-session: -------------------------------------------------------------------------------- 1 | user@host:~/path$ ls -a 2 | . .. a b c 3 | user@host:~/path$ diff -u a b 4 | --- a 2008-07-26 17:10:07.000000000 -0700 5 | +++ b 2008-07-26 17:10:10.000000000 -0700 6 | @@ -1,3 +1,3 @@ 7 | a 8 | -b 9 | +x 10 | c 11 | user@host:~/path$ echo \ 12 | > a 13 | a 14 | user@host:~/path$ su 15 | root@host:~# 16 | sh-3.1$ # on hardy 17 | sh$ # on etch 18 | (virtualenv-name)user@host:~$ ls -a 19 | 20 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.shell-session: -------------------------------------------------------------------------------- 1 | [user@linuxbox imx-bootlets-src-10.05.02]$ make CROSS_COMPILE=arm-none-eabi- clean 2 | rm -rf *.sb 3 | rm -f sd_mmc_bootstream.raw 4 | rm -f linux_prep/board/*.o 5 | ... 6 | Files: 7 | rm -f power_prep.o eabi.o 8 | Build output: 9 | make[1]: Leaving directory `/home/...' 10 | [user@linuxbox imx-bootlets-src-10.05.02]$ make CROSS_COMPILE=arm-none-eabi- 11 | make[1]: Entering directory `/home/...' 12 | ... 13 | #@echo "generating U-Boot boot stream image" 14 | #elftosb2 -z -c ./uboot_prebuilt.db -o imx23_uboot.sb 15 | echo "generating kernel bootstream file sd_mmc_bootstream.raw" 16 | generating kernel bootstream file sd_mmc_bootstream.raw 17 | #Please use cfimager to burn xxx_linux.sb. The below way will no 18 | #work at imx28 platform. 19 | > test 20 | $ test 21 | rm -f sd_mmc_bootstream.raw 22 | [user@linuxbox imx-bootlets-src-10.05.02]$ 23 | pi@raspberrypi ~ $ sudo sh -c "echo 17 > /sys/class/gpio/export" 24 | pi@raspberrypi ~ $ sudo sh -c "echo out > /sys/class/gpio/gpio17/direction" 25 | pi@raspberrypi ~ $ sudo sh -c "echo 1 > /sys/class/gpio/gpio17/value" 26 | pi@raspberrypi ~ $ sudo sh -c "echo 0 > /sys/class/gpio/gpio17/value" 27 | pi@raspberrypi ~ $ 28 | [user@linuxbox ~]$ # copy other stuff to the SD card 29 | root@imx233-olinuxino-micro:~# lsmod 30 | Not tainted 31 | [user@linuxbox ~]$ tail -n 2 /mnt/rpi/etc/inittab 32 | #Spawn a getty on Raspberry Pi serial line 33 | T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 34 | pi@raspberrypi:~/Adafruit-WebIDE$ mkdir tmp 35 | pi@raspberrypi:~/Adafruit-WebIDE$ npm config set tmp tmp 36 | pi@raspberrypi:~/Adafruit-WebIDE$ npm install 37 | pi@raspberrypi ~/Adafruit-WebIDE $ ifconfig eth0 38 | eth0 Link encap:Ethernet HWaddr b5:33:ff:33:ee:aq 39 | inet addr:10.42.0.60 Bcast:10.42.0.255 Mask:255.255.255.0 40 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 41 | RX packets:21867 errors:0 dropped:0 overruns:0 frame:0 42 | TX packets:8684 errors:0 dropped:0 overruns:0 carrier:0 43 | collisions:0 txqueuelen:1000 44 | RX bytes:27338495 (26.0 MiB) TX bytes:1268356 (1.2 MiB) 45 | 46 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.snobol: -------------------------------------------------------------------------------- 1 | -SOME RANDOM DIRECTIVE WOULD GO HERE 2 | * 3 | * SNOBOL4 example file for lexer 4 | * 5 | SOME.THING_OR_OTHER32 = 1 + 1.0 - 1E3 * 1E-3 ** 2.718284590E0 6 | + :F(END)S(IN_LOOP) 7 | PATTERN = LEN(3) ("GAR" | "BAR") 8 | IN_LOOP THING = INPUT :F(END) 9 | THING LEN(3) ("GAR" | "BAR") :S(OK) 10 | OUTPUT = THING " : Failure!" :(IN_LOOP) 11 | OK OUTPUT = THING ' : "Success"!' :(IN_LOOP) 12 | END 13 | FOOBAR 14 | FOOGAR 15 | THiNIg 16 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.stan: -------------------------------------------------------------------------------- 1 | /* 2 | A file for testing Stan syntax highlighting. 3 | 4 | It is not a real model and will not compile 5 | */ 6 | # also a comment 7 | // also a comment 8 | data { 9 | // valid name 10 | int abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_abc; 11 | // all types should be highlighed 12 | int a3; 13 | real foo[2]; 14 | vector[3] bar; 15 | row_vector[3] baz; 16 | matrix[3,3] qux; 17 | simplex[3] quux; 18 | ordered[3] corge; 19 | positive_ordered[3] wibble; 20 | corr_matrix[3] grault; 21 | cov_matrix[3] garply; 22 | 23 | real foo1; 24 | real foo2; 25 | real foo3; 26 | } 27 | transformed data { 28 | real xyzzy; 29 | int thud; 30 | row_vector grault2; 31 | matrix qux2; 32 | 33 | // all floating point literals should be recognized 34 | // all operators should be recognized 35 | // paren should be recognized; 36 | xyzzy <- 1234.5687 + .123 - (2.7e3 / 2E-5 * 135e-5); 37 | // integer literal 38 | thud <- -12309865; 39 | // ./ and .* should be recognized as operators 40 | grault2 <- grault .* garply ./ garply; 41 | // ' and \ should be regognized as operators 42 | qux2 <- qux' \ bar; 43 | 44 | } 45 | parameters { 46 | real fred; 47 | real plugh; 48 | } 49 | transformed parameters { 50 | } 51 | model { 52 | // ~, <- are operators, 53 | // T may be be recognized 54 | // normal is a function 55 | fred ~ normal(0, 1) T(-0.5, 0.5); 56 | real tmp; 57 | // C++ reserved 58 | real public; 59 | 60 | // control structures 61 | for (i in 1:10) { 62 | tmp <- tmp + 0.1; 63 | } 64 | tmp <- 0.0; 65 | while (tmp < 5.0) { 66 | tmp <- tmp + 1; 67 | } 68 | if (tmp > 0.0) { 69 | print(tmp); 70 | } else { 71 | print(tmp); 72 | } 73 | 74 | // operators 75 | tmp || tmp; 76 | tmp && tmp; 77 | tmp == tmp; 78 | tmp != tmp; 79 | tmp < tmp; 80 | tmp <= tmp; 81 | tmp > tmp; 82 | tmp >= tmp; 83 | tmp + tmp; 84 | tmp - tmp; 85 | tmp * tmp; 86 | tmp / tmp; 87 | tmp .* tmp; 88 | tmp ./ tmp; 89 | ! tmp; 90 | - tmp; 91 | + tmp; 92 | tmp '; 93 | 94 | // lp__ should be highlighted 95 | // normal_log as a function 96 | lp__ <- lp__ + normal_log(plugh, 0, 1); 97 | 98 | // print statement and string literal 99 | print("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_~@#$%^&*`'-+={}[].,;: "); 100 | print("Hello, world!"); 101 | print(""); 102 | 103 | } 104 | generated quantities { 105 | real bar1; 106 | bar1 <- foo + 1; 107 | } 108 | 109 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.tea: -------------------------------------------------------------------------------- 1 | <% template example() {...} 2 | a = 123 3 | b = "test"; 4 | c = 4.5 5 | d = call other() 6 | f = other2() 7 | 8 | define g as String 9 | 10 | h = true 11 | i = false 12 | j = null 13 | %> 14 | 15 | 16 | Example<title> 17 | <body> 18 | <a href="http://example.com">Test link</a> 19 | <% // Second block 20 | if(a == 123 and b == "test") { 21 | 'yes' 22 | } else { 23 | 'no' 24 | } 25 | 26 | foreach(i in 1..10) { 27 | i & "," 28 | } 29 | 30 | foreach(i in #(1,2,3) reverse { 31 | i & ";" 32 | } 33 | 34 | %> -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.ts: -------------------------------------------------------------------------------- 1 | class Animal { 2 | constructor(public name) { } 3 | move(meters) { 4 | alert(this.name + " moved " + meters + "m."); 5 | } 6 | } 7 | 8 | class Snake extends Animal { 9 | constructor(name) { super(name); } 10 | move() { 11 | alert("Slithering..."); 12 | super.move(5); 13 | } 14 | } 15 | 16 | class Horse extends Animal { 17 | constructor(name) { super(name); } 18 | move() { 19 | alert("Galloping..."); 20 | super.move(45); 21 | } 22 | } 23 | 24 | var sam = new Snake("Sammy the Python") 25 | var tom: Animal = new Horse("Tommy the Palomino") 26 | 27 | sam.move() 28 | tom.move(34) 29 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.weechatlog: -------------------------------------------------------------------------------- 1 | **** Beginning of log 2007 Sep 01 00:23:55 **** 2 | 2007 Sep 01 00:23:55 --> weechat_user (weechat@localhost.) ist in den Channel &bitlbee gekommen 3 | 2007 Sep 01 00:23:55 -=- Modus &bitlbee [+t] durch localhost. 4 | 2007 Sep 01 00:23:55 -@- Nicks &bitlbee: [@root @weechat_user] 5 | 2007 Sep 01 00:23:55 -=- Channel &bitlbee: 2 Nicks (2 Operatoren, 0 Halb-Operator, 0 Gevoiceter, 0 normal) 6 | 2007 Sep 01 00:23:55 -=- Das Topic von &bitlbee lautet: "Welcome to the control channel. Type help for help information." 7 | 2007 Sep 01 00:23:55 <root> Welcome to the BitlBee gateway! 8 | 2007 Sep 01 00:23:55 <root> 9 | 2007 Sep 01 00:23:55 <root> If you've never used BitlBee before, please do read the help information using the help command. Lots of FAQ's are answered there. -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.xhtml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djanowski/pygmentize/58b923066713abcf967a8836a7177193e64f96a3/vendor/pygments/tests/examplefiles/example.xhtml -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example.xtend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djanowski/pygmentize/58b923066713abcf967a8836a7177193e64f96a3/vendor/pygments/tests/examplefiles/example.xtend -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example2.aspx: -------------------------------------------------------------------------------- 1 | <%@ Register TagPrefix="Acme" TagName="Message" Src="userctrl2_vb.ascx" %> 2 | 3 | <html> 4 | 5 | <script language="VB" runat="server"> 6 | 7 | Sub SubmitBtn_Click(Sender As Object, E As EventArgs) 8 | MyMessage.MessageText = "Message text changed!" 9 | MyMessage.Color = "red" 10 | End Sub 11 | 12 | </script> 13 | 14 | <body style="font: 10pt verdana"> 15 | 16 | <h3>A Simple User Control w/ Properties</h3> 17 | 18 | <form runat="server"> 19 | 20 | <Acme:Message id="MyMessage" MessageText="This is a custom message!" Color="blue" runat="server"/> 21 | 22 | <p> 23 | 24 | <asp:button text="Change Properties" OnClick="SubmitBtn_Click" runat=server/> 25 | 26 | </form> 27 | 28 | </body> 29 | </html> 30 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/example2.msc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/mscgen -Tpng 2 | # 3 | # testinput2.msc : Sample msc input file with URLs 4 | # 5 | # This file is PUBLIC DOMAIN and may be freely reproduced, distributed, 6 | # transmitted, used, modified, built upon, or otherwise exploited by 7 | # anyone for any purpose, commercial or non-commercial, and in any way, 8 | # including by methods that have not yet been invented or conceived. 9 | # 10 | # This file is provided "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 11 | # EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 12 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13 | # 14 | 15 | # Note: This is from mscgen-0.20 16 | 17 | msc { 18 | 19 | A,B; 20 | 21 | --- [label="Start", ID="1"]; 22 | 23 | A->B [label="signal"]; 24 | A<-B [label="signal"]; 25 | 26 | 27 | A=>B [label="method"]; 28 | A<=B [label="method"]; 29 | 30 | A>>B [label="return"]; 31 | A<<B [label="return"]; 32 | 33 | A=>>B [label="call-back"]; 34 | A<<=B [label="call-back", URL="www.google.com"]; 35 | 36 | A x- B [label="loss"]; 37 | A -x B [label="loss"]; 38 | 39 | --- [label="Left arcs", ID="2", IDURL="www.google.co.uk"]; 40 | 41 | A->A [label="signal"]; 42 | A<-A [label="signal"]; 43 | 44 | 45 | A=>A [label="method"]; 46 | A<=A [label="method"]; 47 | 48 | A>>A [label="return"]; 49 | A<<A [label="return"]; 50 | 51 | A=>>A [label="call-back"]; 52 | A<<=A [label="call-back", URL="www.google.com", ID="3"]; 53 | 54 | A x- A [label="loss"]; 55 | A -x A [label="loss"]; 56 | 57 | --- [label="Right arcs"]; 58 | 59 | B->B [label="signal"]; 60 | B<-B [label="signal"]; 61 | 62 | 63 | B=>B [label="method"]; 64 | B<=B [label="method"]; 65 | 66 | B>>B [label="return"]; 67 | B<<B [label="return"]; 68 | 69 | B=>>B [label="call-back", ID="4"]; 70 | B<<=B [label="call-back", URL="www.google.com"]; 71 | 72 | B x- B [label="loss"]; 73 | B -x B [label="loss"]; 74 | 75 | --- [label="End of arcs", URL="www.google.com"]; 76 | 77 | 78 | ... [label="Some time passes", URL="www.google.com"]; 79 | } 80 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/flipflop.sv: -------------------------------------------------------------------------------- 1 | module toplevel(clock,reset); 2 | input clock; 3 | input reset; 4 | 5 | reg flop1; 6 | reg flop2; 7 | 8 | always @ (posedge reset or posedge clock) 9 | if (reset) 10 | begin 11 | flop1 <= 0; 12 | flop2 <= 1; 13 | end 14 | else 15 | begin 16 | flop1 <= flop2; 17 | flop2 <= flop1; 18 | end 19 | endmodule 20 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/foo.sce: -------------------------------------------------------------------------------- 1 | // Scilab 2 | // 3 | disp(%pi); 4 | 5 | assert_checkequal(2+2,4); 6 | 7 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/function.mu: -------------------------------------------------------------------------------- 1 | a::b () 2 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/genshitext_example.genshitext: -------------------------------------------------------------------------------- 1 | ## a comment 2 | 3 | \## not a comment 4 | 5 | #if foo 6 | ${bar} 7 | #endif 8 | 9 | The answer is: 10 | #choose 11 | #when 0 == 1 12 | 0 13 | #end 14 | #when 1 == 1 15 | 1 16 | #end 17 | #otherwise 18 | 2 19 | #end 20 | #end -- comment about choose 21 | 22 | #for item in items 23 | * ${item} 24 | #end 25 | 26 | #def greeting(name) 27 | Hello, ${name}! 28 | #end 29 | ${greeting('world')} 30 | 31 | #with y=7; z=x+10 32 | $x $y $z 33 | #end 34 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/glsl.frag: -------------------------------------------------------------------------------- 1 | /* Fragment shader */ 2 | void main() 3 | { 4 | gl_FragColor[0] = gl_FragCoord[0] / 400.0; 5 | gl_FragColor[1] = gl_FragCoord[1] / 400.0; 6 | gl_FragColor[2] = 1.0; 7 | } 8 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/glsl.vert: -------------------------------------------------------------------------------- 1 | /* Vertex shader */ 2 | uniform float waveTime; 3 | uniform float waveWidth; 4 | uniform float waveHeight; 5 | 6 | void main(void) 7 | { 8 | vec4 v = vec4(gl_Vertex); 9 | 10 | v.z = sin(waveWidth * v.x + waveTime) * cos(waveWidth * v.y + waveTime) * waveHeight; 11 | 12 | gl_Position = gl_ModelViewProjectionMatrix * v; 13 | } 14 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/grammar-test.p6: -------------------------------------------------------------------------------- 1 | token pod_formatting_code { 2 | $<code>=<[A..Z]> 3 | '<' { $*POD_IN_FORMATTINGCODE := 1 } 4 | $<content>=[ <!before '>'> <pod_string_character> ]+ 5 | '>' { $*POD_IN_FORMATTINGCODE := 0 } 6 | } 7 | 8 | token pod_string { 9 | <pod_string_character>+ 10 | } 11 | 12 | token something:sym«<» { 13 | <!> 14 | } 15 | 16 | token name { 17 | <!> 18 | } 19 | 20 | token comment:sym<#> { 21 | '#' {} \N* 22 | } 23 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/hello.smali: -------------------------------------------------------------------------------- 1 | # To Recreate: 2 | # 3 | # echo -e 'class hello {\n public static void main(String[] args) {\n 4 | # System.out.println("hi");\n }\n}\n' > hello.java 5 | # javac -target 1.4 -source 1.4 hello.java 6 | # dx --dex --output=hello.dex hello.class 7 | # baksmali hello.dex 8 | # cat out/hello.smali 9 | 10 | .class Lhello; 11 | .super Ljava/lang/Object; 12 | .source "hello.java" 13 | 14 | 15 | # direct methods 16 | .method constructor <init>()V 17 | .registers 1 18 | 19 | .prologue 20 | .line 1 21 | invoke-direct {p0}, Ljava/lang/Object;-><init>()V 22 | 23 | return-void 24 | .end method 25 | 26 | .method public static main([Ljava/lang/String;)V 27 | .registers 3 28 | .parameter 29 | 30 | .prologue 31 | .line 3 32 | sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream; 33 | 34 | const-string v1, "hi" 35 | 36 | invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V 37 | 38 | .line 4 39 | return-void 40 | .end method 41 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/hello.sp: -------------------------------------------------------------------------------- 1 | #include <sourcemod> 2 | 3 | // Single line comment 4 | /* Multi line 5 | comment */ 6 | 7 | public OnPluginStart() { 8 | PrintToServer("Hello."); 9 | } 10 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/html+php_faulty.php: -------------------------------------------------------------------------------- 1 | <?php 2 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/http_request_example: -------------------------------------------------------------------------------- 1 | POST /demo/submit/ HTTP/1.1 2 | Host: pygments.org 3 | Connection: keep-alivk 4 | Cache-Control: max-age=0 5 | Origin: http://pygments.org 6 | User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) 7 | AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7 8 | Content-Type: application/x-www-form-urlencoded 9 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 10 | Referer: http://pygments.org/ 11 | Accept-Encoding: gzip,deflate,sdch 12 | Accept-Language: en-US,en;q=0.8 13 | Accept-Charset: windows-949,utf-8;q=0.7,*;q=0.3 14 | 15 | name=test&lang=text&code=asdf&user= 16 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/import.hs: -------------------------------------------------------------------------------- 1 | import "mtl" Control.Monad.Trans 2 | 3 | main :: IO () 4 | main = putStrLn "hello world" 5 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/intro.ik: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ioke 2 | 3 | Ioke = LanguageExperiment with( 4 | goal: :expressiveness, 5 | data: as(code), 6 | code: as(data), 7 | features: [ 8 | :dynamic, 9 | :object_oriented, 10 | :prototype_based, 11 | :homoiconic, 12 | :macros 13 | ], 14 | runtimes:(JVM, CLR), 15 | inspirations: set(Io, Smalltalk, Ruby, Lisp) 16 | ) 17 | 18 | hello = method("Every example needs a hello world!", 19 | name, 20 | "hello, #{name}!" println) 21 | 22 | Ioke inspirations select( 23 | features include?(:object_oriented) 24 | ) each(x, hello(x name)) 25 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/ints.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | $x = array(0123, 0x0a, -0x0a, -0123, 12, -12); 4 | 5 | ?> 6 | <?php 7 | $a = 1.234; 8 | $b = 1.2e3; 9 | $c = 7E-10; 10 | ?> 11 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/irb_heredoc: -------------------------------------------------------------------------------- 1 | irb(main):001:0> puts <<XYZ 2 | irb(main):002:0" a 3 | irb(main):003:0" b 4 | irb(main):004:0" XYZ 5 | a 6 | b 7 | => nil 8 | irb(main):005:0> 9 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/java.properties: -------------------------------------------------------------------------------- 1 | foo = bar 2 | foo: bar 3 | foo.oof: \ 4 | bar=baz; \ 5 | asdf 6 | 7 | // comment 8 | # comment 9 | ; comment 10 | 11 | x:a\ 12 | b 13 | x: a \ 14 | b 15 | 16 | x = \ 17 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/jbst_example1.jbst: -------------------------------------------------------------------------------- 1 | <%@ Control Name="MyApp.MyJbstControl" Language="JavaScript" %> 2 | 3 | <script type="text/javascript"> 4 | 5 | /* initialization code block, executed only once as control is loaded */ 6 | this.generateValue = function() { 7 | return new Date().toString(); 8 | }; 9 | 10 | </script> 11 | 12 | <%! 13 | /* initialization code block, executed only once as control is loaded */ 14 | /* alternate syntax to script block above */ 15 | this.myInitTime = this.generateValue(); 16 | %> 17 | 18 | <% 19 | /* data binding code block, executed each time as control is data bound */ 20 | this.myBindTime = this.generateValue(); 21 | %> 22 | 23 | <%-- JBST Comment --%> 24 | <span style="color:red"><%= this.myBindTime /* data binding expression */ %></span> 25 | <span style="color:green"><%= this.myInitTime /* data binding expression */ %></span> 26 | 27 | <!-- HTML Comment --> 28 | <span style="color:blue"><%$ Resources: localizationKey %><%-- JBST globalization--%></span> -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/jbst_example2.jbst: -------------------------------------------------------------------------------- 1 | <%@ Control Name="Foo.MyZebraList" Language="JavaScript" %> 2 | 3 | <script type="text/javascript"> 4 | 5 | /* private members ------------------------------------------ */ 6 | 7 | /*int*/ function digits(/*int*/ n) { 8 | return (n < 10) ? '0' + n : n; 9 | } 10 | 11 | /* public members ------------------------------------------- */ 12 | 13 | // use the item index to alternate colors and highlight 14 | /*string*/ this.zebraStripe = function(/*bool*/ selected, /*int*/ index, /*int*/ count) { 15 | var css = [ "item" ]; 16 | if (index % 2 === 0) { 17 | css.push("item-alt"); 18 | } 19 | if (selected) { 20 | css.push("item-selected"); 21 | } 22 | return css.join(" "); 23 | }; 24 | 25 | /*string*/ this.formatTime = function(/*Date*/ time) { 26 | return time.getHours() + ':' + digits(time.getMinutes()) + ':' + digits(time.getSeconds()); 27 | }; 28 | 29 | </script> 30 | 31 | <div class="example"> 32 | <h2><%= this.data.title %> as of <%= this.formatTime(this.data.timestamp) %>!</h2> 33 | <p><%= this.data.description %></p> 34 | <ul class="items" jbst:visible="<%= this.data.children.length > 0 %>"> 35 | 36 | <!-- anonymous inner template --> 37 | <jbst:control data="<%= this.data.children %>"> 38 | <!-- populate list item for each item of the parent's children property --> 39 | <li class="<%= Foo.MyZebraList.zebraStripe(this.data.selected, this.index, this.count) %>"> 40 | <%= this.data.label %> (<%= this.index+1 %> of <%= this.count %>) 41 | </li> 42 | </jbst:control> 43 | 44 | </ul> 45 | </div> -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/lighttpd_config.conf: -------------------------------------------------------------------------------- 1 | fastcgi.server = ( ".php" => (( 2 | "bin-path" => "/path/to/php-cgi", 3 | "socket" => "/tmp/php.socket", 4 | "max-procs" => 2, 5 | "bin-environment" => ( 6 | "PHP_FCGI_CHILDREN" => "16", 7 | "PHP_FCGI_MAX_REQUESTS" => "10000" 8 | ), 9 | "bin-copy-environment" => ( 10 | "PATH", "SHELL", "USER" 11 | ), 12 | "broken-scriptfilename" => "enable" 13 | ))) 14 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/linecontinuation.py: -------------------------------------------------------------------------------- 1 | apple.filter(x, y) 2 | apple.\ 3 | filter(x, y) 4 | 5 | 1 \ 6 | . \ 7 | __str__ 8 | 9 | from os import path 10 | from \ 11 | os \ 12 | import \ 13 | path 14 | 15 | import os.path as something 16 | 17 | import \ 18 | os.path \ 19 | as \ 20 | something 21 | 22 | class \ 23 | Spam: 24 | pass 25 | 26 | class Spam: pass 27 | 28 | class Spam(object): 29 | pass 30 | 31 | class \ 32 | Spam \ 33 | ( 34 | object 35 | ) \ 36 | : 37 | pass 38 | 39 | 40 | def \ 41 | spam \ 42 | ( \ 43 | ) \ 44 | : \ 45 | pass 46 | 47 | 48 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/livescript-demo.ls: -------------------------------------------------------------------------------- 1 | a = -> [1 to 50] 2 | const b = --> [2 til 5] 3 | var c = ~~> 10_000_000km * 500ms - 16~ff / 32~lol 4 | e = (a) -> (b) ~> (c) --> (d, e) ~~> <[list of words]> 5 | dashes-identifiers = -> 6 | a - a b -- c 1-1 1- -1 a- a a -a 7 | underscores_i$d = -> 8 | /regexp1/ 9 | //regexp2//g 10 | 'strings' and "strings" and \strings 11 | 12 | [2 til 10] 13 | |> map (* 2) 14 | |> filter (> 5) 15 | |> fold (+) 16 | 17 | obj = 18 | prop1: 1 19 | prop2: 2 20 | 21 | class Class extends Anc-est-or 22 | (args) -> 23 | <- # Comment 24 | <~ /* Comment */ 25 | void undefined yes no on off 26 | a.void b.undefined c.off d.if f.no g.not 27 | avoid bundefined coff dif fno gnot 28 | "inter #{2 + 2} #variable" 29 | '''HELLO 'world' ''' 30 | 31 | copy = (from, to, callback) --> 32 | error, data <- read file 33 | return callback error if error? 34 | error <~ write file, data 35 | return callback error if error? 36 | callback() 37 | 38 | take(n, [x, ...xs]:list) = 39 | | n <= 0 => [] 40 | | empty list => [] 41 | | otherwise => [x] +++ take n - 1, xs 42 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/logos_example.xm: -------------------------------------------------------------------------------- 1 | %hook ABC 2 | - (id)a:(B)b { 3 | %log; 4 | return %orig(nil); 5 | } 6 | %end 7 | 8 | %subclass DEF: NSObject 9 | - (id)init { 10 | [%c(RuntimeAccessibleClass) alloc]; 11 | return nil; 12 | } 13 | %end 14 | 15 | %group OptionalHooks 16 | %hook ABC 17 | - (void)release { 18 | [self retain]; 19 | %orig; 20 | } 21 | %end 22 | %end 23 | 24 | %ctor { 25 | %init; 26 | if(OptionalCondition) 27 | %init(OptionalHooks); 28 | } 29 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/main.cmake: -------------------------------------------------------------------------------- 1 | SET( SOURCES back.c io.c main.c ) 2 | MESSAGE( ${SOURCES} ) # three arguments, prints "back.cio.cmain.c" 3 | MESSAGE( "${SOURCES}" ) # one argument, prints "back.c;io.c;main.c" 4 | MESSAGE( "" ) # one argument, prints "" an empty line 5 | MESSAGE( "${EMPTY_STRING}" ) # one argument, prints "" an empty line 6 | MESSAGE( ${EMPTY_STRING} ) # zero arguments, causes CMake Error 7 | # "MESSAGE called with incorrect number of arguments" 8 | MESSAGE( \\\"\ \(\)\#\$\^ ) # this message contains literal characters 9 | 10 | MESSAGE( "This is practice." ) # prints "This is practice." 11 | MESSAGE( "This;is;practice." ) # prints "This;is;practice." 12 | MESSAGE( "Hi. ) MESSAGE( x )" ) # prints "Hi. ) MESSAGE( x )" 13 | 14 | MESSAGE( "Welc"ome ) # rule 1 15 | MESSAGE( Welc"ome" ) # rule 3 16 | MESSAGE( Welc"ome)" ) # rule 2 17 | MESSAGE( ""Thanks ) # rule 1 18 | MESSAGE( Thanks"" ) # rule 3 19 | 20 | SET( x y A B C ) # stores "y;A;B;C" in x (without quote) 21 | SET( ${x} ) # => SET( y;A;B;C ) => SET( y A B C) 22 | MESSAGE( ${y} ) # prints "ABC" to stdout (without quotes) 23 | SET( y x ) # stores "x" in y (without quotes) 24 | SET( ${y} y = x ) # => SET( x y ) 25 | MESSAGE( "\${x} = '${x}'" ) # prints "${x} = 'y;=;x'" to stdout (without quotes) 26 | SET( y ${x} ) # => SET( y y = x ) => stores "y;=;x" in y (without quotes) 27 | MESSAGE( ${y} ) # prints "y=x" to stdout (without quotes) 28 | 29 | SET( x a b c ) # stores "a;b;c" in x (without quotes) 30 | SET( y "a b c" ) # stores "a b c" in y (without quotes) 31 | MESSAGE( a b c ) # prints "abc" to stdout (without quotes) 32 | MESSAGE( ${x} ) # prints "abc" to stdout (without quotes) 33 | MESSAGE("${x}") # prints "a;b;c" to stdout (without quotes) 34 | MESSAGE( ${y} ) # prints "a b c" to stdout (without quotes) 35 | MESSAGE("${y}") # prints "a b c" to stdout (without quotes) 36 | 37 | # This is a comment. 38 | COMMAND( arguments go here ) 39 | ANOTHER_COMMAND() # this command has no arguments 40 | YET_ANOTHER_COMMAND( these 41 | arguments are spread # another comment 42 | over several lines ) 43 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/matlab_noreturn: -------------------------------------------------------------------------------- 1 | function myfunc(s) 2 | a = 1; 3 | end 4 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/matlab_sample: -------------------------------------------------------------------------------- 1 | function zz=sample(aa) 2 | %%%%%%%%%%%%%%%%%% 3 | % some comments 4 | %%%%%%%%%%%%%%%%%% 5 | 6 | x = 'a string'; % some 'ticks' in a comment 7 | y = 'a string with ''interal'' quotes'; 8 | 9 | for i=1:20 10 | disp(i); 11 | end 12 | 13 | a = rand(30); 14 | b = rand(30); 15 | 16 | c = a .* b ./ a \ ... comment at end of line and continuation 17 | (b .* a + b - a); 18 | 19 | c = a' * b'; % note: these ticks are for transpose, not quotes. 20 | 21 | disp('a comment symbol, %, in a string'); 22 | 23 | !echo abc % this isn't a comment - it's passed to system command 24 | 25 | function y=myfunc(x) 26 | y = exp(x); 27 | 28 | {% 29 | a block comment 30 | %} 31 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/matlabsession_sample.txt: -------------------------------------------------------------------------------- 1 | >> 2 | >> 3 | >> a = 'okay' 4 | 5 | a = 6 | 7 | okay 8 | 9 | >> x = rand(3) % a matrix 10 | 11 | x = 12 | 13 | 0.8147 0.9134 0.2785 14 | 0.9058 0.6324 0.5469 15 | 0.1270 0.0975 0.9575 16 | 17 | >> 1/0 18 | 19 | ans = 20 | 21 | Inf 22 | 23 | >> foo 24 | ??? Undefined function or variable 'foo'. 25 | 26 | >> 27 | >> 28 | >> {cos(2*pi), 'testing'} 29 | 30 | ans = 31 | 32 | [1] 'testing' 33 | 34 | >> 35 | >> 36 | >> 37 | 38 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/mg_sample.pro: -------------------------------------------------------------------------------- 1 | ; docformat = 'rst' 2 | 3 | ; Example IDL (Interactive Data Language) source code. 4 | 5 | ;+ 6 | ; Get `nIndices` random indices for an array of size `nValues` (without 7 | ; repeating an index). 8 | ; 9 | ; :Examples: 10 | ; Try:: 11 | ; 12 | ; IDL> r = randomu(seed, 10) 13 | ; IDL> print, r, format='(4F)' 14 | ; 0.6297589 0.7815896 0.2508559 0.7546844 15 | ; 0.1353382 0.1245834 0.8733745 0.0753110 16 | ; 0.8054136 0.9513228 17 | ; IDL> ind = mg_sample(10, 3, seed=seed) 18 | ; IDL> print, ind 19 | ; 2 4 7 20 | ; IDL> print, r[ind] 21 | ; 0.250856 0.135338 0.0753110 22 | ; 23 | ; :Returns: 24 | ; lonarr(`nIndices`) 25 | ; 26 | ; :Params: 27 | ; nValues : in, required, type=long 28 | ; size of array to choose indices from 29 | ; nIndices : in, required, type=long 30 | ; number of indices needed 31 | ; 32 | ; :Keywords: 33 | ; seed : in, out, optional, type=integer or lonarr(36) 34 | ; seed to use for random number generation, leave undefined to use a 35 | ; seed generated from the system clock; new seed will be output 36 | ;- 37 | function mg_sample, nValues, nIndices, seed=seed 38 | compile_opt strictarr 39 | 40 | ; get random nIndices by finding the indices of the smallest nIndices in a 41 | ; array of random values 42 | values = randomu(seed, nValues) 43 | 44 | ; our random values are uniformly distributed, so ideally the nIndices 45 | ; smallest values are in the first bin of the below histogram 46 | nBins = nValues / nIndices 47 | h = histogram(values, nbins=nBins, reverse_indices=ri) 48 | 49 | ; the candidates for being in the first nIndices will live in bins 0..bin 50 | nCandidates = 0L 51 | for bin = 0L, nBins - 1L do begin 52 | nCandidates += h[bin] 53 | if (nCandidates ge nIndices) then break 54 | endfor 55 | 56 | ; get the candidates and sort them 57 | candidates = ri[ri[0] : ri[bin + 1L] - 1L] 58 | sortedCandidates = sort(values[candidates]) 59 | 60 | ; return the first nIndices of them 61 | return, (candidates[sortedCandidates])[0:nIndices-1L] 62 | end 63 | 64 | 65 | ; main-level example program 66 | 67 | r = randomu(seed, 10) 68 | print, r 69 | ind = mg_sample(10, 3, seed=seed) 70 | print, ind 71 | print, r[ind] 72 | 73 | end -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/minimal.ns2: -------------------------------------------------------------------------------- 1 | class A = ( | a = self m. | ) ( 2 | m = (^a isNil ifTrue: [0] ifFalse: [1]) 3 | ) 4 | class B = C ( | b0 = 0. b1 = b0 + 1. | ) () 5 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/multiline_regexes.rb: -------------------------------------------------------------------------------- 1 | / 2 | this is a 3 | multiline 4 | regex 5 | / 6 | 7 | this /is a 8 | multiline regex too/ 9 | 10 | foo = /is also 11 | one/ 12 | 13 | also /4 14 | is one/ 15 | 16 | this(/ 17 | too 18 | /) 19 | 20 | # this not 21 | 2 /4 22 | asfsadf/ 23 | 24 | # this is also not one 25 | 0x4d /25 26 | foo/ 27 | 28 | 42 and /this 29 | is also a multiline 30 | regex/ 31 | 32 | 33 | # And here some special string cases 34 | foo = % blah # comment here to ensure whitespace 35 | foo(% blah ) 36 | foo << % blah # stupid but has to work 37 | foo = % blah + % blub # wicked 38 | foo = %q wicked # works too 39 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/nasm_objexe.asm: -------------------------------------------------------------------------------- 1 | ; Demonstration of how to write an entire .EXE format program as a .OBJ 2 | ; file to be linked. Tested with the VAL free linker. 3 | ; To build: 4 | ; nasm -fobj objexe.asm 5 | ; val objexe.obj,objexe.exe; 6 | ; To test: 7 | ; objexe 8 | ; (should print `hello, world') 9 | 10 | segment code 11 | 12 | ..start: mov ax,data 13 | mov ds,ax 14 | mov ax,stack 15 | mov ss,ax 16 | mov sp,stacktop 17 | 18 | mov dx,hello 19 | mov ah,9 20 | int 0x21 21 | 22 | mov ax,0x4c00 23 | int 0x21 24 | 25 | segment data 26 | hello: db 'hello, world', 13, 10, '$' 27 | 28 | segment stack stack 29 | resb 64 30 | stacktop: 31 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/nemerle_sample.n: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Demo.Ns 4 | { 5 | /// sample class 6 | public class ClassSample : Base 7 | { 8 | /* sample multiline comment */ 9 | #region region sample 10 | fieldSample : int; 11 | #endregion 12 | 13 | public virtual someMethod(str : string) : list[double] 14 | { 15 | def x = "simple string"; 16 | def x = $"simple $splice string $(spliceMethod() + 1)"; 17 | def x = <# 18 | recursive <# string #> sample 19 | #>; 20 | def x = $<# 21 | recursive $splice <# string #> sample 22 | ..$(lst; "; "; x => $"x * 2 = $(x * 2)") str 23 | #>; 24 | def x = @"somestring \"; 25 | 26 | def localFunc(arg) 27 | { 28 | arg + 1; 29 | } 30 | 31 | match (localFunc(2)) 32 | { 33 | | 3 => "ok"; 34 | | _ => "fail"; 35 | } 36 | 37 | using (x = SomeObject()) 38 | { 39 | foreach (item in someCollection) 40 | { 41 | def i = try 42 | { 43 | int.Parse(item) 44 | } 45 | catch 46 | { 47 | | _ is FormatException => 0; 48 | } 49 | when (i > 0xff) 50 | unless (i < 555L) 51 | WriteLine(i); 52 | 53 | } 54 | } 55 | protected override overrideSample() : void 56 | {} 57 | 58 | private privateSample() : void 59 | {} 60 | 61 | public abstract abstractSample() : void 62 | {} 63 | } 64 | 65 | } 66 | 67 | module ModuleSample 68 | { 69 | } 70 | 71 | variant RgbColor { 72 | | Red 73 | | Yellow 74 | | Green 75 | | Different { 76 | red : float; 77 | green : float; 78 | blue : float; 79 | } 80 | } 81 | 82 | macro sampleMacro(expr) 83 | syntax ("write", expr) 84 | { 85 | <[ WriteLine($(expr : dyn)) ]> 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/numbers.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Some Number Test 3 | */ 4 | 5 | int i = 24241424; 6 | float f1 = 342423423.24234; 7 | float f2 = 25235235.; 8 | float f3 = .234234; 9 | float f4 = 234243e+34343; 10 | float f5 = 24234e-234; 11 | int o = 0234; 12 | int h = 0x2342; 13 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/objc_example.m: -------------------------------------------------------------------------------- 1 | #import "Somefile.h" 2 | 3 | @implementation ABC 4 | 5 | - (id)a:(B)b { 6 | return 1; 7 | } 8 | 9 | @end 10 | 11 | @implementation ABC 12 | 13 | - (void)xyz; 14 | 15 | @end 16 | 17 | NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys: 18 | @"quattuor", @"four", @"quinque", @"five", @"sex", @"six", nil]; 19 | 20 | 21 | NSString *key; 22 | for (key in dictionary) { 23 | NSLog(@"English: %@, Latin: %@", key, [dictionary valueForKey:key]); 24 | } 25 | 26 | // Literals 27 | NSArray *a = @[ @"1", @"2" ]; 28 | 29 | NSDictionary *d = @{ @"key": @"value" }; 30 | 31 | NSNumber *n1 = @( 1 ); 32 | NSNumber *n2 = @( [a length] ); 33 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/objc_example2.m: -------------------------------------------------------------------------------- 1 | // MyClass.h 2 | @interface MyClass : NSObject 3 | { 4 | NSString *value; 5 | NSTextField *textField; 6 | @private 7 | NSDate *lastModifiedDate; 8 | } 9 | @property(copy, readwrite) NSString *value; 10 | @property(retain) IBOutlet NSTextField *textField; 11 | @end 12 | 13 | // MyClass.m 14 | // Class extension to declare private property 15 | @interface MyClass () 16 | @property(retain) NSDate *lastModifiedDate; 17 | @end 18 | 19 | @implementation MyClass 20 | @synthesize value; 21 | @synthesize textField; 22 | @synthesize lastModifiedDate; 23 | // implementation continues 24 | @end 25 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/perl_misc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # from http://gist.github.com/485595 4 | use strict; 5 | use warnings; 6 | use Time::HiRes 'usleep'; 7 | 8 | for (1..5) { 9 | open my $in, '<', '/proc/sys/kernel/random/entropy_avail' or die; 10 | print <$in>; 11 | close $in; 12 | usleep 100_000; 13 | } 14 | 15 | # other miscellaneous tests of numbers separated by _ 16 | #usleep 100_000; 17 | 100_000_000; 18 | my $nichts = 0.005_006; 19 | print "$nichts\n"; 20 | my $nichts2 = 0.005_006_007; 21 | print 900_800_700.005_006_007, $/; 22 | 23 | # numbers from `man 1 perlnumber` 24 | my $n; 25 | $n = 1234; # decimal integer 26 | $n = 0b1110011; # binary integer 27 | $n = 01234; # octal integer 28 | $n = 0x1234; # hexadecimal integer 29 | $n = 12.34e-56; # exponential notation 30 | $n = "-12.34e56"; # number specified as a string 31 | $n = "1234"; # number specified as a string 32 | 33 | # other numbers 34 | for ( 35 | -9876, 36 | +8765, 37 | -9876.02, 38 | -9876.02e+10, 39 | +765_432e30, 40 | 2002., 41 | .2002, 42 | ) { 43 | print $_, "\n"; 44 | } 45 | 46 | # operators on numbers 47 | for ( 48 | $n + 300, 49 | $n - 300, 50 | $n / 300 + 10, 51 | $n * 250 / 2.0, 52 | $n == 100, 53 | $n != 100, 54 | $n > 100, 55 | $n >= 100, 56 | $n < 100, 57 | $n <= 100, 58 | $n % 2, 59 | abs $n, 60 | ) { 61 | print $_, "\n"; 62 | } 63 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/perl_regex-delims: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | # common delimiters 7 | print "a: "; 8 | my $a = "foo"; 9 | print $a, " - "; 10 | $a =~ s/foo/bar/; 11 | print $a, "\n"; 12 | 13 | print "b: "; 14 | my $b = "foo"; 15 | print $b, " - "; 16 | $b =~ s!foo!bar!; 17 | print $b, "\n"; 18 | 19 | print "c: "; 20 | my $c = "foo"; 21 | print $c, " - "; 22 | $c =~ s@foo@bar@; 23 | print $c, "\n"; 24 | 25 | print "d: "; 26 | my $d = "foo"; 27 | print $d, " - "; 28 | $d =~ s\foo\bar\; 29 | print $d, "\n"; 30 | 31 | print "\n"; 32 | 33 | # balanced delimiters 34 | print "e: "; 35 | my $e = "foo"; 36 | print $e, " - "; 37 | $e =~ s{foo}{bar}; 38 | print $e, "\n"; 39 | 40 | print "f: "; 41 | my $f = "foo"; 42 | print $f, " - "; 43 | $f =~ s(foo)(bar); 44 | print $f, "\n"; 45 | 46 | print "g: "; 47 | my $g = "foo"; 48 | print $g, " - "; 49 | $g =~ s<foo><bar>; 50 | print $g, "\n"; 51 | 52 | print "h: "; 53 | my $h = "foo"; 54 | print $h, " - "; 55 | $h =~ s[foo][bar]; 56 | print $h, "\n"; 57 | 58 | print "\n"; 59 | 60 | # balanced delimiters with whitespace 61 | print "i: "; 62 | my $i = "foo"; 63 | print $i, " - "; 64 | $i =~ s{foo} {bar}; 65 | print $i, "\n"; 66 | 67 | print "j: "; 68 | my $j = "foo"; 69 | print $j, " - "; 70 | $j =~ s<foo> <bar>; 71 | print $j, "\n"; 72 | 73 | print "k: "; 74 | my $k = "foo"; 75 | print $k, " - "; 76 | $k =~ 77 | s(foo) 78 | 79 | (bar); 80 | print $k, "\n"; 81 | 82 | print "\n"; 83 | 84 | # mixed delimiters 85 | print "l: "; 86 | my $l = "foo"; 87 | print $l, " - "; 88 | $l =~ s{foo} <bar>; 89 | print $l, "\n"; 90 | 91 | print "m: "; 92 | my $m = "foo"; 93 | print $m, " - "; 94 | $m =~ s(foo) !bar!; 95 | print $m, "\n"; 96 | 97 | print "n: "; 98 | my $n = "foo"; 99 | print $n, " - "; 100 | $n =~ s[foo] $bar$; 101 | print $n, "\n"; 102 | 103 | print "\n"; 104 | 105 | # /x modifier 106 | print "o: "; 107 | my $o = "foo"; 108 | print $o, " - "; 109 | $o =~ s{ 110 | foo 111 | } {bar}x; 112 | print $o, "\n"; 113 | 114 | print "p: "; 115 | my $p = "foo"; 116 | print $p, " - "; 117 | $p =~ s% 118 | foo 119 | %bar%x; 120 | print $p, "\n"; 121 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/postgresql_test.txt: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION something() RETURNS int4 AS 2 | $x$ 3 | BEGIN 4 | RETURN 42; 5 | END 6 | $x$ 7 | LANGUAGE 'plpgsql'; 8 | 9 | CREATE FUNCTION pymax (a integer, b integer) 10 | RETURNS integer 11 | AS $$ 12 | if a > b: 13 | return a 14 | return b 15 | $$ language plpythonu; 16 | 17 | CREATE FUNCTION nested_lexers (a integer, b integer) 18 | $function$ 19 | BEGIN 20 | SELECT ($1 ~ $q$[\t\r\n\v\\]$q$); 21 | END; 22 | $function$ 23 | LANGUAGE sql; 24 | 25 | CREATE OR REPLACE FUNCTION measurement_insert_trigger() 26 | RETURNS TRIGGER AS $$ 27 | BEGIN 28 | <<test>> 29 | INSERT INTO measurement_y2008m01 VALUES (NEW.*); 30 | RETURN NULL; 31 | END; 32 | $$ 33 | LANGUAGE plpgsql; 34 | 35 | -- As returned by pg_dump 36 | CREATE FUNCTION test_function() RETURNS integer 37 | LANGUAGE plpgsql STABLE STRICT 38 | AS $$ 39 | begin 40 | return 42; 41 | end 42 | $$; 43 | 44 | -- Unicode names and strings 45 | SELECT U&'\0441\043B\043E\043D' 46 | FROM U&"\0441\043B\043E\043D"; 47 | 48 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/pppoe.applescript: -------------------------------------------------------------------------------- 1 | tell application "System Events" 2 | tell network preferences 3 | tell current location 4 | set aPPPoEService to a reference to (first service whose kind is 10) 5 | if exists aPPPoEService then 6 | connect aPPPoEService 7 | end if 8 | end tell 9 | end tell 10 | end tell 11 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/py3_test.txt: -------------------------------------------------------------------------------- 1 | class Käse: 2 | pass 3 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/py3tb_test.py3tb: -------------------------------------------------------------------------------- 1 | File "<stdin>", line 1 2 | 1+ 3 | ^ 4 | SyntaxError: invalid syntax 5 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/pycon_test.pycon: -------------------------------------------------------------------------------- 1 | >>> : 2 | File "<stdin>", line 1 3 | : 4 | ^ 5 | SyntaxError: invalid syntax 6 | >>> 7 | KeyboardInterrupt 8 | >>> 9 | 10 | >>> 1/0 11 | Traceback (most recent call last): 12 | ... 13 | ZeroDivisionError 14 | 15 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/pytb_test2.pytb: -------------------------------------------------------------------------------- 1 | File "temp.py", line 1 2 | SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details 3 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/pytb_test3.pytb: -------------------------------------------------------------------------------- 1 | >>> 3/"3" 2 | Traceback (most recent call last): 3 | File "<stdin>", line 1, in <module> 4 | TypeError: unsupported operand type(s) for /: 'int' and 'str' 5 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/qsort.prolog: -------------------------------------------------------------------------------- 1 | partition([], _, [], []). 2 | partition([X|Xs], Pivot, Smalls, Bigs) :- 3 | ( X @< Pivot -> 4 | Smalls = [X|Rest], 5 | partition(Xs, Pivot, Rest, Bigs) 6 | ; Bigs = [X|Rest], 7 | partition(Xs, Pivot, Smalls, Rest) 8 | ). 9 | 10 | quicksort([]) --> []. 11 | quicksort([X|Xs]) --> 12 | { partition(Xs, X, Smaller, Bigger) }, 13 | quicksort(Smaller), [X], quicksort(Bigger). 14 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/r-console-transcript.Rout: -------------------------------------------------------------------------------- 1 | 2 | R version 2.9.2 (2009-08-24) 3 | Copyright (C) 2009 The R Foundation for Statistical Computing 4 | ISBN 3-900051-07-0 5 | 6 | R is free software and comes with ABSOLUTELY NO WARRANTY. 7 | You are welcome to redistribute it under certain conditions. 8 | Type 'license()' or 'licence()' for distribution details. 9 | 10 | Natural language support but running in an English locale 11 | 12 | R is a collaborative project with many contributors. 13 | Type 'contributors()' for more information and 14 | 'citation()' on how to cite R or R packages in publications. 15 | 16 | Type 'demo()' for some demos, 'help()' for on-line help, or 17 | 'help.start()' for an HTML browser interface to help. 18 | Type 'q()' to quit R. 19 | 20 | [R.app GUI 1.29 (5464) i386-apple-darwin8.11.1] 21 | 22 | > x <- function {} 23 | Error: syntax error 24 | > x <- function() {} 25 | > x <- function() { 26 | + cat("hello") 27 | + cat("world") 28 | + } 29 | > x 30 | function() { 31 | cat("hello") 32 | cat("world") 33 | } 34 | > x() 35 | helloworld 36 | > 2 + 2 37 | [1] 4 38 | > -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/ragel-cpp_snippet: -------------------------------------------------------------------------------- 1 | %% write init; 2 | /* Read in a block. */ 3 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/regex.js: -------------------------------------------------------------------------------- 1 | // regex 2 | 3 | blah(/abc/); 4 | x = /abc/; 5 | x = /abc/.match; 6 | 7 | // math 8 | 9 | blah(1/2); //comment 10 | x = 1 / 2 / 3; 11 | x = 1/1/.1; 12 | 13 | // broken 14 | 15 | x=/1/; 16 | x=1/a/g; 17 | x=a/a/g; 18 | 19 | // real-world 20 | 21 | var x = 1/(1+Math.sqrt(sum)); // convert to number between 1-0 22 | return Math.round((num / den) * 100)/100; 23 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/robotframework.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Simple example demonstrating syntax highlighting. 3 | Library ExampleLibrary 4 | Test Setup Keyword argument argument with ${VARIABLE} 5 | 6 | *** Variables *** 7 | ${VARIABLE} Variable value 8 | @{LIST} List variable here 9 | 10 | *** Test Cases *** 11 | Keyword-driven example 12 | Initialize System 13 | Do Something 14 | Result Should Be 42 15 | [Teardown] Cleanup System 16 | 17 | Data-driven example 18 | [Template] Keyword 19 | argument1 argument2 20 | argument ${VARIABLE} 21 | @{LIST} 22 | 23 | Gherkin 24 | Given system is initialized 25 | When something is done 26 | Then result should be "42" 27 | 28 | | Pipes | 29 | | | [Documentation] | Also pipe separated format is supported. | 30 | | | Log | As this example demonstrates. | 31 | 32 | *** Keywords *** 33 | Result Should Be 34 | [Arguments] ${expected} 35 | ${actual} = Get Value 36 | Should be Equal ${actual} ${expected} 37 | 38 | Then result should be "${expected}" 39 | Result Should Be ${expected} 40 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/ruby_func_def.rb: -------------------------------------------------------------------------------- 1 | class (get_foo("blub"))::Foo 2 | def (foo("bar") + bar("baz")).something argh, aaahaa 3 | 42 4 | end 5 | end 6 | 7 | class get_the_fuck("out")::Of::My 8 | def parser_definition 9 | ruby! 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/scilab.sci: -------------------------------------------------------------------------------- 1 | // Scilab ( http://www.scilab.org/ ) 2 | // Copyright (C) INRIA - Serge STEER 3 | // 4 | 5 | function I=sub2ind(dims,varargin) 6 | //sub2ind is used to determine the equivalent single index 7 | //corresponding to a given set of subscript values. 8 | 9 | //I = sub2ind(dims,i1,i2,..) returns the linear index equivalent to the 10 | //row, column, ... subscripts in the arrays i1,i2,.. for an matrix of 11 | //size dims. 12 | 13 | //I = sub2ind(dims,Mi) returns the linear index 14 | //equivalent to the n subscripts in the columns of the matrix Mi for a matrix 15 | //of size dims. 16 | 17 | d=[1;cumprod(matrix(dims(1:$-1),-1,1))] 18 | for i=1:size(varargin) 19 | if varargin(i)==[] then I=[],return,end 20 | end 21 | 22 | if size(varargin)==1 then //subindices are the columns of the argument 23 | I=(varargin(1)-1)*d+1 24 | else //subindices are given as separated arguments 25 | I=1 26 | for i=1:size(varargin) 27 | I=I+(varargin(i)-1)*d(i) 28 | end 29 | end 30 | endfunction 31 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/session.dylan-console: -------------------------------------------------------------------------------- 1 | ? 7 * 52; 2 | => 364 3 | ? define variable *your-variable* = $foo; 4 | ? begin 5 | let yours = "apple"; 6 | let mine = yours; 7 | mine == yours; 8 | end; 9 | => #t 10 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/sibling.prolog: -------------------------------------------------------------------------------- 1 | /* Comments /* can nest */ 2 | still a comment 3 | */ 4 | 5 | :- module(maplist, maplist/3) 6 | 7 | assert(world:done). % asserts 8 | 9 | sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y). 10 | 11 | parent_child(X, Y) :- father_child(X, Y). 12 | parent_child(X, Y) :- mother_child(X, Y). 13 | 14 | mother_child(trude, sally). 15 | 16 | father_child(tom, sally). 17 | father_child(tom, erica). 18 | father_child(mike, tom). 19 | 20 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/sphere.pov: -------------------------------------------------------------------------------- 1 | #include "colors.inc" 2 | 3 | background { color Cyan } 4 | 5 | camera { 6 | location <0, 2, -3> 7 | look_at <0, 1, 2> 8 | } 9 | 10 | sphere { 11 | <0, 1, 2>, 2 12 | texture { 13 | pigment { color Yellow } 14 | } 15 | } 16 | 17 | light_source { <2, 4, -3> color White} 18 | 19 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/sqlite3.sqlite3-console: -------------------------------------------------------------------------------- 1 | SQLite version 3.4.2 2 | Enter ".help" for instructions 3 | sqlite> .schema 4 | CREATE TABLE paste (paste_id integer, code text, parsed_code text, pub_date 5 | varchar(24), language varchar(64), parent_id integer, url varchar(128)); 6 | CREATE TABLE vars (key varchar(24), value varchar(128)); 7 | sqlite> a ' 8 | ...> ' 9 | ...> ; 10 | SQL error: near "a": syntax error 11 | sqlite> %; 12 | SQL error: near "%": syntax error 13 | sqlite> select count(language), language from paste group by language order 14 | ...> by count(language) desc; 15 | 144|python 16 | 76|text 17 | 22|pycon 18 | 9|ruby 19 | 7|c 20 | 7|js 21 | 6|html+django 22 | 4|html 23 | 4|tex 24 | 2|html+php 25 | 1|cpp 26 | 1|scheme 27 | sqlite> 28 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/squid.conf: -------------------------------------------------------------------------------- 1 | # Some multiline comments 2 | 3 | acl manager proto cache_object 4 | acl localhost src 127.0.0.1/32 ::1 5 | acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 6 | acl SSL_ports port 443 7 | acl Safe_ports port 80 # http 8 | acl Safe_ports port 21 # ftp 9 | acl Safe_ports port 443 # https 10 | acl Safe_ports port 70 # gopher 11 | acl Safe_ports port 210 # wais 12 | acl Safe_ports port 1025-65535 # unregistered ports 13 | acl Safe_ports port 280 # http-mgmt 14 | acl Safe_ports port 488 # gss-http 15 | acl Safe_ports port 591 # filemaker 16 | acl Safe_ports port 777 # multiling http 17 | acl CONNECT method CONNECT 18 | http_access allow manager localhost 19 | http_access deny manager 20 | http_access deny !Safe_ports 21 | http_access deny CONNECT !SSL_ports 22 | http_access allow localhost 23 | http_access deny all 24 | http_port 3128 25 | hierarchy_stoplist cgi-bin ? 26 | coredump_dir /var/spool/squid3 27 | refresh_pattern ^ftp: 1440 20% 10080 28 | refresh_pattern ^gopher: 1440 0% 1440 29 | refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 30 | refresh_pattern . 0 20% 4320 31 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/string_delimiters.d: -------------------------------------------------------------------------------- 1 | import std.stdio; 2 | 3 | void main() { 4 | // Nesting delimited strings 5 | auto a = q"{foo " {bar} baz}"; 6 | auto b = q"[foo [bar] " baz]"; 7 | auto c = q"(foo " (bar) baz)"; 8 | auto d = q"<foo <bar> " baz>"; 9 | // Non-nesting delimited strings 10 | auto e = q"/foo " bar/"; 11 | auto f = q"-Another " string-"; 12 | // "heredoc" strings 13 | auto g = q"FOO 14 | This is a string! 15 | FOO"; 16 | // Token strings (only the q{} should be highlighted as a string) 17 | auto h = q{ 18 | int i; 19 | void foo() { writefln("Hello, world!"); } 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/stripheredoc.sh: -------------------------------------------------------------------------------- 1 | cat <<-EOF 2 | Hello world $PATH 3 | EOF 4 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.bas: -------------------------------------------------------------------------------- 1 | Public Class Form1 2 | Inherits System.Windows.Forms.Form 3 | 4 | Private t As New System.Timers.Timer(2000) 5 | 6 | Private Sub Form1_Load(ByVal sender As Object, _ 7 | ByVal e As System.EventArgs) Handles MyBase.Load 8 | 9 | AddHandler t.Elapsed, AddressOf TimerFired 10 | End Sub 11 | 12 | Private Sub btnStart_Click(ByVal sender As System.Object, _ 13 | ByVal e As System.EventArgs) Handles btnStart.Click 14 | 15 | t.Enabled = True 16 | End Sub 17 | 18 | Private Sub btnStop_Click(ByVal sender As System.Object, _ 19 | ByVal e As System.EventArgs) Handles btnStop.Click 20 | 21 | t.Enabled = False 22 | End Sub 23 | 24 | Public Sub TimerFired(ByVal sender As Object, _ 25 | ByVal e As System.Timers.ElapsedEventArgs) 26 | 27 | Label1.Text = "Signal Time = " & e.SignalTime.ToString 28 | End Sub 29 | End Class 30 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.bb: -------------------------------------------------------------------------------- 1 | 2 | ;foobar! 3 | 4 | ;Include "blurg/blurg.bb" 5 | 6 | Const ca = $10000000 ; Hex 7 | Const cb = %10101010 ; Binary 8 | Global ga$ = "blargh" 9 | Local a = 124, b$ = "abcdef" 10 | 11 | Function name_123#(zorp$, ll = False, blah#, waffles% = 100) 12 | Return 235.7804 ; comment 13 | End Function 14 | Function TestString$() 15 | End Function 16 | 17 | Function hub(blah$, abc = Pi) 18 | End Function 19 | Function Blar%() 20 | Local aa %, ab # ,ac #, ad# ,ae$,af% ; Intentional mangling 21 | Local ba#, bb.TBlarf , bc%,bd#,be. TFooBar,ff = True 22 | End Function 23 | 24 | abc() 25 | 26 | Function abc() 27 | Print "abc" ; I cannot find a way to parse these as function calls without messing something up 28 | Print ; Anyhow, they're generally not used in this way 29 | Goto Eww_Goto 30 | .Eww_Goto 31 | End Function 32 | 33 | Type TBlarf 34 | End Type 35 | 36 | Type TFooBar 37 | End Type 38 | 39 | Local myinst.MyClass = New MyClass 40 | TestMethod(myinst) 41 | 42 | Type MyClass 43 | 44 | Field m_foo.MyClass 45 | Field m_bar.MyClass 46 | 47 | ; abc 48 | ; def 49 | End Type 50 | 51 | Function TestMethod(self.MyClass) ; foobar 52 | self\m_foo = self 53 | self\m_bar = Object.MyClass(Handle self\m_foo) 54 | Yell self\m_foo\m_bar\m_foo\m_bar 55 | End Function 56 | 57 | Function Yell(self.MyClass) 58 | Print("huzzah!") 59 | End Function 60 | 61 | Function Wakka$(foo$) 62 | Return foo + "bar" 63 | End Function 64 | 65 | 66 | Print("blah " + "blah " + "blah.") 67 | 68 | Local i : For i = 0 To 10 Step 1 69 | Print("Index: " + i) 70 | Next 71 | Local array$[5] 72 | array[0] = "foo": array[1] = "bar":array[2] = "11":array[3] = "22":array[4] = "33" 73 | For i = 0 To 4 74 | Local value$ = array[i] 75 | Print("Value: " + value) 76 | Next 77 | 78 | Local foobar = Not (1 Or (2 And (4 Shl 5 Shr 6)) Sar 7) Mod (8+2) 79 | Local az = 1234567890 80 | az = az + 1 81 | az = az - 2 82 | az = az* 3 83 | az = az/ 4 84 | az = az And 5 85 | az = az Or 6 86 | az= ~ 7 87 | az = az Shl 8 88 | az= az Shr 9 89 | az = az Sar 10 90 | az = az Mod 11 91 | az = ((10-5+2/4*2)>(((8^2)) < 2)) And 12 Or 2 92 | 93 | 94 | ;~IDEal Editor Parameters: 95 | ;~C#Blitz3D -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.boo: -------------------------------------------------------------------------------- 1 | import System 2 | import Boo.Lang.Interpreter from Boo.Lang.Interpreter 3 | 4 | class ObjectInterpreter(AbstractInterpreter): 5 | 6 | _context as object 7 | 8 | [getter(Value)] 9 | _value as object 10 | 11 | def constructor(context): 12 | _context = context 13 | self.RememberLastValue = true 14 | 15 | override def Lookup(name as string): 16 | property = _context.GetType().GetProperty(name) 17 | return property.PropertyType if property is not null 18 | 19 | override def GetValue(name as string): 20 | return _context.GetType().GetProperty(name).GetValue( 21 | _context, null) 22 | 23 | override def SetLastValue(value): 24 | _value = value 25 | 26 | override def SetValue(name as string, value): 27 | raise InvalidOperationException() 28 | 29 | override def Declare(name as string, type as Type): 30 | raise InvalidOperationException() 31 | 32 | class Person: 33 | [property(FirstName)] 34 | _fname as string = "" 35 | 36 | p = Person(FirstName: "Homer") 37 | i = ObjectInterpreter(p) 38 | i.Eval('"Hello, ${FirstName.ToUpper()}!"') 39 | print i.Value 40 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 12pt; 3 | background: #fff url(temp.png) top left no-repeat; 4 | } 5 | 6 | * html body { 7 | font-size: 14pt; 8 | } 9 | 10 | #nav .new { 11 | display: block; 12 | -webkit-border-radius: 5px; 13 | -moz-border-radius: 5px; 14 | -ms-border-radius: 5px; 15 | -o-border-radius: 5px; 16 | border-radius: 5px; 17 | } 18 | 19 | ul#nav li.new { 20 | font-weight: bold; 21 | } 22 | 23 | :link { 24 | color: #f00; 25 | } 26 | 27 | :link:hover { 28 | color: #0f0; 29 | } 30 | 31 | @media screen { 32 | body { 33 | background: #ccc; 34 | } 35 | } 36 | 37 | @namespace "http://www.w3.org/1999/xhtml"; 38 | 39 | @import url("mystyle.css"); 40 | 41 | @charset "ISO-8859-1"; 42 | 43 | @font-face { font-family: "Example Font"; src: url("http://www.example.com/fonts/example"); } 44 | 45 | @media screen { body { font-size: 16px } } @media print { body { font-size: 12pt } } 46 | 47 | 48 | @page { body { margin: 1in 1.5in; } } 49 | 50 | @page linke-seite:left { body { margin:20mm; margin-right:25mm; } } 51 | 52 | @-moz-document url-prefix(http://pygments.org) { a {font-style: normal !important;} } 53 | 54 | 55 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.cu: -------------------------------------------------------------------------------- 1 | #include <stdio.h> 2 | 3 | // __device__ function 4 | __device__ void func() 5 | { 6 | short* array0 = (short*)array; 7 | float* array1 = (float*)&array0[127]; 8 | } 9 | 10 | /* __global__ function */ 11 | __global__ static void reduction(const float* __restrict__ input, float *output, clock_t *timer) 12 | { 13 | // __shared__ float shared[2 * blockDim.x]; 14 | extern __shared__ float shared[]; 15 | 16 | const int tid = threadIdx.x; 17 | const int bid = blockIdx.x; 18 | 19 | if (threadIdx.x == 0) { 20 | __threadfence(); 21 | } 22 | 23 | // Perform reduction to find minimum. 24 | for (int d = blockDim.x; d > 0; d /= 2) 25 | { 26 | __syncthreads(); 27 | } 28 | } 29 | 30 | int main(int argc, char **argv) 31 | { 32 | dim3 dimBlock(8, 8, 1); 33 | 34 | timedReduction<<<dimBlock, 256, 256, 0>>>(dinput, doutput, dtimer); 35 | cudaDeviceReset(); 36 | } 37 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.dart: -------------------------------------------------------------------------------- 1 | // Greeter example from 2 | // <http://www.dartlang.org/docs/getting-started/interface.html> 3 | class Greeter implements Comparable { 4 | String prefix = 'Hello,'; 5 | Greeter() {} 6 | Greeter.withPrefix(this.prefix); 7 | greet(String name) => print('$prefix $name'); 8 | 9 | int compareTo(Greeter other) => prefix.compareTo(other.prefix); 10 | } 11 | 12 | void main() { 13 | Greeter greeter = new Greeter(); 14 | Greeter greeter2 = new Greeter.withPrefix('Hi,'); 15 | 16 | num result = greeter2.compareTo(greeter); 17 | if (result == 0) { 18 | greeter2.greet('you are the same.'); 19 | } else { 20 | greeter2.greet('you are different.'); 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.dtd: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | 3 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 4 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 5 | 6 | 7 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 8 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ 9 | <!-- an internal subset can be embedded here --> 10 | ]> 11 | 12 | <!DOCTYPE greeting SYSTEM "hello.dtd"> 13 | 14 | <!DOCTYPE greeting [ 15 | <!ELEMENT greeting (#PCDATA)> 16 | 17 | <!-- examples from XML spec --> 18 | 19 | <!ELEMENT br EMPTY> 20 | <!ELEMENT p (#PCDATA|emph)* > 21 | <!ELEMENT %name.para; %content.para; > 22 | <!ELEMENT container ANY> 23 | 24 | <!ELEMENT spec (front, body, back?)> 25 | <!ELEMENT div1 (head, (p | list | note)*, div2*)> 26 | <!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*> 27 | 28 | <!ELEMENT p (#PCDATA|a|ul|b|i|em)*> 29 | <!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* > 30 | <!ELEMENT b (#PCDATA)> 31 | 32 | <!ATTLIST termdef 33 | id ID #REQUIRED 34 | name CDATA #IMPLIED> 35 | <!ATTLIST list 36 | type (bullets|ordered|glossary) "ordered"> 37 | <!ATTLIST form 38 | method CDATA #FIXED "POST"> 39 | 40 | <!ENTITY d " "> 41 | <!ENTITY a " "> 42 | <!ENTITY da " "> 43 | 44 | <!ENTITY % ISOLat2 45 | SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" > 46 | 47 | <!ENTITY Pub-Status "This is a pre-release of the 48 | specification."> 49 | 50 | <!ENTITY open-hatch 51 | SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml"> 52 | <!ENTITY open-hatch 53 | PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" 54 | "http://www.textuality.com/boilerplate/OpenHatch.xml"> 55 | <!ENTITY hatch-pic 56 | SYSTEM "../grafix/OpenHatch.gif" 57 | NDATA gif > 58 | 59 | <!NOTATION gif PUBLIC "gif viewer"> 60 | 61 | <!ENTITY % YN '"Yes"' > 62 | <!ENTITY WhatHeSaid "He said %YN;" > 63 | 64 | <!ENTITY EndAttr "27'" > 65 | 66 | <!ENTITY % pub "Éditions Gallimard" > 67 | <!ENTITY rights "All rights reserved" > 68 | <!ENTITY book "La Peste: Albert Camus, 69 | © 1947 %pub;. &rights;" > 70 | 71 | <!ENTITY lt "&#60;"> 72 | <!ENTITY gt ">"> 73 | <!ENTITY amp "&#38;"> 74 | <!ENTITY apos "'"> 75 | <!ENTITY quot """> 76 | 77 | <!ENTITY % draft 'INCLUDE' > 78 | <!ENTITY % final 'IGNORE' > 79 | 80 | <![%draft;[ 81 | <!ELEMENT book (comments*, title, body, supplements?)> 82 | ]]> 83 | <![%final;[ 84 | <!ELEMENT book (title, body, supplements?)> 85 | ]]> 86 | 87 | ]> 88 | 89 | 90 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.ebnf: -------------------------------------------------------------------------------- 1 | letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" 2 | | "H" | "I" | "J" | "K" | "L" | "M" | "N" 3 | | "O" | "P" | "Q" | "R" | "S" | "T" | "U" 4 | | "V" | "W" | "X" | "Y" | "Z" ; 5 | digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; 6 | symbol = "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">" 7 | | "'" | '"' | "=" | "|" | "." | "," | ";" ; 8 | character = letter | digit | symbol | " " ; 9 | 10 | identifier = letter , { letter | digit | " " } ; 11 | terminal = "'" , character , { character } , "'" 12 | | '"' , character , { character } , '"' ; 13 | 14 | special = "?" , any , "?" ; 15 | 16 | comment = (* this is a comment "" *) "(*" , any-symbol , "*)" ; 17 | any-symbol = ? any visible character ? ; (* ? ... ? *) 18 | 19 | lhs = identifier ; 20 | rhs = identifier 21 | | terminal 22 | | comment , rhs 23 | | rhs , comment 24 | | "[" , rhs , "]" 25 | | "{" , rhs , "}" 26 | | "(" , rhs , ")" 27 | | rhs , "|" , rhs 28 | | rhs , "," , rhs ; 29 | 30 | rule = lhs , "=" , rhs , ";" | comment ; 31 | grammar = { rule } ; 32 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.evoque: -------------------------------------------------------------------------------- 1 | $overlay{name=site_base} 2 | 3 | $begin{table_row} 4 | $for{ col in row } 5 | <td>${col}</td>\ 6 | $else 7 | <td class="empty" colspan="7">empty row</td> 8 | $rof 9 | $end{table_row} 10 | 11 | <table> 12 | $for{ i, row in enumerate(rows) } 13 | <tr$if{i%2} class="odd"$fi> #[ "odd" rows get a special style ]# 14 | $evoque{#table_row} 15 | $evoque{ 16 | #table_row 17 | } 18 | $evoque{'#table_row'} 19 | $evoque{ '#table_row', collection=None, quoting="str"} 20 | $evoque{name="#table_row"} 21 | $evoque{name=var_table_row} 22 | $evoque{%#table_row%} 23 | $evoque{% #table_row %} 24 | </tr> 25 | $rof 26 | </table> 27 | 28 | $evoque{disclaimer, collection="legals"} 29 | $evoque{ disclaimer , collection="legals", abc=123} 30 | $evoque{% disclaimer, collection="legals"%} 31 | 32 | $test{% site_base="site.html", 33 | rows=[("a", "b", 3.0, {"one":1}, "<escape-me/>", "i", "j")] %} 34 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.flx: -------------------------------------------------------------------------------- 1 | type tiny = "%i8"; 2 | type int = "%i32"; 3 | typedef bool = 2; 4 | fun add : int*int -> int = "%add"; 5 | fun sub : int*int -> int = "%sub"; 6 | fun eq : int*int -> bool = "%eq"; 7 | fun lnot : bool -> bool = "%lnot"; 8 | proc exit : int = "exit"; 9 | 10 | // comment 1 11 | /* 12 | /* 13 | foo bar 14 | */ 15 | asdas 16 | */ 17 | 18 | noinline fun foo (x:int) = { 19 | val y = 6; 20 | return x + y; 21 | } 22 | 23 | noinline proc fake_exit (x:int) { 24 | exit x; 25 | return; 26 | } 27 | 28 | noinline fun bar (x:int) = { 29 | var y = 10; 30 | noinline proc baz () { 31 | y = 20; 32 | return; 33 | } 34 | baz (); 35 | return x + y; 36 | } 37 | 38 | noinline fun x (a:int, b:int, c:tiny) = { 39 | val x1 = a; 40 | val x2 = b; 41 | val x3 = c; 42 | noinline fun y (d:int, e:int, f:tiny) = { 43 | val y1 = x1; 44 | val y2 = x2; 45 | val y3 = f; 46 | noinline fun z (g:int, h:int, i:tiny) = { 47 | val z1 = x1; 48 | val z2 = x2; 49 | val z3 = i; 50 | return z1; 51 | } 52 | return z (y1,y2,y3); 53 | } 54 | return y (x1,x2,x3); 55 | } 56 | 57 | fake_exit $ (foo 2) + (bar 3) + (x (1,2,3t)); 58 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.gdc: -------------------------------------------------------------------------------- 1 | # Execute the date dimension MAQL script 2 | ExecuteMaql(maqlFile="examples/quotes/quote_date.maql"); 3 | 4 | # load the stock quotes data file 5 | # the data file config has been generated 6 | LoadCsv(csvDataFile="examples/quotes/quotes.csv", 7 | header="true", 8 | configFile="examples/quotes/quotes.config.xml"); 9 | 10 | # transfer the stock quotes data 11 | TransferLastSnapshot(); 12 | 13 | LoadGoogleAnalytics(configFile="examples/ga/ga.config.xml",username="example@gmail.com",password="******",profileId="ga:7468896",dimensions="ga:date|ga:browser|ga:browserVersion|ga:country|ga:isMobile",metrics="ga:bounces|ga:newVisits|ga:pageViews|ga:visits",startDate="2008-01-01",endDate="2010-06-15"); 14 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.ini: -------------------------------------------------------------------------------- 1 | [section] 2 | 3 | foo = bar 4 | continued = foo 5 | baz 6 | conttwo = 7 | foo 8 | ; comment 9 | # comment 10 | 11 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.jsp: -------------------------------------------------------------------------------- 1 | <!-- This page was loaded on <%= (new java.util.Date()).toLocaleString() %> --> 2 | <%= var x = 1; 3 | %> 4 | <%! int i = 0; %> 5 | <%! int a, b, c; %> 6 | <%! Circle a = new Circle(2.0); %> 7 | 8 | <% 9 | String name = null; 10 | if (request.getParameter("name") == null) { 11 | %> 12 | <%@ include file="error.html" %> 13 | <% 14 | } else { 15 | foo.setName(request.getParameter("name")); 16 | if (foo.getName().equalsIgnoreCase("integra")) 17 | name = "acura"; 18 | if (name.equalsIgnoreCase( "acura" )) { 19 | %> 20 | 21 | <jsp:useBean id="calendar" scope="page" class="employee.Calendar" /> 22 | <h2> 23 | Calendar of <jsp:getProperty name="calendar" property="username" /> 24 | </h2> 25 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.maql: -------------------------------------------------------------------------------- 1 | # MAQL script 2 | CREATE DATASET {dataset.quotes} VISUAL(TITLE "St\\tock Qu\totes Data"); 3 | 4 | # A comment 5 | CREATE DATASET {dataset.quotes} VISUAL(TITLE "Stock Qu\"otes Data"); 6 | 7 | CREATE DATASET {dataset.quotes} VISUAL(TITLE "Stock Quotes Data"); 8 | 9 | ALTER DATASET {dataset.quotes} ADD {attribute.sector}; 10 | 11 | ALTER DATASET {dataset.quotes} DROP {attribute.symbol}; 12 | 13 | ALTER DATASET {dataset.quotes} VISUAL(TITLE "Internal Quotes Data"); 14 | 15 | CREATE ATTRIBUTE {attr.quotes.symbol} 16 | VISUAL(TITLE "Symbol", FOLDER {folder.quotes.attr}) 17 | AS {d_quotes_symbol.nm_symbol}; 18 | 19 | ALTER ATTRIBUTE {attr.quotes.symbol} 20 | ADD LABELS {attr.quotes.company} VISUAL(TITLE "Company") 21 | AS {d_quotes_symbol.nm_company}; 22 | 23 | CREATE FACT {fact.quotes.open_price} 24 | VISUAL( TITLE "Open Price", FOLDER {folder.quotes.fact}) AS {f_quotes.f_open_price}; 25 | 26 | ALTER FACT {fact.quotes.open_price} ADD {f_quotes2.f_open_price}; 27 | 28 | CREATE FOLDER {folder.quotes.attr} 29 | VISUAL ( TITLE "Stock Quotes Data", 30 | DESCRIPTION "Stock quotes data obtained from John Doe etc." ) 31 | TYPE ATTRIBUTE; 32 | 33 | ALTER DATATYPE {d_quotes_symbol.nm_symbol} VARCHAR(4), 34 | {d_quotes_symbol.nm_symbol} VARCHAR(80), 35 | {f_quotes.f_open_price} DECIMAL(10,2); 36 | 37 | INCLUDE TEMPLATE "URN:GOODDATA:DATE" MODIFY (IDENTIFIER "my-date", TITLE "quote") 38 | 39 | ALTER ATTRIBUTE {attr.quotes.symbol} ADD KEYS {d_quotes_symbol.nm_symbol} PRIMARY; 40 | 41 | ALTER ATTRIBUTE {attr.quotes.symbol} DROP KEYS {d_quotes_symbol.nm_symbol}; 42 | 43 | ALTER FACT {fact.quotes.open_price} ADD {f_quotes2.f_open_price}; 44 | 45 | # Another comment 46 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.moo: -------------------------------------------------------------------------------- 1 | you_lose_msg = "Either that person does not exist, or has a different password."; 2 | if (!(caller in {#0, this})) 3 | return E_PERM; 4 | "...caller isn't :do_login_command..."; 5 | elseif (args && (args[1] == "test")) 6 | return this:test(@listdelete(args, 1)); 7 | elseif (!(length(args) in {1, 2})) 8 | notify(player, tostr("Usage: ", verb, " <existing-player-name> <password>")); 9 | elseif (!valid(candidate = this:_match_player(name = strsub(args[1], " ", "_")))) 10 | if (name == "guest") 11 | "must be no guests"; 12 | this:notify_lines(this:registration_text("guest")); 13 | else 14 | notify(player, you_lose_msg); 15 | endif 16 | "...unknown player..."; 17 | elseif (is_clear_property(candidate, "password") || ((typeof(candidate.password) == STR) && ((length(candidate.password) < 2) || (crypt({@args, ""}[2], candidate.password) != candidate.password)))) 18 | notify(player, you_lose_msg); 19 | "...bad password..."; 20 | server_log(tostr("FAILED CONNECT: ", args[1], " (", candidate, ") on ", connection_name(player), ($string_utils:connection_hostname(connection_name(player)) in candidate.all_connect_places) ? "" | "******")); 21 | elseif (((candidate.name == "guest") && this.sitematch_guests) && valid(foreigner = $country_db:get_guest())) 22 | notify(player, tostr("Okay,... Logging you in as `", foreigner:name(), "'")); 23 | this:record_connection(foreigner); 24 | return foreigner; 25 | elseif ((parent(candidate) == $guest) && (!valid(candidate = candidate:defer()))) 26 | if (candidate == #-3) 27 | notify(player, "Sorry, guest characters are not allowed from your site right now."); 28 | elseif (candidate == #-2) 29 | this:notify_lines(this:registration_text("blacklisted", "Sorry, guest characters are not allowed from your site.")); 30 | elseif (candidate == #-4) 31 | this:notify_lines(this:registration_text("guest")); 32 | else 33 | notify(player, "Sorry, all of our guest characters are in use right now."); 34 | endif 35 | else 36 | if ((!(name in candidate.aliases)) && (name != tostr(candidate))) 37 | notify(player, tostr("Okay,... ", name, " is in use. Logging you in as `", candidate:name(), "'")); 38 | endif 39 | if (this:is_newted(candidate)) 40 | notify(player, ""); 41 | notify(player, this:newt_message_for(candidate)); 42 | notify(player, ""); 43 | else 44 | this:record_connection(candidate); 45 | if (verb[1] == "s") 46 | candidate.use_do_command = 0; 47 | endif 48 | return candidate; 49 | endif 50 | endif 51 | return 0; -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.nim: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | for x in lines("myfile.txt"): 4 | if x =~ re"(\w+)=(.*)": 5 | echo "Key: ", matches[0], 6 | " Value: ", matches[1] 7 | 8 | Echo("What's your name? ") 9 | var name: string = readLine(stdin) 10 | if name == "": 11 | echo("Poor soul, you lost your name?") 12 | elif name == "name": 13 | echo("Very funny, your name is name.") 14 | else: 15 | Echo("Hi, ", name, "!") 16 | 17 | var name = readLine(stdin) 18 | case name 19 | of "": 20 | echo("Poor soul, you lost your name?") 21 | of "name": 22 | echo("Very funny, your name is name.") 23 | else: 24 | Echo("Hi, ", name, "!") 25 | 26 | from strutils import parseInt 27 | 28 | Echo("A number please: ") 29 | var n = parseInt(readLine(stdin)) 30 | case n 31 | of 0..2, 4..7: Echo("The number is in the set: {0, 1, 2, 4, 5, 6, 7}") 32 | of 3, 8: Echo("The number is 3 or 8") 33 | 34 | Echo("Counting to 10: ") 35 | var i = 1 36 | while i <= 10: 37 | Echo($i) 38 | inc(i) 39 | 40 | proc yes(question: string): bool = 41 | Echo(question, " (y/n)") 42 | while true: 43 | case readLine(stdin) 44 | of "y", "Y", "yes", "Yes": return true 45 | of "n", "N", "no", "No": return false 46 | else: Echo("Please be clear: yes or no") 47 | 48 | proc even(n: int): bool 49 | 50 | proc odd(n: int): bool = 51 | if n == 1: return true 52 | else: return even(n-1) 53 | 54 | iterator countup(a, b: int): int = 55 | var res = a 56 | while res <= b: 57 | yield res 58 | inc(res) 59 | 60 | type 61 | TPerson = object of TObject 62 | name*: string # the * means that `name` is accessible from other modules 63 | age: int # no * means that the field is hidden from other modules 64 | 65 | TStudent = object of TPerson # TStudent inherits from TPerson 66 | id: int # with an id field 67 | 68 | var 69 | student: TStudent 70 | person: TPerson 71 | assert(student is TStudent) 72 | 73 | echo({'a', 'b', 'c'}.card) 74 | stdout.writeln("Hallo") 75 | var 76 | f: TFile 77 | if open(f, "numbers.txt"): 78 | try: 79 | var a = readLine(f) 80 | var b = readLine(f) 81 | echo("sum: " & $(parseInt(a) + parseInt(b))) 82 | except EOverflow: 83 | echo("overflow!") 84 | except EInvalidValue: 85 | echo("could not convert string to integer") 86 | except EIO: 87 | echo("IO error!") 88 | except: 89 | echo("Unknown exception!") 90 | # reraise the unknown exception: 91 | raise 92 | finally: 93 | close(f) -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.opa: -------------------------------------------------------------------------------- 1 | function sample_page() { 2 | <header> 3 | <h3>HTML in Opa</h3> 4 | </header> 5 | <article> 6 | <div class=container> 7 | <p>Learning by examples.</p> 8 | </div> 9 | </article> 10 | } 11 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.r3: -------------------------------------------------------------------------------- 1 | ;## String tests ## 2 | print "Hello ^"World" ;<- with escaped char 3 | multiline-string: { 4 | bla bla "bla" {bla} 5 | } 6 | char-a: #"a" 7 | escaped-a: #"^(61)" 8 | new-line: #"^/" 9 | 10 | ;## Binaries ## 11 | print decompress 64#{eJzLSM3JyQcABiwCFQUAAAA=} 12 | ;2#{0000 00000} ;<- this one is invalid! 13 | 2#{} 14 | #{FF00} 15 | 16 | ;##Date + time ## 17 | 1-Feb-2009 18 | 1-Feb-2009/2:24:46+1:0 19 | 1:0 1:1:1 -0:1.1 20 | 21 | ;## Tuple ## 22 | red: 255.0.0 23 | red-with-alpha: 255.0.0.100 24 | 25 | ;## url!, file! and email! ## 26 | aaa@bbb.cz 27 | http:// 28 | dns:// 29 | tcp://127.0.0.1 30 | %/c/rebol/ 31 | %"c:\Program Files\" 32 | %/c/Program%20Files/ 33 | to-rebol-file "c:\Program Files\" 34 | suffix? %bla.swf 35 | 36 | ;## Money ## 37 | $1 38 | -$1.2 39 | USA$100 40 | 41 | ;## Tag! ## 42 | <a> 43 | <a href="a()"> 44 | 45 | ;## Pair! ## 46 | 10x200 47 | 48 | ;## Issue! ## 49 | type? #ff0000 ;== issue! 50 | 51 | ;## some numbers ## 52 | to integer! (1 + (x / 4.5) * 1E-4) 53 | 54 | ;## some spec comments 55 | comment now 56 | comment 10 57 | comment { 58 | bla 59 | bla 60 | } 61 | comment [ 62 | quit 63 | ] 64 | 65 | ;## other tests ## 66 | ---: 1 67 | x/(1 + n)/y 68 | b/:1 69 | 70 | ;## and... 71 | REBOL [ 72 | purpose: { 73 | reads css file and creates html from it 74 | so one can see how the styles looks like 75 | } 76 | ] 77 | style: %default 78 | out: rejoin [{ 79 | <html> 80 | <head> 81 | <title>Pygments style: } style {.css 82 | 83 | 84 | 85 |
86 | }]
87 | css: read/lines join style %.css
88 | foreach line css [
89 |     parse line [".syntax ." copy c to " " thru "/*" copy t to "*/" to end (
90 |         append out rejoin ["" t "^/"])
91 |     ]
92 | ]
93 | write join style %.html join out "
" 94 | halt 95 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.rhtml: -------------------------------------------------------------------------------- 1 | 2 | <% rows.each do |row| %> 3 | 4 | 5 | 6 | 7 | <% end %> 8 |
<%= item.title %><%= item.description %>
9 | 10 | 11 |

Pages

12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <% if @homepage -%> 23 | <%= render_node @homepage -%> 24 | <% else -%> 25 | 26 | 27 | 28 | <% end -%> 29 | 30 |
PageStatusModify
No Pages
31 | 36 |
37 |

38 | <% unless @homepage -%> 39 | <%= link_to image_tag('new-homepage', :alt => 'New Homepage'), homepage_new_url %> 40 | <% end -%> 41 | <%= image_submit_tag 'clear-page-cache' %> 42 |

43 |
44 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.scaml: -------------------------------------------------------------------------------- 1 | -@ import val city:String = "Tampa" 2 | - val name:String = "Hiram" 3 | %html 4 | %body 5 | %p Hello #{name} from #{city} 6 | %ul 7 | - for ( i <- 1 to 10 ) 8 | %li Item #{i} -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.ssp: -------------------------------------------------------------------------------- 1 | <%@ val someName: String = "someDefaultValue" %> 2 | <% import com.acme.MySnippets._ %> 3 | 4 | 5 |

Hello ${someName}%

6 | 7 |
    8 | <%= for (person <- people) { %> 9 |
  • ${person.name}
  • 10 | <% } %> 11 |
12 | 13 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/test.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/truncated.pytb: -------------------------------------------------------------------------------- 1 | File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 314, in dispatch_request 2 | dispatcher.dispatch(req) 3 | File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 186, in dispatch 4 | req.session = Session(self.env, req) 5 | File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 52, in __init__ 6 | self.promote_session(sid) 7 | File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 125, in promote_session 8 | "AND authenticated=0", (sid,)) 9 | File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 47, in execute 10 | return self.cursor.execute(sql_escape_percent(sql), args) 11 | File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 44, in execute 12 | args or []) 13 | File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error 14 | return function(self, *args, **kwargs) 15 | OperationalError: database is locked 16 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/unicode.applescript: -------------------------------------------------------------------------------- 1 | set jp to "日本語" 2 | 3 | set ru to "Русский" 4 | 5 | jp & " and " & ru -- returns "日本語 and Русский" 6 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/unicodedoc.py: -------------------------------------------------------------------------------- 1 | def foo(): 2 | ur"""unicode-raw""" 3 | 4 | def bar(): 5 | u"""unicode""" 6 | 7 | def baz(): 8 | r'raw' 9 | 10 | def zap(): 11 | """docstring""" 12 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/unix-io.lid: -------------------------------------------------------------------------------- 1 | Library: io 2 | Synopsis: A portable IO library 3 | Author: Gail Zacharias 4 | Files: library 5 | streams/defs 6 | streams/stream 7 | streams/sequence-stream 8 | streams/native-buffer 9 | streams/buffer 10 | streams/typed-stream 11 | streams/external-stream 12 | streams/buffered-stream 13 | streams/convenience 14 | streams/wrapper-stream 15 | streams/cleanup-streams 16 | streams/native-speed 17 | streams/async-writes 18 | streams/file-stream 19 | streams/multi-buffered-streams 20 | pprint 21 | print 22 | print-double-integer-kludge 23 | format 24 | buffered-format 25 | format-condition 26 | unix-file-accessor 27 | unix-standard-io 28 | unix-interface 29 | format-out 30 | C-Source-Files: unix-portability.c 31 | Major-Version: 2 32 | Minor-Version: 1 33 | Target-Type: dll 34 | Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. 35 | All rights reserved. 36 | License: See License.txt in this distribution for details. 37 | Warranty: Distributed WITHOUT WARRANTY OF ANY KIND 38 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/webkit-transition.css: -------------------------------------------------------------------------------- 1 | p { 2 | -webkit-transition: opacity 1s linear; 3 | } 4 | -------------------------------------------------------------------------------- /vendor/pygments/tests/examplefiles/while.pov: -------------------------------------------------------------------------------- 1 | #declare Index1 = 0; 2 | #while(Index1 <= 9) 3 | 4 | #declare Index2 = 0; 5 | #while(Index2 <= 19) 6 | 7 | sphere { , .5 } 8 | 9 | #declare Index2 = Index2 + 1; 10 | #end 11 | 12 | #declare Index1 = Index1 + 1; 13 | #end 14 | -------------------------------------------------------------------------------- /vendor/pygments/tests/run.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Pygments unit tests 4 | ~~~~~~~~~~~~~~~~~~ 5 | 6 | Usage:: 7 | 8 | python run.py [testfile ...] 9 | 10 | 11 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 12 | :license: BSD, see LICENSE for details. 13 | """ 14 | 15 | import sys, os 16 | 17 | if sys.version_info >= (3,): 18 | # copy test suite over to "build/lib" and convert it 19 | print ('Copying and converting sources to build/lib/test...') 20 | from distutils.util import copydir_run_2to3 21 | testroot = os.path.dirname(__file__) 22 | newroot = os.path.join(testroot, '..', 'build/lib/test') 23 | copydir_run_2to3(testroot, newroot) 24 | # make nose believe that we run from the converted dir 25 | os.chdir(newroot) 26 | else: 27 | # only find tests in this directory 28 | if os.path.dirname(__file__): 29 | os.chdir(os.path.dirname(__file__)) 30 | 31 | 32 | try: 33 | import nose 34 | except ImportError: 35 | print ('nose is required to run the Pygments test suite') 36 | sys.exit(1) 37 | 38 | try: 39 | # make sure the current source is first on sys.path 40 | sys.path.insert(0, '..') 41 | import pygments 42 | except ImportError: 43 | print ('Cannot find Pygments to test: %s' % sys.exc_info()[1]) 44 | sys.exit(1) 45 | else: 46 | print ('Pygments %s test suite running (Python %s)...' % 47 | (pygments.__version__, sys.version.split()[0])) 48 | 49 | nose.main() 50 | -------------------------------------------------------------------------------- /vendor/pygments/tests/support.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | """ 3 | Support for Pygments tests 4 | """ 5 | 6 | import os 7 | 8 | 9 | def location(mod_name): 10 | """ 11 | Return the file and directory that the code for *mod_name* is in. 12 | """ 13 | source = mod_name.endswith("pyc") and mod_name[:-1] or mod_name 14 | source = os.path.abspath(source) 15 | return source, os.path.dirname(source) 16 | -------------------------------------------------------------------------------- /vendor/pygments/tests/support/tags: -------------------------------------------------------------------------------- 1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ 2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ 3 | !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ 4 | !_TAG_PROGRAM_NAME Exuberant Ctags // 5 | !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ 6 | !_TAG_PROGRAM_VERSION 5.8 // 7 | HtmlFormatter test_html_formatter.py 19;" i 8 | HtmlFormatterTest test_html_formatter.py 34;" c 9 | NullFormatter test_html_formatter.py 19;" i 10 | PythonLexer test_html_formatter.py 18;" i 11 | StringIO test_html_formatter.py 13;" i 12 | dirname test_html_formatter.py 16;" i 13 | escape_html test_html_formatter.py 20;" i 14 | fp test_html_formatter.py 27;" v 15 | inspect test_html_formatter.py 15;" i 16 | isfile test_html_formatter.py 16;" i 17 | join test_html_formatter.py 16;" i 18 | os test_html_formatter.py 10;" i 19 | re test_html_formatter.py 11;" i 20 | subprocess test_html_formatter.py 125;" i 21 | support test_html_formatter.py 23;" i 22 | tempfile test_html_formatter.py 14;" i 23 | test_all_options test_html_formatter.py 72;" m class:HtmlFormatterTest 24 | test_correct_output test_html_formatter.py 35;" m class:HtmlFormatterTest 25 | test_ctags test_html_formatter.py 165;" m class:HtmlFormatterTest 26 | test_external_css test_html_formatter.py 48;" m class:HtmlFormatterTest 27 | test_get_style_defs test_html_formatter.py 141;" m class:HtmlFormatterTest 28 | test_lineanchors test_html_formatter.py 98;" m class:HtmlFormatterTest 29 | test_lineanchors_with_startnum test_html_formatter.py 106;" m class:HtmlFormatterTest 30 | test_linenos test_html_formatter.py 82;" m class:HtmlFormatterTest 31 | test_linenos_with_startnum test_html_formatter.py 90;" m class:HtmlFormatterTest 32 | test_unicode_options test_html_formatter.py 155;" m class:HtmlFormatterTest 33 | test_valid_output test_html_formatter.py 114;" m class:HtmlFormatterTest 34 | tokensource test_html_formatter.py 29;" v 35 | uni_open test_html_formatter.py 21;" i 36 | unittest test_html_formatter.py 12;" i 37 | -------------------------------------------------------------------------------- /vendor/pygments/tests/test_clexer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Basic CLexer Test 4 | ~~~~~~~~~~~~~~~~~ 5 | 6 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 7 | :license: BSD, see LICENSE for details. 8 | """ 9 | 10 | import unittest 11 | import os 12 | 13 | from pygments.token import Text, Number 14 | from pygments.lexers import CLexer 15 | 16 | 17 | class CLexerTest(unittest.TestCase): 18 | 19 | def setUp(self): 20 | self.lexer = CLexer() 21 | 22 | def testNumbers(self): 23 | code = '42 23.42 23. .42 023 0xdeadbeef 23e+42 42e-23' 24 | wanted = [] 25 | for item in zip([Number.Integer, Number.Float, Number.Float, 26 | Number.Float, Number.Oct, Number.Hex, 27 | Number.Float, Number.Float], code.split()): 28 | wanted.append(item) 29 | wanted.append((Text, ' ')) 30 | wanted = [(Text, '')] + wanted[:-1] + [(Text, '\n')] 31 | self.assertEqual(list(self.lexer.get_tokens(code)), wanted) 32 | -------------------------------------------------------------------------------- /vendor/pygments/tests/test_latex_formatter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Pygments LaTeX formatter tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 7 | :license: BSD, see LICENSE for details. 8 | """ 9 | 10 | import os 11 | import unittest 12 | import tempfile 13 | 14 | from pygments.formatters import LatexFormatter 15 | from pygments.lexers import PythonLexer 16 | 17 | import support 18 | 19 | TESTFILE, TESTDIR = support.location(__file__) 20 | 21 | 22 | class LatexFormatterTest(unittest.TestCase): 23 | 24 | def test_valid_output(self): 25 | fp = open(TESTFILE) 26 | try: 27 | tokensource = list(PythonLexer().get_tokens(fp.read())) 28 | finally: 29 | fp.close() 30 | fmt = LatexFormatter(full=True, encoding='latin1') 31 | 32 | handle, pathname = tempfile.mkstemp('.tex') 33 | # place all output files in /tmp too 34 | old_wd = os.getcwd() 35 | os.chdir(os.path.dirname(pathname)) 36 | tfile = os.fdopen(handle, 'wb') 37 | fmt.format(tokensource, tfile) 38 | tfile.close() 39 | try: 40 | import subprocess 41 | po = subprocess.Popen(['latex', '-interaction=nonstopmode', 42 | pathname], stdout=subprocess.PIPE) 43 | ret = po.wait() 44 | output = po.stdout.read() 45 | po.stdout.close() 46 | except OSError: 47 | # latex not available 48 | pass 49 | else: 50 | if ret: 51 | print output 52 | self.assertFalse(ret, 'latex run reported errors') 53 | 54 | os.unlink(pathname) 55 | os.chdir(old_wd) 56 | -------------------------------------------------------------------------------- /vendor/pygments/tests/test_lexers_other.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Tests for other lexers 4 | ~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 7 | :license: BSD, see LICENSE for details. 8 | """ 9 | 10 | import glob 11 | import os 12 | import unittest 13 | 14 | from pygments.lexers import guess_lexer 15 | from pygments.lexers.other import RexxLexer 16 | 17 | 18 | def _exampleFilePath(filename): 19 | return os.path.join(os.path.dirname(__file__), 'examplefiles', filename) 20 | 21 | 22 | class AnalyseTextTest(unittest.TestCase): 23 | def _testCanRecognizeAndGuessExampleFiles(self, lexer): 24 | assert lexer is not None 25 | 26 | for pattern in lexer.filenames: 27 | exampleFilesPattern = _exampleFilePath(pattern) 28 | for exampleFilePath in glob.glob(exampleFilesPattern): 29 | exampleFile = open(exampleFilePath, 'rb') 30 | try: 31 | text = exampleFile.read() 32 | probability = lexer.analyse_text(text) 33 | self.assertTrue(probability > 0, 34 | '%s must recognize %r' % ( 35 | lexer.name, exampleFilePath)) 36 | guessedLexer = guess_lexer(text) 37 | self.assertEqual(guessedLexer.name, lexer.name) 38 | finally: 39 | exampleFile.close() 40 | 41 | def testCanRecognizeAndGuessExampleFiles(self): 42 | self._testCanRecognizeAndGuessExampleFiles(RexxLexer) 43 | 44 | 45 | class RexxLexerTest(unittest.TestCase): 46 | def testCanGuessFromText(self): 47 | self.assertAlmostEqual(0.01, 48 | RexxLexer.analyse_text('/* */')) 49 | self.assertAlmostEqual(1.0, 50 | RexxLexer.analyse_text('''/* Rexx */ 51 | say "hello world"''')) 52 | self.assertLess(0.5, 53 | RexxLexer.analyse_text('/* */\n' 54 | 'hello:pRoceduRe\n' 55 | ' say "hello world"')) 56 | self.assertLess(0.2, 57 | RexxLexer.analyse_text('''/* */ 58 | if 1 > 0 then do 59 | say "ok" 60 | end 61 | else do 62 | say "huh?" 63 | end''')) 64 | self.assertLess(0.2, 65 | RexxLexer.analyse_text('''/* */ 66 | greeting = "hello world!" 67 | parse value greeting "hello" name "!" 68 | say name''')) 69 | -------------------------------------------------------------------------------- /vendor/pygments/tests/test_regexlexer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Pygments regex lexer tests 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 7 | :license: BSD, see LICENSE for details. 8 | """ 9 | 10 | import unittest 11 | 12 | from pygments.token import Text 13 | from pygments.lexer import RegexLexer 14 | from pygments.lexer import bygroups 15 | 16 | 17 | class TestLexer(RegexLexer): 18 | """Test tuple state transitions including #pop.""" 19 | tokens = { 20 | 'root': [ 21 | ('a', Text.Root, 'rag'), 22 | ('e', Text.Root), 23 | ], 24 | 'beer': [ 25 | ('d', Text.Beer, ('#pop', '#pop')), 26 | ], 27 | 'rag': [ 28 | ('b', Text.Rag, '#push'), 29 | ('c', Text.Rag, ('#pop', 'beer')), 30 | ], 31 | } 32 | 33 | 34 | class TupleTransTest(unittest.TestCase): 35 | def test(self): 36 | lx = TestLexer() 37 | toks = list(lx.get_tokens_unprocessed('abcde')) 38 | self.assertEqual(toks, 39 | [(0, Text.Root, 'a'), (1, Text.Rag, 'b'), (2, Text.Rag, 'c'), 40 | (3, Text.Beer, 'd'), (4, Text.Root, 'e')]) 41 | 42 | def test_multiline(self): 43 | lx = TestLexer() 44 | toks = list(lx.get_tokens_unprocessed('a\ne')) 45 | self.assertEqual(toks, 46 | [(0, Text.Root, 'a'), (1, Text, u'\n'), 47 | (2, Text.Root, 'e')]) 48 | -------------------------------------------------------------------------------- /vendor/pygments/tests/test_token.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Test suite for the token module 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 7 | :license: BSD, see LICENSE for details. 8 | """ 9 | 10 | import unittest 11 | 12 | from pygments import token 13 | 14 | 15 | class TokenTest(unittest.TestCase): 16 | 17 | def test_tokentype(self): 18 | e = self.assertEqual 19 | 20 | t = token.String 21 | 22 | e(t.split(), [token.Token, token.Literal, token.String]) 23 | 24 | e(t.__class__, token._TokenType) 25 | 26 | def test_functions(self): 27 | self.assertTrue(token.is_token_subtype(token.String, token.String)) 28 | self.assertTrue(token.is_token_subtype(token.String, token.Literal)) 29 | self.assertFalse(token.is_token_subtype(token.Literal, token.String)) 30 | 31 | self.assertTrue(token.string_to_tokentype(token.String) is token.String) 32 | self.assertTrue(token.string_to_tokentype('') is token.Token) 33 | self.assertTrue(token.string_to_tokentype('String') is token.String) 34 | 35 | def test_sanity_check(self): 36 | stp = token.STANDARD_TYPES.copy() 37 | stp[token.Token] = '---' # Token and Text do conflict, that is okay 38 | t = {} 39 | for k, v in stp.iteritems(): 40 | t.setdefault(v, []).append(k) 41 | if len(t) == len(stp): 42 | return # Okay 43 | 44 | for k, v in t.iteritems(): 45 | if len(v) > 1: 46 | self.fail("%r has more than one key: %r" % (k, v)) 47 | -------------------------------------------------------------------------------- /vendor/pygments/tests/test_using_api.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Pygments tests for using() 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 7 | :license: BSD, see LICENSE for details. 8 | """ 9 | 10 | import unittest 11 | 12 | from pygments.lexer import using, bygroups, this, RegexLexer 13 | from pygments.token import String, Text, Keyword 14 | 15 | class TestLexer(RegexLexer): 16 | tokens = { 17 | 'root': [ 18 | (r'#.*', 19 | using(this, state='invalid')), 20 | (r'(")(.+?)(")', 21 | bygroups(String, using(this, state='string'), String)), 22 | (r'[^"]+', Text), 23 | ], 24 | 'string': [ 25 | (r'.+', Keyword), 26 | ], 27 | } 28 | 29 | 30 | class UsingStateTest(unittest.TestCase): 31 | def test_basic(self): 32 | expected = [(Text, 'a'), (String, '"'), (Keyword, 'bcd'), 33 | (String, '"'), (Text, 'e\n')] 34 | t = list(TestLexer().get_tokens('a"bcd"e')) 35 | self.assertEqual(t, expected) 36 | 37 | def test_error(self): 38 | def gen(): 39 | return list(TestLexer().get_tokens('#a')) 40 | self.assertRaises(KeyError, gen) 41 | --------------------------------------------------------------------------------