incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r830354 - /incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
Date Tue, 27 Oct 2009 21:53:17 GMT
Author: vdichev
Date: Tue Oct 27 21:53:17 2009
New Revision: 830354

URL: http://svn.apache.org/viewvc?rev=830354&view=rev
Log:
ESME-26 Add anchors in accordance with RFC 1630

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala?rev=830354&r1=830353&r2=830354&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala Tue Oct
27 21:53:17 2009
@@ -46,7 +46,7 @@
 
   lazy val startSpace = rep(' ')
 
-  lazy val url: Parser[URL] = httpUrl ^^ {url => URL(UrlStore.make(url))}
+  lazy val url: Parser[URL] = fragmentAddress ^^ {url => URL(UrlStore.make(url))}
 
   lazy val userNameStr: Parser[String] = alpha ~ rep(alpha | digit | '_') ^^ {
     case first ~ more => first + more.mkString
@@ -134,6 +134,13 @@
 
   lazy val scheme: Parser[String] = (accept("http://") | accept("https://")) ^^ {_ mkString}
 
+  lazy val fragmentAddress: Parser[String] = httpUrl ~ opt( '#' ~> fragmentid ) ^^ {
+    case uri ~ None => uri
+    case uri ~ Some(fragmentid) => uri + "#" + fragmentid
+  }
+  
+  lazy val fragmentid: Parser[String] = rep( uchar ) ^^ {_ mkString}
+  
   lazy val httpUrl: Parser[String] = scheme ~ login ~ urlpart ^^ {
     case front ~ login ~ urlpart => front + login + urlpart
   }



Mime
View raw message