<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #copied {background-color:#ccccff;}
  tr.alt #copied {background-color:#bbbbf7;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="5">Commit in <b><tt>metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/parser</tt></b></td></tr>
<tr><td><tt><a href="#file1">RegexSimpleHelper.java</a></tt> </td><td></td><td align="right" id="added">+15</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center">627 -&gt; 628</td></tr>
</table>
<pre class="comment">
add bugfix in regexp processing already put in place for e4x processing
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/parser</span><br />
<div class="fileheader"><big><b>RegexSimpleHelper.java</b></big> <small id="info">627 -&gt; 628</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/parser/RegexSimpleHelper.java        2008-01-22 21:38:25 UTC (rev 627)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/parser/RegexSimpleHelper.java        2008-01-25 00:45:13 UTC (rev 628)
@@ -40,8 +40,7 @@
</small></pre><pre class="diff" id="context">         }
 
         public static LinkedListTree parseRegexpLiteral(LinkedListToken startMarker, AS3Lexer lexer, CharStream cs, LinkedListTokenStream stream) throws RecognitionException {
</pre><pre class="diff" id="removed">-                String tail = startMarker.getText()  // the '/'
-                            + cs.substring(cs.index(), cs.size()-1);  // the rest
</pre><pre class="diff" id="added">+                String tail = cs.substring(cs.index(), cs.size()-1);
</pre><pre class="diff" id="context">                 int initialTailLength = tail.length();
                 RegexSimpleParser parser;
                 try {
</pre><pre class="diff"><small id="info">@@ -53,7 +52,7 @@
</small></pre><pre class="diff" id="context">                 LinkedListTree ast = AS3FragmentParser.tree(parser.regexpLiteral());
                 tail = parser.getInputTail();
                 // skip over the regexp in the original, underlying CharStream
</pre><pre class="diff" id="removed">-                cs.seek(cs.index() + (initialTailLength - tail.length())<span id="removedchars">&nbsp;-&nbsp;1</span>);
</pre><pre class="diff" id="added">+                cs.seek(cs.index() + (initialTailLength - tail.length()));
</pre><pre class="diff" id="context">                 LinkedListTokenSource source = (LinkedListTokenSource)stream.getTokenSource();
                 stream.setTokenSource(source);  // cause any remembered RegexpSimple state to be dropped
                 stream.scrub(1); // erase the subsequent token that the RegexpSimple parser got from this stream
</pre><pre class="diff"><small id="info">@@ -65,8 +64,20 @@
</small></pre><pre class="diff" id="context">                 ANTLRReaderStream cs = new ANTLRReaderStream(in);
                 RegexSimpleLexer lexer = new RegexSimpleLexer(cs);
                 LinkedListTokenSource source = (LinkedListTokenSource)stream.getTokenSource();
</pre><pre class="diff" id="removed">-                stream.scrub(1); // erase the '&lt;' and subsequent token that the AS3 parser got from this stream
</pre><pre class="diff" id="context">                 source.setDelegate(lexer);
</pre><pre class="diff" id="added">+
+                // The AS3 grammar will see the initial '/' as an DIV (divide)
+                // token, and lookahead in the AS3Parser will have already
+                // grabbed references to that token in order to make it the
+                // startToken for various AST subtrees, so we can't just delete
+                // it.  We therefore find the DIC token and change its type to
+                // match the regexp vocabulary, and then rewind the token stream
+                // so that this will be the first token that the
+                // SinpleRegexpParser will see.
+                LinkedListToken startMarker = (LinkedListToken)stream.LT(-1);
+                startMarker.setType(RegexSimpleParser.REGEXP_DELIMITER);
+                stream.seek(stream.index()-1);
+
</pre><pre class="diff" id="context">                 RegexSimpleParser parser = new RegexSimpleParser(stream);
                 parser.setTreeAdaptor(new LinkedListTreeAdaptor());
                 parser.setInput(lexer, cs);
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; email">CVSspam</a> 0.2.12</small></center>
</body></html>