<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px">Change 20090303-dda-0 by <a href="mailto:dda@lester-2.local">dda@lester-2.local</a> on 2009-03-03 09:29:19 PST</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>in /Users/dda/laszlo/src/svn/openlaszlo/trunk-b</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>for <a href="http://svn.openlaszlo.org/openlaszlo/trunk">http://svn.openlaszlo.org/openlaszlo/trunk</a></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Summary: Capture filename information in parser errors (with addendum 1)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">New Features:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Bugs Fixed: LPP-7839: Compiler does not show file name containing the parsing error</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Technical Reviewer: ptw (pending)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">QA Reviewer: (pending)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Doc Reviewer: (pending)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Documentation:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Release Notes:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Details:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>Addendum 1 - changed NodeModel.java and CompilationError.java:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>the original changeset caused most errors to no longer show the line numbers.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>That was because a workaround the insert the line number was removed because it was no longer needed,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>at least for the original test case.<span class="Apple-converted-space"> </span>This addendum leaves the workaround removed, but file/line information</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>is now correctly copied from a ParseException to a CompilationError.<span class="Apple-converted-space"> </span>In NodeModel, we catch</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>compilation errors for dependencies so they can be displayed normally instead of receiving a stack trace.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/Token.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ParseException.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>This introduce of a better way to track filenames in the parser.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>Javacc does not have a direct way to track filename information for use in error messages, etc.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>Since it already keeps line/column information in tokens, it seems sensible to keep that information there, too.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>These changes overrides the standard Javacc Token.java with our own version that contains the filename,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>and a way to set it from the Parser.<span class="Apple-converted-space"> </span>It removes the knowledge of the current filename from the</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>TokenManager.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>A ParseException, which only has access to the token, not the tokenmanager, is now equipped to tag</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>an error message to include the file name.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/sc/CompilationError.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>When wrapping a ParseException in a CompilationError, correctly copy line number/file name from</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>one to another.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>When parsing a dependency expression, add the current filename location information.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>For compilation errors that happen during creation of dependencies, add the error to the environment,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>rather than let a stack trace appear.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>Added a 'dumpSourceInput' which is turned on when using -SS that dumps that exact input source</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>that the script compiler sees into <name>-src-<count>.txt</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Tests:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>Test case from JIRA now produces a message (not with a stack trace) that includes the filename, and</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>correct line and column numbers.<span class="Apple-converted-space"> </span>Works with lzc and in server.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span><canvas><span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span><class name="test" width="1 0"/><span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span></canvas><span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>LPP-7839.lzx:2:36: Syntax error: the token "0" was not expected at this position.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>Test case with a compilation error not in a dependency also (still) gives a correct error message.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>canvas><span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span><class name="test" width="1"/><span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span><script><span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>var z = 422 9;<span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span></script><span class="Apple-converted-space"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span></canvas></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>LPP-7839b.lzx:4:19: Syntax error: the token "9" was not expected at this position.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space"> </span>Usual regression tests: (smokecheck,weather,lzpix on all platforms).</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Files:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space"> </span>WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationError.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space"> </span>WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">A<span class="Apple-converted-space"> </span>WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/Token.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space"> </span>WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ParseException.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Changeset: <a href="http://svn.openlaszlo.org/openlaszlo/patches/20090303-dda-0.tar">http://svn.openlaszlo.org/openlaszlo/patches/20090303-dda-0.tar</a></p>
<br><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline">--</div><div><br>Don Anderson<br>Java/C/C++, Berkeley DB, systems consultant<br><br>voice: 617-306-2057<br>email: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br>www: <a href="http://www.ddanderson.com/">http://www.ddanderson.com</a><br></div></div></span></span><br class="Apple-interchange-newline"></div></span></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>