Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1025814 // javaParser_reparse_keepComments [new JavaParser]

JavaX fragment (include) [tags: use-pretranspiled]

Uses 1176K of libraries. Click here for Pure Java version (2941L/17K).

!include once #1025812 // javaParseCompilationUnit
!include once #1025811 // javaParser_makeAllPublic

static S javaParser_reparse_keepComments(S src) {
  CompilationUnit cu = javaParseCompilationUnit(src, true);
  new PrettyPrinterConfiguration ppconf;
  ppconf.setPrintComments(true);
  ppconf.setIndentSize(2);
  ppconf.setIndentType(PrettyPrinterConfiguration.IndentType.SPACES);
  ret cu.toString(ppconf);
}

Author comment

Began life as a copy of #1014458

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025814
Snippet name: javaParser_reparse_keepComments [new JavaParser]
Eternal ID of this version: #1025814/4
Text MD5: b02ffe889ab1ecd562839c734b25bd8e
Transpilation MD5: 07d2043a6f5e8dc31fa34ee10401090e
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-12 18:54:01
Source code size: 422 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 191 / 2446
Version history: 3 change(s)
Referenced in: [show references]