motiro 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. data/AUTHORS +15 -0
  2. data/README +2 -2
  3. data/README.en +1 -2
  4. data/README.pt-br +1 -2
  5. data/app/controllers/account_controller.rb +1 -1
  6. data/app/controllers/application.rb +13 -12
  7. data/app/controllers/javascript_controller.rb +1 -1
  8. data/app/controllers/report_controller.rb +1 -1
  9. data/app/controllers/wiki_controller.rb +3 -5
  10. data/app/core/cache_reporter.rb +1 -1
  11. data/app/core/cache_reporter_fetcher.rb +1 -1
  12. data/app/core/chief_editor.rb +1 -1
  13. data/app/core/reporter.rb +1 -1
  14. data/app/core/reporter_driver.rb +1 -1
  15. data/app/core/reporter_fetcher.rb +1 -1
  16. data/app/core/settings.rb +1 -1
  17. data/app/core/version.rb +1 -1
  18. data/app/core/wiki_reporter.rb +1 -1
  19. data/app/helpers/application_helper.rb +5 -1
  20. data/app/helpers/default_page_provider.rb +6 -2
  21. data/app/helpers/report_helper.rb +14 -1
  22. data/app/models/change.rb +1 -1
  23. data/app/models/chunk.rb +1 -1
  24. data/app/models/feed_observer.rb +1 -1
  25. data/app/models/headline.rb +1 -1
  26. data/app/models/page.rb +38 -4
  27. data/app/models/revision.rb +1 -1
  28. data/app/models/user.rb +1 -1
  29. data/app/models/wiki_reference.rb +21 -0
  30. data/app/models/wiki_sweeper.rb +17 -2
  31. data/app/ports/chdir_runner.rb +1 -1
  32. data/app/ports/runner.rb +1 -1
  33. data/app/reporters/darcs_connection.rb +1 -1
  34. data/app/reporters/darcs_reporter.rb +1 -1
  35. data/app/reporters/darcs_temp_repo.rb +1 -1
  36. data/app/reporters/events_reporter.rb +1 -1
  37. data/app/reporters/features_reporter.rb +1 -1
  38. data/app/reporters/subversion_reporter.rb +1 -1
  39. data/app/reporters/svn_connection.rb +1 -1
  40. data/app/reporters/svn_settings.rb +1 -1
  41. data/app/views/report/list.rhtml +6 -7
  42. data/app/views/report/older.rhtml +1 -2
  43. data/app/views/report/rss.rxml +1 -1
  44. data/app/views/report/show.rhtml +2 -2
  45. data/app/views/wiki/_edit_event.rhtml +2 -0
  46. data/app/views/wiki/_edit_feature.rhtml +2 -0
  47. data/app/views/wiki/_properties_edit.rhtml +3 -5
  48. data/app/views/wiki/_properties_show.rhtml +4 -5
  49. data/app/views/wiki/_show_event.rhtml +3 -0
  50. data/app/views/wiki/_show_feature.rhtml +2 -0
  51. data/app/views/wiki/show.rhtml +1 -1
  52. data/bin/motiro +3 -3
  53. data/config/routes.rb +1 -1
  54. data/db/migrate/024_add_feature_status.rb +11 -0
  55. data/db/migrate/025_add_page_references.rb +12 -0
  56. data/db/migrate/026_convert_link_syntax.rb +12 -0
  57. data/db/migrate/027_register_page_references.rb +12 -0
  58. data/db/motirodb.sqlite.initial +0 -0
  59. data/db/schema_version +1 -1
  60. data/db/translation/pt-BR.rb +7 -1
  61. data/lib/array_extensions.rb +1 -1
  62. data/lib/diff_chunk_builder.rb +1 -1
  63. data/lib/differ.rb +1 -1
  64. data/lib/string_extensions.rb +13 -6
  65. data/lib/stub_hash.rb +1 -1
  66. data/lib/tasks/packaging.rake +10 -12
  67. data/lib/tasks/testing.rake +1 -1
  68. data/lib/tick_daemon.rb +1 -1
  69. data/lib/{wiki_url_generator.rb → wiki_link_handler.rb} +13 -3
  70. data/lib/wiki_renderer.rb +63 -34
  71. data/public/images/done.png +0 -0
  72. data/public/images/not-done.png +0 -0
  73. data/public/stylesheets/motiro.css +8 -0
  74. data/script/ticker +1 -1
  75. data/test/acceptance/account_test.rb +1 -1
  76. data/test/acceptance/darcs_test.rb +1 -1
  77. data/test/acceptance/events_test.rb +1 -1
  78. data/test/acceptance/main_page_test.rb +1 -1
  79. data/test/acceptance/subversion_test.rb +1 -1
  80. data/test/acceptance/ts_all_suites.rb +1 -1
  81. data/test/acceptance/wiki_test.rb +3 -3
  82. data/test/contract/darcs_test.rb +1 -1
  83. data/test/contract/remote_darcs_test.rb +1 -1
  84. data/test/contract/svn_test.rb +1 -1
  85. data/test/fixtures/pages.yml +20 -1
  86. data/test/fixtures/revisions.yml +40 -1
  87. data/test/fixtures/wiki_references.yml +5 -0
  88. data/test/functional/report_controller_test.rb +1 -1
  89. data/test/functional/report_features_test.rb +8 -1
  90. data/test/functional/report_subversion_test.rb +1 -1
  91. data/test/functional/root_controller_test.rb +1 -1
  92. data/test/functional/wiki_controller_test.rb +67 -2
  93. data/test/lib/acceptance_test_case.rb +1 -1
  94. data/test/lib/darcs_excerpts.rb +1 -1
  95. data/test/lib/darcs_repo.rb +1 -1
  96. data/test/lib/hash_extensions.rb +22 -0
  97. data/test/lib/live_mode_test.rb +1 -1
  98. data/test/lib/netutils.rb +1 -1
  99. data/test/lib/platform_thread.rb +1 -1
  100. data/test/lib/selenium_extensions.rb +1 -1
  101. data/test/lib/stubio.rb +1 -1
  102. data/test/lib/webserver.rb +1 -1
  103. data/test/meta/darcs_repo_test.rb +1 -1
  104. data/test/meta/local_svn_test.rb +1 -1
  105. data/test/meta/platform_thread_test.rb +1 -1
  106. data/test/meta/stubio_test.rb +1 -1
  107. data/test/stubs/{url_generator.rb → wiki_link_handler.rb} +8 -4
  108. data/test/test_helper.rb +3 -1
  109. data/test/unit/array_extensions_test.rb +1 -1
  110. data/test/unit/cache_reporter_fetcher_test.rb +1 -1
  111. data/test/unit/cache_reporter_test.rb +1 -1
  112. data/test/unit/change_test.rb +1 -1
  113. data/test/unit/chdir_runner_test.rb +1 -1
  114. data/test/unit/chief_editor_test.rb +1 -1
  115. data/test/unit/darcs_connection_test.rb +1 -1
  116. data/test/unit/darcs_reporter_test.rb +4 -4
  117. data/test/unit/darcs_temp_repo_test.rb +1 -1
  118. data/test/unit/default_page_provider_test.rb +23 -13
  119. data/test/unit/diff_chunk_builder_test.rb +1 -1
  120. data/test/unit/page_test.rb +67 -4
  121. data/test/unit/reporter_driver_test.rb +1 -1
  122. data/test/unit/reporter_test.rb +1 -1
  123. data/test/unit/revision_test.rb +1 -1
  124. data/test/unit/runner_test.rb +1 -1
  125. data/test/unit/string_extensions_test.rb +15 -3
  126. data/test/unit/svn_connection_test.rb +1 -1
  127. data/test/unit/svn_reporter_interaction_test.rb +1 -1
  128. data/test/unit/svn_reporter_test.rb +1 -1
  129. data/test/unit/svn_settings_test.rb +1 -1
  130. data/test/unit/user_test.rb +1 -1
  131. data/test/unit/{wiki_url_generator_test.rb → wiki_link_handler_test.rb} +3 -3
  132. data/test/unit/wiki_renderer_test.rb +75 -20
  133. data/test/unit/wiki_reporter_test.rb +1 -1
  134. data/vendor/mediacloth-trunk/MIT-LICENSE +20 -0
  135. data/vendor/mediacloth-trunk/README +32 -0
  136. data/vendor/mediacloth-trunk/Rakefile +33 -0
  137. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiast.rb +122 -0
  138. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikihtmlgenerator.rb +252 -0
  139. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikilexer.rb +821 -0
  140. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikilinkhandler.rb +68 -0
  141. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparams.rb +33 -0
  142. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparser.rb +1218 -0
  143. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiparser.y +493 -0
  144. data/vendor/mediacloth-trunk/lib/mediacloth/mediawikiwalker.rb +146 -0
  145. data/vendor/mediacloth-trunk/lib/mediacloth.rb +29 -0
  146. data/vendor/mediacloth-trunk/mediacloth.gemspec +24 -0
  147. data/vendor/mediacloth-trunk/mediacloth.kdevelop +117 -0
  148. data/vendor/mediacloth-trunk/setup.rb +1585 -0
  149. data/vendor/mediacloth-trunk/test/data/html1 +26 -0
  150. data/vendor/mediacloth-trunk/test/data/html10 +130 -0
  151. data/vendor/mediacloth-trunk/test/data/html11 +17 -0
  152. data/vendor/mediacloth-trunk/test/data/html12 +12 -0
  153. data/vendor/mediacloth-trunk/test/data/html13 +11 -0
  154. data/vendor/mediacloth-trunk/test/data/html2 +2 -0
  155. data/vendor/mediacloth-trunk/test/data/html3 +1 -0
  156. data/vendor/mediacloth-trunk/test/data/html4 +47 -0
  157. data/vendor/mediacloth-trunk/test/data/html5 +57 -0
  158. data/vendor/mediacloth-trunk/test/data/html6 +8 -0
  159. data/vendor/mediacloth-trunk/test/data/html7 +45 -0
  160. data/vendor/mediacloth-trunk/test/data/html8 +1 -0
  161. data/vendor/mediacloth-trunk/test/data/html9 +14 -0
  162. data/vendor/mediacloth-trunk/test/data/input1 +34 -0
  163. data/vendor/mediacloth-trunk/test/data/input10 +124 -0
  164. data/vendor/mediacloth-trunk/test/data/input11 +17 -0
  165. data/vendor/mediacloth-trunk/test/data/input12 +15 -0
  166. data/vendor/mediacloth-trunk/test/data/input13 +10 -0
  167. data/vendor/mediacloth-trunk/test/data/input2 +2 -0
  168. data/vendor/mediacloth-trunk/test/data/input3 +2 -0
  169. data/vendor/mediacloth-trunk/test/data/input4 +50 -0
  170. data/vendor/mediacloth-trunk/test/data/input5 +63 -0
  171. data/vendor/mediacloth-trunk/test/data/input6 +8 -0
  172. data/vendor/mediacloth-trunk/test/data/input7 +45 -0
  173. data/vendor/mediacloth-trunk/test/data/input8 +1 -0
  174. data/vendor/mediacloth-trunk/test/data/input9 +14 -0
  175. data/vendor/mediacloth-trunk/test/data/lex1 +26 -0
  176. data/vendor/mediacloth-trunk/test/data/lex10 +85 -0
  177. data/vendor/mediacloth-trunk/test/data/lex11 +17 -0
  178. data/vendor/mediacloth-trunk/test/data/lex12 +15 -0
  179. data/vendor/mediacloth-trunk/test/data/lex13 +3 -0
  180. data/vendor/mediacloth-trunk/test/data/lex2 +2 -0
  181. data/vendor/mediacloth-trunk/test/data/lex3 +1 -0
  182. data/vendor/mediacloth-trunk/test/data/lex4 +47 -0
  183. data/vendor/mediacloth-trunk/test/data/lex5 +57 -0
  184. data/vendor/mediacloth-trunk/test/data/lex6 +8 -0
  185. data/vendor/mediacloth-trunk/test/data/lex7 +45 -0
  186. data/vendor/mediacloth-trunk/test/data/lex8 +1 -0
  187. data/vendor/mediacloth-trunk/test/data/lex9 +14 -0
  188. data/vendor/mediacloth-trunk/test/data/result1 +48 -0
  189. data/vendor/mediacloth-trunk/test/dataproducers/html.rb +18 -0
  190. data/vendor/mediacloth-trunk/test/dataproducers/lex.rb +15 -0
  191. data/vendor/mediacloth-trunk/test/debugwalker.rb +68 -0
  192. data/vendor/mediacloth-trunk/test/htmlgenerator.rb +97 -0
  193. data/vendor/mediacloth-trunk/test/lexer.rb +542 -0
  194. data/vendor/mediacloth-trunk/test/linkhandler.rb +39 -0
  195. data/vendor/mediacloth-trunk/test/parser.rb +22 -0
  196. data/vendor/mediacloth-trunk/test/testhelper.rb +27 -0
  197. data/vendor/mediacloth.rb +3 -0
  198. data/vendor/motiro-installer.rb +1 -1
  199. data/vendor/plugins/cache_test-0.2/CHANGELOG +14 -0
  200. data/vendor/plugins/cache_test-0.2/MIT-LICENSE +20 -0
  201. data/vendor/plugins/cache_test-0.2/README +124 -0
  202. data/vendor/plugins/cache_test-0.2/init.rb +8 -0
  203. data/vendor/plugins/cache_test-0.2/lib/fragment_cache_test.rb +205 -0
  204. data/vendor/plugins/cache_test-0.2/lib/page_cache_test.rb +140 -0
  205. data/vendor/plugins/global_routing/init.rb +1 -1
  206. metadata +517 -455
@@ -0,0 +1,63 @@
1
+ Unordered lists
2
+
3
+ *A
4
+ **A
5
+ ***a
6
+ ***b
7
+ ****a
8
+ *B
9
+ **b
10
+
11
+ *A
12
+ *B
13
+ *
14
+
15
+ Ordered lists
16
+
17
+ #a
18
+ ##a
19
+ ###a
20
+ ####a
21
+ #a
22
+ ##aa
23
+
24
+ #A
25
+ #B
26
+ #
27
+
28
+ Mixed lists
29
+
30
+ *a
31
+ *#1
32
+ *#2
33
+ *b
34
+
35
+ #a
36
+ #*1
37
+ #*2
38
+ #**2
39
+ #b
40
+
41
+ Dictionary lists
42
+
43
+ ;d
44
+
45
+
46
+ :t
47
+
48
+
49
+ ;d
50
+ :t
51
+
52
+
53
+ ;d
54
+ :t
55
+ :t
56
+
57
+
58
+ ;d
59
+ :t
60
+ ;d
61
+ :t
62
+
63
+ ;d :t [[image:foo.jpg]]
@@ -0,0 +1,8 @@
1
+ This is some text with '''bold''' and ''italic'' formating.
2
+ The list is also here:
3
+ * List Item 1
4
+ ** Sub list item 1
5
+ ** Sub list item 2
6
+ * List Item 2
7
+ The end
8
+ ----
@@ -0,0 +1,45 @@
1
+ http://sun.com
2
+
3
+ [http://sun.com]
4
+
5
+ [mailto:joe@sun.com]
6
+
7
+ [http://sun.com stars]
8
+
9
+ [http://sun.com stars and moon]
10
+
11
+ [http://sun.com stars and ''moon'' and '''trees''' and birds]
12
+
13
+ [http://sun.com <tt>sun</tt> and <tt>moon</tt>]
14
+
15
+ [http://sun.com sun > moon]
16
+
17
+ [[sun]]
18
+
19
+ [[sun|All about Sun]]
20
+
21
+ [[image:sun|All about Sun]]
22
+
23
+ [[sun|nofollow|All about Sun]]
24
+
25
+ [[sun|nofollow|Sun > Moon]]
26
+
27
+ [[sun|nofollow|<tt>sun</tt> and <tt>moon</tt>]]
28
+
29
+ [[image:sun|nofollow|All about Sun]]
30
+
31
+ [[image:sun|All about [[Sun]]]]
32
+
33
+ [[image:sun|All about [[sun|More about]]]]
34
+
35
+ [[image:sun|one||two||three|]]
36
+
37
+ [[image:sun|one|[[aaa|bbb|ccc]]|[[image:moon|aaa|bbb|ccc]]|two]]
38
+
39
+ []
40
+
41
+ [ ]
42
+
43
+ [[]]
44
+
45
+ [[ ]]
@@ -0,0 +1 @@
1
+ === foo ===
@@ -0,0 +1,14 @@
1
+ Some examples of wiki escaping.
2
+
3
+ A paragraph with some wiki characters: <nowiki>''italic'' '''bold''' [[Link]]</nowiki>
4
+
5
+ An escaped list:
6
+ <nowiki>
7
+ * one
8
+ * two
9
+ * three
10
+ </nowiki>
11
+
12
+ Text escaped in a heading:
13
+
14
+ ==Heading with <nowiki>'''</nowiki>==
@@ -0,0 +1,26 @@
1
+ PARA_STARTTEXTThis is a simple text with BOLD_START'''TEXTBold textBOLD_END'''TEXT and ITALIC_START''TEXTItalic textITALIC_END''TEXT inside.
2
+ One paragraph can be written in several lines.
3
+
4
+ PARA_ENDPARA_STARTTEXTAnother paragraph starts after a blank line.
5
+
6
+ PARA_ENDPARA_STARTTEXT
7
+ Another one.
8
+
9
+ PARA_ENDPARA_STARTTEXTThis is text with INTLINK_START[[TEXTInternal LinkINTLINK_END]]TEXT and LINK_START[TEXThttp://www.example.comLINKSEP TEXTexternal linkLINK_END]TEXT.
10
+
11
+ PARA_ENDPARA_STARTTEXTWe can have headlines:
12
+
13
+ PARA_ENDSECTION_START=TEXT Headline1 SECTION_END=SECTION_START==TEXT Headline2 SECTION_END==SECTION_START===TEXT Headline3 SECTION_END===SECTION_START====TEXT Headline4 SECTION_END====SECTION_START=====TEXT Headline5 SECTION_END=====SECTION_START======TEXT Headline6 SECTION_END======SECTION_START=======TEXT Headline7 SECTION_END=======PARA_STARTTEXT
14
+
15
+ PARA_ENDPARA_STARTTEXTHeadlines may have formatting:
16
+
17
+ PARA_ENDSECTION_START=TEXT See INTLINK_START[[TEXTInternal LinkINTLINK_END]]TEXT for more info SECTION_END=SECTION_START==TEXT This is an BOLD_START'''TEXTimportantBOLD_END'''TEXT heading SECTION_END==PARA_STARTTEXT
18
+
19
+ PARA_ENDPRE_STARTTEXT This is a preformatted BOLD_START'''TEXT BOLD_END'''TEXT << ITALIC_START''TEXT ITALIC_END''TEXT text
20
+ yes
21
+ PRE_ENDHLINE----PARA_STARTTEXT
22
+ This is a text after the line.
23
+
24
+ PARA_ENDUL_STARTLI_STARTTEXTfoo
25
+ LI_ENDLI_STARTTEXT foo2
26
+ LI_ENDUL_ENDfalsefalse
@@ -0,0 +1,85 @@
1
+ PARA_STARTTEXTSome examples of tables.
2
+
3
+ PARA_ENDTABLE_START{|TABLE_END|}PARA_STARTTEXT
4
+
5
+ PARA_ENDTABLE_START{|ROW_START|-ROW_ENDTABLE_END|}PARA_STARTTEXT
6
+
7
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
8
+ CELL_ENDCELL_START|TEXT b
9
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
10
+
11
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
12
+ CELL_ENDCELL_START|TEXT b
13
+ CELL_ENDROW_ENDROW_START|-CELL_START|TEXT 1
14
+ CELL_ENDCELL_START|TEXT 2
15
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
16
+
17
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a CELL_ENDCELL_START||TEXT b
18
+ CELL_ENDROW_ENDROW_START|-CELL_START|TEXT 1 CELL_ENDCELL_START||TEXT 2
19
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
20
+
21
+ PARA_ENDTABLE_START{|ROW_STARTHEAD_START!TEXT a
22
+ HEAD_ENDHEAD_START!TEXT b
23
+ HEAD_ENDROW_ENDROW_START|-CELL_START|TEXT 1
24
+ CELL_ENDCELL_START|TEXT 2
25
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
26
+
27
+ PARA_ENDTABLE_START{|ROW_STARTHEAD_START!TEXT a HEAD_ENDHEAD_START||TEXT b
28
+ HEAD_ENDROW_ENDROW_START|-CELL_START|TEXT 1 CELL_ENDCELL_START||TEXT 2
29
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
30
+
31
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
32
+ CELL_ENDROW_ENDROW_START|-CELL_START|TEXT 1
33
+ CELL_ENDCELL_START|TEXT 2
34
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
35
+
36
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
37
+ CELL_ENDCELL_START|TEXT b
38
+ CELL_ENDROW_ENDROW_START|-CELL_START|TEXT 1
39
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
40
+
41
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
42
+ CELL_ENDCELL_START|TEXT b
43
+ CELL_ENDROW_ENDROW_START|-CELL_START|CELL_ENDCELL_START|TEXT 2
44
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
45
+
46
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT LINK_START[TEXThttp://example.comLINKSEP TEXTExampleLINK_END]CELL_ENDCELL_START|TEXT BOLD_START'''TEXTboldBOLD_END'''CELL_ENDROW_ENDROW_START|-CELL_START|TEXT INTLINK_START[[TEXTexampleINTLINKSEP|TEXTExampleINTLINK_END]]CELL_ENDCELL_START|TEXT INTLINK_START[[TEXTimageRESOURCESEP:TEXTexample.jpgINTLINKSEP|TEXT1INTLINKSEP|TEXT2INTLINKSEP|TEXT3INTLINK_END]]CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
47
+
48
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT LINK_START[TEXThttp://example.comLINKSEP TEXTExampleLINK_ENDCELL_ENDCELL_START|TEXT BOLD_START'''TEXTbold
49
+ BOLD_ENDCELL_ENDROW_ENDROW_START|-CELL_START|TEXT INTLINK_START[[TEXTexampleINTLINKSEP|TEXTExampleINTLINK_ENDCELL_ENDCELL_START|TEXT BOLD_START'''TEXTbold ITALIC_START''TEXTitalic
50
+ ITALIC_ENDBOLD_ENDCELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
51
+
52
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
53
+ CELL_ENDCELL_START|TEXT b
54
+ CELL_ENDROW_ENDROW_START|-CELL_START|TEXT A list in a cell:
55
+ UL_STARTLI_STARTTEXT one
56
+ LI_ENDLI_STARTTEXT two
57
+ LI_ENDUL_ENDCELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
58
+
59
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
60
+ CELL_ENDCELL_START|TEXT b
61
+ CELL_ENDROW_ENDROW_START|-CELL_START|TEXT A table in a cell:
62
+ TABLE_START{|ROW_STARTCELL_START|TEXT 1
63
+ CELL_ENDCELL_START|TEXT 2
64
+ CELL_ENDROW_ENDROW_START|-CELL_START|TEXT one
65
+ CELL_ENDCELL_START|TEXT two
66
+ CELL_ENDROW_ENDTABLE_END|}CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
67
+
68
+ PARA_ENDTABLE_START{|TEXT border="1"
69
+ ROW_STARTHEAD_START!TEXT a
70
+ HEAD_ENDHEAD_START!TEXT b
71
+ HEAD_ENDROW_ENDROW_START|-TEXT align="left"
72
+ CELL_START|TEXT 1
73
+ CELL_ENDCELL_START|TEXT 2
74
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
75
+
76
+ PARA_ENDPARA_STARTTEXT
77
+ Text before
78
+ PARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
79
+ CELL_ENDCELL_START|TEXT b
80
+ CELL_ENDROW_ENDTABLE_END|}PARA_STARTTEXT
81
+
82
+ PARA_ENDPARA_STARTTEXTText before with ITALIC_START''TEXTitalic
83
+ ITALIC_ENDPARA_ENDTABLE_START{|ROW_STARTCELL_START|TEXT a
84
+ CELL_ENDCELL_START|TEXT b
85
+ CELL_ENDROW_ENDTABLE_END|}falsefalse
@@ -0,0 +1,17 @@
1
+ SECTION_START==TEXTExamples of XHTML markup and escaping of XML charactersSECTION_END==PARA_STARTTEXT
2
+
3
+ PARA_ENDPARA_STARTTEXTHere is a TAG_STARTttTEXTcode sampleTAG_ENDttTEXT.
4
+
5
+ PARA_ENDPARA_STARTTEXTAnother TAG_STARTttATTR_NAMEclassATTR_VALUEcodeTEXTcode sampleTAG_ENDttTEXT.
6
+
7
+ PARA_ENDPARA_STARTTEXTAn example of a <tt>code sample</tt>.
8
+
9
+ PARA_ENDPARA_STARTTEXTSome math:
10
+
11
+ PARA_ENDPRE_STARTTEXT 1 < 2 & 1 > 0
12
+ PRE_ENDPARA_STARTTEXT
13
+ And more text.
14
+
15
+ PARA_ENDUL_STARTLI_STARTTEXT one
16
+ LI_ENDLI_STARTTEXT two TAG_STARTspanTEXTa b
17
+ c d e fTAG_ENDspanLI_ENDUL_ENDfalsefalse
@@ -0,0 +1,15 @@
1
+ PARA_STARTTEXTone CHAR_ENTampTEXT two
2
+ 1 CHAR_ENTltTEXT 2
3
+ CHAR_ENTltTEXTlt; is the "lt" symbol
4
+ 1 < 2 & 3 > 2
5
+
6
+ PARA_ENDPARA_STARTTEXTthis CHAR_ENTltCHAR_ENTgtTEXT that
7
+
8
+ PARA_ENDPARA_STARTVARIABLE_START{{TEXTrefVARIABLE_END}}TEXT
9
+
10
+ PARA_ENDPARA_STARTVARIABLE_START{{TEXT
11
+ one
12
+ two
13
+ VARIABLE_END}}TEXT
14
+
15
+ PARA_ENDPARA_STARTTEXT{{}}PARA_ENDfalsefalse
@@ -0,0 +1,3 @@
1
+ KEYWORDTOCPARA_STARTTEXT
2
+
3
+ PARA_ENDSECTION_START=TEXT Headline1 SECTION_END=SECTION_START==TEXT Sub Headline 1a SECTION_END==SECTION_START==TEXT Sub Headline 1b SECTION_END==SECTION_START=TEXT Headline2 SECTION_END=SECTION_START==TEXT Sub Headline 2a SECTION_END==SECTION_START===TEXT Sub Sub Headline TAG_STARTiTEXT2iTAG_ENDiTEXT SECTION_END===SECTION_START===TEXT Sub Sub Headline BOLD_START'''TEXT2iiBOLD_END'''TEXT SECTION_END===SECTION_START==TEXT Sub Headline 2b SECTION_END==falsefalse
@@ -0,0 +1,2 @@
1
+ HLINE----PARA_STARTTEXT
2
+ This is a textPARA_ENDfalsefalse
@@ -0,0 +1 @@
1
+ PARA_STARTTEXT--SIGNATURE_DATE~~~~~SIGNATURE_NAME~~~SIGNATURE_FULL~~~~PARA_ENDfalsefalse
@@ -0,0 +1,47 @@
1
+ PARA_STARTTEXTTest mixing of bold and italic formatting:
2
+
3
+ PARA_ENDPARA_STARTITALIC_START''TEXTitalicBOLD_START'''TEXTboldBOLD_END'''TEXTitalicITALIC_END''TEXT
4
+
5
+ PARA_ENDPARA_STARTBOLD_START'''TEXTboldITALIC_START''TEXTitalicITALIC_END''TEXTboldBOLD_END'''TEXT
6
+
7
+ PARA_ENDPARA_STARTITALIC_START''BOLD_START'''TEXTboldalicBOLD_END'''ITALIC_END''TEXT
8
+
9
+ PARA_ENDPARA_STARTITALIC_START''TEXTitalicBOLD_START'''TEXTboldBOLD_END'''TEXTitalicITALIC_END''BOLD_START'''TEXTboldITALIC_START''TEXTitalicITALIC_END''TEXTboldBOLD_END'''TEXT
10
+
11
+ PARA_ENDPARA_STARTTEXT
12
+ Test bold and italic wrapped around inline links:
13
+
14
+ PARA_ENDPARA_STARTITALIC_START''LINK_STARTTEXThttp://example.comLINK_ENDITALIC_END''TEXT
15
+
16
+ PARA_ENDPARA_STARTBOLD_START'''LINK_STARTTEXThttp://example.comLINK_ENDBOLD_END'''TEXT
17
+
18
+ PARA_ENDPARA_STARTITALIC_START''LINK_STARTTEXThttp://example.comLINK_ENDBOLD_START'''TEXT
19
+
20
+ BOLD_ENDITALIC_ENDPARA_ENDPARA_STARTBOLD_START'''LINK_STARTTEXThttp://example.comLINK_ENDTEXT' is goodBOLD_END'''TEXT
21
+
22
+ PARA_ENDPARA_STARTITALIC_START''LINK_STARTTEXThttp://example.comLINK_ENDTEXT' is goodITALIC_END''TEXT
23
+
24
+ PARA_ENDPARA_STARTTEXT
25
+ Test unclosed bold and italic formatting:
26
+
27
+ PARA_ENDPARA_STARTITALIC_START''TEXTSome italic and now ITALIC_END''TEXTbold
28
+ PARA_ENDSECTION_START==TEXTHeadingSECTION_END==PARA_STARTTEXT
29
+ Text
30
+
31
+ PARA_ENDPARA_STARTITALIC_START''TEXTSome italic and now BOLD_START'''TEXTbold
32
+ BOLD_ENDITALIC_ENDPARA_ENDSECTION_START==TEXTHeadingSECTION_END==PARA_STARTTEXT
33
+ Text
34
+
35
+ PARA_ENDPARA_STARTITALIC_START''TEXTSome italic and now BOLD_START'''TEXTbold
36
+
37
+ BOLD_ENDITALIC_ENDPARA_ENDSECTION_START==TEXTHeadingSECTION_END==PARA_STARTTEXT
38
+ Text
39
+
40
+ PARA_ENDPARA_STARTITALIC_START''TEXTSome italic and now BOLD_START'''TEXTbold
41
+ BOLD_ENDITALIC_ENDPARA_ENDUL_STARTLI_STARTTEXT one
42
+ LI_ENDLI_STARTTEXT two
43
+ LI_ENDUL_ENDPARA_STARTTEXT
44
+
45
+ PARA_ENDPARA_STARTITALIC_START''TEXTSome italic and now BOLD_START'''TEXTbold
46
+
47
+ BOLD_ENDITALIC_ENDPARA_ENDPARA_STARTTEXTTextPARA_ENDfalsefalse
@@ -0,0 +1,57 @@
1
+ PARA_STARTTEXTUnordered lists
2
+
3
+ PARA_ENDUL_STARTLI_STARTTEXTA
4
+ UL_STARTLI_STARTTEXTA
5
+ UL_STARTLI_STARTTEXTa
6
+ LI_ENDLI_STARTTEXTb
7
+ UL_STARTLI_STARTTEXTa
8
+ LI_ENDUL_ENDLI_ENDUL_ENDLI_ENDUL_ENDLI_ENDLI_STARTTEXTB
9
+ UL_STARTLI_STARTTEXTb
10
+ LI_ENDUL_ENDLI_ENDUL_ENDUL_STARTLI_STARTTEXTA
11
+ LI_ENDLI_STARTTEXTB
12
+ LI_ENDLI_STARTLI_ENDUL_ENDPARA_STARTTEXT
13
+ Ordered lists
14
+
15
+ PARA_ENDOL_STARTLI_STARTTEXTa
16
+ OL_STARTLI_STARTTEXTa
17
+ OL_STARTLI_STARTTEXTa
18
+ OL_STARTLI_STARTTEXTa
19
+ LI_ENDOL_ENDLI_ENDOL_ENDLI_ENDOL_ENDLI_ENDLI_STARTTEXTa
20
+ OL_STARTLI_STARTTEXTaa
21
+ LI_ENDOL_ENDLI_ENDOL_ENDOL_STARTLI_STARTTEXTA
22
+ LI_ENDLI_STARTTEXTB
23
+ LI_ENDLI_STARTLI_ENDOL_ENDPARA_STARTTEXT
24
+ Mixed lists
25
+
26
+ PARA_ENDUL_STARTLI_STARTTEXTa
27
+ OL_STARTLI_STARTTEXT1
28
+ LI_ENDLI_STARTTEXT2
29
+ LI_ENDOL_ENDLI_ENDLI_STARTTEXTb
30
+ LI_ENDUL_ENDOL_STARTLI_STARTTEXTa
31
+ UL_STARTLI_STARTTEXT1
32
+ LI_ENDLI_STARTTEXT2
33
+ UL_STARTLI_STARTTEXT2
34
+ LI_ENDUL_ENDLI_ENDUL_ENDLI_ENDLI_STARTTEXTb
35
+ LI_ENDOL_ENDPARA_STARTTEXT
36
+ Dictionary lists
37
+
38
+ PARA_ENDDL_STARTDT_START;TEXTd
39
+ DT_ENDDL_ENDPARA_STARTTEXT
40
+
41
+ PARA_ENDDL_STARTDD_START:TEXTt
42
+ DD_ENDDL_ENDPARA_STARTTEXT
43
+
44
+ PARA_ENDDL_STARTDT_START;TEXTd
45
+ DT_ENDDD_START:TEXTt
46
+ DD_ENDDL_ENDPARA_STARTTEXT
47
+
48
+ PARA_ENDDL_STARTDT_START;TEXTd
49
+ DT_ENDDD_START:TEXTt
50
+ DD_ENDDD_START:TEXTt
51
+ DD_ENDDL_ENDPARA_STARTTEXT
52
+
53
+ PARA_ENDDL_STARTDT_START;TEXTd
54
+ DT_ENDDD_START:TEXTt
55
+ DD_ENDDL_ENDDL_STARTDT_START;TEXTd
56
+ DT_ENDDD_START:TEXTt
57
+ DD_ENDDL_ENDDL_STARTDT_START;TEXTd DT_ENDDD_START:TEXTt INTLINK_START[[TEXTimageRESOURCESEP:TEXTfoo.jpgINTLINK_END]]DD_ENDDL_ENDfalsefalse
@@ -0,0 +1,8 @@
1
+ PARA_STARTTEXTThis is some text with BOLD_START'''TEXTboldBOLD_END'''TEXT and ITALIC_START''TEXTitalicITALIC_END''TEXT formating.
2
+ The list is also here:
3
+ PARA_ENDUL_STARTLI_STARTTEXT List Item 1
4
+ UL_STARTLI_STARTTEXT Sub list item 1
5
+ LI_ENDLI_STARTTEXT Sub list item 2
6
+ LI_ENDUL_ENDLI_ENDLI_STARTTEXT List Item 2
7
+ LI_ENDUL_ENDPARA_STARTTEXTThe end
8
+ PARA_ENDHLINE----falsefalse
@@ -0,0 +1,45 @@
1
+ PARA_STARTLINK_STARTTEXThttp://sun.comLINK_ENDTEXT
2
+
3
+ PARA_ENDPARA_STARTLINK_START[TEXThttp://sun.comLINK_END]TEXT
4
+
5
+ PARA_ENDPARA_STARTLINK_START[TEXTmailto:joe@sun.comLINK_END]TEXT
6
+
7
+ PARA_ENDPARA_STARTLINK_START[TEXThttp://sun.comLINKSEP TEXTstarsLINK_END]TEXT
8
+
9
+ PARA_ENDPARA_STARTLINK_START[TEXThttp://sun.comLINKSEP TEXTstars and moonLINK_END]TEXT
10
+
11
+ PARA_ENDPARA_STARTLINK_START[TEXThttp://sun.comLINKSEP TEXTstars and ITALIC_START''TEXTmoonITALIC_END''TEXT and BOLD_START'''TEXTtreesBOLD_END'''TEXT and birdsLINK_END]TEXT
12
+
13
+ PARA_ENDPARA_STARTLINK_START[TEXThttp://sun.comLINKSEP TAG_STARTttTEXTsunTAG_ENDttTEXT and TAG_STARTttTEXTmoonTAG_ENDttLINK_END]TEXT
14
+
15
+ PARA_ENDPARA_STARTLINK_START[TEXThttp://sun.comLINKSEP TEXTsun > moonLINK_END]TEXT
16
+
17
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTsunINTLINK_END]]TEXT
18
+
19
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTsunINTLINKSEP|TEXTAll about SunINTLINK_END]]TEXT
20
+
21
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTimageRESOURCESEP:TEXTsunINTLINKSEP|TEXTAll about SunINTLINK_END]]TEXT
22
+
23
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTsunINTLINKSEP|TEXTnofollow|All about SunINTLINK_END]]TEXT
24
+
25
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTsunINTLINKSEP|TEXTnofollow|Sun > MoonINTLINK_END]]TEXT
26
+
27
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTsunINTLINKSEP|TEXTnofollow|TAG_STARTttTEXTsunTAG_ENDttTEXT and TAG_STARTttTEXTmoonTAG_ENDttINTLINK_END]]TEXT
28
+
29
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTimageRESOURCESEP:TEXTsunINTLINKSEP|TEXTnofollowINTLINKSEP|TEXTAll about SunINTLINK_END]]TEXT
30
+
31
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTimageRESOURCESEP:TEXTsunINTLINKSEP|TEXTAll about INTLINK_START[[TEXTSunINTLINK_END]]INTLINK_END]]TEXT
32
+
33
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTimageRESOURCESEP:TEXTsunINTLINKSEP|TEXTAll about INTLINK_START[[TEXTsunINTLINKSEP|TEXTMore aboutINTLINK_END]]INTLINK_END]]TEXT
34
+
35
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTimageRESOURCESEP:TEXTsunINTLINKSEP|TEXToneINTLINKSEP|INTLINKSEP|TEXTtwoINTLINKSEP|INTLINKSEP|TEXTthreeINTLINKSEP|INTLINK_END]]TEXT
36
+
37
+ PARA_ENDPARA_STARTINTLINK_START[[TEXTimageRESOURCESEP:TEXTsunINTLINKSEP|TEXToneINTLINKSEP|INTLINK_START[[TEXTaaaINTLINKSEP|TEXTbbb|cccINTLINK_END]]INTLINKSEP|INTLINK_START[[TEXTimageRESOURCESEP:TEXTmoonINTLINKSEP|TEXTaaaINTLINKSEP|TEXTbbbINTLINKSEP|TEXTcccINTLINK_END]]INTLINKSEP|TEXTtwoINTLINK_END]]TEXT
38
+
39
+ PARA_ENDPARA_STARTTEXT[]
40
+
41
+ PARA_ENDPARA_STARTTEXT[ ]
42
+
43
+ PARA_ENDPARA_STARTTEXT[[]]
44
+
45
+ PARA_ENDPARA_STARTINTLINK_START[[TEXT INTLINK_END]]PARA_ENDfalsefalse
@@ -0,0 +1 @@
1
+ SECTION_START===TEXT foo SECTION_END===falsefalse
@@ -0,0 +1,14 @@
1
+ PARA_STARTTEXTSome examples of wiki escaping.
2
+
3
+ PARA_ENDPARA_STARTTEXTA paragraph with some wiki characters: ''italic'' '''bold''' [[Link]]
4
+
5
+ PARA_ENDPARA_STARTTEXTAn escaped list:
6
+
7
+ * one
8
+ * two
9
+ * three
10
+
11
+
12
+ PARA_ENDPARA_STARTTEXTText escaped in a heading:
13
+
14
+ PARA_ENDSECTION_START==TEXTHeading with '''SECTION_END==falsefalse
@@ -0,0 +1,48 @@
1
+ <p>This is a simple text with <b>Bold text</b> and <i>Italic text</i> inside.
2
+ One paragraph can be written in several lines.
3
+
4
+ </p><p>Another paragraph starts after a blank line.
5
+ </p><p><br>
6
+ Another one.
7
+ </p><p>This is text with <a href="/wiki/index.php?title=Internal_Link&amp;action=edit" class="new" title="Internal Link">Internal Link</a> and <a href="http://www.example.com" class="external text" title="http://www.example.com" rel="nofollow">external link</a>.
8
+ </p><p>We can have headlines:
9
+ </p><p><br>
10
+ </p>
11
+ <table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
12
+
13
+ <ul style="display: block;">
14
+ <li class="toclevel-1"><a href="#Headline1"><span class="tocnumber">1</span> <span class="toctext">Headline1</span></a>
15
+ <ul>
16
+ <li class="toclevel-2"><a href="#Headline2"><span class="tocnumber">1.1</span> <span class="toctext">Headline2</span></a>
17
+ <ul>
18
+ <li class="toclevel-3"><a href="#Headline3"><span class="tocnumber">1.1.1</span> <span class="toctext">Headline3</span></a>
19
+ <ul>
20
+ <li class="toclevel-4"><a href="#Headline4"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Headline4</span></a></li>
21
+
22
+ </ul>
23
+ </li>
24
+ </ul>
25
+ </li>
26
+ </ul>
27
+ </li>
28
+ </ul>
29
+ </td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
30
+ <div class="editsection" style="float: right; margin-left: 5px;">[<a href="/wiki/index.php?title=Test&amp;action=edit&amp;section=1" title="Edit section: Headline1">edit</a>]</div><a name="Headline1"></a><h1> Headline1 </h1>
31
+ <div class="editsection" style="float: right; margin-left: 5px;">[<a href="/wiki/index.php?title=Test&amp;action=edit&amp;section=2" title="Edit section: Headline2">edit</a>]</div><a name="Headline2"></a><h2> Headline2 </h2>
32
+
33
+ <div class="editsection" style="float: right; margin-left: 5px;">[<a href="/wiki/index.php?title=Test&amp;action=edit&amp;section=3" title="Edit section: Headline3">edit</a>]</div><a name="Headline3"></a><h3> Headline3 </h3>
34
+ <div class="editsection" style="float: right; margin-left: 5px;">[<a href="/wiki/index.php?title=Test&amp;action=edit&amp;section=4" title="Edit section: Headline4">edit</a>]</div><a name="Headline4"></a><h4> Headline4 </h4>
35
+ <div class="editsection" style="float: right; margin-left: 5px;">[<a href="/wiki/index.php?title=Test&amp;action=edit&amp;section=5" title="Edit section: Headline5">edit</a>]</div><a name="Headline5"></a><h5> Headline5 </h5>
36
+ <div class="editsection" style="float: right; margin-left: 5px;">[<a href="/wiki/index.php?title=Test&amp;action=edit&amp;section=6" title="Edit section: Headline6">edit</a>]</div><a name="Headline6"></a><h6> Headline6 </h6>
37
+ <div class="editsection" style="float: right; margin-left: 5px;">[<a href="/wiki/index.php?title=Test&amp;action=edit&amp;section=7" title="Edit section: = Headline7 =">edit</a>]</div><a name=".3D_Headline7_.3D"></a><h6>= Headline7 =</h6>
38
+ <pre>This is a preformatted <b> </b> &lt;&lt; <i> </i> text
39
+ yes
40
+
41
+
42
+ </pre>
43
+ <hr>
44
+ <p>This is a text after the line.
45
+ </p>
46
+ <ul><li>foo
47
+ </li><li> foo2
48
+ </li></ul>
@@ -0,0 +1,18 @@
1
+ require 'mediacloth'
2
+
3
+ def produce(index)
4
+ file = File.new("../test/data/html#{index}", "w")
5
+ inputFile = File.new("../test/data/input#{index}", "r")
6
+ input = inputFile.read
7
+ parser = MediaWikiParser.new
8
+ parser.lexer = MediaWikiLexer.new
9
+ ast = parser.parse(input)
10
+ MediaWikiParams.instance.time = Time.mktime(2000, 1, 1, 1, 1, 1, 1)
11
+ generator = MediaWikiHTMLGenerator.new
12
+ generator.parse(ast)
13
+ file.write(generator.html)
14
+ file.close
15
+ end
16
+
17
+ (1..13).each { |i| produce(i) }
18
+ #produce(13)
@@ -0,0 +1,15 @@
1
+ require 'mediacloth/mediawikilexer'
2
+
3
+ def produce(index)
4
+ file = File.new("../test/data/lex#{index}", "w")
5
+ inputFile = File.new("../test/data/input#{index}", "r")
6
+ input = inputFile.read
7
+
8
+ lexer = MediaWikiLexer.new
9
+ tokens = lexer.tokenize(input)
10
+ file.write(tokens.to_s)
11
+ file.close
12
+ end
13
+
14
+ (1..13).each { |i| produce(i) }
15
+ #produce(13)
@@ -0,0 +1,68 @@
1
+ require 'mediacloth/mediawikiwalker'
2
+
3
+ #A walker to build textual representation of the parse tree.
4
+ #
5
+ #Use as any other walker and then query for tree:
6
+ # parser = MediaWikiParser.new
7
+ # parser.lexer = MediaWikiLexer.new
8
+ # ast = parser.parse(input)
9
+ # walker = DebugWalker.new
10
+ # walker.parse(ast)
11
+ # puts walker.tree
12
+ class DebugWalker < MediaWikiWalker
13
+
14
+ #The textual representation of the parse tree.
15
+ attr_reader :tree
16
+
17
+ def initialize
18
+ super
19
+ @tree = ""
20
+ end
21
+
22
+ protected
23
+
24
+ def parse_wiki_ast(ast)
25
+ info(ast)
26
+ super(ast)
27
+ end
28
+
29
+ def parse_paragraph(ast)
30
+ info(ast)
31
+ super(ast)
32
+ end
33
+
34
+ def parse_text(ast)
35
+ info(ast, ast.formatting)
36
+ super(ast)
37
+ end
38
+
39
+ def parse_list(ast)
40
+ info(ast, ast.class)
41
+ super(ast)
42
+ end
43
+
44
+ def parse_list_item(ast)
45
+ info(ast)
46
+ super(ast)
47
+ end
48
+
49
+ def parse_preformatted(ast)
50
+ info(ast)
51
+ end
52
+
53
+ def parse_section(ast)
54
+ info(ast)
55
+ end
56
+
57
+ private
58
+ #Pretty-print ast node information
59
+ def info(ast, *args)
60
+ @tree += "#{ast.class}"
61
+ if args.length > 0
62
+ @tree += ": "
63
+ args.each { |arg| @tree += "#{arg} " }
64
+ end
65
+ @tree += "\n"
66
+ end
67
+
68
+ end