public abstract int match(String s, int start, Hash v, JSScope scope) throws JSExn;
public int matchAndWrite(final String s, final int start, Hash v, JSScope scope, String key) throws JSExn {
final Hash v2 = new Hash();
final int ret = match(s, start, v2, scope);
public abstract int match(String s, int start, Hash v, JSScope scope) throws JSExn;
public int matchAndWrite(final String s, final int start, Hash v, JSScope scope, String key) throws JSExn {
final Hash v2 = new Hash();
final int ret = match(s, start, v2, scope);
s.substring(start, ret) :
action.cloneWithNewParentScope(new JSScope(scope) {
public Object get(Object key) throws JSExn {
s.substring(start, ret) :
action.cloneWithNewParentScope(new JSScope(scope) {
public Object get(Object key) throws JSExn {
if (key.equals("whole")) return s.substring(start, ret);
return super.get(key);
}
}).call(null, null, null, null, 0);
if (key != null) {
Object old = v.get(key);
if (key.equals("whole")) return s.substring(start, ret);
return super.get(key);
}
}).call(null, null, null, null, 0);
if (key != null) {
Object old = v.get(key);
- if (old == null) { }
- else if (old instanceof JSArray) { ((JSArray)old).addElement(result); result = old; }
- else { JSArray j = new JSArray(); j.addElement(old); j.addElement(result); result = j; }
+ if (old == null || old == NULL) { }
+ else if (old instanceof JSArray) { if (result != NULL) { ((JSArray)old).addElement(result); result = old; } }
+ else if (result != NULL) { JSArray j = new JSArray(); j.addElement(old); j.addElement(result); result = j; }