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
Parser error #4
Comments
Please see: The Language Reference This was done intentionally (a deviation from Ruby) because Objeq isn't parsing the Regular Expressions as part of its lexing pass. Instead, it's just taking the string (or expression result) and constructing a new RegExp instance from it. Because of this, there's no way to disambiguate a string from a Regex, and therefore the ordering is necessary. |
ah I understand. That's a pity, Maybe you could add support for regexp notation like JavaScript has, like: var query = $objeq("name ~= /^Ro/ -> name + ' is ' + age"); Thanks for your fast reply. |
Though the reverse ~= operator isn't part of Ruby as far as I know, it has a certain aesthetic appeal to it that I very much like. Lexing regular expressions might be a huge pain in the ass, but it's worth a shot. |
Yes, this You may not need to do any lexing for the regular expressions at all, just interpret the contents between the forward slashes like a string and feed it to a |
Thanks for this library, I really like this solution where you can provide a query as string.
In the docs I see this example:
which works fine. However, turning around property and value in the comparison does not work:
The text was updated successfully, but these errors were encountered: