Groovy-61 PROGRESS: Implemented a form of regular expressions for groovy that more naturally integrates with the current lexer and parser. Regular expression matching can be done like:
string ~= regex string
This expression returns a java.util.regex.Matcher that you can then manipulate as you see fit. This form:
string ~== regex string
Returns a boolean based on whether string is fully matched by regex string. Also implemented is asIterator for Matcher so that you can use it with closures:
("cheesecheese" ~= "cheese").each({x | println(x)})
Prints two 'cheese' lines. See the unit tests for more examples in RegularExpressionsTest.groovy.
Also within this change is a minor change to increase classloader support. I think that James is going to redo that in the future anyway.
242 lines of code changed in:
Added a property to avoid the exception stack trace when running the console
4 lines of code changed in:
pretty print
33 lines of code changed in:
Adding some methods for lists
Set Intersection [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] -> [1, 3]
Repetition [ 1, 2, 3 ] * 3 -> [1, 2, 3, 1, 2, 3, 1, 2, 3]
Concatenation [ 1, 2, 3 ] + [ 4, 5 ] -> [1, 2, 3, 4, 5]
Set Difference [ 1, 1, 2, 2, 3, 3, 3, 4, 5 ] - [ 1, 2, 4 ] -> [3, 5]
flatten [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10] -> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
199 lines of code changed in:
Added support for a step() method on a range so that step based iteration can be done on any range object
104 lines of code changed in:
added some documentation about the inject method
53 lines of code changed in:
added an extra test case
3 lines of code changed in:
added sam's ID
1 lines of code changed in:
added Sams name (damn I got distracted, meant to do this some time ago)
1 lines of code changed in:
Added support for Ruby / Python style inject method for incrementally processing each item in a list & passing the value into each closure
Removed some cruft from the todo.txt
41 lines of code changed in:
Added some documentation to the website describing Sam's cool work on groovlets (and pinching Sam's example groovlet too :)
1 lines of code changed in:
updated so website shows timestamp
2 lines of code changed in:
Various problems existed for accessing properties of variables from the script context. The meat of the fix was to remove the stack reordering that we were doing in visitPropertyExpression and replace it with a method call that takes the parameters in the natural order. Finding this hidden ASTORE that was stomping on my variables was fun for the whole family. I added a test for this case and also for using GroovyShell in general. After working on this for a few hours you wouldn't believe the sigh of relief when I found this reordering was being done and I could fix about 4 bugs that I ran into that turns out were all related to this. Yay!
122 lines of code changed in:
Groovy-59 NEW FEATURE: Heredocs/verbatim/reports whatever you want to call them are implemented. The syntax is <<<TOKEN .....\nTOKEN They act just like double quoted GStrings so you can use them for large template text quite easily:
println(<<<EOS
Hello there!
EOS)
is exactly the same as
println("Hello there!")
Notice there are no trailing or prefixed new lines. You can see other examples in VerbatimGStringTest.groovy.
143 lines of code changed in:
Groovy-48 FIXED: When there is a GString with a value in the first position the elegant logic of the toString method breaks down because in order to preserve its simplicity, there must be a string not a value as the first thing in the GString. This change simply checks to see if there are no strings when adding a value, if there are not, then it puts an EMPTY_STRING as the first thing in the string list. This preserves the way toString is handled, is unobtrusive, and fixes the bugs that were commented out.
6 lines of code changed in:
Groovy-42 FIXED: This adds ! support to groovy. I tried a number of different strategies for adding it and this was the least traumatic. Javac supports ! by reversing the compares that are done in the underlying expression. This proved to be an extremely large change for something that is easily handled with a utility method. I do suggest that when we go back to optimize groovy that this may something that can be done more efficiently.
172 lines of code changed in:
Groovy-44: FIXED You can now use numbers as objects.
27 lines of code changed in:
Groovy-60 FIXED: If the variable is new and it is a property we need to ensure that we store it in the local scope so that when someone sets in a lower scope and then reads it in a higher scope we don't get a verifier error because it may not have been initialized.
29 lines of code changed in:
Tidying up the imports, should have gotten this the first time.
0 lines of code changed in:
This is a checkin of the GroovyServlet. The groovy servlet can be registered to handle .groovy files in a web application. Those scripts are compiled and are run under the webapplications context so that you get additional variables from the container including "application", "session", "request", "response", "out" and any form parameters that are passed in. See the servlet source for the xml required to register it in the DD. This introduces an additional dependency "servletapi-2.3" on the build because it references javax.servlet.* classes. At some future date we may move this so that we can have a separate J2EE section in the repository. I had to remove the debugging calls to LogFactory because it can interfere with most servers use of the same functionality.
167 lines of code changed in:
Reset the context classloader to the classloader that we saved on the stack to play nicely with application servers.
6 lines of code changed in:
Fix for GROOVY-50, plus test.
17 lines of code changed in:
fixed the build system to include the FAQ
1 lines of code changed in:
* removed unnecessary logging in console.
* fixed some typeos in the documentation
* added a basic FAQ
88 lines of code changed in:
trivial
1 lines of code changed in:
trivial
1 lines of code changed in:
* applied Sam's patch to tidy up the MetaClass
* added early implementation of Sequences (for 0..n or 1..n cardinalities)
* added a keystroke for the swing console
* started some early implementations of an SQL facade for gdo
1004 lines of code changed in:
trivial
2 lines of code changed in:
trivial
0 lines of code changed in:
Trivial change to test damagecontrol.
2 lines of code changed in:
Tidied up the console & fixed the classloader bug - creating a GroovyClassLoader will by default use the thread context class loader
145 lines of code changed in:
Applied Sam's patch
16 lines of code changed in:
Fixed my recent hacks which broke some unit test cases.
All test cases now seem to work fine.
4 lines of code changed in:
Fixed the unit test cases after I accidentally broke them - sorry everyone!
97 lines of code changed in:
added JTextPane support
2 lines of code changed in:
Added support for String.tokenize
164 lines of code changed in:
Tidied up the groovy console to be more like a normal terminal
70 lines of code changed in:
stopped tracing of class files
1 lines of code changed in:
Fixed GROOVY-50
11 lines of code changed in:
added test case for static println
19 lines of code changed in:
Fixed GROOVY-51
67 lines of code changed in:
fixed my bad attempt to apply Sam's patch :)
2 lines of code changed in:
Committed Sam's patch to avoid NPEs when not specifying classpath
8 lines of code changed in:
added documentation about the swing console
16 lines of code changed in:
added a history dialog to the command shell
14 lines of code changed in:
Much neater swing console
4 lines of code changed in:
Fixed various test cases I broke with the GPath changes
156 lines of code changed in:
Added an early version of a GPath test case
81 lines of code changed in:
tidied up todo list & added new map test
138 lines of code changed in:
Apologies for the monster commit everyone - was stuck travelling for 24 hours so had heaps of time to hack groovy - without WiFi in Houston or Gatwick :(
here's a summary of the changes
* refactored the MetaClass method invocation code to be much cleaner (no List and Object[] crap) the dispatcher can now handle overloading of 1 type of a multi-arg list.
* fixed bad exception message when exceptions occur inside a closure which lead to a wierd exception message that was very confusing (due to an exception being wrapped). Added a test case to demonstrate this now works fine.
* added a NoSuchMethodException for better exception
* added better error checking validation messages & exceptions for bad class names & known properties & methods.
* attempted to tidy up the line numbers when exceptions occur; its not totally working yet :)
* tidied up class resolving code so that classpath & compile unit class resolutions work much cleaner.
* uncommented a bunch of test cases. If you search for @todo in the *.groovy files you'll often see little bits of tests that are commented out until some issue with the parser or runtime is sorted out.
* the while() loop appears to be working now
896 lines of code changed in:
Added more test cases & fixed bug with typesafe method returns
37 lines of code changed in:
added some new test cases
24 lines of code changed in:
Fixing double-quoted string interpolation. Building from CST to AST was failing
due to iterating children nodes ineffectively.
9 lines of code changed in:
further attempts to get the string interpolation working
20 lines of code changed in:
Tidied up my patches to get more unit test cases working again
33 lines of code changed in:
fixed test due to && and || now working
0 lines of code changed in:
Minor patch to the GString expression changes, so that by default strings are turned into ConstantExpressions unless they have at least 1 dynamic value
33 lines of code changed in:
added work around for NPE
21 lines of code changed in:
working logical branches
7 lines of code changed in:
First attempt at GROOVY-14
106 lines of code changed in:
First attempt at creating implementing && and ||
68 lines of code changed in:
added test case for GString for bob
13 lines of code changed in:
Front-end fix for GROOVY-41
Backend borks on && binary op.
8 lines of code changed in:
Fix for GROOVY-43.
a+b+c
40 lines of code changed in:
Added GroovyMock library for mock testing of groovy objects
390 lines of code changed in:
Added more folks to developer list
27 lines of code changed in:
Adds a feature summary to the homepage
30 lines of code changed in:
added more docs on eclipse plugin
7 lines of code changed in:
updated the documentation and project descriptor to be consistent with the new groovy-core subdirectory. Also made a brief mention of groovy-eclipse on the website
17 lines of code changed in:
Moved the code into the groovy-core subdirectory to allow new modules to be added to the groovy CVS tree.
0 lines of code changed in:
Added a simple (and so far quite crap) groovy console in Swing
93 lines of code changed in:
Added target to help groovy-eclipse
62 lines of code changed in: