Sha256: 59f0ee54343c6f9eb4786b647d9a3f051511ad25c9d96ebc274ea5a586e6c6c7

Contents?: true

Size: 725 Bytes

Versions: 5

Compression:

Stored size: 725 Bytes

Contents

require_relative 'syntax_function'
require_relative 'syntax_error'
require_relative 'syntax_warning'

module BELParser
  module Language
    module Syntax
      def self.syntax_functions
        self.constants.collect do |symbol|
          const = self.const_get(symbol)
          const if
            const.respond_to?(:include?) &&
            const.include?(SyntaxFunction)
        end.compact
      end

      class Valid < SyntaxResult
        def msg
          'Syntax is valid.'
        end
      end
    end
  end
end

# Require all generic syntax functions.
Dir[
  File.join(
    File.dirname(File.expand_path(__FILE__)),
    'syntax', '*.rb')
].each do |path|
  require_relative "syntax/#{File.basename(path)}"
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bel_parser-1.0.0.alpha.7 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.6 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.5 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.4 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.3 lib/bel_parser/language/syntax.rb