Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(15)

Issue 8713: Rewrite pretty printing to avoid long lines & horrible indentation. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
18 years ago by MikeSamuel
Modified:
17 years, 4 months ago
Reviewers:
ihab.awad
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Split out the bits of JavaScript rendering code relating to deciding whether spaces or newlines are required/allowed between tokens. Ihab pointed out that the side-by-side renderer is splitting lines in ways that allow for semicolons to be inserted after return and throw. This consolidates the code related to that. In another CL I will rewrite existing renderers to use this consistently, and in a third, I will rewrite JsPrettyPrinter to do better formatting. This CL is simple and semantics preserving. The second will be a more substantial change but semantics preserving. The third will not be semantics preserving.

Patch Set 1 #

Patch Set 2 : Rewrite pretty printing to avoid long lines & horrible indentation. #

Total comments: 6

Patch Set 3 : Rewrite pretty printing to avoid long lines & horrible indentation. #

Patch Set 4 : Rewrite pretty printing to avoid long lines & horrible indentation. #

Patch Set 5 : Rewrite pretty printing to avoid long lines & horrible indentation. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+677 lines, -434 lines) Patch
M src/com/google/caja/parser/js/Minify.java View 1 chunk +0 lines, -1 line 0 comments Download
M src/com/google/caja/parser/js/Parser.java View 1 chunk +0 lines, -1 line 0 comments Download
A src/com/google/caja/render/Indent.java View 1 chunk +64 lines, -0 lines 0 comments Download
A src/com/google/caja/render/Indenter.java View 1 chunk +291 lines, -0 lines 0 comments Download
M src/com/google/caja/render/JsPrettyPrinter.java View 1 2 3 4 chunks +13 lines, -368 lines 0 comments Download
A src/com/google/caja/render/Spacer.java View 1 chunk +230 lines, -0 lines 0 comments Download
M tests/com/google/caja/opensocial/DefaultGadgetRewriterTest.java View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/opensocial/example-rewritten.xml View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M tests/com/google/caja/opensocial/service/CajolingServiceTest.java View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/parser/js/ParserTest.java View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M tests/com/google/caja/parser/js/rendergolden1.txt View 1 2 4 chunks +4 lines, -12 lines 0 comments Download
M tests/com/google/caja/parser/js/rendergolden2.txt View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M tests/com/google/caja/parser/js/rendergolden4.txt View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M tests/com/google/caja/parser/js/rendergolden5.txt View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M tests/com/google/caja/parser/js/rendergolden9.txt View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M tests/com/google/caja/plugin/CssCompilerTest.java View 1 2 3 chunks +12 lines, -1 line 0 comments Download
M tests/com/google/caja/plugin/DomProcessingEventsTest.java View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/HtmlSanitizerTest.java View 1 chunk +0 lines, -5 lines 0 comments Download
M tests/com/google/caja/plugin/stages/OpenTemplateStageTest.java View 1 2 1 chunk +2 lines, -4 lines 0 comments Download
M tests/com/google/caja/plugin/stages/RewriteHtmlStageTest.java View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M tests/com/google/caja/render/JsPrettyPrinterTest.java View 1 2 6 chunks +25 lines, -13 lines 0 comments Download
M tests/com/google/caja/render/sbs-golden.js View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/util/CajaTestCase.java View 1 2 2 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 7
MikeSamuel
18 years ago (2008-12-04 04:19:57 UTC) #1
MikeSamuel
ping
17 years, 11 months ago (2008-12-16 20:06:55 UTC) #2
MikeSamuel
On 2008/12/16 20:06:55, mikesamuel wrote: > ping ping
17 years, 11 months ago (2009-01-09 19:49:45 UTC) #3
MikeSamuel
over the shoulder review http://codereview.appspot.com/8713/diff/201/417 File src/com/google/caja/render/JsPrettyPrinter.java (right): http://codereview.appspot.com/8713/diff/201/417#newcode320 Line 320: } Ihab wants to ...
17 years, 10 months ago (2009-01-16 21:21:41 UTC) #4
ihab.awad
Just publishing some draft comments. Mike, per our discussion, CL is LGTM given whatever changes ...
17 years, 10 months ago (2009-01-16 21:30:39 UTC) #5
MikeSamuel
Commented all those ancillary classes and moved them into their own files.
17 years, 10 months ago (2009-01-26 22:19:48 UTC) #6
MikeSamuel
17 years, 10 months ago (2009-01-26 22:40:05 UTC) #7
@3205
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b