[as2api-dev] [CVS trunk] Fix an apparent out-by-one error in line number
reporting.
David Holroyd
dave at badgers-in-foil.co.uk
Sun, 17 Jul 2005 14:10:17 +0000
<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;}
#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 {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="4">Commit in <b><tt>trunk/as2api/parse</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">aslexer.rb</a></tt></td><td align="right" id="added">+6</td><td align="right" id="removed">-6</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/aslexer.rb?rev=203&content-type=text/vnd.viewcvs-markup">203</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/aslexer.rb.diff?r1=203&r2=204">-></a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/aslexer.rb?rev=204&content-type=text/vnd.viewcvs-markup">204</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">doccomment_lexer.rb</a></tt></td><td align="right" id="added">+3</td><td align="right" id="removed">-3</td><td nowrap="nowrap" align="center"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/doccomment_lexer.rb?rev=203&content-type=text/vnd.viewcvs-markup">203</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/doccomment_lexer.rb.diff?r1=203&r2=204">-></a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/doccomment_lexer.rb?rev=204&content-type=text/vnd.viewcvs-markup">204</a></td></tr>
<tr><td></td><td align="right" id="added">+9</td><td align="right" id="removed">-9</td><td></td></tr>
</table>
<small id="info">2 modified files</small><br />
<pre class="comment">
Fix an apparent out-by-one error in line number reporting.
We've already read the tokens from the line by the time we inspect io.lineno,
so it's actually reporting the line number for the line _after_ the token
object we're constructing.
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk">trunk</a>/<a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api">as2api</a>/<a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse">parse</a></span><br />
<div class="fileheader"><big><b>aslexer.rb</b></big> <small id="info"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/aslexer.rb?rev=203&content-type=text/vnd.viewcvs-markup">203</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/aslexer.rb.diff?r1=203&r2=204">-></a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/aslexer.rb?rev=204&content-type=text/vnd.viewcvs-markup">204</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/parse/aslexer.rb 2005-07-16 14:14:48 UTC (rev 203)
+++ trunk/as2api/parse/aslexer.rb 2005-07-17 14:10:14 UTC (rev 204)
@@ -221,19 +221,19 @@
</small></pre><pre class="diff" id="context">
def lex_simple_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- ActionScript::Parse.const_get(class_sym).new(io.lineno)
</pre><pre class="diff" id="added">+ ActionScript::Parse.const_get(class_sym).new(io.lineno<span id="addedchars">-1</span>)
</pre><pre class="diff" id="context"> end
def lex_simplebody_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- ActionScript::Parse.const_get(class_sym).new(match[0], io.lineno)
</pre><pre class="diff" id="added">+ ActionScript::Parse.const_get(class_sym).new(match[0], io.lineno<span id="addedchars">-1</span>)
</pre><pre class="diff" id="context"> end
def lex_singlelinecoomment_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- SingleLineCommentToken.new(match[1], io.lineno)
</pre><pre class="diff" id="added">+ SingleLineCommentToken.new(match[1], io.lineno<span id="addedchars">-1</span>)
</pre><pre class="diff" id="context"> end
def lex_multilinecomment_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- lineno = io.lineno
</pre><pre class="diff" id="added">+ lineno = io.lineno<span id="addedchars">-1</span>
</pre><pre class="diff" id="context"> line = match.post_match
comment = ''
until line =~ /\*\//o
</pre><pre class="diff"><small id="info">@@ -246,7 +246,7 @@
</small></pre><pre class="diff" id="context"> end
def lex_string1_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- lineno = io.lineno
</pre><pre class="diff" id="added">+ lineno = io.lineno<span id="addedchars">-1</span>
</pre><pre class="diff" id="context"> line = match.post_match
str = ''
until line =~ /#{STRING_END1}/o
</pre><pre class="diff"><small id="info">@@ -260,7 +260,7 @@
</small></pre><pre class="diff" id="context"> end
def lex_string2_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- lineno = io.lineno
</pre><pre class="diff" id="added">+ lineno = io.lineno<span id="addedchars">-1</span>
</pre><pre class="diff" id="context"> line = match.post_match
str = ''
until line =~ /#{STRING_END2}/o
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname"><a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk">trunk</a>/<a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api">as2api</a>/<a
href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse">parse</a></span><br />
<div class="fileheader"><big><b>doccomment_lexer.rb</b></big> <small id="info"><a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/doccomment_lexer.rb?rev=203&content-type=text/vnd.viewcvs-markup">203</a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/doccomment_lexer.rb.diff?r1=203&r2=204">-></a> <a href="http://svn.badgers-in-foil.co.uk/viewcvs.cgi/as2api/trunk/as2api/parse/doccomment_lexer.rb?rev=204&content-type=text/vnd.viewcvs-markup">204</a></small></div>
<pre class="diff"><small id="info">--- trunk/as2api/parse/doccomment_lexer.rb 2005-07-16 14:14:48 UTC (rev 203)
+++ trunk/as2api/parse/doccomment_lexer.rb 2005-07-17 14:10:14 UTC (rev 204)
@@ -30,15 +30,15 @@
</small></pre><pre class="diff" id="context">
class DocCommentLexer < AbstractLexer
def lex_simple_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- ActionScript::Parse.const_get(class_sym).new(io.lineno)
</pre><pre class="diff" id="added">+ ActionScript::Parse.const_get(class_sym).new(io.lineno<span id="addedchars">-1</span>)
</pre><pre class="diff" id="context"> end
def lex_simplebody_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- ActionScript::Parse.const_get(class_sym).new(match[0], io.lineno)
</pre><pre class="diff" id="added">+ ActionScript::Parse.const_get(class_sym).new(match[0], io.lineno<span id="addedchars">-1</span>)
</pre><pre class="diff" id="context"> end
def lex_simplecapture_token(class_sym, match, io)
</pre><pre class="diff" id="removed">- ActionScript::Parse.const_get(class_sym).new(match[1], io.lineno)
</pre><pre class="diff" id="added">+ ActionScript::Parse.const_get(class_sym).new(match[1], io.lineno<span id="addedchars">-1</span>)
</pre><pre class="diff" id="context"> end
end
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.11</small></center>
</body></html>