diff --git a/relational/optimizations.py b/relational/optimizations.py index 6866dc1..267bfd4 100644 --- a/relational/optimizations.py +++ b/relational/optimizations.py @@ -326,6 +326,17 @@ def tokenize_select(expression): except: pass + + level=0 + for i in range(len(l)): + l[i]=level_string(l[i]) + l[i].level=level + + if l[i]=='(': + level+=1 + elif l[i]==')': + level-=1 + return l def swap_rename_projection(n): diff --git a/test/driver.py b/test/driver.py index b30f0a8..5114905 100644 --- a/test/driver.py +++ b/test/driver.py @@ -22,6 +22,8 @@ from relational import relation, parser, optimizer import os +print relation + rels={} examples_path='samples/' tests_path='test/' @@ -44,9 +46,10 @@ def load_relations(): #Naming the relation relname=i[:-4] - print "Loading relation %s with name %s" % (i,relname) + print ("Loading relation %s with name %s..." % (i,relname)), rels[relname]=relation.relation('%s%s' % (examples_path,i)) + print 'done' def execute_tests(): diff --git a/test/php.query b/test/php.query index 41e6510..19e0d80 100644 --- a/test/php.query +++ b/test/php.query @@ -1 +1 @@ -σ age<30and skill=='PHP' (people ᐅᐊ skills) +σ age<30 and skill=='PHP' (people ᐅᐊ skills)