textpow 0.10.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. data/.travis.yml +7 -0
  2. data/Gemfile +10 -0
  3. data/Gemfile.lock +30 -0
  4. data/{History.txt → History.rdoc} +10 -0
  5. data/{README.txt → MIT-LICENSE.txt} +0 -30
  6. data/README.rdoc +82 -0
  7. data/Rakefile +42 -49
  8. data/bin/plist2syntax +0 -0
  9. data/bin/plist2yaml +0 -0
  10. data/examples/benchmark_js.rb +13 -0
  11. data/examples/jquery.js +9046 -0
  12. data/lib/textpow.rb +43 -3
  13. data/lib/textpow/debug_processor.rb +35 -35
  14. data/lib/textpow/recording_processor.rb +13 -0
  15. data/lib/textpow/score_manager.rb +60 -60
  16. data/lib/textpow/syntax.rb +303 -262
  17. data/lib/textpow/syntax/broken/markdown.syntax +519 -0
  18. data/lib/textpow/syntax/broken/php.syntax +1253 -0
  19. data/lib/textpow/syntax/buggy/nemerle.syntax +74 -0
  20. data/lib/textpow/syntax/old/YAML.yaml +160 -0
  21. data/lib/textpow/syntax/old/txt2tags.yaml +139 -0
  22. data/lib/textpow/syntax/source.actionscript.syntax +97 -0
  23. data/lib/textpow/syntax/source.active4d.library.syntax +21 -0
  24. data/lib/textpow/syntax/source.active4d.syntax +276 -0
  25. data/lib/textpow/syntax/source.ada.syntax +33 -0
  26. data/lib/textpow/syntax/source.antlr.syntax +151 -0
  27. data/lib/textpow/syntax/source.apache-config.mod_perl.syntax +50 -0
  28. data/lib/textpow/syntax/source.apache-config.syntax +191 -0
  29. data/lib/textpow/syntax/source.applescript.syntax +384 -0
  30. data/lib/textpow/syntax/source.asp.syntax +70 -0
  31. data/lib/textpow/syntax/source.asp.vb.net.syntax +129 -0
  32. data/lib/textpow/syntax/source.c++.qt.syntax +26 -0
  33. data/lib/textpow/syntax/source.c++.syntax +186 -0
  34. data/lib/textpow/syntax/source.c-sharp.syntax +59 -0
  35. data/lib/textpow/syntax/source.c.ragel.syntax +201 -0
  36. data/lib/textpow/syntax/source.c.syntax +414 -0
  37. data/lib/textpow/syntax/source.camlp4.ocaml.syntax +36 -0
  38. data/lib/textpow/syntax/source.cm.syntax +32 -0
  39. data/lib/textpow/syntax/source.coffee.syntax +216 -0
  40. data/lib/textpow/syntax/source.context-free.syntax +176 -0
  41. data/lib/textpow/syntax/source.css.beta.syntax +1925 -0
  42. data/lib/textpow/syntax/source.css.syntax +195 -0
  43. data/lib/textpow/syntax/source.d.syntax +142 -0
  44. data/lib/textpow/syntax/source.diff.syntax +81 -0
  45. data/lib/textpow/syntax/source.dot.syntax +47 -0
  46. data/lib/textpow/syntax/source.dylan.syntax +62 -0
  47. data/lib/textpow/syntax/source.eiffel.syntax +78 -0
  48. data/lib/textpow/syntax/source.erlang.syntax +922 -0
  49. data/lib/textpow/syntax/source.fortran.syntax +141 -0
  50. data/lib/textpow/syntax/source.fscript.syntax +80 -0
  51. data/lib/textpow/syntax/source.fxscript.syntax +142 -0
  52. data/lib/textpow/syntax/source.gri.syntax +83 -0
  53. data/lib/textpow/syntax/source.groovy.groovy.syntax +191 -0
  54. data/lib/textpow/syntax/source.haskell.syntax +88 -0
  55. data/lib/textpow/syntax/source.icalendar.syntax +32 -0
  56. data/lib/textpow/syntax/source.inform.syntax +48 -0
  57. data/lib/textpow/syntax/source.ini.syntax +55 -0
  58. data/lib/textpow/syntax/source.io.syntax +81 -0
  59. data/lib/textpow/syntax/source.java-props.syntax +20 -0
  60. data/lib/textpow/syntax/source.java.syntax +211 -0
  61. data/lib/textpow/syntax/source.js.greasemonkey.syntax +34 -0
  62. data/lib/textpow/syntax/source.js.jquery.syntax +114 -0
  63. data/lib/textpow/syntax/source.js.mootools.syntax +572 -0
  64. data/lib/textpow/syntax/source.js.prototype.bracketed.syntax +140 -0
  65. data/lib/textpow/syntax/source.js.prototype.syntax +72 -0
  66. data/lib/textpow/syntax/source.js.syntax +256 -0
  67. data/lib/textpow/syntax/source.js.yui.syntax +176 -0
  68. data/lib/textpow/syntax/source.json.syntax +136 -0
  69. data/lib/textpow/syntax/source.lex.syntax +219 -0
  70. data/lib/textpow/syntax/source.lighttpd-config.syntax +54 -0
  71. data/lib/textpow/syntax/source.lilypond.syntax +492 -0
  72. data/lib/textpow/syntax/source.lisp.syntax +61 -0
  73. data/lib/textpow/syntax/source.logo.syntax +29 -0
  74. data/lib/textpow/syntax/source.logtalk.syntax +152 -0
  75. data/lib/textpow/syntax/source.lua.syntax +86 -0
  76. data/lib/textpow/syntax/source.makefile.syntax +36 -0
  77. data/lib/textpow/syntax/source.matlab.syntax +142 -0
  78. data/lib/textpow/syntax/source.mel.syntax +92 -0
  79. data/lib/textpow/syntax/source.mips.syntax +66 -0
  80. data/lib/textpow/syntax/source.ml.syntax +121 -0
  81. data/lib/textpow/syntax/source.modula-3.syntax +47 -0
  82. data/lib/textpow/syntax/source.nant-build.syntax +53 -0
  83. data/lib/textpow/syntax/source.objc++.syntax +18 -0
  84. data/lib/textpow/syntax/source.objc.syntax +233 -0
  85. data/lib/textpow/syntax/source.ocaml.syntax +764 -0
  86. data/lib/textpow/syntax/source.ocamllex.syntax +167 -0
  87. data/lib/textpow/syntax/source.ocamlyacc.syntax +184 -0
  88. data/lib/textpow/syntax/source.open-gl.syntax +14 -0
  89. data/lib/textpow/syntax/source.pascal.syntax +77 -0
  90. data/lib/textpow/syntax/source.pascal.vectorscript.syntax +57 -0
  91. data/lib/textpow/syntax/source.perl.syntax +1113 -0
  92. data/lib/textpow/syntax/source.php.cake.syntax +55 -0
  93. data/lib/textpow/syntax/source.plist.tm-grammar.syntax +708 -0
  94. data/lib/textpow/syntax/source.postscript.syntax +114 -0
  95. data/lib/textpow/syntax/source.processing.syntax +106 -0
  96. data/lib/textpow/syntax/source.prolog.syntax +40 -0
  97. data/lib/textpow/syntax/source.python.django.syntax +21 -0
  98. data/lib/textpow/syntax/source.python.syntax +868 -0
  99. data/lib/textpow/syntax/source.qmake.syntax +114 -0
  100. data/lib/textpow/syntax/source.quake-config.syntax +32 -0
  101. data/lib/textpow/syntax/source.r-console.syntax +16 -0
  102. data/lib/textpow/syntax/source.r.syntax +81 -0
  103. data/lib/textpow/syntax/source.regexp.oniguruma.syntax +107 -0
  104. data/lib/textpow/syntax/source.regexp.python.syntax +109 -0
  105. data/lib/textpow/syntax/source.regexp.syntax +50 -0
  106. data/lib/textpow/syntax/source.remind.syntax +253 -0
  107. data/lib/textpow/syntax/source.rez.syntax +80 -0
  108. data/lib/textpow/syntax/source.ruby.experimental.syntax +145 -0
  109. data/lib/textpow/syntax/source.ruby.rails.syntax +88 -0
  110. data/lib/textpow/syntax/source.ruby.syntax +1035 -0
  111. data/lib/textpow/syntax/source.s5.syntax +69 -0
  112. data/lib/textpow/syntax/source.sass.syntax +45 -0
  113. data/lib/textpow/syntax/source.scheme.syntax +347 -0
  114. data/lib/textpow/syntax/source.scilab.syntax +41 -0
  115. data/lib/textpow/syntax/source.scss.syntax +527 -0
  116. data/lib/textpow/syntax/source.shell.syntax +384 -0
  117. data/lib/textpow/syntax/source.slate.syntax +149 -0
  118. data/lib/textpow/syntax/source.smarty.syntax +63 -0
  119. data/lib/textpow/syntax/source.sql.ruby.syntax +18 -0
  120. data/lib/textpow/syntax/source.sql.syntax +237 -0
  121. data/lib/textpow/syntax/source.ssh-config.syntax +33 -0
  122. data/lib/textpow/syntax/source.strings.syntax +39 -0
  123. data/lib/textpow/syntax/source.swig.syntax +57 -0
  124. data/lib/textpow/syntax/source.tcl.macports.syntax +163 -0
  125. data/lib/textpow/syntax/source.tcl.syntax +152 -0
  126. data/lib/textpow/syntax/source.yaml.syntax +160 -0
  127. data/lib/textpow/syntax/text.active4d-ini.syntax +50 -0
  128. data/lib/textpow/syntax/text.bbcode.syntax +287 -0
  129. data/lib/textpow/syntax/text.bibtex.syntax +151 -0
  130. data/lib/textpow/syntax/text.blog.html.syntax +41 -0
  131. data/lib/textpow/syntax/text.blog.markdown.syntax +42 -0
  132. data/lib/textpow/syntax/text.blog.syntax +27 -0
  133. data/lib/textpow/syntax/text.blog.textile.syntax +27 -0
  134. data/lib/textpow/syntax/text.gtdalt.syntax +143 -0
  135. data/lib/textpow/syntax/text.haml.syntax +88 -0
  136. data/lib/textpow/syntax/text.html.asp.net.syntax +424 -0
  137. data/lib/textpow/syntax/text.html.asp.syntax +27 -0
  138. data/lib/textpow/syntax/text.html.basic.syntax +362 -0
  139. data/lib/textpow/syntax/text.html.cfm.syntax +119 -0
  140. data/lib/textpow/syntax/text.html.django.syntax +36 -0
  141. data/lib/textpow/syntax/text.html.dokuwiki.syntax +204 -0
  142. data/lib/textpow/syntax/text.html.doxygen.syntax +43 -0
  143. data/lib/textpow/syntax/text.html.markdown.multimarkdown.syntax +39 -0
  144. data/lib/textpow/syntax/text.html.mason.syntax +119 -0
  145. data/lib/textpow/syntax/text.html.mediawiki.syntax +567 -0
  146. data/lib/textpow/syntax/text.html.mt.syntax +162 -0
  147. data/lib/textpow/syntax/text.html.ruby.syntax +40 -0
  148. data/lib/textpow/syntax/text.html.strict.active4d.syntax +311 -0
  149. data/lib/textpow/syntax/text.html.tcl.syntax +26 -0
  150. data/lib/textpow/syntax/text.html.textile.syntax +215 -0
  151. data/lib/textpow/syntax/text.html.tt.syntax +121 -0
  152. data/lib/textpow/syntax/text.html.twiki.syntax +241 -0
  153. data/lib/textpow/syntax/text.html.xhtml.1-strict.syntax +4027 -0
  154. data/lib/textpow/syntax/text.log.latex.syntax +50 -0
  155. data/lib/textpow/syntax/text.mail.markdown.syntax +118 -0
  156. data/lib/textpow/syntax/text.man.syntax +17 -0
  157. data/lib/textpow/syntax/text.moinmoin.syntax +189 -0
  158. data/lib/textpow/syntax/text.plain.gtd.syntax +22 -0
  159. data/lib/textpow/syntax/text.plain.release-notes.syntax +46 -0
  160. data/lib/textpow/syntax/text.plain.syntax +32 -0
  161. data/lib/textpow/syntax/text.plist.syntax +635 -0
  162. data/lib/textpow/syntax/text.pmwiki.syntax +113 -0
  163. data/lib/textpow/syntax/text.restructuredtext.syntax +250 -0
  164. data/lib/textpow/syntax/text.setext.syntax +147 -0
  165. data/lib/textpow/syntax/text.subversion-commit.syntax +36 -0
  166. data/lib/textpow/syntax/text.tabular.csv.syntax +68 -0
  167. data/lib/textpow/syntax/text.tabular.tsv.syntax +50 -0
  168. data/lib/textpow/syntax/text.tex.latex.beamer.syntax +41 -0
  169. data/lib/textpow/syntax/text.tex.latex.haskell.syntax +24 -0
  170. data/lib/textpow/syntax/text.tex.latex.memoir.syntax +64 -0
  171. data/lib/textpow/syntax/text.tex.latex.rd.syntax +91 -0
  172. data/lib/textpow/syntax/text.tex.latex.sweave.syntax +84 -0
  173. data/lib/textpow/syntax/text.tex.latex.syntax +566 -0
  174. data/lib/textpow/syntax/text.tex.math.syntax +49 -0
  175. data/lib/textpow/syntax/text.tex.syntax +86 -0
  176. data/lib/textpow/syntax/text.txt2tags.syntax +79 -0
  177. data/lib/textpow/syntax/text.xml.apple-dist.syntax +77 -0
  178. data/lib/textpow/syntax/text.xml.strict.syntax +92 -0
  179. data/lib/textpow/syntax/text.xml.syntax +180 -0
  180. data/lib/textpow/syntax/text.xml.xsl.syntax +60 -0
  181. data/lib/textpow/version.rb +3 -0
  182. data/spec/fixtures/objeck.plist +107 -0
  183. data/spec/fixtures/utf8.txt +1 -0
  184. data/spec/spec_helper.rb +2 -0
  185. data/spec/textpow/score_manager_spec.rb +20 -0
  186. data/spec/textpow/syntax_files_spec.rb +26 -0
  187. data/spec/textpow/syntax_spec.rb +225 -0
  188. data/spec/textpow_spec.rb +57 -0
  189. data/textpow.gemspec +19 -0
  190. metadata +246 -68
  191. data/Manifest.txt +0 -13
  192. data/mm/manual.mm +0 -266
  193. data/test/test_textpow.rb +0 -25
@@ -0,0 +1,57 @@
1
+ require 'spec_helper'
2
+
3
+ describe Textpow do
4
+ before do
5
+ Textpow.send(:class_variable_set, "@@syntax", {})
6
+ end
7
+
8
+ it "has a version" do
9
+ Textpow::Version =~ /^\d\.\d\.\d$/
10
+ end
11
+
12
+ it "has syntax files named after their scopeName" do
13
+ Dir["#{Textpow.syntax_path}/*"].each do |file|
14
+ next if File.directory?(file)
15
+ (YAML.load_file(file)['scopeName'] + '.syntax').should == File.basename(file)
16
+ end
17
+ end
18
+
19
+ describe "syntax" do
20
+ it "finds syntax by path" do
21
+ Textpow.syntax('lib/textpow/syntax/source.ruby.syntax').name.should == 'Ruby'
22
+ end
23
+
24
+ it "finds a syntax by scopeName" do
25
+ Textpow.syntax('source.ruby').name.should == 'Ruby'
26
+ end
27
+
28
+ it "caches found syntax" do
29
+ Textpow.syntax('ruby').name.should == 'Ruby'
30
+ Dir.should_not_receive(:glob)
31
+ Textpow.syntax('ruby').name.should == 'Ruby'
32
+ end
33
+
34
+ it "finds a syntax by name parts" do
35
+ Textpow.syntax('ruby').name.should == 'Ruby'
36
+ end
37
+
38
+ it "returns the found syntax for mixed case" do
39
+ Textpow.syntax('RuBy').name.should == 'Ruby'
40
+ end
41
+
42
+ it "returns nil for unfound syntax" do
43
+ Textpow.syntax('buby').should == nil
44
+ end
45
+
46
+ it "does not find directories" do
47
+ Textpow.syntax('lib').should == nil
48
+ end
49
+
50
+ it "caches nil for unfound syntax" do
51
+ Dir.should_receive(:glob).and_return []
52
+ Textpow.syntax('buby').should == nil
53
+ Dir.should_not_receive(:glob)
54
+ Textpow.syntax('buby').should == nil
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,19 @@
1
+ $LOAD_PATH.push File.expand_path("../lib", __FILE__)
2
+ require "textpow/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "textpow"
6
+ s.version = Textpow::Version
7
+ s.authors = ["Dizan Vasquez", "Spox", "Chris Hoffman", "Michael Grosser"]
8
+ s.email = ["michael@grosser.it"]
9
+ s.homepage = "http://github.com/grosser/textpow"
10
+ s.summary = "A library for parsing TextMate bundles"
11
+ s.description = s.summary
12
+ s.license = "MIT"
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.executables = ["plist2yaml", "plist2syntax"]
16
+ s.rdoc_options = ["--main", "README.rdoc"]
17
+
18
+ s.add_dependency "plist", '>=3.0.1'
19
+ end
metadata CHANGED
@@ -1,86 +1,264 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: textpow
3
- version: !ruby/object:Gem::Version
4
- version: 0.10.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Dizan Vasquez
9
+ - Spox
10
+ - Chris Hoffman
11
+ - Michael Grosser
8
12
  autorequire:
9
13
  bindir: bin
10
14
  cert_chain: []
11
-
12
- date: 2008-02-20 00:00:00 +01:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: oniguruma
17
- version_requirement:
18
- version_requirements: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.1.0
23
- version:
24
- - !ruby/object:Gem::Dependency
15
+ date: 2012-08-19 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
25
18
  name: plist
26
- version_requirement:
27
- version_requirements: !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: 3.0.0
32
- version:
33
- description: A library for parsing TextMate[http://macromates.com/] bundles.
34
- email: dichodaemon@gmail.com
35
- executables:
19
+ requirement: !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ! '>='
23
+ - !ruby/object:Gem::Version
24
+ version: 3.0.1
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 3.0.1
33
+ description: A library for parsing TextMate bundles
34
+ email:
35
+ - michael@grosser.it
36
+ executables:
36
37
  - plist2yaml
37
38
  - plist2syntax
38
39
  extensions: []
39
-
40
- extra_rdoc_files:
41
- - History.txt
42
- - Manifest.txt
43
- - README.txt
44
- files:
45
- - bin/plist2yaml
40
+ extra_rdoc_files: []
41
+ files:
42
+ - .travis.yml
43
+ - Gemfile
44
+ - Gemfile.lock
45
+ - History.rdoc
46
+ - MIT-LICENSE.txt
47
+ - README.rdoc
48
+ - Rakefile
46
49
  - bin/plist2syntax
50
+ - bin/plist2yaml
51
+ - examples/benchmark_js.rb
52
+ - examples/jquery.js
47
53
  - lib/textpow.rb
48
- - lib/textpow
49
- - lib/textpow/syntax.rb
50
- - lib/textpow/score_manager.rb
51
54
  - lib/textpow/debug_processor.rb
52
- - mm/manual.mm
53
- - test/test_textpow.rb
54
- - History.txt
55
- - Rakefile
56
- - Manifest.txt
57
- - README.txt
58
- has_rdoc: true
59
- homepage: http://textpow.rubyforge.org
55
+ - lib/textpow/recording_processor.rb
56
+ - lib/textpow/score_manager.rb
57
+ - lib/textpow/syntax.rb
58
+ - lib/textpow/syntax/broken/markdown.syntax
59
+ - lib/textpow/syntax/broken/php.syntax
60
+ - lib/textpow/syntax/buggy/nemerle.syntax
61
+ - lib/textpow/syntax/old/YAML.yaml
62
+ - lib/textpow/syntax/old/txt2tags.yaml
63
+ - lib/textpow/syntax/source.actionscript.syntax
64
+ - lib/textpow/syntax/source.active4d.library.syntax
65
+ - lib/textpow/syntax/source.active4d.syntax
66
+ - lib/textpow/syntax/source.ada.syntax
67
+ - lib/textpow/syntax/source.antlr.syntax
68
+ - lib/textpow/syntax/source.apache-config.mod_perl.syntax
69
+ - lib/textpow/syntax/source.apache-config.syntax
70
+ - lib/textpow/syntax/source.applescript.syntax
71
+ - lib/textpow/syntax/source.asp.syntax
72
+ - lib/textpow/syntax/source.asp.vb.net.syntax
73
+ - lib/textpow/syntax/source.c++.qt.syntax
74
+ - lib/textpow/syntax/source.c++.syntax
75
+ - lib/textpow/syntax/source.c-sharp.syntax
76
+ - lib/textpow/syntax/source.c.ragel.syntax
77
+ - lib/textpow/syntax/source.c.syntax
78
+ - lib/textpow/syntax/source.camlp4.ocaml.syntax
79
+ - lib/textpow/syntax/source.cm.syntax
80
+ - lib/textpow/syntax/source.coffee.syntax
81
+ - lib/textpow/syntax/source.context-free.syntax
82
+ - lib/textpow/syntax/source.css.beta.syntax
83
+ - lib/textpow/syntax/source.css.syntax
84
+ - lib/textpow/syntax/source.d.syntax
85
+ - lib/textpow/syntax/source.diff.syntax
86
+ - lib/textpow/syntax/source.dot.syntax
87
+ - lib/textpow/syntax/source.dylan.syntax
88
+ - lib/textpow/syntax/source.eiffel.syntax
89
+ - lib/textpow/syntax/source.erlang.syntax
90
+ - lib/textpow/syntax/source.fortran.syntax
91
+ - lib/textpow/syntax/source.fscript.syntax
92
+ - lib/textpow/syntax/source.fxscript.syntax
93
+ - lib/textpow/syntax/source.gri.syntax
94
+ - lib/textpow/syntax/source.groovy.groovy.syntax
95
+ - lib/textpow/syntax/source.haskell.syntax
96
+ - lib/textpow/syntax/source.icalendar.syntax
97
+ - lib/textpow/syntax/source.inform.syntax
98
+ - lib/textpow/syntax/source.ini.syntax
99
+ - lib/textpow/syntax/source.io.syntax
100
+ - lib/textpow/syntax/source.java-props.syntax
101
+ - lib/textpow/syntax/source.java.syntax
102
+ - lib/textpow/syntax/source.js.greasemonkey.syntax
103
+ - lib/textpow/syntax/source.js.jquery.syntax
104
+ - lib/textpow/syntax/source.js.mootools.syntax
105
+ - lib/textpow/syntax/source.js.prototype.bracketed.syntax
106
+ - lib/textpow/syntax/source.js.prototype.syntax
107
+ - lib/textpow/syntax/source.js.syntax
108
+ - lib/textpow/syntax/source.js.yui.syntax
109
+ - lib/textpow/syntax/source.json.syntax
110
+ - lib/textpow/syntax/source.lex.syntax
111
+ - lib/textpow/syntax/source.lighttpd-config.syntax
112
+ - lib/textpow/syntax/source.lilypond.syntax
113
+ - lib/textpow/syntax/source.lisp.syntax
114
+ - lib/textpow/syntax/source.logo.syntax
115
+ - lib/textpow/syntax/source.logtalk.syntax
116
+ - lib/textpow/syntax/source.lua.syntax
117
+ - lib/textpow/syntax/source.makefile.syntax
118
+ - lib/textpow/syntax/source.matlab.syntax
119
+ - lib/textpow/syntax/source.mel.syntax
120
+ - lib/textpow/syntax/source.mips.syntax
121
+ - lib/textpow/syntax/source.ml.syntax
122
+ - lib/textpow/syntax/source.modula-3.syntax
123
+ - lib/textpow/syntax/source.nant-build.syntax
124
+ - lib/textpow/syntax/source.objc++.syntax
125
+ - lib/textpow/syntax/source.objc.syntax
126
+ - lib/textpow/syntax/source.ocaml.syntax
127
+ - lib/textpow/syntax/source.ocamllex.syntax
128
+ - lib/textpow/syntax/source.ocamlyacc.syntax
129
+ - lib/textpow/syntax/source.open-gl.syntax
130
+ - lib/textpow/syntax/source.pascal.syntax
131
+ - lib/textpow/syntax/source.pascal.vectorscript.syntax
132
+ - lib/textpow/syntax/source.perl.syntax
133
+ - lib/textpow/syntax/source.php.cake.syntax
134
+ - lib/textpow/syntax/source.plist.tm-grammar.syntax
135
+ - lib/textpow/syntax/source.postscript.syntax
136
+ - lib/textpow/syntax/source.processing.syntax
137
+ - lib/textpow/syntax/source.prolog.syntax
138
+ - lib/textpow/syntax/source.python.django.syntax
139
+ - lib/textpow/syntax/source.python.syntax
140
+ - lib/textpow/syntax/source.qmake.syntax
141
+ - lib/textpow/syntax/source.quake-config.syntax
142
+ - lib/textpow/syntax/source.r-console.syntax
143
+ - lib/textpow/syntax/source.r.syntax
144
+ - lib/textpow/syntax/source.regexp.oniguruma.syntax
145
+ - lib/textpow/syntax/source.regexp.python.syntax
146
+ - lib/textpow/syntax/source.regexp.syntax
147
+ - lib/textpow/syntax/source.remind.syntax
148
+ - lib/textpow/syntax/source.rez.syntax
149
+ - lib/textpow/syntax/source.ruby.experimental.syntax
150
+ - lib/textpow/syntax/source.ruby.rails.syntax
151
+ - lib/textpow/syntax/source.ruby.syntax
152
+ - lib/textpow/syntax/source.s5.syntax
153
+ - lib/textpow/syntax/source.sass.syntax
154
+ - lib/textpow/syntax/source.scheme.syntax
155
+ - lib/textpow/syntax/source.scilab.syntax
156
+ - lib/textpow/syntax/source.scss.syntax
157
+ - lib/textpow/syntax/source.shell.syntax
158
+ - lib/textpow/syntax/source.slate.syntax
159
+ - lib/textpow/syntax/source.smarty.syntax
160
+ - lib/textpow/syntax/source.sql.ruby.syntax
161
+ - lib/textpow/syntax/source.sql.syntax
162
+ - lib/textpow/syntax/source.ssh-config.syntax
163
+ - lib/textpow/syntax/source.strings.syntax
164
+ - lib/textpow/syntax/source.swig.syntax
165
+ - lib/textpow/syntax/source.tcl.macports.syntax
166
+ - lib/textpow/syntax/source.tcl.syntax
167
+ - lib/textpow/syntax/source.yaml.syntax
168
+ - lib/textpow/syntax/text.active4d-ini.syntax
169
+ - lib/textpow/syntax/text.bbcode.syntax
170
+ - lib/textpow/syntax/text.bibtex.syntax
171
+ - lib/textpow/syntax/text.blog.html.syntax
172
+ - lib/textpow/syntax/text.blog.markdown.syntax
173
+ - lib/textpow/syntax/text.blog.syntax
174
+ - lib/textpow/syntax/text.blog.textile.syntax
175
+ - lib/textpow/syntax/text.gtdalt.syntax
176
+ - lib/textpow/syntax/text.haml.syntax
177
+ - lib/textpow/syntax/text.html.asp.net.syntax
178
+ - lib/textpow/syntax/text.html.asp.syntax
179
+ - lib/textpow/syntax/text.html.basic.syntax
180
+ - lib/textpow/syntax/text.html.cfm.syntax
181
+ - lib/textpow/syntax/text.html.django.syntax
182
+ - lib/textpow/syntax/text.html.dokuwiki.syntax
183
+ - lib/textpow/syntax/text.html.doxygen.syntax
184
+ - lib/textpow/syntax/text.html.markdown.multimarkdown.syntax
185
+ - lib/textpow/syntax/text.html.mason.syntax
186
+ - lib/textpow/syntax/text.html.mediawiki.syntax
187
+ - lib/textpow/syntax/text.html.mt.syntax
188
+ - lib/textpow/syntax/text.html.ruby.syntax
189
+ - lib/textpow/syntax/text.html.strict.active4d.syntax
190
+ - lib/textpow/syntax/text.html.tcl.syntax
191
+ - lib/textpow/syntax/text.html.textile.syntax
192
+ - lib/textpow/syntax/text.html.tt.syntax
193
+ - lib/textpow/syntax/text.html.twiki.syntax
194
+ - lib/textpow/syntax/text.html.xhtml.1-strict.syntax
195
+ - lib/textpow/syntax/text.log.latex.syntax
196
+ - lib/textpow/syntax/text.mail.markdown.syntax
197
+ - lib/textpow/syntax/text.man.syntax
198
+ - lib/textpow/syntax/text.moinmoin.syntax
199
+ - lib/textpow/syntax/text.plain.gtd.syntax
200
+ - lib/textpow/syntax/text.plain.release-notes.syntax
201
+ - lib/textpow/syntax/text.plain.syntax
202
+ - lib/textpow/syntax/text.plist.syntax
203
+ - lib/textpow/syntax/text.pmwiki.syntax
204
+ - lib/textpow/syntax/text.restructuredtext.syntax
205
+ - lib/textpow/syntax/text.setext.syntax
206
+ - lib/textpow/syntax/text.subversion-commit.syntax
207
+ - lib/textpow/syntax/text.tabular.csv.syntax
208
+ - lib/textpow/syntax/text.tabular.tsv.syntax
209
+ - lib/textpow/syntax/text.tex.latex.beamer.syntax
210
+ - lib/textpow/syntax/text.tex.latex.haskell.syntax
211
+ - lib/textpow/syntax/text.tex.latex.memoir.syntax
212
+ - lib/textpow/syntax/text.tex.latex.rd.syntax
213
+ - lib/textpow/syntax/text.tex.latex.sweave.syntax
214
+ - lib/textpow/syntax/text.tex.latex.syntax
215
+ - lib/textpow/syntax/text.tex.math.syntax
216
+ - lib/textpow/syntax/text.tex.syntax
217
+ - lib/textpow/syntax/text.txt2tags.syntax
218
+ - lib/textpow/syntax/text.xml.apple-dist.syntax
219
+ - lib/textpow/syntax/text.xml.strict.syntax
220
+ - lib/textpow/syntax/text.xml.syntax
221
+ - lib/textpow/syntax/text.xml.xsl.syntax
222
+ - lib/textpow/version.rb
223
+ - spec/fixtures/objeck.plist
224
+ - spec/fixtures/utf8.txt
225
+ - spec/spec_helper.rb
226
+ - spec/textpow/score_manager_spec.rb
227
+ - spec/textpow/syntax_files_spec.rb
228
+ - spec/textpow/syntax_spec.rb
229
+ - spec/textpow_spec.rb
230
+ - textpow.gemspec
231
+ homepage: http://github.com/grosser/textpow
232
+ licenses:
233
+ - MIT
60
234
  post_install_message:
61
- rdoc_options:
235
+ rdoc_options:
62
236
  - --main
63
- - README.txt
64
- require_paths:
237
+ - README.rdoc
238
+ require_paths:
65
239
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: "0"
71
- version:
72
- required_rubygems_version: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: "0"
77
- version:
240
+ required_ruby_version: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ! '>='
244
+ - !ruby/object:Gem::Version
245
+ version: '0'
246
+ segments:
247
+ - 0
248
+ hash: 1600551724538838794
249
+ required_rubygems_version: !ruby/object:Gem::Requirement
250
+ none: false
251
+ requirements:
252
+ - - ! '>='
253
+ - !ruby/object:Gem::Version
254
+ version: '0'
255
+ segments:
256
+ - 0
257
+ hash: 1600551724538838794
78
258
  requirements: []
79
-
80
- rubyforge_project: textpow
81
- rubygems_version: 1.0.1
259
+ rubyforge_project:
260
+ rubygems_version: 1.8.24
82
261
  signing_key:
83
- specification_version: 2
84
- summary: An engine for parsing Textmate bundles
85
- test_files:
86
- - test/test_textpow.rb
262
+ specification_version: 3
263
+ summary: A library for parsing TextMate bundles
264
+ test_files: []
@@ -1,13 +0,0 @@
1
- bin/plist2yaml
2
- bin/plist2syntax
3
- lib/textpow.rb
4
- lib/textpow
5
- lib/textpow/syntax.rb
6
- lib/textpow/score_manager.rb
7
- lib/textpow/debug_processor.rb
8
- mm/manual.mm
9
- test/test_textpow.rb
10
- History.txt
11
- Rakefile
12
- Manifest.txt
13
- README.txt
@@ -1,266 +0,0 @@
1
- ~ Textpow ~
2
- ~~ A Library for Processing TextMate Bundles ~~
3
-
4
- #Introduction# | index
5
-
6
- = What is Textpow? =
7
- Textpow is a library to parse and process
8
- [Textmate http://macromates.com] bundles. Although created created for their
9
- use in a word processor, these bundles have many other uses. For example, we
10
- have used them to create a syntax highligting
11
- [utility http://ultraviolet.rubyforge.org] and also the markup rendering
12
- [engine http://mama.rubyforge.org] used to render this
13
- documentation.
14
-
15
- = Requirements =
16
-
17
- * [Oniguruma http://www.geocities.jp/kosako3/oniguruma/] regular expression library (/>= 4.x.x/)
18
- * [Oniguruma for Ruby http://www.geocities.jp/kosako3/oniguruma/] ruby bindings for oniguruma (/>= 1.1.x/)
19
-
20
- = Installation =
21
-
22
- If you have [rubygems http://docs.rubygems.org/] installation is straightforward by typing
23
- (as root if needed):
24
-
25
- --------hl shell-unix-generic,,false------
26
- gem install -r textpow --include-dependencies
27
- ------------------------------------------
28
-
29
- If you prefer to get the sources, the last stable version may be
30
- downloaded [here http://rubyforge.org/frs/?group_id=3513].
31
-
32
- = Status =
33
-
34
- The current version of Textpow (0.9.0) is able to parse syntax (/tmLanguage/, /tmSyntax/)
35
- and theme (/tmTheme/) files.
36
-
37
- #Use#
38
-
39
- = Syntax files and text parsing =
40
-
41
- The idea of parsing is to process some /input text/ using the rules defined in
42
- a /syntax [file > syntax_files]/ (which are discussed in detail in Textmate
43
- [documentation http://macromates.com/textmate/manual/language_grammars#language_grammars]).
44
- The text is parsed line by line, and, events are sent to a /[processor > processors]/
45
- according to how the text matches the syntax file.
46
-
47
- -------dot parsing_overview, Overview of the parsing process.----------
48
- digraph G {
49
- node [fontname=Helvetica, fontsize=10];
50
- edge [fontname=Helvetica, style=dashed, fontsize=10, decorate=true, fontcolor="#0066aa"];
51
- center=true;
52
- {
53
- rank=same;
54
- node [shape=invhouse, style="filled", color="#333399", fillcolor="#6666cc", fontcolor="white"];
55
- syntax_file[label="Syntax file"];
56
- text[label="Input text"];
57
- }
58
- {
59
- node [shape=box, style="filled", color="#993333", fillcolor="#cc6666", fontcolor="white"]
60
- syntax_object[label="SyntaxNode"];
61
- processor[label="Processor", shape=box];
62
- }
63
- parse [label="", style=invis, fontsize=0,height=0,width=0,shape=none];
64
- rank=same{syntax_object; parse};
65
-
66
- syntax_file -> syntax_object [label=" SyntaxNode#load"];
67
- syntax_object -> parse [arrowhead=none];
68
- text -> parse [arrowhead=none];
69
- parse -> processor [label=" SyntaxNode#parse"];
70
-
71
- }
72
- -----------------------------------------------------------------------
73
-
74
- = For the impatient =
75
-
76
- Parsing a file using Textpow is as easy as 1-2-3!
77
-
78
- 1. Load the Syntax File:
79
-
80
- ---hl ruby,,false---
81
- require 'textpow'
82
- syntax = Textpow::SyntaxNode.load("ruby.tmSyntax")
83
- -------------
84
-
85
- 2. Initialize a processor:
86
- ---hl ruby,,false---
87
- processor = Textpow::DebugProcessor.new
88
- -------------
89
-
90
- 3. Parse some text:
91
- ---hl ruby,,false---
92
- syntax.parse( text, processor )
93
- -------------
94
-
95
- = The gory details =
96
-
97
-
98
- == Syntax files == | syntax_files
99
- At the heart of syntax parsing are ..., well, syntax files. Lets see for instance
100
- the example syntax that appears in textmate's
101
- [documentation http://macromates.com/textmate/manual/language_grammars#language_grammars]:
102
-
103
-
104
- ---------hl property_list---------
105
- { scopeName = 'source.untitled';
106
- fileTypes = ( txt );
107
- foldingStartMarker = '\{\s*$';
108
- foldingStopMarker = '^\s*\}';
109
- patterns = (
110
- { name = 'keyword.control.untitled';
111
- match = '\b(if|while|for|return)\b';
112
- },
113
- { name = 'string.quoted.double.untitled';
114
- begin = '"';
115
- end = '"';
116
- patterns = (
117
- { name = 'constant.character.escape.untitled';
118
- match = '\\.';
119
- }
120
- );
121
- },
122
- );
123
- }
124
- ----------------------------------
125
-
126
- But Textpow is not able to parse text pfiles. However, in practice this is not a problem,
127
- since it is possible to convert both text and binary pfiles to an XML format. Indeed, all
128
- the syntaxes in the Textmate syntax [repository http://macromates.com/svn/Bundles/trunk/Bundles/]
129
- are in XML format:
130
-
131
- ---------hl xml---------
132
- <?xml version="1.0" encoding="UTF-8"?>
133
- <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
134
- <plist version="1.0">
135
- <dict>
136
- <key>scopeName</key>
137
- <string>source.untitled</string>
138
- <key>fileTypes</key>
139
- <array>
140
- <string>txt</string>
141
- </array>
142
- <key>foldingStartMarker</key>
143
- <string>\{\s*$</string>
144
- <key>foldingStopMarker</key>
145
- <string>^\s*\}</string>
146
- <key>patterns</key>
147
- <array>
148
- <dict>
149
- <key>name</key>
150
- <string>keyword.control.untitled</string>
151
- <key>match</key>
152
- <string>\b(if|while|for|return)\b</string>
153
- </dict>
154
- <dict>
155
- <key>name</key>
156
- <string>string.quoted.double.untitled</string>
157
- <key>begin</key>
158
- <string>"</string>
159
- <key>end</key>
160
- <string>"</string>
161
- <key>patterns</key>
162
- <array>
163
- <dict>
164
- <key>name</key>
165
- <string>constant.character.escape.untitled</string>
166
- <key>match</key>
167
- <string>\\.</string>
168
- </dict>
169
- </array>
170
- </dict>
171
- </array>
172
- </dict>
173
- ------------------------
174
-
175
- Of course, most people find XML both ugly and cumbersome. Fortunately, it is
176
- also possible to store syntax files in YAML format, which is much easier to
177
- read:
178
-
179
- -------------hl yaml---------------
180
- ---
181
- fileTypes:
182
- - txt
183
- scopeName: source.untitled
184
- foldingStartMarker: \{\s*$
185
- foldingStopMarker: ^\s*\}
186
- patterns:
187
- - name: keyword.control.untitled
188
- match: \b(if|while|for|return)\b
189
- - name: string.quoted.double.untitled
190
- begin: '"'
191
- end: '"'
192
- patterns:
193
- - name: constant.character.escape.untitled
194
- match: \\.
195
- -----------------------------------
196
-
197
- == Processors == | processors
198
-
199
- Until now we have talked about the parsing process without explaining what
200
- it is exactly. Basically, parsing consists in reading text from a string or
201
- file and applying tags to parts of the text according to what has been
202
- specified in the [syntax file > syntax_files].
203
-
204
- In textpow, the process takes place line by line, from the beginning to the
205
- end and from left to right for every line. As the text is parsed, events are
206
- sent to a /processor/ object when a tag is open or closed and so on.
207
- A processor is any object which implements one or more of the following
208
- methods:
209
-
210
- ------------hl ruby--------------
211
- class Processor
212
- def open_tag name, position
213
- end
214
-
215
- def close_tag name, position
216
- end
217
-
218
- def new_line line
219
- end
220
-
221
- def start_parsing name
222
- end
223
-
224
- def end_parsing name
225
- end
226
- end
227
- ---------------------------------
228
-
229
- * `open_tag`. Is called when a new tag is opened, it receives the tag's name and
230
- its position (relative to the current line).
231
- * `close_tag`. The same that `open_tag`, but it is called when a tag is closed.
232
- * `new_line`. Is called every time that a new line is processed, it receives the
233
- line's contents.
234
- * `start_parsing`. Is called once at the beginning of the parsing process. It
235
- receives the scope name for the syntax being used.
236
- * `end_parsing`. Is called once after all the input text has been parsed. It
237
- receives the scope name for the syntax being used.
238
-
239
- Textpow ensures that the methods are called in parsing order, thus,
240
- for example, if there are two subsequent calls to `open_tag`, the first
241
- having `name="text.string", position=10` and the second having
242
- `name="markup.string", position=10`, it should be understood that the
243
- `"markup.string"` tag is /inside/ the `"text.string"` tag.
244
-
245
- # Links #
246
-
247
-
248
- = Rubyforge project page =
249
-
250
- * [Textpow http://rubyforge.org/projects/textpow].
251
-
252
- = Documentation =
253
-
254
- * [Textmate documentation http://macromates.com/textmate/manual/].
255
- * [YAML cookbook http://yaml4r.sourceforge.net/cookbook/].
256
-
257
- = Requirements =
258
-
259
- * [Oniguruma http://www.geocities.jp/kosako3/oniguruma/].
260
- * [Oniguruma for ruby http://rubyforge.org/projects/oniguruma/].
261
- * [Ruby plist parsing library http://rubyforge.org/projects/plist].
262
-
263
- = Projects using Textpow =
264
-
265
- * [Ultraviolet Syntax Highlighting Engine http://ultraviolet.rubyforge.org/].
266
- * [Macaronic markup engine http://mama.rubyforge.org/].