From d4b947462bc61cdd0f5a2f36cc02872855a3c773 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Sat, 10 Feb 2007 23:17:16 -0600 Subject: [PATCH] Whoops! Missed one. --- lib/syntax.rb | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 lib/syntax.rb diff --git a/lib/syntax.rb b/lib/syntax.rb deleted file mode 100644 index 604dcc2f..00000000 --- a/lib/syntax.rb +++ /dev/null @@ -1,38 +0,0 @@ -require 'syntax/common' - -module Syntax - - # A default tokenizer for handling syntaxes that are not explicitly handled - # elsewhere. It simply yields the given text as a single token. - class Default - - # Yield the given text as a single token. - def tokenize( text ) - yield Token.new( text, :normal ) - end - - end - - # A hash for registering syntax implementations. - SYNTAX = Hash.new( Default ) - - # Load the implementation of the requested syntax. If the syntax cannot be - # found, or if it cannot be loaded for whatever reason, the Default syntax - # handler will be returned. - def load( syntax ) - begin - require "syntax/lang/#{syntax}" - rescue LoadError - end - SYNTAX[ syntax ].new - end - module_function :load - - # Return an array of the names of supported syntaxes. - def all - lang_dir = File.join(File.dirname(__FILE__), "syntax", "lang") - Dir["#{lang_dir}/*.rb"].map { |path| File.basename(path, ".rb") } - end - module_function :all - -end