question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Special Grammar not supported

See original GitHub issue

The Special Grammar is not supported. If I try the simple example matcher (m = r.sub.Name in (r.obj.Admins)), I get an error:

com.googlecode.aviator.exception.ExpressionSyntaxErrorException: Syntax error: unexpect token 'in', maybe forget to insert ';' to complete last expression  at 13, lineNumber: 1, token : [type='variable',lexeme='in'],
while parsing expression: `
r_sub.Name in^^^
`
	at com.googlecode.aviator.AviatorEvaluatorInstance.innerCompile(AviatorEvaluatorInstance.java:1494)
	at com.googlecode.aviator.AviatorEvaluatorInstance.access$000(AviatorEvaluatorInstance.java:180)
	at com.googlecode.aviator.AviatorEvaluatorInstance$2.call(AviatorEvaluatorInstance.java:1465)
	at com.googlecode.aviator.AviatorEvaluatorInstance$2.call(AviatorEvaluatorInstance.java:1462)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.googlecode.aviator.AviatorEvaluatorInstance.compile(AviatorEvaluatorInstance.java:1449)
	at com.googlecode.aviator.AviatorEvaluatorInstance.compile(AviatorEvaluatorInstance.java:1413)
	at com.googlecode.aviator.AviatorEvaluatorInstance.compile(AviatorEvaluatorInstance.java:1400)
	at org.casbin.jcasbin.main.CoreEnforcer.enforce(CoreEnforcer.java:439)
	at org.casbin.jcasbin.main.CoreEnforcer.enforce(CoreEnforcer.java:546)
        ...

The parsing seems to incorrectly see in as variable and not as operator.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hsluoyzcommented, Jul 7, 2021

@tangyang9464 can we support in in Java? See: https://casbin.org/docs/en/syntax-for-models#expression-evaluator . Java uses: https://github.com/killme2008/aviatorscript as the expression evaluator. And aviatorscript is evolving faster now. We should send issue to their community for in support.

0reactions
github-actions[bot]commented, Jul 19, 2021

🎉 This issue has been resolved in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Special Cases in Subject Verb Agreement | Style for Students ...
Part of why subject/verb agreement errors are so numerous is because of the "special cases" that often arise in English, e.g., when words...
Read more >
Speech Recognition Grammar Specification Version 1.0 - W3C
The Speech Recognition Grammar Specification provides syntactic support for limited semantic interpretation.
Read more >
Top 20 Errors in Undergraduate Writing
Summary and examples of the top 20 errors in undergraduate writing as found by Lunsford and Lunsford.
Read more >
ANTLR 4 - Grammar Rule for string to support whitespace and ...
1 Answer 1 ... and here his solution : You are declaring your rule for string as a parser rule. Lexer rules should...
Read more >
Common Grammar Mistakes: 11 Goofs You Might Know Too ...
I have tested emails in Gmail and several other email programs, plus every major feed reader and everything looks great. Sorry it's not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found