diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-22 13:18:01 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-22 13:18:01 +0000 |
commit | 144ca23442a5e123935dea4073670d4dba4caa89 (patch) | |
tree | 61c02c4fee71195b09fd7e6270d866a3b2fabd28 /vendor | |
parent | e4faf3553a1b9d22ee171e08f62f112637b05e19 (diff) | |
download | redmine-144ca23442a5e123935dea4073670d4dba4caa89.tar.gz redmine-144ca23442a5e123935dea4073670d4dba4caa89.zip |
Coderay upgraded to 0.9.7 (#5344).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4739 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/gems/coderay-0.9.7/.specification | 155 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/FOLDERS | 53 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/LICENSE (renamed from vendor/plugins/coderay-0.9.2/LICENSE) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/Rakefile | 35 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/bin/coderay | 86 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/bin/coderay_stylesheet | 4 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/README (renamed from vendor/plugins/coderay-0.9.2/lib/README) | 3 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay.rb) | 2 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/duo.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/duo.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoder.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoder.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/_map.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/_map.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/comment_filter.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/comment_filter.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/count.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/count.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/debug.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/debug.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/div.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/div.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/filter.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/filter.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/html.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html.rb) | 10 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/css.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/css.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/numerization.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/numerization.rb) | 4 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/output.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/output.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/json.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/json.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/lines_of_code.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/lines_of_code.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/null.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/null.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/page.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/page.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/span.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/span.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/statistic.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/statistic.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/term.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/term.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/text.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/text.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/token_class_filter.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/token_class_filter.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/xml.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/xml.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/encoders/yaml.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/encoders/yaml.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/for_redcloth.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/for_redcloth.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/helpers/file_type.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/helpers/file_type.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/helpers/gzip_simple.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/helpers/gzip_simple.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/helpers/plugin.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/helpers/plugin.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/helpers/word_list.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/helpers/word_list.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanner.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanner.rb) | 26 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/_map.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/_map.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/c.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/c.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/cpp.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/cpp.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/css.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/css.rb) | 5 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/debug.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/debug.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/delphi.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/delphi.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/diff.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/diff.rb) | 17 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/groovy.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/groovy.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/html.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/html.rb) | 2 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/java.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java.rb) | 2 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/java/builtin_types.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java/builtin_types.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/java_script-0.9.6.rb | 224 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/java_script.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java_script.rb) | 6 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/json.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/json.rb) | 8 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/nitro_xhtml.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/nitro_xhtml.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/php.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/php.rb) | 6 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/plaintext.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/plaintext.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/python.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/python.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/rhtml.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/rhtml.rb) | 8 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/ruby.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/ruby.rb) | 73 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/ruby/patterns.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/ruby/patterns.rb) | 22 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/scheme.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/scheme.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/sql.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/sql.rb) | 2 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/xml.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/xml.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/scanners/yaml.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/scanners/yaml.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/style.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/style.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/styles/_map.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/styles/_map.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/styles/cycnus.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/styles/cycnus.rb) | 1 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/styles/murphy.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/styles/murphy.rb) | 2 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/token_classes.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/token_classes.rb) | 0 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/lib/coderay/tokens.rb (renamed from vendor/plugins/coderay-0.9.2/lib/coderay/tokens.rb) | 32 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/basic.rb | 122 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/basic.rbc | 2022 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rb | 77 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rbc | 1708 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rb | 11 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rbc | 317 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/suite.rb | 12 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/suite.rbc | 322 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/vhdl.rb | 126 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/vhdl.rbc | 2334 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/word_list.rb | 79 | ||||
-rw-r--r-- | vendor/gems/coderay-0.9.7/test/functional/word_list.rbc | 1763 |
80 files changed, 9601 insertions, 80 deletions
diff --git a/vendor/gems/coderay-0.9.7/.specification b/vendor/gems/coderay-0.9.7/.specification new file mode 100644 index 000000000..bafeb65cc --- /dev/null +++ b/vendor/gems/coderay-0.9.7/.specification @@ -0,0 +1,155 @@ +--- !ruby/object:Gem::Specification
+name: coderay
+version: !ruby/object:Gem::Version
+ hash: 53
+ prerelease: false
+ segments:
+ - 0
+ - 9
+ - 7
+ version: 0.9.7
+platform: ruby
+authors:
+- murphy
+autorequire:
+bindir: bin
+cert_chain: []
+
+date: 2011-01-15 00:00:00 +01:00
+default_executable:
+dependencies: []
+
+description: |
+ Fast and easy syntax highlighting for selected languages, written in Ruby.
+ Comes with RedCloth integration and LOC counter.
+
+email: murphy@rubychan.de
+executables:
+- coderay
+- coderay_stylesheet
+extensions: []
+
+extra_rdoc_files:
+- lib/README
+- FOLDERS
+files:
+- ./lib/coderay/duo.rb
+- ./lib/coderay/encoder.rb
+- ./lib/coderay/encoders/_map.rb
+- ./lib/coderay/encoders/comment_filter.rb
+- ./lib/coderay/encoders/count.rb
+- ./lib/coderay/encoders/debug.rb
+- ./lib/coderay/encoders/div.rb
+- ./lib/coderay/encoders/filter.rb
+- ./lib/coderay/encoders/html/css.rb
+- ./lib/coderay/encoders/html/numerization.rb
+- ./lib/coderay/encoders/html/output.rb
+- ./lib/coderay/encoders/html.rb
+- ./lib/coderay/encoders/json.rb
+- ./lib/coderay/encoders/lines_of_code.rb
+- ./lib/coderay/encoders/null.rb
+- ./lib/coderay/encoders/page.rb
+- ./lib/coderay/encoders/span.rb
+- ./lib/coderay/encoders/statistic.rb
+- ./lib/coderay/encoders/term.rb
+- ./lib/coderay/encoders/text.rb
+- ./lib/coderay/encoders/token_class_filter.rb
+- ./lib/coderay/encoders/xml.rb
+- ./lib/coderay/encoders/yaml.rb
+- ./lib/coderay/for_redcloth.rb
+- ./lib/coderay/helpers/file_type.rb
+- ./lib/coderay/helpers/gzip_simple.rb
+- ./lib/coderay/helpers/plugin.rb
+- ./lib/coderay/helpers/word_list.rb
+- ./lib/coderay/scanner.rb
+- ./lib/coderay/scanners/_map.rb
+- ./lib/coderay/scanners/c.rb
+- ./lib/coderay/scanners/cpp.rb
+- ./lib/coderay/scanners/css.rb
+- ./lib/coderay/scanners/debug.rb
+- ./lib/coderay/scanners/delphi.rb
+- ./lib/coderay/scanners/diff.rb
+- ./lib/coderay/scanners/groovy.rb
+- ./lib/coderay/scanners/html.rb
+- ./lib/coderay/scanners/java/builtin_types.rb
+- ./lib/coderay/scanners/java.rb
+- ./lib/coderay/scanners/java_script-0.9.6.rb
+- ./lib/coderay/scanners/java_script.rb
+- ./lib/coderay/scanners/json.rb
+- ./lib/coderay/scanners/nitro_xhtml.rb
+- ./lib/coderay/scanners/php.rb
+- ./lib/coderay/scanners/plaintext.rb
+- ./lib/coderay/scanners/python.rb
+- ./lib/coderay/scanners/rhtml.rb
+- ./lib/coderay/scanners/ruby/patterns.rb
+- ./lib/coderay/scanners/ruby.rb
+- ./lib/coderay/scanners/scheme.rb
+- ./lib/coderay/scanners/sql.rb
+- ./lib/coderay/scanners/xml.rb
+- ./lib/coderay/scanners/yaml.rb
+- ./lib/coderay/style.rb
+- ./lib/coderay/styles/_map.rb
+- ./lib/coderay/styles/cycnus.rb
+- ./lib/coderay/styles/murphy.rb
+- ./lib/coderay/token_classes.rb
+- ./lib/coderay/tokens.rb
+- ./lib/coderay.rb
+- ./Rakefile
+- ./test/functional/basic.rb
+- ./test/functional/basic.rbc
+- ./test/functional/for_redcloth.rb
+- ./test/functional/for_redcloth.rbc
+- ./test/functional/load_plugin_scanner.rb
+- ./test/functional/load_plugin_scanner.rbc
+- ./test/functional/suite.rb
+- ./test/functional/suite.rbc
+- ./test/functional/vhdl.rb
+- ./test/functional/vhdl.rbc
+- ./test/functional/word_list.rb
+- ./test/functional/word_list.rbc
+- ./lib/README
+- ./LICENSE
+- lib/README
+- FOLDERS
+- bin/coderay
+- bin/coderay_stylesheet
+has_rdoc: true
+homepage: http://coderay.rubychan.de
+licenses: []
+
+post_install_message:
+rdoc_options:
+- -SNw2
+- -mlib/README
+- -t CodeRay Documentation
+require_paths:
+- lib
+required_ruby_version: !ruby/object:Gem::Requirement
+ none: false
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ hash: 51
+ segments:
+ - 1
+ - 8
+ - 2
+ version: 1.8.2
+required_rubygems_version: !ruby/object:Gem::Requirement
+ none: false
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ hash: 3
+ segments:
+ - 0
+ version: "0"
+requirements: []
+
+rubyforge_project: coderay
+rubygems_version: 1.3.7
+signing_key:
+specification_version: 3
+summary: Fast syntax highlighting for selected languages.
+test_files:
+- ./test/functional/suite.rb
diff --git a/vendor/gems/coderay-0.9.7/FOLDERS b/vendor/gems/coderay-0.9.7/FOLDERS new file mode 100644 index 000000000..e393ed7f9 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/FOLDERS @@ -0,0 +1,53 @@ += CodeRay - Trunk folder structure
+
+== bench - Benchmarking system
+
+All benchmarking stuff goes here.
+
+Test inputs are stored in files named <code>example.<lang></code>.
+Test outputs go to <code>bench/test.<encoder-default-file-extension></code>.
+
+Run <code>bench/bench.rb</code> to get a usage description.
+
+Run <code>rake bench</code> to perform an example benchmark.
+
+
+== bin - Scripts
+
+Executional files for CodeRay.
+
+
+== demo - Demos and functional tests
+
+Demonstrational scripts to show of CodeRay's features.
+
+Run them as functional tests with <code>rake test:demos</code>.
+
+
+== etc - Lots of stuff
+
+Some addidtional files for CodeRay, mainly graphics and Vim scripts.
+
+
+== gem_server - Gem output folder
+
+For <code>rake gem</code>.
+
+
+== lib - CodeRay library code
+
+This is the base directory for the CodeRay library.
+
+
+== rake_helpers - Rake helper libraries
+
+Some files to enhance Rake, including the Autumnal Rdoc template and some scripts.
+
+
+== test - Tests
+
+Tests for the scanners.
+
+Each language has its own subfolder and sub-suite.
+
+Run with <code>rake test</code>.
diff --git a/vendor/plugins/coderay-0.9.2/LICENSE b/vendor/gems/coderay-0.9.7/LICENSE index c00103def..c00103def 100644 --- a/vendor/plugins/coderay-0.9.2/LICENSE +++ b/vendor/gems/coderay-0.9.7/LICENSE diff --git a/vendor/gems/coderay-0.9.7/Rakefile b/vendor/gems/coderay-0.9.7/Rakefile new file mode 100644 index 000000000..05d0144de --- /dev/null +++ b/vendor/gems/coderay-0.9.7/Rakefile @@ -0,0 +1,35 @@ +require 'rake/rdoctask' + +ROOT = '.' +LIB_ROOT = File.join ROOT, 'lib' +EXTRA_RDOC_FILES = %w(lib/README FOLDERS) + +task :default => :test + +if File.directory? 'rake_tasks' + + # load rake tasks from subfolder + for task_file in Dir['rake_tasks/*.rake'].sort + load task_file + end + +else + + # fallback tasks when rake_tasks folder is not present + desc 'Run CodeRay tests (basic)' + task :test do + ruby './test/functional/suite.rb' + ruby './test/functional/for_redcloth.rb' + end + + desc 'Generate documentation for CodeRay' + Rake::RDocTask.new :doc do |rd| + rd.title = 'CodeRay Documentation' + rd.main = 'lib/README' + rd.rdoc_files.add Dir['lib'] + rd.rdoc_files.add 'lib/README' + rd.rdoc_files.add 'FOLDERS' + rd.rdoc_dir = 'doc' + end + +end
\ No newline at end of file diff --git a/vendor/gems/coderay-0.9.7/bin/coderay b/vendor/gems/coderay-0.9.7/bin/coderay new file mode 100644 index 000000000..62101a83a --- /dev/null +++ b/vendor/gems/coderay-0.9.7/bin/coderay @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# CodeRay Executable +# +# Version: 0.2 +# Author: murphy + +require 'coderay' + +if ARGV.empty? + $stderr.puts <<-USAGE +CodeRay #{CodeRay::VERSION} (http://coderay.rubychan.de) + +Usage: + coderay file [-<format>] + coderay -<lang> [-<format>] [< file] [> output] + +Defaults: + lang: based on file extension + format: ANSI colorized output for terminal, HTML page for files + +Examples: + coderay foo.rb # colorized output to terminal, based on file extension + coderay foo.rb -loc # print LOC count, based on file extension and format + coderay foo.rb > foo.html # HTML page output to file, based on extension + coderay -ruby < foo.rb # colorized output to terminal, based on lang + coderay -ruby -loc < foo.rb # print LOC count, based on lang + coderay -ruby -page foo.rb # HTML page output to terminal, based on lang and format + coderay -ruby -page foo.rb > foo.html # HTML page output to file, based on lang and format + USAGE +end + +first, second = ARGV + +def read + file = ARGV.grep(/^(?!-)/).last + if file + if File.exist?(file) + File.read file + else + $stderr.puts "No such file: #{file}" + end + else + $stdin.read + end +end + +if first + if first[/-(\w+)/] == first + lang = $1 + input = read + tokens = :scan + else + file = first + unless File.exist? file + $stderr.puts "No such file: #{file}" + exit 2 + end + tokens = CodeRay.scan_file file + end +else + $stderr.puts 'No lang/file given.' + exit 1 +end + +if second + if second[/-(\w+)/] == second + format = $1.to_sym + else + raise 'invalid format (must be -xxx)' + end +else + if $stdout.tty? + format = :term + else + $stderr.puts 'No format given; setting to default (HTML Page).' + format = :page + end +end + +if tokens == :scan + output = CodeRay::Duo[lang => format].highlight input +else + output = tokens.encode format +end +out = $stdout +out.puts output diff --git a/vendor/gems/coderay-0.9.7/bin/coderay_stylesheet b/vendor/gems/coderay-0.9.7/bin/coderay_stylesheet new file mode 100644 index 000000000..baa7c260e --- /dev/null +++ b/vendor/gems/coderay-0.9.7/bin/coderay_stylesheet @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby
+require 'coderay'
+
+puts CodeRay::Encoders[:html]::CSS.new.stylesheet
diff --git a/vendor/plugins/coderay-0.9.2/lib/README b/vendor/gems/coderay-0.9.7/lib/README index 564a9c0f4..c440f30c7 100644 --- a/vendor/plugins/coderay-0.9.2/lib/README +++ b/vendor/gems/coderay-0.9.7/lib/README @@ -18,7 +18,7 @@ And with line numbers. * is what everybody should have on their website * solves all your problems and makes the girls run after you -Version: 0.9.2 +Version: 0.9.7 Author:: murphy (Kornelius Kalnbach) Contact:: murphy rubychan de Website:: coderay.rubychan.de[http://coderay.rubychan.de] @@ -94,6 +94,7 @@ Please report errors in this documentation to <murphy rubychan de>. * Rob Aldred for the terminal encoder * Trans for pointing out $DEBUG dependencies * Flameeyes for finding that Term::ANSIColor was obsolete +* Etienne Massip for reporting a serious bug in JavaScript scanner * matz and all Ruby gods and gurus * The inventors of: the computer, the internet, the true color display, HTML & CSS, VIM, Ruby, pizza, microwaves, guitars, scouting, programming, anime, diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay.rb b/vendor/gems/coderay-0.9.7/lib/coderay.rb index d8f3fd53d..3e2d10b7e 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay.rb @@ -134,7 +134,7 @@ module CodeRay # Minor: feature milestone # Teeny: development state, 0 for pre-release # Revision: Subversion Revision number (generated on rake gem:make) - VERSION = '0.9.2' + VERSION = '0.9.7' require 'coderay/tokens' require 'coderay/token_classes' diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/duo.rb b/vendor/gems/coderay-0.9.7/lib/coderay/duo.rb index 5468dda8d..5468dda8d 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/duo.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/duo.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoder.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoder.rb index 3ae29244b..3ae29244b 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoder.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoder.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/_map.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/_map.rb index 526c3a07c..526c3a07c 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/_map.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/_map.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/comment_filter.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/comment_filter.rb index 4d3fb54c2..4d3fb54c2 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/comment_filter.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/comment_filter.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/count.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/count.rb index c9a6dfdea..c9a6dfdea 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/count.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/count.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/debug.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/debug.rb index a4b064833..a4b064833 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/debug.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/debug.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/div.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/div.rb index 41201724a..41201724a 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/div.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/div.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/filter.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/filter.rb index 5e4b34d13..5e4b34d13 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/filter.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/filter.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html.rb index 73d2c49c3..f280c7d36 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html.rb @@ -276,9 +276,13 @@ module Encoders when :begin_line @opened[0] = type if style = @css_style[@opened] - @out << style.sub('<span', '<div') + if style['class="'] + @out << style.sub('class="', 'class="line ') + else + @out << style.sub('>', ' class="line">') + end else - @out << '<div>' + @out << '<span class="line">' end @opened << type when :end_line @@ -289,7 +293,7 @@ module Encoders raise 'Malformed token stream: Trying to close a line (%p) \ that is not open. Open are: %p.' % [type, @opened[1..-1]] end - @out << '</div>' + @out << '</span>' @opened.pop end diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/css.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/css.rb index 09ac8bc07..09ac8bc07 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/css.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/css.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/numerization.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/numerization.rb index 7058edd87..17e8ddb00 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/numerization.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/numerization.rb @@ -80,8 +80,8 @@ module Encoders line_numbers.gsub!(/\n/) { "<tt>\n</tt>" } line_numbers_table_tpl = TABLE.apply('LINE_NUMBERS', line_numbers) - gsub!(/<\/div>\n/) { '</div>' } - gsub!(/\n/) { "<tt>\n</tt>" } + gsub!("</div>\n", '</div>') + gsub!("\n", "<tt>\n</tt>") wrap_in! line_numbers_table_tpl @wrapped_in = :div diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/output.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/output.rb index 28574a5de..28574a5de 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/html/output.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/html/output.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/json.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/json.rb index 7aa077c28..7aa077c28 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/json.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/json.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/lines_of_code.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/lines_of_code.rb index c1ad66e2e..c1ad66e2e 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/lines_of_code.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/lines_of_code.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/null.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/null.rb index add3862a3..add3862a3 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/null.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/null.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/page.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/page.rb index 1b69cce97..1b69cce97 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/page.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/page.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/span.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/span.rb index 319f6fd09..319f6fd09 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/span.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/span.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/statistic.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/statistic.rb index 6d0c64680..6d0c64680 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/statistic.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/statistic.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/term.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/term.rb index 1f284ed13..1f284ed13 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/term.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/term.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/text.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/text.rb index 161ee67c5..161ee67c5 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/text.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/text.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/token_class_filter.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/token_class_filter.rb index a9e8673a3..a9e8673a3 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/token_class_filter.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/token_class_filter.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/xml.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/xml.rb index f32c967bc..f32c967bc 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/xml.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/xml.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/yaml.rb b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/yaml.rb index 5564e58a4..5564e58a4 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/encoders/yaml.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/encoders/yaml.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/for_redcloth.rb b/vendor/gems/coderay-0.9.7/lib/coderay/for_redcloth.rb index 69985bcad..69985bcad 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/for_redcloth.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/for_redcloth.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/file_type.rb b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/file_type.rb index e8a038495..e8a038495 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/file_type.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/file_type.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/gzip_simple.rb b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/gzip_simple.rb index b979f665b..b979f665b 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/gzip_simple.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/gzip_simple.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/plugin.rb b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/plugin.rb index 2dffbdc92..2dffbdc92 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/plugin.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/plugin.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/word_list.rb b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/word_list.rb index 9b4f4569c..9b4f4569c 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/helpers/word_list.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/helpers/word_list.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanner.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanner.rb index 5460d4e30..b12c865fb 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanner.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanner.rb @@ -68,15 +68,16 @@ module CodeRay def normify code code = code.to_s - if code.respond_to? :force_encoding - debug, $DEBUG = $DEBUG, false - begin - code.force_encoding 'utf-8' - code[/\z/] # raises an ArgumentError when code contains a non-UTF-8 char - rescue ArgumentError - code.force_encoding 'binary' - ensure - $DEBUG = debug + if code.respond_to?(:encoding) && (code.encoding.name != 'UTF-8' || !code.valid_encoding?) + code = code.dup + original_encoding = code.encoding + code.force_encoding 'Windows-1252' + unless code.valid_encoding? + code.force_encoding original_encoding + if code.encoding.name == 'UTF-8' + code.encode! 'UTF-16BE', :invalid => :replace, :undef => :replace, :replace => '?' + end + code.encode! 'UTF-8', :invalid => :replace, :undef => :replace, :replace => '?' end end code.to_unix @@ -147,7 +148,12 @@ module CodeRay def string= code code = Scanner.normify(code) - super code + if defined?(RUBY_DESCRIPTION) && RUBY_DESCRIPTION['rubinius 1.0.1'] + reset_state + @string = code + else + super code + end reset_instance end diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/_map.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/_map.rb index 01078c1a4..01078c1a4 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/_map.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/_map.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/c.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/c.rb index d7f2be7c3..d7f2be7c3 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/c.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/c.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/cpp.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/cpp.rb index c29083a40..c29083a40 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/cpp.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/cpp.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/css.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/css.rb index 5f4614534..08ecbb18c 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/css.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/css.rb @@ -14,12 +14,11 @@ module Scanners ] module RE - NonASCII = /[\x80-\xFF]/ Hex = /[0-9a-fA-F]/ Unicode = /\\#{Hex}{1,6}(?:\r\n|\s)?/ # differs from standard because it allows uppercase hex too Escape = /#{Unicode}|\\[^\r\n\f0-9a-fA-F]/ - NMChar = /[-_a-zA-Z0-9]|#{NonASCII}|#{Escape}/ - NMStart = /[_a-zA-Z]|#{NonASCII}|#{Escape}/ + NMChar = /[-_a-zA-Z0-9]|#{Escape}/ + NMStart = /[_a-zA-Z]|#{Escape}/ NL = /\r\n|\r|\n|\f/ String1 = /"(?:[^\n\r\f\\"]|\\#{NL}|#{Escape})*"?/ # FIXME: buggy regexp String2 = /'(?:[^\n\r\f\\']|\\#{NL}|#{Escape})*'?/ # FIXME: buggy regexp diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/debug.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/debug.rb index 0e78b239e..0e78b239e 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/debug.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/debug.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/delphi.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/delphi.rb index de0ee718c..de0ee718c 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/delphi.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/delphi.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/diff.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/diff.rb index 0a3b6b348..353b96691 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/diff.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/diff.rb @@ -47,11 +47,16 @@ module Scanners tokens << [match, :change] next unless match = scan(/.+/) kind = :plain - elsif scan(/(@@)((?>[^@\n]*))(@@)/) - tokens << [:begin_line, line_kind = :change] - tokens << [self[1], :change] - tokens << [self[2], :plain] - tokens << [self[3], :change] + elsif match = scan(/@@(?>[^@\n]*)@@/) + if check(/\n|$/) + tokens << [:begin_line, line_kind = :change] + else + tokens << [:open, :change] + end + tokens << [match[0,2], :change] + tokens << [match[2...-2], :plain] + tokens << [match[-2,2], :change] + tokens << [:close, :change] unless line_kind next unless match = scan(/.+/) kind = :plain elsif match = scan(/\+/) @@ -67,7 +72,7 @@ module Scanners elsif scan(/ .*/) kind = :comment elsif scan(/.+/) - tokens << [:begin_line, line_kind = :head] + tokens << [:begin_line, line_kind = :comment] kind = :plain else raise_inspect 'else case rached' diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/groovy.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/groovy.rb index 17330e64c..17330e64c 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/groovy.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/groovy.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/html.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/html.rb index 5cb110426..009a461d6 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/html.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/html.rb @@ -91,7 +91,7 @@ module Scanners end when :attribute - if scan(/#{TAG_END}/) + if scan(/#{TAG_END}/o) kind = :tag state = :initial elsif scan(/#{ATTR_NAME}/o) diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java.rb index 0d218fbe5..caf36199c 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java.rb @@ -138,7 +138,7 @@ module Scanners elsif scan(/\\./m) kind = :content elsif scan(/ \\ | $ /x) - tokens << [:close, :delimiter] + tokens << [:close, state] kind = :error state = :initial else diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java/builtin_types.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java/builtin_types.rb index 8087edd22..8087edd22 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java/builtin_types.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java/builtin_types.rb diff --git a/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java_script-0.9.6.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java_script-0.9.6.rb new file mode 100644 index 000000000..cb49b7af9 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java_script-0.9.6.rb @@ -0,0 +1,224 @@ +module CodeRay +module Scanners + + class JavaScript < Scanner + + include Streamable + + register_for :java_script + file_extension 'js' + + # The actual JavaScript keywords. + KEYWORDS = %w[ + break case catch continue default delete do else + finally for function if in instanceof new + return switch throw try typeof var void while with + ] + PREDEFINED_CONSTANTS = %w[ + false null true undefined + ] + + MAGIC_VARIABLES = %w[ this arguments ] # arguments was introduced in JavaScript 1.4 + + KEYWORDS_EXPECTING_VALUE = WordList.new.add %w[ + case delete in instanceof new return throw typeof with + ] + + # Reserved for future use. + RESERVED_WORDS = %w[ + abstract boolean byte char class debugger double enum export extends + final float goto implements import int interface long native package + private protected public short static super synchronized throws transient + volatile + ] + + IDENT_KIND = WordList.new(:ident). + add(RESERVED_WORDS, :reserved). + add(PREDEFINED_CONSTANTS, :pre_constant). + add(MAGIC_VARIABLES, :local_variable). + add(KEYWORDS, :keyword) + + ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x + UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x + REGEXP_ESCAPE = / [bBdDsSwW] /x + STRING_CONTENT_PATTERN = { + "'" => /[^\\']+/, + '"' => /[^\\"]+/, + '/' => /[^\\\/]+/, + } + KEY_CHECK_PATTERN = { + "'" => / [^\\']* (?: \\.? [^\\']* )* '? \s* : /x, + '"' => / [^\\"]* (?: \\.? [^\\"]* )* "? \s* : /x, + } + + def scan_tokens tokens, options + + state = :initial + string_delimiter = nil + value_expected = true + key_expected = false + function_expected = false + + until eos? + + kind = nil + match = nil + + case state + + when :initial + + if match = scan(/ \s+ | \\\n /x) + value_expected = true if !value_expected && match.index(?\n) + tokens << [match, :space] + next + + elsif scan(%r! // [^\n\\]* (?: \\. [^\n\\]* )* | /\* (?: .*? \*/ | .* ) !mx) + value_expected = true + kind = :comment + + elsif check(/\.?\d/) + key_expected = value_expected = false + if scan(/0[xX][0-9A-Fa-f]+/) + kind = :hex + elsif scan(/(?>0[0-7]+)(?![89.eEfF])/) + kind = :oct + elsif scan(/\d+[fF]|\d*\.\d+(?:[eE][+-]?\d+)?[fF]?|\d+[eE][+-]?\d+[fF]?/) + kind = :float + elsif scan(/\d+/) + kind = :integer + end + + elsif value_expected && match = scan(/<([[:alpha:]]\w*) (?: [^\/>]*\/> | .*?<\/\1>)/xim) + # FIXME: scan over nested tags + xml_scanner.tokenize match + value_expected = false + next + + elsif match = scan(/ [-+*=<>?:;,!&^|(\[{~%]+ | \.(?!\d) /x) + value_expected = true + last_operator = match[-1] + key_expected = (last_operator == ?{) || (last_operator == ?,) + function_expected = false + kind = :operator + + elsif scan(/ [)\]}]+ /x) + function_expected = key_expected = value_expected = false + kind = :operator + + elsif match = scan(/ [$a-zA-Z_][A-Za-z_0-9$]* /x) + kind = IDENT_KIND[match] + value_expected = (kind == :keyword) && KEYWORDS_EXPECTING_VALUE[match] + # TODO: labels + if kind == :ident + if match.index(?$) # $ allowed inside an identifier + kind = :predefined + elsif function_expected + kind = :function + elsif check(/\s*[=:]\s*function\b/) + kind = :function + elsif key_expected && check(/\s*:/) + kind = :key + end + end + function_expected = (kind == :keyword) && (match == 'function') + key_expected = false + + elsif match = scan(/["']/) + if key_expected && check(KEY_CHECK_PATTERN[match]) + state = :key + else + state = :string + end + tokens << [:open, state] + string_delimiter = match + kind = :delimiter + + elsif value_expected && (match = scan(/\/(?=\S)/)) + tokens << [:open, :regexp] + state = :regexp + string_delimiter = '/' + kind = :delimiter + + elsif scan(/ \/ /x) + value_expected = true + key_expected = false + kind = :operator + + else + getch + kind = :error + + end + + when :string, :regexp, :key + if scan(STRING_CONTENT_PATTERN[string_delimiter]) + kind = :content + elsif match = scan(/["'\/]/) + tokens << [match, :delimiter] + if state == :regexp + modifiers = scan(/[gim]+/) + tokens << [modifiers, :modifier] if modifiers && !modifiers.empty? + end + tokens << [:close, state] + string_delimiter = nil + key_expected = value_expected = false + state = :initial + next + elsif state != :regexp && (match = scan(/ \\ (?: #{ESCAPE} | #{UNICODE_ESCAPE} ) /mox)) + if string_delimiter == "'" && !(match == "\\\\" || match == "\\'") + kind = :content + else + kind = :char + end + elsif state == :regexp && scan(/ \\ (?: #{ESCAPE} | #{REGEXP_ESCAPE} | #{UNICODE_ESCAPE} ) /mox) + kind = :char + elsif scan(/\\./m) + kind = :content + elsif scan(/ \\ | $ /x) + tokens << [:close, state] + kind = :error + key_expected = value_expected = false + state = :initial + else + raise_inspect "else case \" reached; %p not handled." % peek(1), tokens + end + + else + raise_inspect 'Unknown state', tokens + + end + + match ||= matched + if $CODERAY_DEBUG and not kind + raise_inspect 'Error token %p in line %d' % + [[match, kind], line], tokens + end + raise_inspect 'Empty token', tokens unless match + + tokens << [match, kind] + + end + + if [:string, :regexp].include? state + tokens << [:close, state] + end + + tokens + end + + protected + + def reset_instance + super + @xml_scanner.reset if defined? @xml_scanner + end + + def xml_scanner + @xml_scanner ||= CodeRay.scanner :xml, :tokens => @tokens, :keep_tokens => true, :keep_state => false + end + + end + +end +end diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java_script.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java_script.rb index e2f9a5827..1f26348be 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/java_script.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/java_script.rb @@ -47,8 +47,8 @@ module Scanners '/' => /[^\\\/]+/, } KEY_CHECK_PATTERN = { - "'" => / [^\\']* (?: \\.? [^\\']* )* '? \s* : /x, - '"' => / [^\\"]* (?: \\.? [^\\"]* )* "? \s* : /x, + "'" => / (?> [^\\']* (?: \\. [^\\']* )* ) ' \s* : /mx, + '"' => / (?> [^\\"]* (?: \\. [^\\"]* )* ) " \s* : /mx, } def scan_tokens tokens, options @@ -215,7 +215,7 @@ module Scanners end def xml_scanner - @xml_scanner ||= CodeRay.scanner :xml, :tokens => @tokens, :keep_tokens => true, :keep_state => true + @xml_scanner ||= CodeRay.scanner :xml, :tokens => @tokens, :keep_tokens => true, :keep_state => false end end diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/json.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/json.rb index 33dd30f68..abe24fb04 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/json.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/json.rb @@ -13,9 +13,6 @@ module Scanners :error, :integer, :operator, :value, ] - CONSTANTS = %w( true false null ) - IDENT_KIND = WordList.new(:key).add(CONSTANTS, :value) - ESCAPE = / [bfnrt\\"\/] /x UNICODE_ESCAPE = / u[a-fA-F0-9]{4} /x @@ -23,7 +20,6 @@ module Scanners state = :initial stack = [] - string_delimiter = nil key_expected = false until eos? @@ -47,7 +43,7 @@ module Scanners when '}', ']' then stack.pop # no error recovery, but works for valid JSON end elsif match = scan(/ true | false | null /x) - kind = IDENT_KIND[match] + kind = :value elsif match = scan(/-?(?:0|[1-9]\d*)/) kind = :integer if scan(/\.\d+(?:[eE][-+]?\d+)?|[eE][-+]?\d+/) @@ -76,7 +72,7 @@ module Scanners elsif scan(/\\./m) kind = :content elsif scan(/ \\ | $ /x) - tokens << [:close, :delimiter] + tokens << [:close, state] kind = :error state = :initial else diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/nitro_xhtml.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/nitro_xhtml.rb index 6eb1d3b8b..6eb1d3b8b 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/nitro_xhtml.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/nitro_xhtml.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/php.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/php.rb index cc3e7bc97..cb93264f5 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/php.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/php.rb @@ -225,6 +225,12 @@ module Scanners end def scan_tokens tokens, options + if string.respond_to?(:encoding) + unless string.encoding == Encoding::ASCII_8BIT + self.string = string.encode Encoding::ASCII_8BIT, + :invalid => :replace, :undef => :replace, :replace => '?' + end + end if check(RE::PHP_START) || # starts with <? (match?(/\s*<\S/) && exist?(RE::PHP_START)) || # starts with tag and contains <? diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/plaintext.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/plaintext.rb index 6cbb1196c..6cbb1196c 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/plaintext.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/plaintext.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/python.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/python.rb index 1daa79fcf..1daa79fcf 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/python.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/python.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/rhtml.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/rhtml.rb index 581f1f802..378d0786d 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/rhtml.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/rhtml.rb @@ -49,12 +49,16 @@ module Scanners @html_scanner.tokenize match elsif match = scan(/#{ERB_RUBY_BLOCK}/o) - start_tag = match[/\A<%[-=]?/] + start_tag = match[/\A<%[-=#]?/] end_tag = match[/-?%?>?\z/] tokens << [:open, :inline] tokens << [start_tag, :inline_delimiter] code = match[start_tag.size .. -1 - end_tag.size] - @ruby_scanner.tokenize code + if start_tag == '<%#' + tokens << [code, :comment] + else + @ruby_scanner.tokenize code + end tokens << [end_tag, :inline_delimiter] unless end_tag.empty? tokens << [:close, :inline] diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/ruby.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/ruby.rb index 8512678c3..3cadc64d1 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/ruby.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/ruby.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 module CodeRay module Scanners @@ -28,6 +29,16 @@ module Scanners private def scan_tokens tokens, options + if string.respond_to?(:encoding) + unless string.encoding == Encoding::UTF_8 + self.string = string.encode Encoding::UTF_8, + :invalid => :replace, :undef => :replace, :replace => '?' + end + unicode = false + else + unicode = exist?(/[^\x00-\x7f]/) + end + last_token_dot = false value_expected = true heredocs = nil @@ -35,7 +46,7 @@ module Scanners state = :initial depth = nil inline_block_stack = [] - unicode = string.respond_to?(:encoding) && string.encoding.name == 'UTF-8' + patterns = Patterns # avoid constant lookup @@ -170,19 +181,28 @@ module Scanners if last_token_dot kind = if match[/^[A-Z]/] and not match?(/\(/) then :constant else :ident end else - kind = patterns::IDENT_KIND[match] - if kind == :ident and match[/^[A-Z]/] and not match[/[!?]$/] and not match?(/\(/) - kind = :constant - elsif kind == :reserved - state = patterns::DEF_NEW_STATE[match] - value_expected = :set if patterns::KEYWORDS_EXPECTING_VALUE[match] + if value_expected != :expect_colon && scan(/:(?= )/) + tokens << [match, :key] + match = ':' + kind = :operator + else + kind = patterns::IDENT_KIND[match] + if kind == :ident + if match[/\A[A-Z]/] and not match[/[!?]$/] and not match?(/\(/) + kind = :constant + end + elsif kind == :reserved + state = patterns::DEF_NEW_STATE[match] + value_expected = :set if patterns::KEYWORDS_EXPECTING_VALUE[match] + end end end value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o) elsif last_token_dot and match = scan(/#{patterns::METHOD_NAME_OPERATOR}|\(/o) kind = :ident - value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o) + value_expected = :set if check(unicode ? /#{patterns::VALUE_FOLLOWS}/uo : + /#{patterns::VALUE_FOLLOWS}/o) # OPERATORS # elsif not last_token_dot and match = scan(/ \.\.\.? | (?:\.|::)() | [,\(\)\[\]\{\}] | ==?=? /x) @@ -212,7 +232,8 @@ module Scanners kind = :delimiter state = patterns::StringState.new :string, match == '"', match # important for streaming - elsif match = scan(/#{patterns::INSTANCE_VARIABLE}/o) + elsif match = scan(unicode ? /#{patterns::INSTANCE_VARIABLE}/uo : + /#{patterns::INSTANCE_VARIABLE}/o) kind = :instance_variable elsif value_expected and match = scan(/\//) @@ -225,7 +246,8 @@ module Scanners elsif match = value_expected ? scan(/[-+]?#{patterns::NUMERIC}/o) : scan(/#{patterns::NUMERIC}/o) kind = self[1] ? :float : :integer - elsif match = scan(/#{patterns::SYMBOL}/o) + elsif match = scan(unicode ? /#{patterns::SYMBOL}/uo : + /#{patterns::SYMBOL}/o) case delim = match[1] when ?', ?" tokens << [:open, :symbol] @@ -237,11 +259,12 @@ module Scanners kind = :symbol end - elsif match = scan(/ [-+!~^]=? | [*|&]{1,2}=? | >>? /x) + elsif match = scan(/ -[>=]? | [+!~^]=? | [*|&]{1,2}=? | >>? /x) value_expected = :set kind = :operator - elsif value_expected and match = scan(/#{patterns::HEREDOC_OPEN}/o) + elsif value_expected and match = scan(unicode ? /#{patterns::HEREDOC_OPEN}/uo : + /#{patterns::HEREDOC_OPEN}/o) indented = self[1] == '-' quote = self[3] delim = self[quote ? 4 : 2] @@ -261,7 +284,8 @@ module Scanners state = patterns::StringState.new kind, interpreted, self[2] kind = :delimiter - elsif value_expected and match = scan(/#{patterns::CHARACTER}/o) + elsif value_expected and match = scan(unicode ? /#{patterns::CHARACTER}/uo : + /#{patterns::CHARACTER}/o) kind = :integer elsif match = scan(/ [\/%]=? | <(?:<|=>?)? | [?:;] /x) @@ -277,14 +301,16 @@ module Scanners state = patterns::StringState.new :shell, true, match end - elsif match = scan(/#{patterns::GLOBAL_VARIABLE}/o) + elsif match = scan(unicode ? /#{patterns::GLOBAL_VARIABLE}/uo : + /#{patterns::GLOBAL_VARIABLE}/o) kind = :global_variable - elsif match = scan(/#{patterns::CLASS_VARIABLE}/o) + elsif match = scan(unicode ? /#{patterns::CLASS_VARIABLE}/uo : + /#{patterns::CLASS_VARIABLE}/o) kind = :class_variable else - if !unicode + if !unicode && !string.respond_to?(:encoding) # check for unicode debug, $DEBUG = $DEBUG, false begin @@ -300,7 +326,7 @@ module Scanners next if unicode end kind = :error - match = getch + match = scan(unicode ? /./mu : /./m) end @@ -322,7 +348,8 @@ module Scanners kind = :operator else state = :initial - if match = scan(/ (?:#{patterns::IDENT}::)* #{patterns::IDENT} /ox) + if match = scan(unicode ? /(?:#{patterns::IDENT}::)*#{patterns::IDENT}/uo : + /(?:#{patterns::IDENT}::)*#{patterns::IDENT}/o) kind = :class else next @@ -331,9 +358,11 @@ module Scanners elsif state == :undef_expected state = :undef_comma_expected - if match = scan(/#{patterns::METHOD_NAME_EX}/o) + if match = scan(unicode ? /#{patterns::METHOD_NAME_EX}/uo : + /#{patterns::METHOD_NAME_EX}/o) kind = :method - elsif match = scan(/#{patterns::SYMBOL}/o) + elsif match = scan(unicode ? /#{patterns::SYMBOL}/uo : + /#{patterns::SYMBOL}/o) case delim = match[1] when ?', ?" tokens << [:open, :symbol] @@ -375,7 +404,9 @@ module Scanners # }}} unless kind == :error - value_expected = value_expected == :set + if value_expected = value_expected == :set + value_expected = :expect_colon if match == '?' || match == 'when' + end last_token_dot = last_token_dot == :set end diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/ruby/patterns.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/ruby/patterns.rb index 576bedae8..ba3ac8a46 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/ruby/patterns.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/ruby/patterns.rb @@ -16,7 +16,7 @@ module Scanners DEF_KEYWORDS = %w[ def ] UNDEF_KEYWORDS = %w[ undef ] ALIAS_KEYWORDS = %w[ alias ] - MODULE_KEYWORDS = %w[class module] + MODULE_KEYWORDS = %w[ class module ] DEF_NEW_STATE = WordList.new(:initial). add(DEF_KEYWORDS, :def_expected). add(UNDEF_KEYWORDS, :undef_expected). @@ -25,14 +25,26 @@ module Scanners PREDEFINED_CONSTANTS = %w[ nil true false self - DATA ARGV ARGF __FILE__ __LINE__ + DATA ARGV ARGF + __FILE__ __LINE__ __ENCODING__ ] IDENT_KIND = WordList.new(:ident). add(RESERVED_WORDS, :reserved). add(PREDEFINED_CONSTANTS, :pre_constant) - IDENT = 'ä'[/[[:alpha:]]/] == 'ä' ? /[[:alpha:]_][[:alnum:]_]*/ : /[^\W\d]\w*/ + if /\w/u === '∑' + # MRI 1.8.6, 1.8.7 + IDENT = /[^\W\d]\w*/ + else + if //.respond_to? :encoding + # MRI 1.9.1, 1.9.2 + IDENT = Regexp.new '[\p{L}\p{M}\p{Pc}\p{Sm}&&[^\x00-\x40\x5b-\x5e\x60\x7b-\x7f]][\p{L}\p{M}\p{N}\p{Pc}\p{Sm}&&[^\x00-\x2f\x3a-\x40\x5b-\x5e\x60\x7b-\x7f]]*' + else + # JRuby, Rubinius + IDENT = /[^\x00-\x40\x5b-\x5e\x60\x7b-\x7f][^\x00-\x2f\x3a-\x40\x5b-\x5e\x60\x7b-\x7f]*/ + end + end METHOD_NAME = / #{IDENT} [?!]? /ox METHOD_NAME_OPERATOR = / @@ -109,10 +121,12 @@ module Scanners # NOTE: This is not completely correct, but # nobody needs heredoc delimiters ending with \n. + # Also, delimiters starting with numbers are allowed. + # but they are more often than not a false positive. HEREDOC_OPEN = / << (-)? # $1 = float (?: - ( [A-Za-z_0-9]+ ) # $2 = delim + ( #{IDENT} ) # $2 = delim | ( ["'`\/] ) # $3 = quote, type ( [^\n]*? ) \3 # $4 = delim diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/scheme.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/scheme.rb index ba22b80be..ba22b80be 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/scheme.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/scheme.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/sql.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/sql.rb index 2b21c79d0..890758162 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/sql.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/sql.rb @@ -56,7 +56,7 @@ module CodeRay module Scanners if scan(/ \s+ | \\\n /x) kind = :space - elsif scan(/^(?:--\s?|#).*/) + elsif scan(/(?:--\s?|#).*/) kind = :comment elsif scan(%r! /\* (?: .*? \*/ | .* ) !mx) diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/xml.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/xml.rb index aeabeca86..aeabeca86 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/xml.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/xml.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/yaml.rb b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/yaml.rb index 7903ab970..7903ab970 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/scanners/yaml.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/scanners/yaml.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/style.rb b/vendor/gems/coderay-0.9.7/lib/coderay/style.rb index c2977c5f8..c2977c5f8 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/style.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/style.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/styles/_map.rb b/vendor/gems/coderay-0.9.7/lib/coderay/styles/_map.rb index 52035fea3..52035fea3 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/styles/_map.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/styles/_map.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/styles/cycnus.rb b/vendor/gems/coderay-0.9.7/lib/coderay/styles/cycnus.rb index d2a435306..da4f62691 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/styles/cycnus.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/styles/cycnus.rb @@ -33,6 +33,7 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top } } .CodeRay .line_numbers tt { font-weight: bold } .CodeRay .line_numbers .highlighted { color: red } +.CodeRay .line { display: block; float: left; width: 100%; } .CodeRay .no { padding: 0px 4px } .CodeRay .code { width: 100% } diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/styles/murphy.rb b/vendor/gems/coderay-0.9.7/lib/coderay/styles/murphy.rb index 211ab6b05..8345942fa 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/styles/murphy.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/styles/murphy.rb @@ -32,6 +32,8 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; } text-align: right; } .CodeRay .line_numbers tt { font-weight: bold; } +.CodeRay .line_numbers .highlighted { color: red } +.CodeRay .line { display: block; float: left; width: 100%; } .CodeRay .no { padding: 0px 4px; } .CodeRay .code { width: 100%; } diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/token_classes.rb b/vendor/gems/coderay-0.9.7/lib/coderay/token_classes.rb index ae35c0f68..ae35c0f68 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/token_classes.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/token_classes.rb diff --git a/vendor/plugins/coderay-0.9.2/lib/coderay/tokens.rb b/vendor/gems/coderay-0.9.7/lib/coderay/tokens.rb index b01a4ddbd..6ac5f4405 100644 --- a/vendor/plugins/coderay-0.9.2/lib/coderay/tokens.rb +++ b/vendor/gems/coderay-0.9.7/lib/coderay/tokens.rb @@ -7,29 +7,30 @@ module CodeRay # # A token is not a special object, just a two-element Array # consisting of + # * the _token_ _text_ (the original source of the token in a String) or + # a _token_ _action_ (:open, :close, :begin_line, :end_line) # * the _token_ _kind_ (a Symbol representing the type of the token) - # * the _token_ _text_ (the original source of the token in a String) # # A token looks like this: # - # [:comment, '# It looks like this'] - # [:float, '3.1415926'] - # [:error, '$^'] + # ['# It looks like this', :comment] + # ['3.1415926', :float] + # ['$^', :error] # - # Some scanners also yield some kind of sub-tokens, represented by special - # token texts, namely :open and :close . + # Some scanners also yield sub-tokens, represented by special + # token actions, namely :open and :close. # # The Ruby scanner, for example, splits "a string" into: # # [ # [:open, :string], - # [:delimiter, '"'], - # [:content, 'a string'], - # [:delimiter, '"'], + # ['"', :delimiter], + # ['a string', :content], + # ['"', :delimiter], # [:close, :string] # ] # - # Tokens is also the interface between Scanners and Encoders: + # Tokens is the interface between Scanners and Encoders: # The input is split and saved into a Tokens object. The Encoder # then builds the output from this object. # @@ -43,6 +44,9 @@ module CodeRay # Tokens gives you the power to handle pre-scanned code very easily: # You can convert it to a webpage, a YAML file, or dump it into a gzip'ed string # that you put in your DB. + # + # It also allows you to generate tokens directly (without using a scanner), + # to load them from a file, and still use any Encoder that CodeRay provides. # # Tokens' subclass TokenStream allows streaming to save memory. class Tokens < Array @@ -239,9 +243,7 @@ module CodeRay size end - # The total size of the tokens. - # Should be equal to the input size before - # scanning. + # Return all text tokens joined into a single string. def text map { |t, k| t if t.is_a? ::String }.join end @@ -301,11 +303,11 @@ module CodeRay # # require 'coderay' # - # token_stream = CodeRay::TokenStream.new do |kind, text| + # token_stream = CodeRay::TokenStream.new do |text, kind| # puts 'kind: %s, text size: %d.' % [kind, text.size] # end # - # token_stream << [:regexp, '/\d+/'] + # token_stream << ['/\d+/', :regexp] # #-> kind: rexpexp, text size: 5. # def initialize &block diff --git a/vendor/gems/coderay-0.9.7/test/functional/basic.rb b/vendor/gems/coderay-0.9.7/test/functional/basic.rb new file mode 100644 index 000000000..8ecd3d35f --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/basic.rb @@ -0,0 +1,122 @@ +require 'test/unit' +require 'coderay' + +class BasicTest < Test::Unit::TestCase + + def test_version + assert_nothing_raised do + assert_match(/\A\d\.\d\.\d\z/, CodeRay::VERSION) + end + end + + RUBY_TEST_CODE = 'puts "Hello, World!"' + + RUBY_TEST_TOKENS = [ + ['puts', :ident], + [' ', :space], + [:open, :string], + ['"', :delimiter], + ['Hello, World!', :content], + ['"', :delimiter], + [:close, :string] + ] + def test_simple_scan + assert_nothing_raised do + assert_equal RUBY_TEST_TOKENS, CodeRay.scan(RUBY_TEST_CODE, :ruby).to_ary + end + end + + RUBY_TEST_HTML = 'puts <span class="s"><span class="dl">"</span>' + + '<span class="k">Hello, World!</span><span class="dl">"</span></span>' + def test_simple_highlight + assert_nothing_raised do + assert_equal RUBY_TEST_HTML, CodeRay.scan(RUBY_TEST_CODE, :ruby).html + end + end + + def test_duo + assert_equal(RUBY_TEST_CODE, + CodeRay::Duo[:plain, :plain].highlight(RUBY_TEST_CODE)) + assert_equal(RUBY_TEST_CODE, + CodeRay::Duo[:plain => :plain].highlight(RUBY_TEST_CODE)) + end + + def test_duo_stream + assert_equal(RUBY_TEST_CODE, + CodeRay::Duo[:plain, :plain].highlight(RUBY_TEST_CODE, :stream => true)) + end + + def test_comment_filter + assert_equal <<-EXPECTED, CodeRay.scan(<<-INPUT, :ruby).comment_filter.text +#!/usr/bin/env ruby + +code + +more code + EXPECTED +#!/usr/bin/env ruby +=begin +A multi-line comment. +=end +code +# A single-line comment. +more code # and another comment, in-line. + INPUT + end + + def test_lines_of_code + assert_equal 2, CodeRay.scan(<<-INPUT, :ruby).lines_of_code +#!/usr/bin/env ruby +=begin +A multi-line comment. +=end +code +# A single-line comment. +more code # and another comment, in-line. + INPUT + rHTML = <<-RHTML +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> + <title><%= controller.controller_name.titleize %>: <%= controller.action_name %></title> + <%= stylesheet_link_tag 'scaffold' %> +</head> +<body> + +<p style="color: green"><%= flash[:notice] %></p> + +<div id="main"> + <%= yield %> +</div> + +</body> +</html> + RHTML + assert_equal 0, CodeRay.scan(rHTML, :html).lines_of_code + assert_equal 0, CodeRay.scan(rHTML, :php).lines_of_code + assert_equal 0, CodeRay.scan(rHTML, :yaml).lines_of_code + assert_equal 4, CodeRay.scan(rHTML, :rhtml).lines_of_code + end + + def test_rubygems_not_loaded + assert_equal nil, defined? Gem + end if ENV['check_rubygems'] && RUBY_VERSION < '1.9' + + def test_list_of_encoders + assert_kind_of(Array, CodeRay::Encoders.list) + assert CodeRay::Encoders.list.include?('count') + end + + def test_list_of_scanners + assert_kind_of(Array, CodeRay::Scanners.list) + assert CodeRay::Scanners.list.include?('plaintext') + end + + def test_scan_a_frozen_string + CodeRay.scan RUBY_VERSION, :ruby + end + +end diff --git a/vendor/gems/coderay-0.9.7/test/functional/basic.rbc b/vendor/gems/coderay-0.9.7/test/functional/basic.rbc new file mode 100644 index 000000000..1e114cf75 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/basic.rbc @@ -0,0 +1,2022 @@ +!RBIX +0 +x +M +1 +n +n +x +10 +__script__ +i +53 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +47 +49 +1 +1 +15 +99 +7 +3 +45 +4 +5 +43 +6 +43 +7 +65 +49 +8 +3 +13 +99 +12 +7 +9 +12 +7 +10 +12 +65 +12 +49 +11 +4 +15 +49 +9 +0 +15 +2 +11 +I +6 +I +0 +I +0 +I +0 +n +p +12 +s +9 +test/unit +x +7 +require +s +7 +coderay +x +9 +BasicTest +x +4 +Test +n +x +4 +Unit +x +8 +TestCase +x +10 +open_class +x +14 +__class_init__ +M +1 +n +n +x +9 +BasicTest +i +263 +5 +66 +99 +7 +0 +7 +1 +65 +67 +49 +2 +0 +49 +3 +4 +15 +65 +7 +4 +7 +5 +64 +49 +6 +2 +15 +65 +7 +7 +7 +8 +64 +7 +9 +35 +2 +7 +10 +64 +7 +11 +35 +2 +7 +12 +7 +13 +35 +2 +7 +14 +64 +7 +15 +35 +2 +7 +16 +64 +7 +17 +35 +2 +7 +14 +64 +7 +15 +35 +2 +7 +18 +7 +13 +35 +2 +35 +7 +49 +6 +2 +15 +99 +7 +19 +7 +20 +65 +67 +49 +2 +0 +49 +3 +4 +15 +65 +7 +21 +7 +22 +64 +7 +23 +64 +81 +24 +49 +6 +2 +15 +99 +7 +25 +7 +26 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +27 +7 +28 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +29 +7 +30 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +31 +7 +32 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +33 +7 +34 +65 +67 +49 +2 +0 +49 +3 +4 +15 +45 +35 +36 +7 +37 +64 +49 +38 +1 +13 +9 +202 +15 +45 +39 +40 +7 +41 +64 +84 +42 +9 +219 +99 +7 +43 +7 +44 +65 +67 +49 +2 +0 +49 +3 +4 +8 +220 +1 +15 +99 +7 +45 +7 +46 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +47 +7 +48 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +49 +7 +50 +65 +67 +49 +2 +0 +49 +3 +4 +11 +I +a +I +0 +I +0 +I +0 +n +p +51 +x +12 +test_version +M +1 +n +n +x +12 +test_version +i +8 +5 +56 +0 +47 +50 +1 +0 +11 +I +2 +I +0 +I +0 +I +0 +n +p +2 +M +1 +p +2 +x +9 +for_block +t +n +x +12 +test_version +i +29 +5 +7 +0 +13 +70 +9 +19 +15 +44 +43 +1 +7 +2 +78 +49 +3 +2 +6 +0 +45 +4 +5 +43 +6 +47 +49 +7 +2 +11 +I +5 +I +0 +I +0 +I +0 +I +-2 +p +8 +n +x +6 +Regexp +s +14 +\A\d\.\d\.\d\z +x +3 +new +x +7 +CodeRay +n +x +7 +VERSION +x +12 +assert_match +p +5 +I +0 +I +7 +I +0 +I +8 +I +1d +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +21 +assert_nothing_raised +p +5 +I +0 +I +6 +I +0 +I +7 +I +8 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +17 +method_visibility +x +15 +add_defn_method +x +14 +RUBY_TEST_CODE +s +20 +puts "Hello, World!" +x +9 +const_set +x +16 +RUBY_TEST_TOKENS +s +4 +puts +x +5 +ident +s +1 + +x +5 +space +x +4 +open +x +6 +string +s +1 +" +x +9 +delimiter +s +13 +Hello, World! +x +7 +content +x +5 +close +x +16 +test_simple_scan +M +1 +n +n +x +16 +test_simple_scan +i +8 +5 +56 +0 +47 +50 +1 +0 +11 +I +2 +I +0 +I +0 +I +0 +n +p +2 +M +1 +p +2 +x +9 +for_block +t +n +x +16 +test_simple_scan +i +23 +5 +45 +0 +1 +45 +2 +3 +45 +4 +5 +7 +6 +49 +7 +2 +49 +8 +0 +47 +49 +9 +2 +11 +I +6 +I +0 +I +0 +I +0 +I +-2 +p +10 +x +16 +RUBY_TEST_TOKENS +n +x +7 +CodeRay +n +x +14 +RUBY_TEST_CODE +n +x +4 +ruby +x +4 +scan +x +6 +to_ary +x +12 +assert_equal +p +5 +I +0 +I +18 +I +0 +I +19 +I +17 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +21 +assert_nothing_raised +p +5 +I +0 +I +17 +I +0 +I +18 +I +8 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +14 +RUBY_TEST_HTML +s +51 +puts <span class="s"><span class="dl">"</span> +s +73 +<span class="k">Hello, World!</span><span class="dl">"</span></span> +x +1 ++ +x +21 +test_simple_highlight +M +1 +n +n +x +21 +test_simple_highlight +i +8 +5 +56 +0 +47 +50 +1 +0 +11 +I +2 +I +0 +I +0 +I +0 +n +p +2 +M +1 +p +2 +x +9 +for_block +t +n +x +21 +test_simple_highlight +i +23 +5 +45 +0 +1 +45 +2 +3 +45 +4 +5 +7 +6 +49 +7 +2 +49 +8 +0 +47 +49 +9 +2 +11 +I +6 +I +0 +I +0 +I +0 +I +-2 +p +10 +x +14 +RUBY_TEST_HTML +n +x +7 +CodeRay +n +x +14 +RUBY_TEST_CODE +n +x +4 +ruby +x +4 +scan +x +4 +html +x +12 +assert_equal +p +5 +I +0 +I +20 +I +0 +I +21 +I +17 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +21 +assert_nothing_raised +p +5 +I +0 +I +1f +I +0 +I +20 +I +8 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +8 +test_duo +M +1 +n +n +x +8 +test_duo +i +66 +5 +45 +0 +1 +45 +2 +3 +43 +4 +7 +5 +7 +5 +49 +6 +2 +45 +0 +7 +49 +8 +1 +47 +49 +9 +2 +15 +5 +45 +0 +10 +45 +2 +11 +43 +4 +44 +43 +12 +79 +49 +13 +1 +13 +7 +5 +7 +5 +49 +14 +2 +15 +49 +6 +1 +45 +0 +15 +49 +8 +1 +47 +49 +9 +2 +11 +I +7 +I +0 +I +0 +I +0 +n +p +16 +x +14 +RUBY_TEST_CODE +n +x +7 +CodeRay +n +x +3 +Duo +x +5 +plain +x +2 +[] +n +x +9 +highlight +x +12 +assert_equal +n +n +x +4 +Hash +x +16 +new_from_literal +x +3 +[]= +n +p +15 +I +0 +I +25 +I +0 +I +26 +I +4 +I +27 +I +16 +I +26 +I +1b +I +28 +I +1f +I +29 +I +3d +I +28 +I +42 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +15 +test_duo_stream +M +1 +n +n +x +15 +test_duo_stream +i +42 +5 +45 +0 +1 +45 +2 +3 +43 +4 +7 +5 +7 +5 +49 +6 +2 +45 +0 +7 +44 +43 +8 +79 +49 +9 +1 +13 +7 +10 +2 +49 +11 +2 +15 +49 +12 +2 +47 +49 +13 +2 +11 +I +8 +I +0 +I +0 +I +0 +n +p +14 +x +14 +RUBY_TEST_CODE +n +x +7 +CodeRay +n +x +3 +Duo +x +5 +plain +x +2 +[] +n +x +4 +Hash +x +16 +new_from_literal +x +6 +stream +x +3 +[]= +x +9 +highlight +x +12 +assert_equal +p +9 +I +0 +I +2c +I +0 +I +2d +I +4 +I +2e +I +25 +I +2d +I +2a +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +19 +test_comment_filter +M +1 +n +n +x +19 +test_comment_filter +i +26 +5 +7 +0 +64 +45 +1 +2 +7 +3 +64 +7 +4 +49 +5 +2 +49 +6 +0 +49 +7 +0 +47 +49 +8 +2 +11 +I +5 +I +0 +I +0 +I +0 +n +p +9 +s +39 +#!/usr/bin/env ruby + +code + +more code + +x +7 +CodeRay +n +s +127 +#!/usr/bin/env ruby +=begin +A multi-line comment. +=end +code +# A single-line comment. +more code # and another comment, in-line. + +x +4 +ruby +x +4 +scan +x +14 +comment_filter +x +4 +text +x +12 +assert_equal +p +5 +I +0 +I +31 +I +0 +I +32 +I +1a +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +18 +test_lines_of_code +M +1 +n +n +x +18 +test_lines_of_code +i +108 +5 +80 +45 +0 +1 +7 +2 +64 +7 +3 +49 +4 +2 +49 +5 +0 +47 +49 +6 +2 +15 +7 +7 +64 +19 +0 +15 +5 +78 +45 +0 +8 +20 +0 +7 +9 +49 +4 +2 +49 +5 +0 +47 +49 +6 +2 +15 +5 +78 +45 +0 +10 +20 +0 +7 +11 +49 +4 +2 +49 +5 +0 +47 +49 +6 +2 +15 +5 +78 +45 +0 +12 +20 +0 +7 +13 +49 +4 +2 +49 +5 +0 +47 +49 +6 +2 +15 +5 +4 +4 +45 +0 +14 +20 +0 +7 +15 +49 +4 +2 +49 +5 +0 +47 +49 +6 +2 +11 +I +6 +I +1 +I +0 +I +0 +n +p +16 +x +7 +CodeRay +n +s +127 +#!/usr/bin/env ruby +=begin +A multi-line comment. +=end +code +# A single-line comment. +more code # and another comment, in-line. + +x +4 +ruby +x +4 +scan +x +13 +lines_of_code +x +12 +assert_equal +s +514 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> + <title><%= controller.controller_name.titleize %>: <%= controller.action_name %></title> + <%= stylesheet_link_tag 'scaffold' %> +</head> +<body> + +<p style="color: green"><%= flash[:notice] %></p> + +<div id="main"> + <%= yield %> +</div> + +</body> +</html> + +n +x +4 +html +n +x +3 +php +n +x +4 +yaml +n +x +5 +rhtml +p +15 +I +0 +I +43 +I +0 +I +44 +I +15 +I +4d +I +1b +I +62 +I +2f +I +63 +I +43 +I +64 +I +57 +I +65 +I +6c +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +1 +x +5 +rHTML +x +3 +ENV +n +s +14 +check_rubygems +x +2 +[] +x +12 +RUBY_VERSION +n +s +3 +1.9 +x +1 +< +x +24 +test_rubygems_not_loaded +M +1 +n +n +x +24 +test_rubygems_not_loaded +i +34 +5 +1 +26 +93 +0 +15 +29 +17 +0 +7 +0 +98 +1 +1 +30 +8 +23 +25 +92 +0 +27 +8 +28 +15 +7 +2 +8 +29 +1 +47 +49 +3 +2 +11 +I +4 +I +0 +I +0 +I +0 +n +p +4 +x +3 +Gem +x +16 +vm_const_defined +s +8 +constant +x +12 +assert_equal +p +5 +I +0 +I +68 +I +0 +I +69 +I +22 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +21 +test_list_of_encoders +M +1 +n +n +x +21 +test_list_of_encoders +i +37 +5 +45 +0 +1 +45 +2 +3 +43 +4 +49 +5 +0 +47 +49 +6 +2 +15 +5 +45 +2 +7 +43 +4 +49 +5 +0 +7 +8 +64 +49 +9 +1 +47 +49 +10 +1 +11 +I +3 +I +0 +I +0 +I +0 +n +p +11 +x +5 +Array +n +x +7 +CodeRay +n +x +8 +Encoders +x +4 +list +x +14 +assert_kind_of +n +s +5 +count +x +8 +include? +x +6 +assert +p +7 +I +0 +I +6c +I +0 +I +6d +I +11 +I +6e +I +25 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +21 +test_list_of_scanners +M +1 +n +n +x +21 +test_list_of_scanners +i +37 +5 +45 +0 +1 +45 +2 +3 +43 +4 +49 +5 +0 +47 +49 +6 +2 +15 +5 +45 +2 +7 +43 +4 +49 +5 +0 +7 +8 +64 +49 +9 +1 +47 +49 +10 +1 +11 +I +3 +I +0 +I +0 +I +0 +n +p +11 +x +5 +Array +n +x +7 +CodeRay +n +x +8 +Scanners +x +4 +list +x +14 +assert_kind_of +n +s +9 +plaintext +x +8 +include? +x +6 +assert +p +7 +I +0 +I +71 +I +0 +I +72 +I +11 +I +73 +I +25 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +25 +test_scan_a_frozen_string +M +1 +n +n +x +25 +test_scan_a_frozen_string +i +12 +45 +0 +1 +45 +2 +3 +7 +4 +49 +5 +2 +11 +I +3 +I +0 +I +0 +I +0 +n +p +6 +x +7 +CodeRay +n +x +12 +RUBY_VERSION +n +x +4 +ruby +x +4 +scan +p +5 +I +0 +I +76 +I +0 +I +77 +I +c +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +p +51 +I +2 +I +6 +I +10 +I +c +I +1a +I +e +I +1d +I +f +I +24 +I +10 +I +2b +I +11 +I +31 +I +12 +I +38 +I +13 +I +3f +I +14 +I +46 +I +15 +I +52 +I +17 +I +60 +I +1d +I +63 +I +1d +I +66 +I +1e +I +6f +I +1f +I +7d +I +25 +I +8b +I +2c +I +99 +I +31 +I +a7 +I +43 +I +b5 +I +6a +I +cc +I +68 +I +db +I +6a +I +dd +I +6c +I +eb +I +71 +I +f9 +I +76 +I +107 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 +x +13 +attach_method +p +7 +I +0 +I +1 +I +9 +I +2 +I +12 +I +4 +I +35 +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/basic.rb +p +0 diff --git a/vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rb b/vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rb new file mode 100644 index 000000000..efd057821 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rb @@ -0,0 +1,77 @@ +require 'test/unit' +$:.unshift 'lib' +require 'coderay' + +begin + require 'rubygems' unless defined? Gem + gem 'RedCloth', '>= 4.0.3' rescue nil + require 'redcloth' +rescue LoadError + warn 'RedCloth not found - skipping for_redcloth tests.' +end + +class BasicTest < Test::Unit::TestCase + + def test_for_redcloth + require 'coderay/for_redcloth' + assert_equal "<p><span lang=\"ruby\" class=\"CodeRay\">puts <span style=\"background-color:#fff0f0;color:#D20\"><span style=\"color:#710\">"</span><span style=\"\">Hello, World!</span><span style=\"color:#710\">"</span></span></span></p>", + RedCloth.new('@[ruby]puts "Hello, World!"@').to_html + assert_equal <<-BLOCKCODE.chomp, +<div lang="ruby" class="CodeRay"> + <div class="code"><pre>puts <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Hello, World!</span><span style="color:#710">"</span></span></pre></div> +</div> + BLOCKCODE + RedCloth.new('bc[ruby]. puts "Hello, World!"').to_html + end + + def test_for_redcloth_no_lang + require 'coderay/for_redcloth' + assert_equal "<p><code>puts \"Hello, World!\"</code></p>", + RedCloth.new('@puts "Hello, World!"@').to_html + assert_equal <<-BLOCKCODE.chomp, +<pre><code>puts \"Hello, World!\"</code></pre> + BLOCKCODE + RedCloth.new('bc. puts "Hello, World!"').to_html + end + + def test_for_redcloth_style + require 'coderay/for_redcloth' + assert_equal <<-BLOCKCODE.chomp, +<pre style=\"color: red;\"><code style=\"color: red;\">puts \"Hello, World!\"</code></pre> + BLOCKCODE + RedCloth.new('bc{color: red}. puts "Hello, World!"').to_html + end + + def test_for_redcloth_escapes + require 'coderay/for_redcloth' + assert_equal '<p><span lang="ruby" class="CodeRay">></span></p>', + RedCloth.new('@[ruby]>@').to_html + assert_equal <<-BLOCKCODE.chomp, +<div lang="ruby" class="CodeRay"> + <div class="code"><pre>&</pre></div> +</div> + BLOCKCODE + RedCloth.new('bc[ruby]. &').to_html + end + + def test_for_redcloth_escapes2 + require 'coderay/for_redcloth' + assert_equal "<p><span lang=\"c\" class=\"CodeRay\"><span style=\"color:#579\">#include</span> <span style=\"color:#B44;font-weight:bold\"><test.h></span></span></p>", + RedCloth.new('@[c]#include <test.h>@').to_html + end + + # See http://jgarber.lighthouseapp.com/projects/13054/tickets/124-code-markup-does-not-allow-brackets. + def test_for_redcloth_false_positive + require 'coderay/for_redcloth' + assert_equal '<p><code>[project]_dff.skjd</code></p>', + RedCloth.new('@[project]_dff.skjd@').to_html + # false positive, but expected behavior / known issue + assert_equal "<p><span lang=\"ruby\" class=\"CodeRay\">_dff.skjd</span></p>", + RedCloth.new('@[ruby]_dff.skjd@').to_html + assert_equal <<-BLOCKCODE.chomp, +<pre><code>[project]_dff.skjd</code></pre> + BLOCKCODE + RedCloth.new('bc. [project]_dff.skjd').to_html + end + +end if defined? RedCloth
\ No newline at end of file diff --git a/vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rbc b/vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rbc new file mode 100644 index 000000000..09a7fc84c --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/for_redcloth.rbc @@ -0,0 +1,1708 @@ +!RBIX +0 +x +M +1 +n +n +x +10 +__script__ +i +249 +5 +7 +0 +64 +47 +49 +1 +1 +15 +99 +43 +2 +7 +3 +49 +4 +1 +7 +5 +64 +49 +6 +1 +15 +5 +7 +7 +64 +47 +49 +1 +1 +15 +26 +93 +0 +15 +29 +144 +0 +26 +93 +1 +15 +29 +55 +0 +7 +8 +98 +9 +1 +30 +8 +61 +25 +92 +1 +27 +8 +66 +15 +7 +10 +8 +67 +1 +9 +72 +1 +8 +80 +5 +7 +11 +64 +47 +49 +1 +1 +15 +26 +93 +2 +15 +29 +102 +0 +5 +7 +12 +64 +7 +13 +64 +47 +49 +14 +2 +30 +8 +129 +26 +93 +3 +15 +24 +13 +45 +15 +16 +12 +49 +17 +1 +10 +119 +8 +124 +15 +1 +25 +8 +129 +15 +92 +3 +27 +34 +92 +2 +27 +15 +5 +7 +18 +64 +47 +49 +1 +1 +30 +8 +178 +26 +93 +4 +15 +24 +13 +45 +19 +20 +12 +49 +17 +1 +10 +161 +8 +173 +15 +5 +7 +21 +64 +47 +49 +22 +1 +25 +8 +178 +15 +92 +4 +27 +34 +92 +0 +27 +15 +26 +93 +5 +15 +29 +197 +0 +7 +23 +98 +9 +1 +30 +8 +203 +25 +92 +5 +27 +8 +208 +15 +7 +10 +8 +209 +1 +9 +245 +99 +7 +24 +45 +25 +26 +43 +27 +43 +28 +65 +49 +29 +3 +13 +99 +12 +7 +30 +12 +7 +31 +12 +65 +12 +49 +32 +4 +15 +49 +30 +0 +8 +246 +1 +15 +2 +11 +I +c +I +0 +I +0 +I +0 +n +p +33 +s +9 +test/unit +x +7 +require +x +7 +Globals +x +2 +$: +x +2 +[] +s +3 +lib +x +2 +<< +s +7 +coderay +x +3 +Gem +x +16 +vm_const_defined +s +8 +constant +s +8 +rubygems +s +8 +RedCloth +s +8 +>= 4.0.3 +x +3 +gem +x +13 +StandardError +n +x +3 +=== +s +8 +redcloth +x +9 +LoadError +n +s +49 +RedCloth not found - skipping for_redcloth tests. +x +4 +warn +x +8 +RedCloth +x +9 +BasicTest +x +4 +Test +n +x +4 +Unit +x +8 +TestCase +x +10 +open_class +x +14 +__class_init__ +M +1 +n +n +x +9 +BasicTest +i +86 +5 +66 +99 +7 +0 +7 +1 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +4 +7 +5 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +6 +7 +7 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +8 +7 +9 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +10 +7 +11 +65 +67 +49 +2 +0 +49 +3 +4 +15 +99 +7 +12 +7 +13 +65 +67 +49 +2 +0 +49 +3 +4 +11 +I +5 +I +0 +I +0 +I +0 +n +p +14 +x +17 +test_for_redcloth +M +1 +n +n +x +17 +test_for_redcloth +i +96 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +45 +3 +4 +13 +71 +5 +47 +9 +37 +47 +49 +6 +0 +13 +7 +7 +64 +47 +49 +8 +1 +15 +8 +43 +7 +7 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +15 +5 +7 +11 +64 +49 +12 +0 +45 +3 +13 +13 +71 +5 +47 +9 +82 +47 +49 +6 +0 +13 +7 +14 +64 +47 +49 +8 +1 +15 +8 +88 +7 +14 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +11 +I +5 +I +0 +I +0 +I +0 +n +p +15 +s +20 +coderay/for_redcloth +x +7 +require +s +221 +<p><span lang="ruby" class="CodeRay">puts <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Hello, World!</span><span style="color:#710">"</span></span></span></p> +x +8 +RedCloth +n +x +3 +new +x +8 +allocate +s +28 +@[ruby]puts "Hello, World!"@ +x +10 +initialize +x +7 +to_html +x +12 +assert_equal +s +252 +<div lang="ruby" class="CodeRay"> + <div class="code"><pre>puts <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Hello, World!</span><span style="color:#710">"</span></span></pre></div> +</div> + +x +5 +chomp +n +s +30 +bc[ruby]. puts "Hello, World!" +p +17 +I +0 +I +f +I +0 +I +10 +I +9 +I +11 +I +d +I +12 +I +2e +I +11 +I +33 +I +13 +I +3a +I +18 +I +5b +I +13 +I +60 +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 +x +17 +method_visibility +x +15 +add_defn_method +x +25 +test_for_redcloth_no_lang +M +1 +n +n +x +25 +test_for_redcloth_no_lang +i +96 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +45 +3 +4 +13 +71 +5 +47 +9 +37 +47 +49 +6 +0 +13 +7 +7 +64 +47 +49 +8 +1 +15 +8 +43 +7 +7 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +15 +5 +7 +11 +64 +49 +12 +0 +45 +3 +13 +13 +71 +5 +47 +9 +82 +47 +49 +6 +0 +13 +7 +14 +64 +47 +49 +8 +1 +15 +8 +88 +7 +14 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +11 +I +5 +I +0 +I +0 +I +0 +n +p +15 +s +20 +coderay/for_redcloth +x +7 +require +s +40 +<p><code>puts "Hello, World!"</code></p> +x +8 +RedCloth +n +x +3 +new +x +8 +allocate +s +22 +@puts "Hello, World!"@ +x +10 +initialize +x +7 +to_html +x +12 +assert_equal +s +45 +<pre><code>puts "Hello, World!"</code></pre> + +x +5 +chomp +n +s +24 +bc. puts "Hello, World!" +p +17 +I +0 +I +1b +I +0 +I +1c +I +9 +I +1d +I +d +I +1e +I +2e +I +1d +I +33 +I +1f +I +3a +I +22 +I +5b +I +1f +I +60 +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 +x +23 +test_for_redcloth_style +M +1 +n +n +x +23 +test_for_redcloth_style +i +54 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +49 +3 +0 +45 +4 +5 +13 +71 +6 +47 +9 +40 +47 +49 +7 +0 +13 +7 +8 +64 +47 +49 +9 +1 +15 +8 +46 +7 +8 +64 +49 +6 +1 +49 +10 +0 +47 +49 +11 +2 +11 +I +5 +I +0 +I +0 +I +0 +n +p +12 +s +20 +coderay/for_redcloth +x +7 +require +s +85 +<pre style="color: red;"><code style="color: red;">puts "Hello, World!"</code></pre> + +x +5 +chomp +x +8 +RedCloth +n +x +3 +new +x +8 +allocate +s +36 +bc{color: red}. puts "Hello, World!" +x +10 +initialize +x +7 +to_html +x +12 +assert_equal +p +11 +I +0 +I +25 +I +0 +I +26 +I +9 +I +27 +I +10 +I +2a +I +31 +I +27 +I +36 +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 +x +25 +test_for_redcloth_escapes +M +1 +n +n +x +25 +test_for_redcloth_escapes +i +96 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +45 +3 +4 +13 +71 +5 +47 +9 +37 +47 +49 +6 +0 +13 +7 +7 +64 +47 +49 +8 +1 +15 +8 +43 +7 +7 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +15 +5 +7 +11 +64 +49 +12 +0 +45 +3 +13 +13 +71 +5 +47 +9 +82 +47 +49 +6 +0 +13 +7 +14 +64 +47 +49 +8 +1 +15 +8 +88 +7 +14 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +11 +I +5 +I +0 +I +0 +I +0 +n +p +15 +s +20 +coderay/for_redcloth +x +7 +require +s +52 +<p><span lang="ruby" class="CodeRay">></span></p> +x +8 +RedCloth +n +x +3 +new +x +8 +allocate +s +9 +@[ruby]>@ +x +10 +initialize +x +7 +to_html +x +12 +assert_equal +s +84 +<div lang="ruby" class="CodeRay"> + <div class="code"><pre>&</pre></div> +</div> + +x +5 +chomp +n +s +11 +bc[ruby]. & +p +17 +I +0 +I +2d +I +0 +I +2e +I +9 +I +2f +I +d +I +30 +I +2e +I +2f +I +33 +I +31 +I +3a +I +36 +I +5b +I +31 +I +60 +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 +x +26 +test_for_redcloth_escapes2 +M +1 +n +n +x +26 +test_for_redcloth_escapes2 +i +51 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +45 +3 +4 +13 +71 +5 +47 +9 +37 +47 +49 +6 +0 +13 +7 +7 +64 +47 +49 +8 +1 +15 +8 +43 +7 +7 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +11 +I +5 +I +0 +I +0 +I +0 +n +p +11 +s +20 +coderay/for_redcloth +x +7 +require +s +149 +<p><span lang="c" class="CodeRay"><span style="color:#579">#include</span> <span style="color:#B44;font-weight:bold"><test.h></span></span></p> +x +8 +RedCloth +n +x +3 +new +x +8 +allocate +s +22 +@[c]#include <test.h>@ +x +10 +initialize +x +7 +to_html +x +12 +assert_equal +p +11 +I +0 +I +39 +I +0 +I +3a +I +9 +I +3b +I +d +I +3c +I +2e +I +3b +I +33 +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 +x +32 +test_for_redcloth_false_positive +M +1 +n +n +x +32 +test_for_redcloth_false_positive +i +138 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +45 +3 +4 +13 +71 +5 +47 +9 +37 +47 +49 +6 +0 +13 +7 +7 +64 +47 +49 +8 +1 +15 +8 +43 +7 +7 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +15 +5 +7 +11 +64 +45 +3 +12 +13 +71 +5 +47 +9 +79 +47 +49 +6 +0 +13 +7 +13 +64 +47 +49 +8 +1 +15 +8 +85 +7 +13 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +15 +5 +7 +14 +64 +49 +15 +0 +45 +3 +16 +13 +71 +5 +47 +9 +124 +47 +49 +6 +0 +13 +7 +17 +64 +47 +49 +8 +1 +15 +8 +130 +7 +17 +64 +49 +5 +1 +49 +9 +0 +47 +49 +10 +2 +11 +I +5 +I +0 +I +0 +I +0 +n +p +18 +s +20 +coderay/for_redcloth +x +7 +require +s +38 +<p><code>[project]_dff.skjd</code></p> +x +8 +RedCloth +n +x +3 +new +x +8 +allocate +s +20 +@[project]_dff.skjd@ +x +10 +initialize +x +7 +to_html +x +12 +assert_equal +s +57 +<p><span lang="ruby" class="CodeRay">_dff.skjd</span></p> +n +s +17 +@[ruby]_dff.skjd@ +s +43 +<pre><code>[project]_dff.skjd</code></pre> + +x +5 +chomp +n +s +22 +bc. [project]_dff.skjd +p +23 +I +0 +I +40 +I +0 +I +41 +I +9 +I +42 +I +d +I +43 +I +2e +I +42 +I +33 +I +45 +I +37 +I +46 +I +58 +I +45 +I +5d +I +47 +I +64 +I +4a +I +85 +I +47 +I +8a +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 +p +13 +I +2 +I +f +I +10 +I +1b +I +1e +I +25 +I +2c +I +2d +I +3a +I +39 +I +48 +I +40 +I +56 +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 +x +13 +attach_method +p +23 +I +0 +I +1 +I +9 +I +2 +I +18 +I +3 +I +21 +I +6 +I +51 +I +7 +I +85 +I +8 +I +95 +I +9 +I +a2 +I +a +I +b6 +I +4d +I +d3 +I +d +I +f5 +I +4d +I +f9 +x +62 +/Users/murphy/ruby/coderay-0.9/test/functional/for_redcloth.rb +p +0 diff --git a/vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rb b/vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rb new file mode 100644 index 000000000..25bbc93a6 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rb @@ -0,0 +1,11 @@ +require 'test/unit' +require 'coderay' + +class PluginScannerTest < Test::Unit::TestCase + + def test_load + require File.join(File.dirname(__FILE__), 'vhdl') + assert_equal 'VHDL', CodeRay.scanner(:vhdl).class.name + end + +end diff --git a/vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rbc b/vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rbc new file mode 100644 index 000000000..ef61d3407 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/load_plugin_scanner.rbc @@ -0,0 +1,317 @@ +!RBIX +0 +x +M +1 +n +n +x +10 +__script__ +i +53 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +47 +49 +1 +1 +15 +99 +7 +3 +45 +4 +5 +43 +6 +43 +7 +65 +49 +8 +3 +13 +99 +12 +7 +9 +12 +7 +10 +12 +65 +12 +49 +11 +4 +15 +49 +9 +0 +15 +2 +11 +I +6 +I +0 +I +0 +I +0 +n +p +12 +s +9 +test/unit +x +7 +require +s +7 +coderay +x +17 +PluginScannerTest +x +4 +Test +n +x +4 +Unit +x +8 +TestCase +x +10 +open_class +x +14 +__class_init__ +M +1 +n +n +x +17 +PluginScannerTest +i +16 +5 +66 +99 +7 +0 +7 +1 +65 +67 +49 +2 +0 +49 +3 +4 +11 +I +5 +I +0 +I +0 +I +0 +n +p +4 +x +9 +test_load +M +1 +n +n +x +9 +test_load +i +48 +5 +45 +0 +1 +45 +0 +2 +65 +49 +3 +0 +49 +4 +1 +7 +5 +64 +49 +6 +2 +47 +49 +7 +1 +15 +5 +7 +8 +64 +45 +9 +10 +7 +11 +49 +12 +1 +49 +13 +0 +49 +14 +0 +47 +49 +15 +2 +11 +I +4 +I +0 +I +0 +I +0 +n +p +16 +x +4 +File +n +n +x +11 +active_path +x +7 +dirname +s +4 +vhdl +x +4 +join +x +7 +require +s +4 +VHDL +x +7 +CodeRay +n +x +4 +vhdl +x +7 +scanner +x +5 +class +x +4 +name +x +12 +assert_equal +p +7 +I +0 +I +6 +I +0 +I +7 +I +19 +I +8 +I +30 +x +69 +/Users/murphy/ruby/coderay-0.9/test/functional/load_plugin_scanner.rb +p +0 +x +17 +method_visibility +x +15 +add_defn_method +p +3 +I +2 +I +6 +I +10 +x +69 +/Users/murphy/ruby/coderay-0.9/test/functional/load_plugin_scanner.rb +p +0 +x +13 +attach_method +p +7 +I +0 +I +1 +I +9 +I +2 +I +12 +I +4 +I +35 +x +69 +/Users/murphy/ruby/coderay-0.9/test/functional/load_plugin_scanner.rb +p +0 diff --git a/vendor/gems/coderay-0.9.7/test/functional/suite.rb b/vendor/gems/coderay-0.9.7/test/functional/suite.rb new file mode 100644 index 000000000..97dd330d6 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/suite.rb @@ -0,0 +1,12 @@ +require 'test/unit' + +MYDIR = File.dirname(__FILE__) + +$:.unshift 'lib' +require 'coderay' +puts "Running basic CodeRay #{CodeRay::VERSION} tests..." + +suite = %w(basic load_plugin_scanner word_list) +for test_case in suite + load File.join(MYDIR, test_case + '.rb') +end diff --git a/vendor/gems/coderay-0.9.7/test/functional/suite.rbc b/vendor/gems/coderay-0.9.7/test/functional/suite.rbc new file mode 100644 index 000000000..977354aec --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/suite.rbc @@ -0,0 +1,322 @@ +!RBIX +0 +x +M +1 +n +n +x +10 +__script__ +i +95 +5 +7 +0 +64 +47 +49 +1 +1 +15 +65 +7 +2 +45 +3 +4 +65 +49 +5 +0 +49 +6 +1 +49 +7 +2 +15 +99 +43 +8 +7 +9 +49 +10 +1 +7 +11 +64 +49 +12 +1 +15 +5 +7 +13 +64 +47 +49 +1 +1 +15 +5 +7 +14 +45 +15 +16 +43 +17 +47 +49 +18 +0 +7 +19 +63 +3 +47 +49 +20 +1 +15 +7 +21 +64 +7 +22 +64 +7 +23 +64 +35 +3 +19 +0 +15 +20 +0 +56 +24 +50 +25 +0 +15 +2 +11 +I +6 +I +2 +I +0 +I +0 +n +p +26 +s +9 +test/unit +x +7 +require +x +5 +MYDIR +x +4 +File +n +x +11 +active_path +x +7 +dirname +x +9 +const_set +x +7 +Globals +x +2 +$: +x +2 +[] +s +3 +lib +x +2 +<< +s +7 +coderay +s +22 +Running basic CodeRay +x +7 +CodeRay +n +x +7 +VERSION +x +4 +to_s +s +9 + tests... +x +4 +puts +s +5 +basic +s +19 +load_plugin_scanner +s +9 +word_list +M +1 +p +2 +x +9 +for_block +t +n +x +9 +__block__ +i +28 +57 +22 +1 +1 +15 +5 +45 +0 +1 +45 +2 +3 +21 +1 +1 +7 +4 +64 +81 +5 +49 +6 +2 +47 +49 +7 +1 +11 +I +6 +I +0 +I +1 +I +1 +n +p +8 +x +4 +File +n +x +5 +MYDIR +n +s +3 +.rb +x +1 ++ +x +4 +join +x +4 +load +p +5 +I +0 +I +a +I +5 +I +b +I +1c +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/suite.rb +p +0 +x +4 +each +p +15 +I +0 +I +1 +I +9 +I +3 +I +1a +I +5 +I +29 +I +6 +I +32 +I +7 +I +47 +I +9 +I +55 +I +a +I +5f +x +55 +/Users/murphy/ruby/coderay-0.9/test/functional/suite.rb +p +2 +x +5 +suite +x +9 +test_case diff --git a/vendor/gems/coderay-0.9.7/test/functional/vhdl.rb b/vendor/gems/coderay-0.9.7/test/functional/vhdl.rb new file mode 100644 index 000000000..c7e382436 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/vhdl.rb @@ -0,0 +1,126 @@ +class VHDL < CodeRay::Scanners::Scanner + + register_for :vhdl + + RESERVED_WORDS = [ + 'access','after','alias','all','assert','architecture','begin', + 'block','body','buffer','bus','case','component','configuration','constant', + 'disconnect','downto','else','elsif','end','entity','exit','file','for', + 'function','generate','generic','group','guarded','if','impure','in', + 'inertial','inout','is','label','library','linkage','literal','loop', + 'map','new','next','null','of','on','open','others','out','package', + 'port','postponed','procedure','process','pure','range','record','register', + 'reject','report','return','select','severity','signal','shared','subtype', + 'then','to','transport','type','unaffected','units','until','use','variable', + 'wait','when','while','with','note','warning','error','failure','and', + 'or','xor','not','nor', + 'array' + ] + + PREDEFINED_TYPES = [ + 'bit','bit_vector','character','boolean','integer','real','time','string', + 'severity_level','positive','natural','signed','unsigned','line','text', + 'std_logic','std_logic_vector','std_ulogic','std_ulogic_vector','qsim_state', + 'qsim_state_vector','qsim_12state','qsim_12state_vector','qsim_strength', + 'mux_bit','mux_vector','reg_bit','reg_vector','wor_bit','wor_vector' + ] + + PREDEFINED_CONSTANTS = [ + + ] + + IDENT_KIND = CodeRay::CaseIgnoringWordList.new(:ident). + add(RESERVED_WORDS, :reserved). + add(PREDEFINED_TYPES, :pre_type). + add(PREDEFINED_CONSTANTS, :pre_constant) + + ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x + UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x + + def scan_tokens tokens, options + + state = :initial + + until eos? + + kind = nil + match = nil + + case state + + when :initial + + if scan(/ \s+ | \\\n /x) + kind = :space + + elsif scan(/-- .*/x) + kind = :comment + + elsif scan(/ [-+*\/=<>?:;,!&^|()\[\]{}~%]+ | \.(?!\d) /x) + kind = :operator + + elsif match = scan(/ [A-Za-z_][A-Za-z_0-9]* /x) + kind = IDENT_KIND[match.downcase] + + elsif match = scan(/[a-z]?"/i) + tokens << [:open, :string] + state = :string + kind = :delimiter + + elsif scan(/ L?' (?: [^\'\n\\] | \\ #{ESCAPE} )? '? /ox) + kind = :char + + elsif scan(/(?:\d+)(?![.eEfF])/) + kind = :integer + + elsif scan(/\d[fF]?|\d*\.\d+(?:[eE][+-]?\d+)?[fF]?|\d+[eE][+-]?\d+[fF]?/) + kind = :float + + else + getch + kind = :error + + end + + when :string + if scan(/[^\\\n"]+/) + kind = :content + elsif scan(/"/) + tokens << ['"', :delimiter] + tokens << [:close, :string] + state = :initial + next + elsif scan(/ \\ (?: #{ESCAPE} | #{UNICODE_ESCAPE} ) /mox) + kind = :char + elsif scan(/ \\ | $ /x) + tokens << [:close, :string] + kind = :error + state = :initial + else + raise_inspect "else case \" reached; %p not handled." % peek(1), tokens + end + + else + raise_inspect 'Unknown state', tokens + + end + + match ||= matched + if $DEBUG and not kind + raise_inspect 'Error token %p in line %d' % + [[match, kind], line], tokens + end + raise_inspect 'Empty token', tokens unless match + + tokens << [match, kind] + + end + + if state == :string + tokens << [:close, :string] + end + + tokens + end + +end diff --git a/vendor/gems/coderay-0.9.7/test/functional/vhdl.rbc b/vendor/gems/coderay-0.9.7/test/functional/vhdl.rbc new file mode 100644 index 000000000..80d01bf60 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/vhdl.rbc @@ -0,0 +1,2334 @@ +!RBIX +0 +x +M +1 +n +n +x +10 +__script__ +i +35 +99 +7 +0 +45 +1 +2 +43 +3 +43 +4 +65 +49 +5 +3 +13 +99 +12 +7 +6 +12 +7 +7 +12 +65 +12 +49 +8 +4 +15 +49 +6 +0 +15 +2 +11 +I +6 +I +0 +I +0 +I +0 +n +p +9 +x +4 +VHDL +x +7 +CodeRay +n +x +8 +Scanners +x +7 +Scanner +x +10 +open_class +x +14 +__class_init__ +M +1 +n +n +x +4 +VHDL +i +519 +5 +66 +5 +7 +0 +47 +49 +1 +1 +15 +65 +7 +2 +7 +3 +64 +7 +4 +64 +7 +5 +64 +7 +6 +64 +7 +7 +64 +7 +8 +64 +7 +9 +64 +7 +10 +64 +7 +11 +64 +7 +12 +64 +7 +13 +64 +7 +14 +64 +7 +15 +64 +7 +16 +64 +7 +17 +64 +7 +18 +64 +7 +19 +64 +7 +20 +64 +7 +21 +64 +7 +22 +64 +7 +23 +64 +7 +24 +64 +7 +25 +64 +7 +26 +64 +7 +27 +64 +7 +28 +64 +7 +29 +64 +7 +30 +64 +7 +31 +64 +7 +32 +64 +7 +33 +64 +7 +34 +64 +7 +35 +64 +7 +36 +64 +7 +37 +64 +7 +38 +64 +7 +39 +64 +7 +40 +64 +7 +41 +64 +7 +42 +64 +7 +43 +64 +7 +44 +64 +7 +45 +64 +7 +46 +64 +7 +47 +64 +7 +48 +64 +7 +49 +64 +7 +50 +64 +7 +51 +64 +7 +52 +64 +7 +53 +64 +7 +54 +64 +7 +55 +64 +7 +56 +64 +7 +57 +64 +7 +58 +64 +7 +59 +64 +7 +60 +64 +7 +61 +64 +7 +62 +64 +7 +63 +64 +7 +64 +64 +7 +65 +64 +7 +66 +64 +7 +67 +64 +7 +68 +64 +7 +69 +64 +7 +70 +64 +7 +71 +64 +7 +72 +64 +7 +73 +64 +7 +74 +64 +7 +75 +64 +7 +76 +64 +7 +77 +64 +7 +78 +64 +7 +79 +64 +7 +80 +64 +7 +81 +64 +7 +82 +64 +7 +83 +64 +7 +84 +64 +7 +85 +64 +7 +86 +64 +7 +87 +64 +7 +88 +64 +7 +89 +64 +7 +90 +64 +7 +91 +64 +35 +89 +49 +92 +2 +15 +65 +7 +93 +7 +94 +64 +7 +95 +64 +7 +96 +64 +7 +97 +64 +7 +98 +64 +7 +99 +64 +7 +100 +64 +7 +101 +64 +7 +102 +64 +7 +103 +64 +7 +104 +64 +7 +105 +64 +7 +106 +64 +7 +107 +64 +7 +108 +64 +7 +109 +64 +7 +110 +64 +7 +111 +64 +7 +112 +64 +7 +113 +64 +7 +114 +64 +7 +115 +64 +7 +116 +64 +7 +117 +64 +7 +118 +64 +7 +119 +64 +7 +120 +64 +7 +121 +64 +7 +122 +64 +7 +123 +64 +35 +30 +49 +92 +2 +15 +65 +7 +124 +35 +0 +49 +92 +2 +15 +65 +7 +125 +45 +126 +127 +43 +128 +13 +71 +129 +47 +9 +422 +47 +49 +130 +0 +13 +7 +131 +47 +49 +132 +1 +15 +8 +427 +7 +131 +49 +129 +1 +45 +2 +133 +7 +134 +49 +135 +2 +45 +93 +136 +7 +137 +49 +135 +2 +45 +124 +138 +7 +139 +49 +135 +2 +49 +92 +2 +15 +65 +7 +140 +7 +141 +13 +70 +9 +476 +15 +44 +43 +142 +7 +143 +80 +49 +129 +2 +6 +141 +49 +92 +2 +15 +65 +7 +144 +7 +145 +13 +70 +9 +501 +15 +44 +43 +142 +7 +146 +80 +49 +129 +2 +6 +145 +49 +92 +2 +15 +99 +7 +147 +7 +148 +65 +67 +49 +149 +0 +49 +150 +4 +11 +I +5b +I +0 +I +0 +I +0 +n +p +151 +x +4 +vhdl +x +12 +register_for +x +14 +RESERVED_WORDS +s +6 +access +s +5 +after +s +5 +alias +s +3 +all +s +6 +assert +s +12 +architecture +s +5 +begin +s +5 +block +s +4 +body +s +6 +buffer +s +3 +bus +s +4 +case +s +9 +component +s +13 +configuration +s +8 +constant +s +10 +disconnect +s +6 +downto +s +4 +else +s +5 +elsif +s +3 +end +s +6 +entity +s +4 +exit +s +4 +file +s +3 +for +s +8 +function +s +8 +generate +s +7 +generic +s +5 +group +s +7 +guarded +s +2 +if +s +6 +impure +s +2 +in +s +8 +inertial +s +5 +inout +s +2 +is +s +5 +label +s +7 +library +s +7 +linkage +s +7 +literal +s +4 +loop +s +3 +map +s +3 +new +s +4 +next +s +4 +null +s +2 +of +s +2 +on +s +4 +open +s +6 +others +s +3 +out +s +7 +package +s +4 +port +s +9 +postponed +s +9 +procedure +s +7 +process +s +4 +pure +s +5 +range +s +6 +record +s +8 +register +s +6 +reject +s +6 +report +s +6 +return +s +6 +select +s +8 +severity +s +6 +signal +s +6 +shared +s +7 +subtype +s +4 +then +s +2 +to +s +9 +transport +s +4 +type +s +10 +unaffected +s +5 +units +s +5 +until +s +3 +use +s +8 +variable +s +4 +wait +s +4 +when +s +5 +while +s +4 +with +s +4 +note +s +7 +warning +s +5 +error +s +7 +failure +s +3 +and +s +2 +or +s +3 +xor +s +3 +not +s +3 +nor +s +5 +array +x +9 +const_set +x +16 +PREDEFINED_TYPES +s +3 +bit +s +10 +bit_vector +s +9 +character +s +7 +boolean +s +7 +integer +s +4 +real +s +4 +time +s +6 +string +s +14 +severity_level +s +8 +positive +s +7 +natural +s +6 +signed +s +8 +unsigned +s +4 +line +s +4 +text +s +9 +std_logic +s +16 +std_logic_vector +s +10 +std_ulogic +s +17 +std_ulogic_vector +s +10 +qsim_state +s +17 +qsim_state_vector +s +12 +qsim_12state +s +19 +qsim_12state_vector +s +13 +qsim_strength +s +7 +mux_bit +s +10 +mux_vector +s +7 +reg_bit +s +10 +reg_vector +s +7 +wor_bit +s +10 +wor_vector +x +20 +PREDEFINED_CONSTANTS +x +10 +IDENT_KIND +x +7 +CodeRay +n +x +20 +CaseIgnoringWordList +x +3 +new +x +8 +allocate +x +5 +ident +x +10 +initialize +n +x +8 +reserved +x +3 +add +n +x +8 +pre_type +n +x +12 +pre_constant +x +6 +ESCAPE +n +x +6 +Regexp +s +49 + [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} +x +14 +UNICODE_ESCAPE +n +s +35 + u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} +x +11 +scan_tokens +M +1 +n +n +x +11 +scan_tokens +i +688 +7 +0 +19 +2 +15 +5 +47 +49 +1 +0 +10 +660 +1 +19 +3 +15 +1 +19 +4 +15 +20 +2 +13 +7 +0 +12 +49 +2 +1 +9 +331 +15 +5 +7 +3 +13 +70 +9 +51 +15 +44 +43 +4 +7 +5 +80 +49 +6 +2 +6 +3 +47 +49 +7 +1 +9 +63 +7 +8 +19 +3 +8 +329 +5 +7 +9 +13 +70 +9 +82 +15 +44 +43 +4 +7 +10 +80 +49 +6 +2 +6 +9 +47 +49 +7 +1 +9 +94 +7 +11 +19 +3 +8 +329 +5 +7 +12 +13 +70 +9 +113 +15 +44 +43 +4 +7 +13 +80 +49 +6 +2 +6 +12 +47 +49 +7 +1 +9 +125 +7 +14 +19 +3 +8 +329 +5 +7 +15 +13 +70 +9 +144 +15 +44 +43 +4 +7 +16 +80 +49 +6 +2 +6 +15 +47 +49 +7 +1 +19 +4 +9 +167 +45 +17 +18 +20 +4 +49 +19 +0 +49 +20 +1 +19 +3 +8 +329 +5 +7 +21 +13 +70 +9 +186 +15 +44 +43 +4 +7 +22 +79 +49 +6 +2 +6 +21 +47 +49 +7 +1 +19 +4 +9 +217 +20 +0 +7 +23 +7 +24 +35 +2 +49 +25 +1 +15 +7 +24 +19 +2 +15 +7 +26 +19 +3 +8 +329 +5 +7 +27 +13 +70 +9 +247 +15 +44 +43 +4 +7 +28 +45 +29 +30 +47 +49 +31 +0 +7 +32 +63 +3 +80 +49 +6 +2 +6 +27 +47 +49 +7 +1 +9 +259 +7 +33 +19 +3 +8 +329 +5 +7 +34 +13 +70 +9 +278 +15 +44 +43 +4 +7 +35 +78 +49 +6 +2 +6 +34 +47 +49 +7 +1 +9 +290 +7 +36 +19 +3 +8 +329 +5 +7 +37 +13 +70 +9 +309 +15 +44 +43 +4 +7 +38 +78 +49 +6 +2 +6 +37 +47 +49 +7 +1 +9 +321 +7 +39 +19 +3 +8 +329 +5 +48 +40 +15 +7 +41 +19 +3 +8 +564 +13 +7 +24 +12 +49 +2 +1 +9 +553 +15 +5 +7 +42 +13 +70 +9 +360 +15 +44 +43 +4 +7 +43 +78 +49 +6 +2 +6 +42 +47 +49 +7 +1 +9 +372 +7 +44 +19 +3 +8 +551 +5 +7 +45 +13 +70 +9 +391 +15 +44 +43 +4 +7 +46 +78 +49 +6 +2 +6 +45 +47 +49 +7 +1 +9 +432 +20 +0 +7 +46 +64 +7 +26 +35 +2 +49 +25 +1 +15 +20 +0 +7 +47 +7 +24 +35 +2 +49 +25 +1 +15 +7 +0 +19 +2 +15 +1 +8 +656 +8 +551 +5 +7 +48 +13 +70 +9 +472 +15 +44 +43 +4 +7 +49 +45 +29 +50 +47 +49 +31 +0 +7 +51 +45 +52 +53 +47 +49 +31 +0 +7 +54 +63 +5 +4 +6 +49 +6 +2 +6 +48 +47 +49 +7 +1 +9 +484 +7 +33 +19 +3 +8 +551 +5 +7 +55 +13 +70 +9 +503 +15 +44 +43 +4 +7 +56 +80 +49 +6 +2 +6 +55 +47 +49 +7 +1 +9 +532 +20 +0 +7 +47 +7 +24 +35 +2 +49 +25 +1 +15 +7 +41 +19 +3 +15 +7 +0 +19 +2 +8 +551 +5 +7 +57 +64 +5 +79 +47 +49 +58 +1 +49 +59 +1 +20 +0 +47 +49 +60 +2 +8 +564 +15 +5 +7 +61 +64 +20 +0 +47 +49 +60 +2 +15 +20 +4 +13 +10 +576 +15 +5 +48 +62 +19 +4 +15 +99 +43 +63 +7 +64 +49 +20 +1 +13 +9 +597 +15 +20 +3 +10 +596 +2 +8 +597 +3 +9 +625 +5 +7 +65 +64 +20 +4 +20 +3 +35 +2 +5 +48 +66 +35 +2 +49 +59 +1 +20 +0 +47 +49 +60 +2 +8 +626 +1 +15 +20 +4 +9 +634 +1 +8 +644 +5 +7 +67 +64 +20 +0 +47 +49 +60 +2 +15 +20 +0 +20 +4 +20 +3 +35 +2 +49 +25 +1 +15 +68 +8 +5 +1 +15 +20 +2 +7 +24 +83 +68 +9 +683 +20 +0 +7 +47 +7 +24 +35 +2 +49 +25 +1 +8 +684 +1 +15 +20 +0 +11 +I +c +I +5 +I +2 +I +2 +n +p +69 +x +7 +initial +x +4 +eos? +x +3 +=== +n +x +6 +Regexp +s +12 + \s+ | \\\n +x +3 +new +x +4 +scan +x +5 +space +n +s +5 +-- .* +x +7 +comment +n +s +42 + [-+*\/=<>?:;,!&^|()\[\]{}~%]+ | \.(?!\d) +x +8 +operator +n +s +24 + [A-Za-z_][A-Za-z_0-9]* +x +10 +IDENT_KIND +n +x +8 +downcase +x +2 +[] +n +s +7 +[a-z]?" +x +4 +open +x +6 +string +x +2 +<< +x +9 +delimiter +n +s +24 + L?' (?: [^\'\n\\] | \\ +x +6 +ESCAPE +n +x +4 +to_s +s +7 + )? '? +x +4 +char +n +s +18 +(?:\d+)(?![.eEfF]) +x +7 +integer +n +s +59 +\d[fF]?|\d*\.\d+(?:[eE][+-]?\d+)?[fF]?|\d+[eE][+-]?\d+[fF]? +x +5 +float +x +5 +getch +x +5 +error +n +s +9 +[^\\\n"]+ +x +7 +content +n +s +1 +" +x +5 +close +n +s +8 + \\ (?: +n +s +3 + | +x +14 +UNICODE_ESCAPE +n +s +3 + ) +n +s +8 + \\ | $ +s +36 +else case " reached; %p not handled. +x +4 +peek +x +1 +% +x +13 +raise_inspect +s +13 +Unknown state +x +7 +matched +x +7 +Globals +x +6 +$DEBUG +s +25 +Error token %p in line %d +x +4 +line +s +11 +Empty token +x +2 +== +p +111 +I +0 +I +28 +I +0 +I +2a +I +5 +I +2c +I +c +I +2e +I +10 +I +2f +I +14 +I +31 +I +17 +I +33 +I +20 +I +35 +I +39 +I +36 +I +3f +I +38 +I +58 +I +39 +I +5e +I +3b +I +77 +I +3c +I +7d +I +3e +I +98 +I +3f +I +a7 +I +41 +I +c2 +I +42 +I +ce +I +43 +I +d3 +I +44 +I +d9 +I +46 +I +fd +I +47 +I +103 +I +49 +I +11c +I +4a +I +122 +I +4c +I +13b +I +4d +I +141 +I +50 +I +145 +I +51 +I +14c +I +55 +I +155 +I +56 +I +16e +I +57 +I +174 +I +58 +I +18d +I +59 +I +19a +I +5a +I +1a6 +I +5b +I +1ab +I +5c +I +1b0 +I +5d +I +1de +I +5e +I +1e4 +I +5f +I +1fd +I +60 +I +209 +I +61 +I +20e +I +62 +I +214 +I +64 +I +22a +I +68 +I +235 +I +6c +I +241 +I +6d +I +257 +I +6f +I +258 +I +6e +I +25b +I +6f +I +271 +I +6d +I +273 +I +71 +I +285 +I +73 +I +296 +I +77 +I +29e +I +78 +I +2ab +I +77 +I +2ad +I +7b +I +2b0 +x +54 +/Users/murphy/ruby/coderay-0.9/test/functional/vhdl.rb +p +5 +x +6 +tokens +x +7 +options +x +5 +state +x +4 +kind +x +5 +match +x +17 +method_visibility +x +15 +add_defn_method +p +65 +I +2 +I +3 +I +a +I +5 +I +d +I +6 +I +22 +I +7 +I +3a +I +8 +I +55 +I +9 +I +6d +I +a +I +85 +I +b +I +a3 +I +c +I +bb +I +d +I +d3 +I +e +I +ee +I +f +I +109 +I +10 +I +115 +I +11 +I +11e +I +14 +I +121 +I +15 +I +139 +I +16 +I +14e +I +17 +I +15d +I +18 +I +169 +I +19 +I +181 +I +1c +I +184 +I +1e +I +18a +I +20 +I +1ab +I +21 +I +1b0 +I +20 +I +1b3 +I +22 +I +1b8 +I +20 +I +1bb +I +23 +I +1c0 +I +20 +I +1c7 +I +25 +I +1e0 +I +26 +I +1f9 +I +28 +I +207 +x +54 +/Users/murphy/ruby/coderay-0.9/test/functional/vhdl.rb +p +0 +x +13 +attach_method +p +3 +I +0 +I +1 +I +23 +x +54 +/Users/murphy/ruby/coderay-0.9/test/functional/vhdl.rb +p +0 diff --git a/vendor/gems/coderay-0.9.7/test/functional/word_list.rb b/vendor/gems/coderay-0.9.7/test/functional/word_list.rb new file mode 100644 index 000000000..84d6e9e79 --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/word_list.rb @@ -0,0 +1,79 @@ +require 'test/unit' +require 'coderay' + +class WordListTest < Test::Unit::TestCase + + include CodeRay + + # define word arrays + RESERVED_WORDS = %w[ + asm break case continue default do else + ... + ] + + PREDEFINED_TYPES = %w[ + int long short char void + ... + ] + + PREDEFINED_CONSTANTS = %w[ + EOF NULL ... + ] + + # make a WordList + IDENT_KIND = WordList.new(:ident). + add(RESERVED_WORDS, :reserved). + add(PREDEFINED_TYPES, :pre_type). + add(PREDEFINED_CONSTANTS, :pre_constant) + + def test_word_list_example + assert_equal :pre_type, IDENT_KIND['void'] + # assert_equal :pre_constant, IDENT_KIND['...'] # not specified + end + + def test_word_list + list = WordList.new(:ident).add(['foobar'], :reserved) + assert_equal :reserved, list['foobar'] + assert_equal :ident, list['FooBar'] + end + + def test_word_list_cached + list = WordList.new(:ident, true).add(['foobar'], :reserved) + assert_equal :reserved, list['foobar'] + assert_equal :ident, list['FooBar'] + end + + def test_case_ignoring_word_list + list = CaseIgnoringWordList.new(:ident).add(['foobar'], :reserved) + assert_equal :ident, list['foo'] + assert_equal :reserved, list['foobar'] + assert_equal :reserved, list['FooBar'] + + list = CaseIgnoringWordList.new(:ident).add(['FooBar'], :reserved) + assert_equal :ident, list['foo'] + assert_equal :reserved, list['foobar'] + assert_equal :reserved, list['FooBar'] + end + + def test_case_ignoring_word_list_cached + list = CaseIgnoringWordList.new(:ident, true).add(['foobar'], :reserved) + assert_equal :ident, list['foo'] + assert_equal :reserved, list['foobar'] + assert_equal :reserved, list['FooBar'] + + list = CaseIgnoringWordList.new(:ident, true).add(['FooBar'], :reserved) + assert_equal :ident, list['foo'] + assert_equal :reserved, list['foobar'] + assert_equal :reserved, list['FooBar'] + end + + def test_dup + list = WordList.new(:ident).add(['foobar'], :reserved) + assert_equal :reserved, list['foobar'] + list2 = list.dup + list2.add(%w[foobar], :keyword) + assert_equal :keyword, list2['foobar'] + assert_equal :reserved, list['foobar'] + end + +end
\ No newline at end of file diff --git a/vendor/gems/coderay-0.9.7/test/functional/word_list.rbc b/vendor/gems/coderay-0.9.7/test/functional/word_list.rbc new file mode 100644 index 000000000..37bcdd28a --- /dev/null +++ b/vendor/gems/coderay-0.9.7/test/functional/word_list.rbc @@ -0,0 +1,1763 @@ +!RBIX +0 +x +M +1 +n +n +x +10 +__script__ +i +53 +5 +7 +0 +64 +47 +49 +1 +1 +15 +5 +7 +2 +64 +47 +49 +1 +1 +15 +99 +7 +3 +45 +4 +5 +43 +6 +43 +7 +65 +49 +8 +3 +13 +99 +12 +7 +9 +12 +7 +10 +12 +65 +12 +49 +11 +4 +15 +49 +9 +0 +15 +2 +11 +I +6 +I +0 +I +0 +I +0 +n +p +12 +s +9 +test/unit +x +7 +require +s +7 +coderay +x +12 +WordListTest +x +4 +Test +n +x +4 +Unit +x +8 +TestCase +x +10 +open_class +x +14 +__class_init__ +M +1 +n +n +x +12 +WordListTest +i +232 +5 +66 +5 +45 +0 +1 +47 +49 +2 +1 +15 +65 +7 +3 +7 +4 +64 +7 +5 +64 +7 +6 +64 +7 +7 +64 +7 +8 +64 +7 +9 +64 +7 +10 +64 +7 +11 +64 +35 +8 +49 +12 +2 +15 +65 +7 +13 +7 +14 +64 +7 +15 +64 +7 +16 +64 +7 +17 +64 +7 +18 +64 +7 +11 +64 +35 +6 +49 +12 +2 +15 +65 +7 +19 +7 +20 +64 +7 +21 +64 +7 +11 +64 +35 +3 +49 +12 +2 +15 +65 +7 +22 +45 +23 +24 +13 +71 +25 +47 +9 +115 +47 +49 +26 +0 +13 +7 +27 +47 +49 +28 +1 +15 +8 +120 +7 +27 +49 +25 +1 +45 +3 +29 +7 +30 +49 +31 +2 +45 +13 +32 +7 +33 +49 +31 +2 +45 +19 +34 +7 +35 +49 +31 +2 +49 +12 +2 +15 +99 +7 +36 +7 +37 +65 +67 +49 +38 +0 +49 +39 +4 +15 +99 +7 +40 +7 +41 +65 +67 +49 +38 +0 +49 +39 +4 +15 +99 +7 +42 +7 +43 +65 +67 +49 +38 +0 +49 +39 +4 +15 +99 +7 +44 +7 +45 +65 +67 +49 +38 +0 +49 +39 +4 +15 +99 +7 +46 +7 +47 +65 +67 +49 +38 +0 +49 +39 +4 +15 +99 +7 +48 +7 +49 +65 +67 +49 +38 +0 +49 +39 +4 +11 +I +a +I +0 +I +0 +I +0 +n +p +50 +x +7 +CodeRay +n +x +7 +include +x +14 +RESERVED_WORDS +s +3 +asm +s +5 +break +s +4 +case +s +8 +continue +s +7 +default +s +2 +do +s +4 +else +s +3 +... +x +9 +const_set +x +16 +PREDEFINED_TYPES +s +3 +int +s +4 +long +s +5 +short +s +4 +char +s +4 +void +x +20 +PREDEFINED_CONSTANTS +s +3 +EOF +s +4 +NULL +x +10 +IDENT_KIND +x +8 +WordList +n +x +3 +new +x +8 +allocate +x +5 +ident +x +10 +initialize +n +x +8 +reserved +x +3 +add +n +x +8 +pre_type +n +x +12 +pre_constant +x +22 +test_word_list_example +M +1 +n +n +x +22 +test_word_list_example +i +17 +5 +7 +0 +45 +1 +2 +7 +3 +64 +49 +4 +1 +47 +49 +5 +2 +11 +I +4 +I +0 +I +0 +I +0 +n +p +6 +x +8 +pre_type +x +10 +IDENT_KIND +n +s +4 +void +x +2 +[] +x +12 +assert_equal +p +5 +I +0 +I +1d +I +0 +I +1e +I +11 +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +0 +x +17 +method_visibility +x +15 +add_defn_method +x +14 +test_word_list +M +1 +n +n +x +14 +test_word_list +i +73 +45 +0 +1 +13 +71 +2 +47 +9 +23 +47 +49 +3 +0 +13 +7 +4 +47 +49 +5 +1 +15 +8 +28 +7 +4 +49 +2 +1 +7 +6 +64 +35 +1 +7 +7 +49 +8 +2 +19 +0 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +9 +1 +47 +49 +10 +2 +15 +5 +7 +4 +20 +0 +7 +11 +64 +49 +9 +1 +47 +49 +10 +2 +11 +I +5 +I +1 +I +0 +I +0 +n +p +12 +x +8 +WordList +n +x +3 +new +x +8 +allocate +x +5 +ident +x +10 +initialize +s +6 +foobar +x +8 +reserved +x +3 +add +x +2 +[] +x +12 +assert_equal +s +6 +FooBar +p +9 +I +0 +I +22 +I +0 +I +23 +I +29 +I +24 +I +39 +I +25 +I +49 +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +1 +x +4 +list +x +21 +test_word_list_cached +M +1 +n +n +x +21 +test_word_list_cached +i +75 +45 +0 +1 +13 +71 +2 +47 +9 +24 +47 +49 +3 +0 +13 +7 +4 +2 +47 +49 +5 +2 +15 +8 +30 +7 +4 +2 +49 +2 +2 +7 +6 +64 +35 +1 +7 +7 +49 +8 +2 +19 +0 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +9 +1 +47 +49 +10 +2 +15 +5 +7 +4 +20 +0 +7 +11 +64 +49 +9 +1 +47 +49 +10 +2 +11 +I +5 +I +1 +I +0 +I +0 +n +p +12 +x +8 +WordList +n +x +3 +new +x +8 +allocate +x +5 +ident +x +10 +initialize +s +6 +foobar +x +8 +reserved +x +3 +add +x +2 +[] +x +12 +assert_equal +s +6 +FooBar +p +9 +I +0 +I +28 +I +0 +I +29 +I +2b +I +2a +I +3b +I +2b +I +4b +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +1 +x +4 +list +x +28 +test_case_ignoring_word_list +M +1 +n +n +x +28 +test_case_ignoring_word_list +i +178 +45 +0 +1 +13 +71 +2 +47 +9 +23 +47 +49 +3 +0 +13 +7 +4 +47 +49 +5 +1 +15 +8 +28 +7 +4 +49 +2 +1 +7 +6 +64 +35 +1 +7 +7 +49 +8 +2 +19 +0 +15 +5 +7 +4 +20 +0 +7 +9 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +12 +64 +49 +10 +1 +47 +49 +11 +2 +15 +45 +0 +13 +13 +71 +2 +47 +9 +112 +47 +49 +3 +0 +13 +7 +4 +47 +49 +5 +1 +15 +8 +117 +7 +4 +49 +2 +1 +7 +12 +64 +35 +1 +7 +7 +49 +8 +2 +19 +0 +15 +5 +7 +4 +20 +0 +7 +9 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +12 +64 +49 +10 +1 +47 +49 +11 +2 +11 +I +5 +I +1 +I +0 +I +0 +n +p +14 +x +20 +CaseIgnoringWordList +n +x +3 +new +x +8 +allocate +x +5 +ident +x +10 +initialize +s +6 +foobar +x +8 +reserved +x +3 +add +s +3 +foo +x +2 +[] +x +12 +assert_equal +s +6 +FooBar +n +p +19 +I +0 +I +2e +I +0 +I +2f +I +29 +I +30 +I +39 +I +31 +I +49 +I +32 +I +59 +I +34 +I +82 +I +35 +I +92 +I +36 +I +a2 +I +37 +I +b2 +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +1 +x +4 +list +x +35 +test_case_ignoring_word_list_cached +M +1 +n +n +x +35 +test_case_ignoring_word_list_cached +i +182 +45 +0 +1 +13 +71 +2 +47 +9 +24 +47 +49 +3 +0 +13 +7 +4 +2 +47 +49 +5 +2 +15 +8 +30 +7 +4 +2 +49 +2 +2 +7 +6 +64 +35 +1 +7 +7 +49 +8 +2 +19 +0 +15 +5 +7 +4 +20 +0 +7 +9 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +12 +64 +49 +10 +1 +47 +49 +11 +2 +15 +45 +0 +13 +13 +71 +2 +47 +9 +115 +47 +49 +3 +0 +13 +7 +4 +2 +47 +49 +5 +2 +15 +8 +121 +7 +4 +2 +49 +2 +2 +7 +12 +64 +35 +1 +7 +7 +49 +8 +2 +19 +0 +15 +5 +7 +4 +20 +0 +7 +9 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +10 +1 +47 +49 +11 +2 +15 +5 +7 +7 +20 +0 +7 +12 +64 +49 +10 +1 +47 +49 +11 +2 +11 +I +5 +I +1 +I +0 +I +0 +n +p +14 +x +20 +CaseIgnoringWordList +n +x +3 +new +x +8 +allocate +x +5 +ident +x +10 +initialize +s +6 +foobar +x +8 +reserved +x +3 +add +s +3 +foo +x +2 +[] +x +12 +assert_equal +s +6 +FooBar +n +p +19 +I +0 +I +3a +I +0 +I +3b +I +2b +I +3c +I +3b +I +3d +I +4b +I +3e +I +5b +I +40 +I +86 +I +41 +I +96 +I +42 +I +a6 +I +43 +I +b6 +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +1 +x +4 +list +x +8 +test_dup +M +1 +n +n +x +8 +test_dup +i +110 +45 +0 +1 +13 +71 +2 +47 +9 +23 +47 +49 +3 +0 +13 +7 +4 +47 +49 +5 +1 +15 +8 +28 +7 +4 +49 +2 +1 +7 +6 +64 +35 +1 +7 +7 +49 +8 +2 +19 +0 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +9 +1 +47 +49 +10 +2 +15 +20 +0 +49 +11 +0 +19 +1 +15 +20 +1 +7 +6 +64 +35 +1 +7 +12 +49 +8 +2 +15 +5 +7 +12 +20 +1 +7 +6 +64 +49 +9 +1 +47 +49 +10 +2 +15 +5 +7 +7 +20 +0 +7 +6 +64 +49 +9 +1 +47 +49 +10 +2 +11 +I +6 +I +2 +I +0 +I +0 +n +p +13 +x +8 +WordList +n +x +3 +new +x +8 +allocate +x +5 +ident +x +10 +initialize +s +6 +foobar +x +8 +reserved +x +3 +add +x +2 +[] +x +12 +assert_equal +x +3 +dup +x +7 +keyword +p +15 +I +0 +I +46 +I +0 +I +47 +I +29 +I +48 +I +39 +I +49 +I +41 +I +4a +I +4e +I +4b +I +5e +I +4c +I +6e +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +2 +x +4 +list +x +5 +list2 +p +45 +I +2 +I +6 +I +b +I +9 +I +e +I +a +I +23 +I +b +I +2c +I +e +I +2f +I +f +I +3e +I +10 +I +47 +I +13 +I +4a +I +14 +I +59 +I +18 +I +78 +I +19 +I +7d +I +18 +I +80 +I +1a +I +85 +I +18 +I +88 +I +1b +I +8d +I +18 +I +94 +I +1d +I +a2 +I +22 +I +b0 +I +28 +I +be +I +2e +I +cc +I +3a +I +da +I +46 +I +e8 +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +0 +x +13 +attach_method +p +7 +I +0 +I +1 +I +9 +I +2 +I +12 +I +4 +I +35 +x +59 +/Users/murphy/ruby/coderay-0.9/test/functional/word_list.rb +p +0 |