mail 2.1.5.2 → 2.1.5.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mail might be problematic. Click here for more details.

Files changed (134) hide show
  1. data/CHANGELOG.rdoc +6 -0
  2. data/Rakefile +2 -1
  3. data/lib/mail.rb +0 -1
  4. data/lib/mail/elements.rb +0 -1
  5. data/lib/mail/utilities.rb +1 -1
  6. data/lib/mail/version.rb +1 -1
  7. data/lib/tasks/treetop.rake +4 -4
  8. metadata +17 -129
  9. data/lib/mail/vendor/treetop-1.4.4/History.txt +0 -18
  10. data/lib/mail/vendor/treetop-1.4.4/LICENSE +0 -19
  11. data/lib/mail/vendor/treetop-1.4.4/README.md +0 -164
  12. data/lib/mail/vendor/treetop-1.4.4/Rakefile +0 -28
  13. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Preferences/Comments.tmPreferences +0 -22
  14. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Snippets/grammar ___ end.tmSnippet +0 -20
  15. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Snippets/rule ___ end.tmSnippet +0 -18
  16. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Support/nibs/SyntaxTreeViewer.nib/designable.nib +0 -1524
  17. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Support/nibs/SyntaxTreeViewer.nib/keyedobjects.nib +0 -0
  18. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Support/syntax_tree_viewer.rb +0 -117
  19. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Syntaxes/Treetop Grammar.tmLanguage +0 -278
  20. data/lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/info.plist +0 -10
  21. data/lib/mail/vendor/treetop-1.4.4/benchmark/seqpar.gnuplot +0 -15
  22. data/lib/mail/vendor/treetop-1.4.4/benchmark/seqpar.treetop +0 -16
  23. data/lib/mail/vendor/treetop-1.4.4/benchmark/seqpar_benchmark.rb +0 -107
  24. data/lib/mail/vendor/treetop-1.4.4/bin/tt +0 -112
  25. data/lib/mail/vendor/treetop-1.4.4/doc/contributing_and_planned_features.markdown +0 -103
  26. data/lib/mail/vendor/treetop-1.4.4/doc/grammar_composition.markdown +0 -65
  27. data/lib/mail/vendor/treetop-1.4.4/doc/index.markdown +0 -90
  28. data/lib/mail/vendor/treetop-1.4.4/doc/pitfalls_and_advanced_techniques.markdown +0 -51
  29. data/lib/mail/vendor/treetop-1.4.4/doc/semantic_interpretation.markdown +0 -189
  30. data/lib/mail/vendor/treetop-1.4.4/doc/site.rb +0 -112
  31. data/lib/mail/vendor/treetop-1.4.4/doc/sitegen.rb +0 -65
  32. data/lib/mail/vendor/treetop-1.4.4/doc/syntactic_recognition.markdown +0 -100
  33. data/lib/mail/vendor/treetop-1.4.4/doc/using_in_ruby.markdown +0 -28
  34. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic.rb +0 -551
  35. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic.treetop +0 -97
  36. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic_node_classes.rb +0 -7
  37. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic_test.rb +0 -54
  38. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus +0 -0
  39. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus.rb +0 -718
  40. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus.treetop +0 -132
  41. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus_node_classes.rb +0 -5
  42. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus_test.rb +0 -89
  43. data/lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/test_helper.rb +0 -18
  44. data/lib/mail/vendor/treetop-1.4.4/lib/treetop.rb +0 -3
  45. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/bootstrap_gen_1_metagrammar.rb +0 -42
  46. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler.rb +0 -7
  47. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/grammar_compiler.rb +0 -44
  48. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/lexical_address_space.rb +0 -17
  49. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/metagrammar.rb +0 -3366
  50. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/metagrammar.treetop +0 -436
  51. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes.rb +0 -19
  52. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/anything_symbol.rb +0 -18
  53. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/atomic_expression.rb +0 -14
  54. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/character_class.rb +0 -28
  55. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/choice.rb +0 -31
  56. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/declaration_sequence.rb +0 -24
  57. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/grammar.rb +0 -28
  58. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/inline_module.rb +0 -27
  59. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/nonterminal.rb +0 -13
  60. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/optional.rb +0 -19
  61. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/parenthesized_expression.rb +0 -9
  62. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/parsing_expression.rb +0 -146
  63. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/parsing_rule.rb +0 -58
  64. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/predicate.rb +0 -45
  65. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/predicate_block.rb +0 -16
  66. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/repetition.rb +0 -55
  67. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/sequence.rb +0 -71
  68. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/terminal.rb +0 -20
  69. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/transient_prefix.rb +0 -9
  70. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/treetop_file.rb +0 -9
  71. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/ruby_builder.rb +0 -113
  72. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/polyglot.rb +0 -9
  73. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/ruby_extensions.rb +0 -1
  74. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/ruby_extensions/string.rb +0 -42
  75. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime.rb +0 -6
  76. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/compiled_parser.rb +0 -110
  77. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list.rb +0 -3
  78. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list/head_node.rb +0 -15
  79. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list/interval_skip_list.rb +0 -200
  80. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list/node.rb +0 -164
  81. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/syntax_node.rb +0 -114
  82. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/terminal_parse_failure.rb +0 -16
  83. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/terminal_syntax_node.rb +0 -17
  84. data/lib/mail/vendor/treetop-1.4.4/lib/treetop/version.rb +0 -9
  85. data/lib/mail/vendor/treetop-1.4.4/script/generate_metagrammar.rb +0 -13
  86. data/lib/mail/vendor/treetop-1.4.4/script/svnadd +0 -11
  87. data/lib/mail/vendor/treetop-1.4.4/script/svnrm +0 -11
  88. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/and_predicate_spec.rb +0 -36
  89. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/anything_symbol_spec.rb +0 -44
  90. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/character_class_spec.rb +0 -276
  91. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/choice_spec.rb +0 -80
  92. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/circular_compilation_spec.rb +0 -30
  93. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/failure_propagation_functional_spec.rb +0 -21
  94. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/grammar_compiler_spec.rb +0 -84
  95. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/grammar_spec.rb +0 -41
  96. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/multibyte_chars_spec.rb +0 -38
  97. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/nonterminal_symbol_spec.rb +0 -40
  98. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/not_predicate_spec.rb +0 -38
  99. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/one_or_more_spec.rb +0 -35
  100. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/optional_spec.rb +0 -37
  101. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/parenthesized_expression_spec.rb +0 -19
  102. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/parsing_rule_spec.rb +0 -61
  103. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/repeated_subrule_spec.rb +0 -29
  104. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/semantic_predicate_spec.rb +0 -175
  105. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/sequence_spec.rb +0 -115
  106. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/terminal_spec.rb +0 -81
  107. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/terminal_symbol_spec.rb +0 -37
  108. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/test_grammar.treetop +0 -7
  109. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/test_grammar.tt +0 -7
  110. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/test_grammar_do.treetop +0 -7
  111. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/tt_compiler_spec.rb +0 -216
  112. data/lib/mail/vendor/treetop-1.4.4/spec/compiler/zero_or_more_spec.rb +0 -56
  113. data/lib/mail/vendor/treetop-1.4.4/spec/composition/a.treetop +0 -11
  114. data/lib/mail/vendor/treetop-1.4.4/spec/composition/b.treetop +0 -11
  115. data/lib/mail/vendor/treetop-1.4.4/spec/composition/c.treetop +0 -10
  116. data/lib/mail/vendor/treetop-1.4.4/spec/composition/d.treetop +0 -10
  117. data/lib/mail/vendor/treetop-1.4.4/spec/composition/f.treetop +0 -17
  118. data/lib/mail/vendor/treetop-1.4.4/spec/composition/grammar_composition_spec.rb +0 -40
  119. data/lib/mail/vendor/treetop-1.4.4/spec/composition/subfolder/e_includes_c.treetop +0 -15
  120. data/lib/mail/vendor/treetop-1.4.4/spec/ruby_extensions/string_spec.rb +0 -32
  121. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/compiled_parser_spec.rb +0 -101
  122. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/delete_spec.rb +0 -147
  123. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/expire_range_spec.rb +0 -349
  124. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/insert_and_delete_node.rb +0 -385
  125. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/insert_spec.rb +0 -660
  126. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/interval_skip_list_spec.graffle +0 -6175
  127. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/interval_skip_list_spec.rb +0 -58
  128. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/palindromic_fixture.rb +0 -23
  129. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/palindromic_fixture_spec.rb +0 -163
  130. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/spec_helper.rb +0 -84
  131. data/lib/mail/vendor/treetop-1.4.4/spec/runtime/syntax_node_spec.rb +0 -77
  132. data/lib/mail/vendor/treetop-1.4.4/spec/spec_helper.rb +0 -110
  133. data/lib/mail/vendor/treetop-1.4.4/treetop.gemspec +0 -18
  134. data/lib/mail/vendor/treetop.rb +0 -2
@@ -1,3 +1,9 @@
1
+ == Mon 29 Mar 2010 07:04:34 UTC Mikel Lindsaar <raasdnil@gmail.com>
2
+
3
+ * Version bump to 2.1.5.3
4
+ * No longer depend on vendor'd treetop as treetop now has optional loading of parts of the library
5
+ * Change treetop dependency to 1.4.5
6
+
1
7
  == Sun 28 Mar 2010 10:31:33 UTC Mikel Lindsaar <raasdnil@gmail.com>
2
8
 
3
9
  * Version bump to 2.1.5.2
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require 'cucumber/rake/task'
8
8
 
9
9
  spec = Gem::Specification.new do |s|
10
10
  s.name = "mail"
11
- s.version = "2.1.5.2"
11
+ s.version = "2.1.5.3"
12
12
  s.author = "Mike Lindsaar"
13
13
  s.email = "raasdnil@gmail.com"
14
14
  s.homepage = "http://github.com/mikel/mail"
@@ -21,6 +21,7 @@ spec = Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency('activesupport', ">= 2.3.4")
23
23
  s.add_dependency('mime-types')
24
+ s.add_dependency('treetop', '>= 1.4.5')
24
25
 
25
26
  s.require_path = 'lib'
26
27
  s.files = %w(README.rdoc Rakefile TODO.rdoc) + Dir.glob("lib/**/*")
@@ -50,7 +50,6 @@ module Mail # :doc:
50
50
 
51
51
  require 'mail/envelope'
52
52
 
53
- require 'mail/vendor/treetop'
54
53
  parsers = %w[ rfc2822_obsolete rfc2822 address_lists phrase_lists
55
54
  date_time received message_ids envelope_from rfc2045
56
55
  mime_version content_type content_disposition
@@ -11,5 +11,4 @@ module Mail
11
11
  autoload :MimeVersionElement, 'mail/elements/mime_version_element'
12
12
  autoload :PhraseList, 'mail/elements/phrase_list'
13
13
  autoload :ReceivedElement, 'mail/elements/received_element'
14
- autoload :ReceivedElement, 'mail/elements/received_element'
15
14
  end
@@ -135,7 +135,7 @@ module Mail
135
135
  str.to_s.gsub('_', '-')
136
136
  end
137
137
 
138
- # Swaps out all underscores (_) for hyphens (-) good for stringing from symbols
138
+ # Swaps out all hyphens (-) for underscores (_) good for stringing to symbols
139
139
  # a field name.
140
140
  #
141
141
  # Example:
@@ -4,7 +4,7 @@ module Mail
4
4
  MAJOR = 2
5
5
  MINOR = 1
6
6
  TINY = 5
7
- MICRO = 2
7
+ MICRO = 3
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY, MICRO].join('.')
10
10
  end
@@ -2,9 +2,9 @@ namespace :treetop do
2
2
 
3
3
  desc "Pre-generate all the .treetop files into .rb files"
4
4
  task :generate do
5
- Dir[File.join(File.dirname(__FILE__), '..', 'mail', 'parsers', '*.treetop')].each do |filename|
6
- `lib/mail/vendor/treetop-1.4.3/bin/tt #{filename}`
5
+ Dir.glob(File.expand_path('../../mail/parsers/*.treetop', __FILE__)).each do |filename|
6
+ `bundle exec tt #{filename}`
7
7
  end
8
8
  end
9
-
10
- end
9
+
10
+ end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 2
7
7
  - 1
8
8
  - 5
9
- - 2
10
- version: 2.1.5.2
9
+ - 3
10
+ version: 2.1.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mike Lindsaar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-03-28 00:00:00 +11:00
18
+ date: 2010-03-29 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -44,6 +44,20 @@ dependencies:
44
44
  version: "0"
45
45
  type: :runtime
46
46
  version_requirements: *id002
47
+ - !ruby/object:Gem::Dependency
48
+ name: treetop
49
+ prerelease: false
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 1
56
+ - 4
57
+ - 5
58
+ version: 1.4.5
59
+ type: :runtime
60
+ version_requirements: *id003
47
61
  description: A really Ruby Mail handler.
48
62
  email: raasdnil@gmail.com
49
63
  executables: []
@@ -167,132 +181,6 @@ files:
167
181
  - lib/mail/parts_list.rb
168
182
  - lib/mail/patterns.rb
169
183
  - lib/mail/utilities.rb
170
- - lib/mail/vendor/treetop-1.4.4/benchmark/seqpar.gnuplot
171
- - lib/mail/vendor/treetop-1.4.4/benchmark/seqpar.treetop
172
- - lib/mail/vendor/treetop-1.4.4/benchmark/seqpar_benchmark.rb
173
- - lib/mail/vendor/treetop-1.4.4/bin/tt
174
- - lib/mail/vendor/treetop-1.4.4/doc/contributing_and_planned_features.markdown
175
- - lib/mail/vendor/treetop-1.4.4/doc/grammar_composition.markdown
176
- - lib/mail/vendor/treetop-1.4.4/doc/index.markdown
177
- - lib/mail/vendor/treetop-1.4.4/doc/pitfalls_and_advanced_techniques.markdown
178
- - lib/mail/vendor/treetop-1.4.4/doc/semantic_interpretation.markdown
179
- - lib/mail/vendor/treetop-1.4.4/doc/site.rb
180
- - lib/mail/vendor/treetop-1.4.4/doc/sitegen.rb
181
- - lib/mail/vendor/treetop-1.4.4/doc/syntactic_recognition.markdown
182
- - lib/mail/vendor/treetop-1.4.4/doc/using_in_ruby.markdown
183
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic.rb
184
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic.treetop
185
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic_node_classes.rb
186
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/arithmetic_test.rb
187
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus
188
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus.rb
189
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus.treetop
190
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus_node_classes.rb
191
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/lambda_calculus_test.rb
192
- - lib/mail/vendor/treetop-1.4.4/examples/lambda_calculus/test_helper.rb
193
- - lib/mail/vendor/treetop-1.4.4/History.txt
194
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/bootstrap_gen_1_metagrammar.rb
195
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/grammar_compiler.rb
196
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/lexical_address_space.rb
197
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/metagrammar.rb
198
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/metagrammar.treetop
199
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/anything_symbol.rb
200
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/atomic_expression.rb
201
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/character_class.rb
202
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/choice.rb
203
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/declaration_sequence.rb
204
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/grammar.rb
205
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/inline_module.rb
206
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/nonterminal.rb
207
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/optional.rb
208
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/parenthesized_expression.rb
209
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/parsing_expression.rb
210
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/parsing_rule.rb
211
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/predicate.rb
212
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/predicate_block.rb
213
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/repetition.rb
214
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/sequence.rb
215
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/terminal.rb
216
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/transient_prefix.rb
217
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes/treetop_file.rb
218
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/node_classes.rb
219
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler/ruby_builder.rb
220
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/compiler.rb
221
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/polyglot.rb
222
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/ruby_extensions/string.rb
223
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/ruby_extensions.rb
224
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/compiled_parser.rb
225
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list/head_node.rb
226
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list/interval_skip_list.rb
227
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list/node.rb
228
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/interval_skip_list.rb
229
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/syntax_node.rb
230
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/terminal_parse_failure.rb
231
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime/terminal_syntax_node.rb
232
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/runtime.rb
233
- - lib/mail/vendor/treetop-1.4.4/lib/treetop/version.rb
234
- - lib/mail/vendor/treetop-1.4.4/lib/treetop.rb
235
- - lib/mail/vendor/treetop-1.4.4/LICENSE
236
- - lib/mail/vendor/treetop-1.4.4/Rakefile
237
- - lib/mail/vendor/treetop-1.4.4/README.md
238
- - lib/mail/vendor/treetop-1.4.4/script/generate_metagrammar.rb
239
- - lib/mail/vendor/treetop-1.4.4/script/svnadd
240
- - lib/mail/vendor/treetop-1.4.4/script/svnrm
241
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/and_predicate_spec.rb
242
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/anything_symbol_spec.rb
243
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/character_class_spec.rb
244
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/choice_spec.rb
245
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/circular_compilation_spec.rb
246
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/failure_propagation_functional_spec.rb
247
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/grammar_compiler_spec.rb
248
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/grammar_spec.rb
249
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/multibyte_chars_spec.rb
250
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/nonterminal_symbol_spec.rb
251
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/not_predicate_spec.rb
252
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/one_or_more_spec.rb
253
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/optional_spec.rb
254
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/parenthesized_expression_spec.rb
255
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/parsing_rule_spec.rb
256
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/repeated_subrule_spec.rb
257
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/semantic_predicate_spec.rb
258
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/sequence_spec.rb
259
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/terminal_spec.rb
260
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/terminal_symbol_spec.rb
261
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/test_grammar.treetop
262
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/test_grammar.tt
263
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/test_grammar_do.treetop
264
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/tt_compiler_spec.rb
265
- - lib/mail/vendor/treetop-1.4.4/spec/compiler/zero_or_more_spec.rb
266
- - lib/mail/vendor/treetop-1.4.4/spec/composition/a.treetop
267
- - lib/mail/vendor/treetop-1.4.4/spec/composition/b.treetop
268
- - lib/mail/vendor/treetop-1.4.4/spec/composition/c.treetop
269
- - lib/mail/vendor/treetop-1.4.4/spec/composition/d.treetop
270
- - lib/mail/vendor/treetop-1.4.4/spec/composition/f.treetop
271
- - lib/mail/vendor/treetop-1.4.4/spec/composition/grammar_composition_spec.rb
272
- - lib/mail/vendor/treetop-1.4.4/spec/composition/subfolder/e_includes_c.treetop
273
- - lib/mail/vendor/treetop-1.4.4/spec/ruby_extensions/string_spec.rb
274
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/compiled_parser_spec.rb
275
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/delete_spec.rb
276
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/expire_range_spec.rb
277
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/insert_and_delete_node.rb
278
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/insert_spec.rb
279
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/interval_skip_list_spec.graffle
280
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/interval_skip_list_spec.rb
281
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/palindromic_fixture.rb
282
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/palindromic_fixture_spec.rb
283
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/interval_skip_list/spec_helper.rb
284
- - lib/mail/vendor/treetop-1.4.4/spec/runtime/syntax_node_spec.rb
285
- - lib/mail/vendor/treetop-1.4.4/spec/spec_helper.rb
286
- - lib/mail/vendor/treetop-1.4.4/treetop.gemspec
287
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/info.plist
288
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Preferences/Comments.tmPreferences
289
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Snippets/grammar ___ end.tmSnippet
290
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Snippets/rule ___ end.tmSnippet
291
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Support/nibs/SyntaxTreeViewer.nib/designable.nib
292
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Support/nibs/SyntaxTreeViewer.nib/keyedobjects.nib
293
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Support/syntax_tree_viewer.rb
294
- - lib/mail/vendor/treetop-1.4.4/Treetop.tmbundle/Syntaxes/Treetop Grammar.tmLanguage
295
- - lib/mail/vendor/treetop.rb
296
184
  - lib/mail/version.rb
297
185
  - lib/mail/version_specific/ruby_1_8.rb
298
186
  - lib/mail/version_specific/ruby_1_9.rb
@@ -1,18 +0,0 @@
1
- == 1.4.1 2009-09-04
2
-
3
- * several enhancements:
4
- * Many small-to-medium performance improvements
5
- * Semantic predicates
6
- * Support for UTF-8 characters
7
- * Generation of graphvis DOT files for visualising parse results
8
- * Commandline revamped with help
9
-
10
- == 1.2.5 2009-03-10
11
-
12
- * 1 minor enhancement:
13
- * Extensions may always be modules, instead of sometimes modules, sometimes classes
14
-
15
- == 0.0.1 2008-05-21
16
-
17
- * 1 major enhancement:
18
- * Initial release
@@ -1,19 +0,0 @@
1
- Copyright (c) 2007 Nathan Sobo.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
@@ -1,164 +0,0 @@
1
- Tutorial
2
- ========
3
- Languages can be split into two components, their *syntax* and their *semantics*. It's your understanding of English syntax that tells you the stream of words "Sleep furiously green ideas colorless" is not a valid sentence. Semantics is deeper. Even if we rearrange the above sentence to be "Colorless green ideas sleep furiously", which is syntactically correct, it remains nonsensical on a semantic level. With Treetop, you'll be dealing with languages that are much simpler than English, but these basic concepts apply. Your programs will need to address both the syntax and the semantics of the languages they interpret.
4
-
5
- Treetop equips you with powerful tools for each of these two aspects of interpreter writing. You'll describe the syntax of your language with a *parsing expression grammar*. From this description, Treetop will generate a Ruby parser that transforms streams of characters written into your language into *abstract syntax trees* representing their structure. You'll then describe the semantics of your language in Ruby by defining methods on the syntax trees the parser generates.
6
-
7
- Parsing Expression Grammars, The Basics
8
- =======================================
9
- The first step in using Treetop is defining a grammar in a file with the `.treetop` extension. Here's a grammar that's useless because it's empty:
10
-
11
- # my_grammar.treetop
12
- grammar MyGrammar
13
- end
14
-
15
- Next, you start filling your grammar with rules. Each rule associates a name with a parsing expression, like the following:
16
-
17
- # my_grammar.treetop
18
- # You can use a .tt extension instead if you wish
19
- grammar MyGrammar
20
- rule hello
21
- 'hello chomsky'
22
- end
23
- end
24
-
25
- The first rule becomes the *root* of the grammar, causing its expression to be matched when a parser for the grammar is fed a string. The above grammar can now be used in a Ruby program. Notice how a string matching the first rule parses successfully, but a second nonmatching string does not.
26
-
27
- # use_grammar.rb
28
- require 'rubygems'
29
- require 'treetop'
30
- Treetop.load 'my_grammar'
31
- # or just:
32
- # require 'my_grammar' # This works because Polyglot hooks "require" to find and load Treetop files
33
-
34
- parser = MyGrammarParser.new
35
- puts parser.parse('hello chomsky') # => Treetop::Runtime::SyntaxNode
36
- puts parser.parse('silly generativists!') # => nil
37
-
38
- Users of *regular expressions* will find parsing expressions familiar. They share the same basic purpose, matching strings against patterns. However, parsing expressions can recognize a broader category of languages than their less expressive brethren. Before we get into demonstrating that, lets cover some basics. At first parsing expressions won't seem much different. Trust that they are.
39
-
40
- Terminal Symbols
41
- ----------------
42
- The expression in the grammar above is a terminal symbol. It will only match a string that matches it exactly. There are two other kinds of terminal symbols, which we'll revisit later. Terminals are called *atomic expressions* because they aren't composed of smaller expressions.
43
-
44
- Ordered Choices
45
- ---------------
46
- Ordered choices are *composite expressions*, which allow for any of several subexpressions to be matched. These should be familiar from regular expressions, but in parsing expressions, they are delimited by the `/` character. Its important to note that the choices are prioritized in the order they appear. If an earlier expression is matched, no subsequent expressions are tried. Here's an example:
47
-
48
- # my_grammar.treetop
49
- grammar MyGrammar
50
- rule hello
51
- 'hello chomsky' / 'hello lambek'
52
- end
53
- end
54
-
55
- # fragment of use_grammar.rb
56
- puts parser.parse('hello chomsky') # => Treetop::Runtime::SyntaxNode
57
- puts parser.parse('hello lambek') # => Treetop::Runtime::SyntaxNode
58
- puts parser.parse('silly generativists!') # => nil
59
-
60
- Note that once a choice rule has matched the text using a particular alternative at a particular location in the input and hence has succeeded, that choice will never be reconsidered, even if the chosen alternative causes another rule to fail where a later alternative wouldn't have. It's always a later alternative, since the first to succeed is final - why keep looking when you've found what you wanted? This is a feature of PEG parsers that you need to understand if you're going to succeed in using Treetop. In order to memoize success and failures, such decisions cannot be reversed. Luckily Treetop provides a variety of clever ways you can tell it to avoid making the wrong decisions. But more on that later.
61
-
62
- Sequences
63
- ---------
64
- Sequences are composed of other parsing expressions separated by spaces. Using sequences, we can tighten up the above grammar.
65
-
66
- # my_grammar.treetop
67
- grammar MyGrammar
68
- rule hello
69
- 'hello ' ('chomsky' / 'lambek')
70
- end
71
- end
72
-
73
- Note the use of parentheses to override the default precedence rules, which bind sequences more tightly than choices.
74
-
75
- Once the whole sequence has been matched, the result is memoized and the details of the match will not be reconsidered for that location in the input.
76
-
77
- Nonterminal Symbols
78
- -------------------
79
- Here we leave regular expressions behind. Nonterminals allow expressions to refer to other expressions by name. A trivial use of this facility would allow us to make the above grammar more readable should the list of names grow longer.
80
-
81
- # my_grammar.treetop
82
- grammar MyGrammar
83
- rule hello
84
- 'hello ' linguist
85
- end
86
-
87
- rule linguist
88
- 'chomsky' / 'lambek' / 'jacobsen' / 'frege'
89
- end
90
- end
91
-
92
- The true power of this facility, however, is unleashed when writing *recursive expressions*. Here is a self-referential expression that can match any number of open parentheses followed by any number of closed parentheses. This is theoretically impossible with regular expressions due to the *pumping lemma*.
93
-
94
- # parentheses.treetop
95
- grammar Parentheses
96
- rule parens
97
- '(' parens ')' / ''
98
- end
99
- end
100
-
101
-
102
- The `parens` expression simply states that a `parens` is a set of parentheses surrounding another `parens` expression or, if that doesn't match, the empty string. If you are uncomfortable with recursion, its time to get comfortable, because it is the basis of language. Here's a tip: Don't try and imagine the parser circling round and round through the same rule. Instead, imagine the rule is *already* defined while you are defining it. If you imagine that `parens` already matches a string of matching parentheses, then its easy to think of `parens` as an open and closing parentheses around another set of matching parentheses, which conveniently, you happen to be defining. You know that `parens` is supposed to represent a string of matched parentheses, so trust in that meaning, even if you haven't fully implemented it yet.
103
-
104
- Repetition
105
- ----------
106
- Any item in a rule may be followed by a '+' or a '*' character, signifying one-or-more and zero-or-more occurrences of that item. Beware though; the match is greedy, and if it matches too many items and causes subsequent items in the sequence to fail, the number matched will never be reconsidered. Here's a simple example of a rule that will never succeed:
107
-
108
- # toogreedy.treetop
109
- grammar TooGreedy
110
- rule a_s
111
- 'a'* 'a'
112
- end
113
- end
114
-
115
- The 'a'* will always eat up any 'a's that follow, and the subsequent 'a' will find none there, so the whole rule will fail. You might need to use lookahead to avoid matching too much.
116
-
117
- Negative Lookahead
118
- ------------------
119
-
120
- When you need to ensure that the following item *doesn't* match in some case where it might otherwise, you can use negat!ve lookahead, which is an item preceeded by a ! - here's an example:
121
-
122
- # postcondition.treetop
123
- grammar PostCondition
124
- rule conditional_sentence
125
- ( !conditional_keyword word )+ conditional_keyword [ \t]+ word*
126
- end
127
-
128
- rule word
129
- ([a-zA-Z]+ [ \t]+)
130
- end
131
-
132
- rule conditional_keyword
133
- 'if' / 'while' / 'until'
134
- end
135
- end
136
-
137
- Even though the rule `word` would match any of the conditional keywords, the first words of a conditional_sentence must not be conditional_keywords. The negative lookahead prevents that matching, and prevents the repetition from matching too much input. Note that the lookahead may be a grammar rule of any complexity, including one that isn't used elsewhere in your grammar.
138
-
139
- Positive lookahead
140
- ------------------
141
-
142
- Sometimes you want an item to match, but only if the *following* text would match some pattern. You don't want to consume that following text, but if it's not there, you want this rule to fail. You can append a positive lookahead like this to a rule by appending the lookahead rule preceeded by an & character.
143
-
144
-
145
-
146
- Features to cover in the talk
147
- =============================
148
-
149
- * Treetop files
150
- * Grammar definition
151
- * Rules
152
- * Loading a grammar
153
- * Compiling a grammar with the `tt` command
154
- * Accessing a parser for the grammar from Ruby
155
- * Parsing Expressions of all kinds
156
- ? Left recursion and factorization
157
- - Here I can talk about function application, discussing how the operator
158
- could be an arbitrary expression
159
- * Inline node class eval blocks
160
- * Node class declarations
161
- * Labels
162
- * Use of super within within labels
163
- * Grammar composition with include
164
- * Use of super with grammar composition