Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.8.3, 1.9-beta-4
-
Component/s: None
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
Line number reported from scripts compiled by SimpleTemplateEngine is off by one because it generates an extra new line that's not found in the original source file. Patch attached.
Activity
Roshan Dawrani
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Roshan Dawrani [ roshandawrani ] |
Roshan Dawrani
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 1.8.3 [ 17657 ] | |
| Fix Version/s | 1.9-beta-4 [ 17656 ] | |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Thanks for the patch. A slight improvement suggested below.
If we currently have script generated as a), with the patch it looks like b)
a)
-- script source -- /* Generated by SimpleTemplateEngine */ out.print("""Hello \"$firstname\", Nice to meet you in """); print city ; out.print(""""""); -- script end --b)
-- script source -- /* Generated by SimpleTemplateEngine */out.print("""Hello \"$firstname\", Nice to meet you in """); print city ; out.print(""""""); -- script end --With slightld modified patch, it looks like c)
private void startScript(StringWriter sw) { - sw.write("/* Generated by SimpleTemplateEngine */\n"); sw.write("out.print(\"\"\""); } private void endScript(StringWriter sw) { - sw.write("\"\"\");\n"); + sw.write("\"\"\");\n\n/* Generated by SimpleTemplateEngine */"); }Suggested new output that preserves the line numbers of the original script, but reads slightly better
-- script source -- out.print("""Hello \"$firstname\", Nice to meet you in """); print city ; out.print(""""""); /* Generated by SimpleTemplateEngine */ -- script end --