Permalink
Browse files

Moving parser classes into own folder

Signed-off-by: Johannes Thoenes <johannes.thoenes@googlemail.com>
  • Loading branch information...
1 parent 7635369 commit 9204c9098facaf3827f10fee6027456b21c375a9 @jthoenes committed Dec 8, 2011
View
@@ -16,15 +16,16 @@
require 'lib/formatting'
require 'lib/formattings'
-require 'lib/parser'
-require 'lib/code_parser'
-require 'lib/xml_parser'
-require 'lib/command_node'
-require 'lib/text_node'
-require 'lib/formattable_text'
+require 'lib/parser/base_parser'
+require 'lib/parser/code_parser'
+require 'lib/parser/xml_parser'
+require 'lib/parser/command_node'
+require 'lib/parser/text_node'
+require 'lib/parser/tag_matcher'
+require 'lib/parser/tag_match'
+
require 'lib/shape_formatter'
-require 'lib/tag_matcher'
-require 'lib/tag_match'
+require 'lib/formattable_text'
require 'lib/power_point'
require 'lib/power_point/application'
@@ -1,4 +1,4 @@
-class Parser
+class BaseParser
TAB_WIDTH = 2
@@ -1,4 +1,4 @@
-class CodeParser < Parser
+class CodeParser < BaseParser
def pre_pattern
/#{Regexp.escape('/*')}/
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
-class XMLParser < Parser
+class XMLParser < BaseParser
def pre_pattern
/#{Regexp.escape('<!--')}/
end
@@ -1,10 +1,6 @@
$:.unshift File.dirname($0) + '/..'
require 'lib/loader'
-class Parser
- public :create_ast
-end
-
describe CodeParser do
describe "reference example" do
@@ -15,7 +11,7 @@ class Parser
Formatting.create('+')
Formatting.create('-')
- @root = CodeParser.new("spec-non-file", REFERENCE_EXAMPLE).create_ast
+ @root = CodeParser.new("spec-non-file", REFERENCE_EXAMPLE).send(:create_ast)
end
after(:all) do

0 comments on commit 9204c90

Please sign in to comment.