You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by je...@apache.org on 2002/07/25 12:25:20 UTC
cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd Client.g
jericho 2002/07/25 03:25:20
Modified: src/webdav/client/src/org/apache/webdav/cmd Client.g
Log:
- Support to parse the special character like '-'....
Patched by Tim Anderson(mailto:tima@intalio.com) request by Michael Smith.
Thanks to Tim Anderson ;)
Revision Changes Path
1.6 +9 -18 jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Client.g
Index: Client.g
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Client.g,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Client.g 17 Jul 2002 21:02:52 -0000 1.5
+++ Client.g 25 Jul 2002 10:25:20 -0000 1.6
@@ -76,7 +76,7 @@
class ClientParser extends Parser;
options {
buildAST = false; // uses CommonAST by default
- k=20;
+ k=2;
}
///////////////////////////////////////////////////////////////////////
@@ -92,17 +92,7 @@
private String text(Token token)
{
- if (token==null)
- return null;
-
- String tmp=token.getText();
-
- // strip " from strings like "a b"
- if (tmp.startsWith("\"") && tmp.endsWith("\"")) {
- return tmp.substring(1,tmp.length()-1);
- }
-
- return tmp;
+ return (token != null) ? token.getText() : null;
}
private QName qname(Token token)
@@ -433,7 +423,7 @@
class ClientLexer extends Lexer;
options {
- k=20;
+ k=1;
caseSensitiveLiterals = false;
charVocabulary='\u0000'..'\uFFFE';
}
@@ -515,9 +505,9 @@
NL : '\n';
-OPTIONSTRING: '-' STRING;
+OPTIONSTRING: '-' (CHARS)+;
-STRING: (CHARS)+ | '"' (CHARS| ' ')+ '"';
+STRING: CHARS (CHARS | '-')+ | '"'! (CHARS | ' ' | '-')+ '"'!;
protected
CHARS: 'a'..'z' | 'A'..'Z' | '0'..'9' | '.' | ':' | '/';
@@ -530,3 +520,4 @@
//
//
//INT : (DIGIT)+ ;
+
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>