groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <realblue...@hotmail.com>
Subject Re: Negative relational operators for Groovy 3
Date Wed, 23 Nov 2016 23:37:49 GMT
Hi Guillaume,

      All features added in the new parser have been synch to parrot branch. I am looking
for a better way to report missing the RIGHT parenthesis with less performance reduction ;)

Cheers,
Daniel.Sun



在 "Guillaume Laforge [via Groovy]" <ml-node+s329449n5736964h42@n5.nabble.com>,2016年11月24日
上午6:14写道:

Ooops, a mistake of mine with a missing parens in some code before that.
We might have to pay attention to error reporting, and see how good it is to help fix developer's
mistakes.

On Wed, Nov 23, 2016 at 10:47 PM, Guillaume Laforge <[hidden email]> wrote:
Is the "parrot" branch covering !in already?

I fetched it today, but got issues with !in

if (1 !in [0, 1, 2]) {}

Nov 23, 2016 10:45:29 PM org.apache.groovy.parser.antlr4.AstBuilder buildAST
SEVERE: Failed to build AST
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
ConsoleScript17: 11: Unexpected input: 'if'; Expecting RPAREN @ line 11, column 1.
   if (1 !in [0, 1, 2]) {}
   ^

1 error

And

assert 3 !in []

Nov 23, 2016 10:45:50 PM org.apache.groovy.parser.antlr4.AstBuilder buildAST
SEVERE: Failed to build AST
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
ConsoleScript18: 9: Unexpected input: 'assert'; Expecting RPAREN @ line 9, column 1.
   assert 3 !in []
   ^

1 error

I did build with -PuseAntlr4=true though.

Guillaume


On Fri, Nov 18, 2016 at 1:45 PM, Daniel Sun <[hidden email]> wrote:
Hi all,

      The new parser(Parrot) supports negative relational operators now,
which is proposed by Guillaume Laforge :)

      Here are some example
codes(https://github.com/danielsun1106/groovy-parser/blob/negativeRelationalOperators/src/test/resources/core/NegativeRelationalOperators_01x.groovy):

assert 'a' instanceof String
assert 'a' !instanceof Integer
assert 1 <= 2
assert 2 !<= 1
assert 2 >= 1
assert 1 !>= 2
assert 1 < 2
assert 2 !< 1
assert 2 > 1
assert 1 !> 2
assert 1 in [1, 2]
assert 3 !in [1, 2]

      The static compilation example codes can be found at
https://github.com/danielsun1106/groovy-parser/blob/negativeRelationalOperators/src/test/resources/core/NegativeRelationalOperators_02x.groovy

       Any thoughts?

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/Negative-relational-operators-for-Groovy-3-tp5736809.html
Sent from the Groovy Dev mailing list archive at Nabble.com.



--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge<http://twitter.com/glaforge> / Google+<https://plus.google.com/u/0/114130972232398734985/posts>



--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge<http://twitter.com/glaforge> / Google+<https://plus.google.com/u/0/114130972232398734985/posts>


________________________________
If you reply to this email, your message will be added to the discussion below:
http://groovy.329449.n5.nabble.com/Negative-relational-operators-for-Groovy-3-tp5736809p5736964.html
To unsubscribe from Negative relational operators for Groovy 3, click here<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5736809&code=cmVhbGJsdWVzdW5AaG90bWFpbC5jb218NTczNjgwOXwxMTQ2MjE4MjI1>.
NAML<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://groovy.329449.n5.nabble.com/Negative-relational-operators-for-Groovy-3-tp5736809p5736968.html
Sent from the Groovy Dev mailing list archive at Nabble.com.
Mime
View raw message