predicator 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +9 -0
- data/README.md +20 -0
- data/Rakefile +5 -0
- data/bin/console +1 -0
- data/lib/predicator.rb +6 -17
- data/lib/predicator/context.rb +24 -0
- data/lib/predicator/generated_parser.rb +885 -0
- data/lib/predicator/lexer.rb +93 -0
- data/lib/predicator/parser.rb +24 -37
- data/lib/predicator/parser.y +46 -0
- data/lib/predicator/predicates/and.rb +15 -9
- data/lib/predicator/predicates/equals.rb +21 -0
- data/lib/predicator/predicates/false.rb +13 -0
- data/lib/predicator/predicates/not.rb +15 -8
- data/lib/predicator/predicates/or.rb +15 -9
- data/lib/predicator/predicates/true.rb +13 -0
- data/lib/predicator/variable.rb +26 -0
- data/lib/predicator/version.rb +1 -1
- data/predicator.gemspec +4 -4
- metadata +35 -12
- data/lib/predicator/transform.rb +0 -10
data/lib/predicator/transform.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
module Predicator
|
2
|
-
class Transform < Parslet::Transform
|
3
|
-
rule(:boolean => simple(:b)) { !!(b.match /true/) }
|
4
|
-
rule(:array => subtree(:a)) { Array(a) }
|
5
|
-
|
6
|
-
rule(:not => subtree(:sub)) { Predicator::Predicates::Not.new sub }
|
7
|
-
rule(:or => subtree(:sub)) { Predicator::Predicates::Or.new sub }
|
8
|
-
rule(:and => subtree(:sub)) { Predicator::Predicates::And.new sub }
|
9
|
-
end
|
10
|
-
end
|