groovy

Grammar cleanup

Details

  • Type: Task Task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1-beta-2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

As of Groovy DevCon #3, it has been decided that some Antlr grammar clean-up were in order.

Jeremy can expand on the details of the clean-up to be made.

Activity

Hide
Paul King added a comment -

Adding as comment, to make it easier to find when we go looking for it:

Grammar cleanup - from groovydevcon3

REMOVED
o break with value from loops
for (i in 1..100) { break 2 }

o continue with value from loops
for (i in 1..100) { continue 2 }

o break/continue label no longer need a colon afterwards
(because previous two items now removed)
for (i in 1..100) { break label1: }
-Becomes-
for (i in 1..100) { break label1 }

o "with" keyword removed
with(foo) { bar() }

o Scope Escape($) removed
println([$x, x, y])

o "any" keyword removed
any bar = "";

o Spread argument directly in GStrings removed
def bar = [1,2,3]
def g = "foo$*bar"

FIXED
o Qualified Exception Types now work
def foo() throws bar.MookyException{}

ADDED
o with() added to Object
[1,2,3].with { it << 4 println it }

(this is what I would have called Object.identity()
all along if "with" wasn't a keyword,
o.identity {...} now synonym for o.with {...} )

Show
Paul King added a comment - Adding as comment, to make it easier to find when we go looking for it: Grammar cleanup - from groovydevcon3 REMOVED o break with value from loops for (i in 1..100) { break 2 } o continue with value from loops for (i in 1..100) { continue 2 } o break/continue label no longer need a colon afterwards (because previous two items now removed) for (i in 1..100) { break label1: } -Becomes- for (i in 1..100) { break label1 } o "with" keyword removed with(foo) { bar() } o Scope Escape($) removed println([$x, x, y]) o "any" keyword removed any bar = ""; o Spread argument directly in GStrings removed def bar = [1,2,3] def g = "foo$*bar" FIXED o Qualified Exception Types now work def foo() throws bar.MookyException{} ADDED o with() added to Object [1,2,3].with { it << 4 println it } (this is what I would have called Object.identity() all along if "with" wasn't a keyword, o.identity {...} now synonym for o.with {...} )
Hide
Guillaume Laforge added a comment -

Thank you Jeremy for this spring clean! Well done.

Show
Guillaume Laforge added a comment - Thank you Jeremy for this spring clean! Well done.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: