Skip to content

Instantly share code, notes, and snippets.

@trystant
Created July 7, 2009 21:12
Show Gist options
  • Save trystant/142374 to your computer and use it in GitHub Desktop.
Save trystant/142374 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'treetop'
require 'polyglot'
Treetop.load File.dirname(__FILE__) + '/../grammars/test'
class Driver
attr_accessor :test_parser, :test_parser_errors
def initialize
@test_parser = TestParser.new
@test_parser_errors = []
end
def validate_test_string(test_string)
parse_result = @test_parser.parse(test_string)
if parse_result.nil?
@test_parser_errors << @test_parser.terminal_failures[0]
return false
end
return true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment