Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

rparsec #1

Closed
wants to merge 28 commits into from

2 participants

Eric asasassa
Eric

rparsec,
had some time today to fix-up rparsec. Updated it to 1.9.3 and fixed an error or two.

ExternalReality and others added some commits
Eric ExternalReality Add tokland's algebraic types for Ruby. 9f90d09
asasassa asasassa Remove unneeded file. 1982c68
Eric ExternalReality Add permutation tree class. bffaff4
Eric ExternalReality Merge branch 'master' of github.com:ExternalReality/rparsec 45a79cf
Eric ExternalReality Add permutation tree class. 0ae85c0
Cyrus Innovation Put class in RParsec module. 0b15292
Cyrus Innovation Change test name. bdeb18c
Cyrus Innovation Add a methods to add collections of elements to tree and count elements 994a827
ExternalReality Kill algebraic type thing. 21d28b6
ExternalReality Update git ingore to block RubyMine project files. ecdded7
ExternalReality Update require statements to follow newer conventions. e391cfe
ExternalReality Fix import require path. 593a334
ExternalReality update parser_test.rb to 1.9.3 ac33f79
ExternalReality Update functortest.rb to 1.9.3 7f41c40
ExternalReality Update expression_test.rb to 1.9.3 5498d18
ExternalReality remove load path assignment 6e671d3
ExternalReality Update require statements for ruby 1.9.3. 3c2f106
ExternalReality Update tests for ruby 1.9.3. fd3ea7e
ExternalReality Add Succ functor for strings. f9293fb
ExternalReality Update numeric character manipulations 464ab18
ExternalReality Fix test parser errors due to ruby syntax differences from post 1.9.2 6e99cf3
ExternalReality Fix more test. 7718b31
Eric ExternalReality Fix Sequence parser test character manipulation. a691ea0
Eric ExternalReality fix more tests 3b37f55
Eric ExternalReality Fix _locateEof file. e3462a5
Eric ExternalReality Bump version. 2bf6dea
Eric ExternalReality Update require statement. da5e72b
Eric ExternalReality remove .cvsignore 9228b7e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 24, 2011
  1. Eric
Commits on Oct 26, 2011
  1. asasassa

    Remove unneeded file.

    asasassa authored
Commits on Oct 31, 2011
  1. Eric
  2. Eric
  3. Eric
Commits on Dec 13, 2011
  1. Put class in RParsec module.

    Cyrus Innovation authored
  2. Change test name.

    Cyrus Innovation authored
  3. Kill algebraic type thing.

    ExternalReality authored
  4. Update git ingore to block RubyMine project files.

    ExternalReality authored
Commits on Dec 14, 2011
  1. Update require statements to follow newer conventions.

    ExternalReality authored
  2. Fix import require path.

    ExternalReality authored
  3. update parser_test.rb to 1.9.3

    ExternalReality authored
  4. Update functortest.rb to 1.9.3

    ExternalReality authored
  5. Update expression_test.rb to 1.9.3

    ExternalReality authored
  6. remove load path assignment

    ExternalReality authored
  7. Update require statements for ruby 1.9.3.

    ExternalReality authored
  8. Update tests for ruby 1.9.3.

    ExternalReality authored
  9. Add Succ functor for strings.

    ExternalReality authored
  10. Update numeric character manipulations

    ExternalReality authored
  11. Fix more test.

    ExternalReality authored
Commits on Dec 15, 2011
  1. Eric
  2. Eric

    fix more tests

    ExternalReality authored
  3. Eric

    Fix _locateEof file.

    ExternalReality authored
  4. Eric

    Bump version.

    ExternalReality authored
  5. Eric
  6. Eric

    remove .cvsignore

    ExternalReality authored
This page is out of date. Refresh to see the latest.
1  .cvsignore
View
@@ -1 +0,0 @@
-doc
5 .gitignore
View
@@ -1 +1,4 @@
-doc
+\#*#
+#*
+*~
+.idea
2  rparsec.gemspec
View
@@ -1,7 +1,7 @@
require 'rake'
spec = Gem::Specification.new do |s|
s.name = 'rparsec'
- s.version = '1.0'
+ s.version = '1.1.0'
s.summary = 'A Ruby Parser Combinator Framework'
s.description = 'rparsec is a recursive descent parser combinator framework. Declarative API allows creating parser intuitively and dynamically.'
s.author = 'Ben Yu'
2  rparsec.rb
View
@@ -1,3 +1,3 @@
%w{
parsers operators keywords expressions
-}.each {|lib| require "rparsec/#{lib}"}
+}.each {|lib| require_relative "rparsec/#{lib}"}
4 rparsec/error.rb
View
@@ -1,4 +1,4 @@
-require 'rparsec/misc'
+require_relative 'misc'
module RParsec
@@ -25,4 +25,4 @@ class Expected < Failure
Precedence = 100
end
-end # module
+end # module
4 rparsec/expressions.rb
View
@@ -1,4 +1,4 @@
-require 'rparsec/parser'
+require_relative 'parser'
module RParsec
@@ -181,4 +181,4 @@ def self.prepare_suites(table)
end
end
-end # module
+end # module
9 rparsec/functors.rb
View
@@ -8,6 +8,7 @@ module Functors
Idn = proc {|*x|x}
Neg = proc {|x|-x}
Inc = proc {|x|x+1}
+ Succ = proc {|x|x.succ}
Dec = proc {|x|x-1}
Plus = proc {|x,y|x+y}
Minus = proc {|x,y|x-y}
@@ -86,7 +87,7 @@ def curry(arity, &block)
#
# Create a Proc that's curriable.
- # When curried, parameters are passed in from right to left.
+ # When reverse_curried, parameters are passed in from right to left.
# i.e. reverse_curry(closure).call(a).call(b) is quivalent to closure.call(b,a) .
# _block_ is encapsulated under the hood to perform the actual
# job when currying is done.
@@ -101,7 +102,7 @@ def reverse_curry(arity, &block)
# Uncurry a curried closure.
#
def uncurry(&block)
- return block unless block.arity == 1
+ return block unless block.arity == 1 || block.arity == -1
proc do |*args|
result = block
args.each do |a|
@@ -115,7 +116,7 @@ def uncurry(&block)
# Uncurry a reverse curried closure.
#
def reverse_uncurry(&block)
- return block unless block.arity == 1
+ return block unless block.arity == 1 || block.arity == -1
proc do |*args|
result = block
args.reverse_each do |a|
@@ -271,4 +272,4 @@ def power(n)
alias * repeat
end
-end # module
+end # module
4 rparsec/keywords.rb
View
@@ -1,4 +1,4 @@
-require 'rparsec/parser'
+require_relative 'parser'
module RParsec
@@ -111,4 +111,4 @@ def copy_words(words, case_sensitive)
end
end
-end # module
+end # module
7 rparsec/locator.rb
View
@@ -1,4 +1,4 @@
-require 'rparsec/misc'
+require_relative 'misc'
module RParsec
@@ -10,6 +10,7 @@ class CodeLocator
LF = ?\n
def locate(ind)
+ p ind if code == "ab\nc"
return _locateEof if ind >= code.length
line, col = 1,1
return line,col if ind<=0
@@ -27,7 +28,7 @@ def locate(ind)
def _locateEof
line, col = 1, 1
code.each_byte do |c|
- if c == LF
+ if c.chr == LF
line, col = line+1, 1
else
col = col+1
@@ -37,4 +38,4 @@ def _locateEof
end
end
-end # module
+end # module
4 rparsec/operators.rb
View
@@ -1,4 +1,4 @@
-require 'rparsec/parser'
+require_relative 'parser'
module RParsec
@@ -100,4 +100,4 @@ def self.to_array suites
end
end
-end # module
+end # module
2  rparsec/parser.rb
View
@@ -1,6 +1,6 @@
%w{
monad misc error context locator token functors parser_monad
-}.each {|lib| require "rparsec/#{lib}"}
+}.each {|lib| require_relative "#{lib}"}
require 'strscan'
module RParsec
13 rparsec/parsers.rb
View
@@ -1,4 +1,4 @@
-require 'rparsec/parser'
+require_relative 'parser'
module RParsec
@@ -372,7 +372,7 @@ def _parse ctxt
end
def downcase c
- case when c >= ?A && c <=?Z then c + (?a - ?A) else c end
+ case when c >= ?A && c <=?Z then (c.ord + (?a.ord - ?A.ord)).chr else c end
end
class StringCaseInsensitiveParser < Parser
@@ -611,6 +611,7 @@ def _parse ctxt
ctxt.retn(ctxt.index)
end
end
+
class SetIndexParser < Parser
init :index
def _parse ctxt
@@ -618,6 +619,12 @@ def _parse ctxt
end
end
+class PermutationParser < Parser
+ class Choice
+
+ end
+end
+
Nil = ValueParser.new(nil)
-end # module
+end # module
54 rparsec/perms.rb
View
@@ -0,0 +1,54 @@
+require_relative 'parser'
+
+module RParsec
+
+ class PTree
+ attr_reader :choice
+
+ def initialize(choice = nil)
+ @choice = choice ? choice : []
+ end
+
+ def add(elem)
+ if @choice == [] then
+ @choice = [Branch.new(PTree.new, elem)]
+ else
+ choice = Marshal.load(Marshal.dump(@choice) ) #make a deep copy
+ @choice = [Branch.new(PTree.new(@choice), elem)] + (others choice, elem)
+ end
+
+ return self
+ end
+
+ def add_elems(elems)
+ elems.map { |elem| self.add elem }
+ end
+
+ def num_elems
+ @choice.length
+ end
+
+ def others(chs, elem)
+ chs.map! do |branch|
+ Branch.new (branch.ptree.add elem), branch.elem
+ end
+ end
+
+ private :others
+
+ end
+
+ class Branch
+ attr_accessor :ptree
+ attr_reader :elem
+
+ def initialize (ptree, elem)
+ @elem = elem
+ @ptree = ptree
+ end
+ end
+
+ class PermutationPaser < Parser
+
+ end
+end
33 rparsec/perms_test.rb
View
@@ -0,0 +1,33 @@
+require_relative 'perms'
+require 'test/unit'
+
+include RParsec
+
+class TestPTree < Test::Unit::TestCase
+
+ def test_add_elem_should_add_new_branch_to_tree
+ ptree = PTree.new()
+ ptree.add "elem"
+
+ assert ptree.choice.first.kind_of? Branch
+ assert_equal ptree.choice.length, 1
+ end
+
+ def test_add_elems_should_add_collection_of_elements_to_tree
+ ptree = PTree.new
+ elems = ["elem1", "elem2", "elem3"]
+ ptree.add_elems elems
+
+ assert_equal 3, ptree.num_elems
+ end
+
+ def test_num_elems_should_return_the_number_of_elements_in_a_tree
+ ptree = PTree.new
+ ptree.add "elem1"
+ ptree.add "elem2"
+ ptree.add "elem3"
+
+ assert_equal 3, ptree.num_elems()
+ end
+
+end
4 rparsec/token.rb
View
@@ -1,4 +1,4 @@
-require 'rparsec/misc'
+require_relative 'misc'
module RParsec
@@ -40,4 +40,4 @@ def to_s
end
end
-end # module
+end # module
6 test/src/expression_test.rb
View
@@ -1,6 +1,6 @@
-require 'import'
+require_relative 'import'
import :parsers, :functors, :expressions
-require 'parser_test'
+require_relative 'parser_test'
class ExpressionParserTest < ParserTestCase
include Functors
@@ -121,4 +121,4 @@ def testExpression
assertParser('((2-3 )*-+2--//4//2) ', 2, expr)
assertParser('((2-3 )*-+2--/2/2) ', 0, expr)
end
-end
+end
22 test/src/full_parser_test.rb
View
@@ -1,6 +1,6 @@
-require 'import'
+require_relative 'import'
import :parsers, :keywords, :operators, :functors, :expressions
-require 'parser_test'
+require_relative 'parser_test'
class FullParserTest < ParserTestCase
def calculate_simple_cases(val, cases, default)
@@ -17,7 +17,7 @@ def calculate_full_cases(cases, default)
default
end
def parser
- keywords = Keywords.case_sensitive(%w{case when else end and or not true false})
+ keywords = Keywords.case_sensitive(%w{case when else end and or not true false then})
ops = Operators.new(%w{+ - * / % ++ -- == > < >= <= != : ( )})
lexer = integer.token(:int)|keywords.lexer|ops.lexer
delim = whitespaces |comment_line('#')
@@ -37,10 +37,10 @@ def parser
infixl(keywords[:not] >> Not, 30)
bool = Expressions.build(bool_term, bool_table)
- simple_case = sequence(keywords[:when], lazy_expr, ops[':'], lazy_expr) do |w,cond,t,val|
+ simple_case = sequence(keywords[:when], lazy_expr, keywords[:then], lazy_expr) do |w,cond,t,val|
[cond, val]
end
- full_case = sequence(keywords[:when], bool, ops[':'], lazy_expr) do |w,cond,t,val|
+ full_case = sequence(keywords[:when], bool, keywords[:then], lazy_expr) do |w,cond,t,val|
[cond, val]
end
default_case = (keywords[:else] >> lazy_expr).optional
@@ -78,18 +78,18 @@ def testComplexCalculationWithComment
verify('2*15/-(5- -2) #this is test')
end
def testSimpleCaseWhen
- verify('case 1 when 1: 0 else 1 end')
+ verify('case 1 when 1 then 0 else 1 end')
end
def testSimpleCaseWhenWithRegularCalc
- verify('case 1 when 1*1: (1-2) when 3:4 end+1')
+ verify('case 1 when 1*1 then (1-2) when 3 then 4 end+1')
end
def testFullCaseWhen
- assertParser('3*case when 1==0 and 1==1: 1 when 1==1 : 2 end', 6, parser)
+ assertParser('3*case when 1==0 and 1==1 then 1 when 1==1 then 2 end', 6, parser)
begin
- parser.parse('3*case when (1==0 and 1==1): 1 when 1==1 then 2 end')
+ parser.parse('3*case when (1==0 and 1==1) then 1 when 1==1 : 2 end')
fail('should have failed')
rescue ParserException => e
- assert(e.message.include?(': expected, then at line 1, col 42'))
+ assert(e.message.include?('keyword:then expected, : at line 1, col 46.'))
end
end
-end
+end
8 test/src/functor_test.rb
View
@@ -1,5 +1,5 @@
-require 'import'
-require 'runit/testcase'
+require_relative 'import'
+require 'test/unit'
import :parsers, :functors
include RParsec
@@ -10,7 +10,7 @@ class Method
include FunctorMixin
end
-class FunctorTestCase < RUNIT::TestCase
+class FunctorTestCase < Test::Unit::TestCase
include Functors
def verify(expected, f, *args)
assert_equal(expected, f.call(*args))
@@ -63,4 +63,4 @@ def testNth
def testMethodIsMixedIn
verify(false, 1.method(:kind_of?).compose(Id), String)
end
-end
+end
6 test/src/import.rb
View
@@ -1,5 +1,5 @@
-# $: << "#{File.dirname(__FILE__)}/../.."
+$: << "#{File.dirname(__FILE__)}/../.."
def import *names
- names.each {|lib|require "rparsec/#{lib}"}
-end
+ names.each {|lib|require "#{File.dirname(__FILE__)}/../../rparsec/#{lib}"}
+end
8 test/src/keyword_test.rb
View
@@ -1,6 +1,6 @@
-require 'import'
+require_relative 'import'
import :parsers, :keywords
-require 'parser_test'
+require_relative 'parser_test'
class KeywordTestCase < ParserTestCase
Insensitive = Keywords.case_insensitive(%w{select from where group by order having}){|x|x.downcase}
@@ -23,6 +23,6 @@ def testCaseInsensitiveKeywords
def testBasics
assert(!Insensitive.case_sensitive?)
assert(Sensitive.case_sensitive?)
- assert(:keyword, Sensitive.keyword_symbol)
+ assert_equal(:keyword, Sensitive.keyword_symbol)
end
-end
+end
6 test/src/operator_test.rb
View
@@ -1,6 +1,6 @@
-require 'import'
+require_relative 'import'
import :parsers, :operators, :functors
-require 'parser_test'
+require_relative 'parser_test'
class OperatorTestCase < ParserTestCase
Ops = Operators.new(%w{++ + - -- * / ~}, &Id)
@@ -18,4 +18,4 @@ def testAll
def testSort
assert_equal(%w{+++ ++- ++ + --- -- -}, Operators.sort(%w{++ - + -- +++ ++- ---}))
end
-end
+end
8 test/src/parser_test.rb
View
@@ -1,10 +1,10 @@
-require 'import'
-require 'rubyunit'
+require_relative 'import'
+require 'test/unit'
import :parsers, :functors
include RParsec
-class ParserTestCase < RUNIT::TestCase
+class ParserTestCase < Test::Unit::TestCase
include Functors
include Parsers
def assertParser(code, expected, parser)
@@ -50,4 +50,4 @@ def add_encountered(msg, encountered)
result << ', ' unless msg.strip.length == 0 || msg =~ /.*(\.|,)\s*$/
"#{result}#{encountered}"
end
-end
+end
10 test/src/perf_benchmark.rb
View
@@ -1,8 +1,8 @@
-require 'import'
-import :rparsec
+require_relative 'import'
+import :parsers, :operators, :keywords, :expressions
require 'benchmark'
-require 'rubyunit'
-class PerfTestCase < RUNIT::TestCase
+require 'test/unit'
+class PerfTestCase < Test::Unit::TestCase
include Parsers
include Functors
def test1
@@ -22,4 +22,4 @@ def test1
x.report("parsing") {puts(expr.parse(code))}
end
end
-end
+end
6 test/src/s_expression_test.rb
View
@@ -1,6 +1,6 @@
-require 'import'
+require_relative 'import'
import :parsers, :functors, :expressions
-require 'parser_test'
+require_relative 'parser_test'
class SExpressionTestCase < ParserTestCase
def delim
@@ -30,4 +30,4 @@ def parser
def test1
assertParser('- (+ 1 * 2 2.0) (1)', 4, parser)
end
-end
+end
10 test/src/simple_monad_test.rb
View
@@ -1,5 +1,5 @@
-require 'import'
-require 'runit/testcase'
+require_relative 'import'
+require 'test/unit'
import :id_monad, :monad
include RParsec
@@ -14,9 +14,9 @@ def to_s
end
end
-class SimpleMonadTest < RUNIT::TestCase
+class SimpleMonadTest < Test::Unit::TestCase
def test1
- assert 20, Idm.new(10).map{|i|i*2}
- assert 10, Idm.new(10).plus(Idm.new(20))
+ assert_equal 20, Idm.new(10).map{|i|i*2}
+ assert_equal 10, Idm.new(10).plus(Idm.new(20))
end
end
24 test/src/simple_parser_test.rb
View
@@ -1,6 +1,6 @@
-require 'import'
+require_relative 'import'
import :parsers
-require 'parser_test'
+require_relative 'parser_test'
class SimpleParserTest < ParserTestCase
def testValue
@@ -32,7 +32,7 @@ def testFailSeqFailFails
end
def testMap
assertParser('', 2, value(1).map{|x|x*2})
- relative = Proc.new{|x|x-?a}
+ relative = Proc.new{|x|(x.ord - ?a.ord)}
assertParser('b', 1, char('b').map(&relative))
end
def testMapOnFailFails
@@ -58,11 +58,11 @@ def testSatisfies
end
def testIs
assertParser('abc', ?a, is(?a))
- assertError('abc', '98 expected', is(?b))
+ assertError('abc', 'b expected', is(?b))
end
def testIsnt
assertParser('abc', ?a, isnt(?b))
- assertError('abc', '97 unexpected', isnt(?a))
+ assertError('abc', 'a unexpected', isnt(?a))
assertError('abc', "'b' unexpected", not_char(?b) >> not_char('b'), 1)
end
def testCharAndEof
@@ -75,7 +75,7 @@ def testAre
def testSequence
assertParser('abc', ?c, sequence(char(?a),char('b'),char('c')))
a = ?a
- relative = proc {|c|c-a}
+ relative = proc {|c|(c.ord - a.ord)}
parser = sequence(
char('c').map(&relative),
char('b').map(&relative),
@@ -136,10 +136,10 @@ def testArent
def testAmong
assertParser('abc', ?a, among(?b, ?a))
assertParser('abc', ?a, among('ba'))
- assertError('abc', "one of [98, 99] expected", among(?b,?c))
+ assertError('abc', "one of [b, c] expected", among(?b,?c))
end
def testNotAmong
- assertError('abc', "one of [98, 97] unexpected", not_among(?b, ?a))
+ assertError('abc', "one of [b, a] unexpected", not_among(?b, ?a))
assertParser('abc', ?a, not_among(?b,?c))
end
def testGetIndex
@@ -312,7 +312,7 @@ def testWhitespace
def testWhitespaces
assertParser(' ', ?\s, whitespaces)
assertParser("\n\t", ?\t, whitespaces)
- assertError("\n \tabc ", "whitespace(s) expected, 'a' at line 2, col 3.", whitespaces >> whitespaces, 3)
+ assertError("\n \tabc ", "whitespace(s) expected, a at line 2, col 3.", whitespaces >> whitespaces, 3)
end
def testCommentLineWithLexeme
assertParser('#abc', nil, comment_line('#'))
@@ -374,7 +374,7 @@ def testSetIndex
assertParser('abc', [?a,?a,?a], parser.repeat(3))
end
def testMapn
- assertParser('abc', ?b, any.repeat(3).mapn{|a,b,c|c-b+a})
+ assertParser('abc', ?b, any.repeat(3).mapn{|a,b,c| (c.ord - b.ord + a.ord).chr })
end
def testWatch
i = nil
@@ -392,14 +392,14 @@ def testWatch
assertParser('abc', ?b, any.repeat_(2) >> watch);
end
def testMapCurrent
- assertParser('abc', ?b, any >> map{|x|x+1})
+ assertParser('abc', ?b, any >> map{|x|x.succ})
assertParser('abc', ?a, any >> map)
assertParser('abc', ?a, any.map)
assertParser('abc', ?a, any.mapn)
end
def testMapnCurrent
assertParser('abc', ?a, any.repeat(2) >> mapn{|a,_|a})
- assertParser('abc', ?c, any.repeat_(2) >> mapn(&Inc))
+ assertParser('abc', ?c, any.repeat_(2) >> mapn(&Succ))
assertParser('abc', [?a,?b], any.repeat(2) >> mapn)
end
def verifyTypeMismatch(mtd, n, expected, actual)
9 test/src/sql.rb
View
@@ -1,4 +1,4 @@
-require 'import'
+require_relative 'import'
import :misc
include RParsec
@@ -108,7 +108,8 @@ def to_s
"#{left} #{op_name} #{right}"
end
def op_name
- case op when :"!=": "<>" else op.to_s end
+ case op when :!= then "<>"
+ else op.to_s end
end
end
class CompoundPredicate < Predicate
@@ -263,6 +264,6 @@ def to_s
class UnionRelation < Relation
def_readable :left, :all, :right
def to_s
- "#{left} union #{case when all: 'all ' else '' end}#{right}"
+ "#{left} union #{case when all then 'all ' else '' end}#{right}"
end
-end
+end
8 test/src/sql_parser.rb
View
@@ -1,4 +1,4 @@
-require 'import'
+require_relative 'import'
import :parsers, :keywords, :operators, :functors, :expressions
include RParsec
@@ -182,7 +182,7 @@ def make_relation expr, pred
lazy_relation = lazy{relation}
term_relation = word {|w|TableRelation.new w} | operator['('] >> lazy_relation << operator[')']
sub_relation = sequence(term_relation, (keyword[:as].optional >> word).optional) do |rel, name|
- case when name.nil?: rel else AliasRelation.new(rel, name) end
+ case when name.nil? then rel else AliasRelation.new(rel, name) end
end
joined_relation = sub_relation.postfix(join_maker(lazy{joined_relation}, pred))
where_clause = keyword[:where] >> pred
@@ -201,7 +201,7 @@ def make_relation expr, pred
SelectRelation.new(projected, distinct, from, where, groupby, orderby)
end
relation = sequence(relation, (keyword[:limit] >> token(:number, &To_i)).optional) do |rel, limit|
- case when limit.nil?: rel else LimitRelation.new(rel, limit) end
+ case when limit.nil? then rel else LimitRelation.new(rel, limit) end
end
relation = relation.infixl(union_maker)
end
@@ -255,4 +255,4 @@ def assemble
def make parser
MyLexeme.nested(parser << eof)
end
-end
+end
8 test/src/sql_test.rb
View
@@ -1,6 +1,6 @@
-require 'parser_test'
-require 'sql'
-require 'sql_parser'
+require_relative 'parser_test'
+require_relative 'sql'
+require_relative 'sql_parser'
class SqlTestCase < ParserTestCase
include SqlParser
def verify_sql(code, expected, parser)
@@ -125,4 +125,4 @@ def testUnion
def testAndOrNot
verify_predicate '1>1 or 1<=1 and not true', '(1 > 1 or (1 <= 1 and (not true)))'
end
-end
+end
4 test/src/tests.rb
View
@@ -9,5 +9,5 @@
full_parser
sql
}.each do |name|
- require "#{name}_test"
-end
+ require_relative "#{name}_test"
+end
Something went wrong with that request. Please try again.