-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional URN prefixes are not being parsed correctly. #8
Comments
On a side note, I was wondering if you were able to find a tool online that, given two ABNF files, checks for their mathematical equality. I was only able to find Bill's ABNF validator, but this just validates and canonicalizes the ABNF; it does not check for equality given two ABNF files. If we had this tool, it would be easy to see if the ABNF transformations you did are compliant. |
Thanks for the note here: I'll definitely investigate this. I'm not aware of a tool that does algebraic comparisons of ABNF files, although it should be possible. I would be very interested if you found one! I suspect my transformation to remove left recursion (which is unsupported by just about all parsers) would trip up naive implementations. |
Cool, thanks for the speedy response! For now, this isn't a blocker for us as our regexp-based fix is sufficient. I'll keep you posted if I find anything on the algebraic equivalence, though. I would be surprised if such a program did not exist! |
Hmm. I am actually led to believe this is an attributePath = [URI "<"] attributePathSegment *1("." attributePathSegment) (i.e. change the optional delimiter from And now it can correctly parse stuff like: import { parseAttributePath } from "scim-query-filter-parser";
// Note the delimiter was changed from ":" to "<"
const filterPredicate = parseAttributePath("urn:ietf:params:scim:schemas:core:2.0:User<userName")
// ["userName"] It doesn't include the URI in the output array because I didn't update the library-level code to consider the current in-context URI in I'm taking a wild stab in the dark here, but it appears the |
Another example illustrating this issue: attributePath = attributePathSegment "-" attributePathSegment
attributePathSegment = ALPHA *("-" / "_" / DIGIT / ALPHA) I guess this is ambiguous because |
Hi again, @mike-marcacci! I was unsure how to solve this problem, and the out-of-repo fix is quite trivial, so I did not open a PR. That said, I would still like to inform you of this issue.
Based on the ABNF rules for
attrPath
(leaving out the other tokens for brevity, you get the idea):An
attrPath
may contain an optional URI, followed by a colon. However, trying to parse an example does not work:I suspect this is an error in either your transformation of the ABNF rules, or in
apg-lib
. The problem can be easily solved out-of-repo by slicing off the URI before passing the purportedattrPath
toparseAttributePath
. It's a very simple fix, but it would be awesome if you looked into why this is happening.The text was updated successfully, but these errors were encountered: