Commit 92ecdb1

mokha <mokha@cisco.com>
2019-05-11 19:48:52
try to figure out stack overflow in value_filter
1 parent 5c0720d
Changed files (2)
lib
scim
spec
scim
lib/scim/kit/v2/parser.rb
@@ -26,6 +26,9 @@ module Scim
             logical_expression |
             (not_op >> lparen >> value_filter >> rparen)
         end
+        rule(:tmp) do
+          attribute_expression | logical_expression
+        end
 
         # attrExp = (attrPath SP "pr") / (attrPath SP compareOp SP compValue)
         rule(:attribute_expression) do
spec/scim/kit/v2/parser_spec.rb
@@ -40,15 +40,16 @@ RSpec.describe Scim::Kit::V2::Parser do
   specify { expect(subject.value_path.parse_with_debug(%(title pr and userType eq "Employee"))).not_to be_truthy }
 
   [
-    'emails[type eq "work" and value co "@example.com"]'
+    #'emails[type eq "work" and value co "@example.com"]'
   ].each do |x|
-    xspecify { expect(subject.value_path).to parse(x) }
+    specify { expect(subject.value_path.parse_with_debug(x)).to be_truthy }
   end
 
   [
+    #'firstName eq "Tsuyoshi" and lastName eq "Garret"',
+    #'type eq "work" and value co "@example.com"',
     'firstName eq "Tsuyoshi"',
-    'firstName pr'
-    # 'firstName eq "Tsuyoshi" and lastName eq "Garret"'
+    'firstName pr',
   ].each do |x|
     specify { expect(subject.value_filter).to parse(x) }
   end