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

11
LINES

< > BotCompany Repo | #1034733 // getJavaLineCommentsWithoutNestedBlocks

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

Libraryless. Click here for Pure Java version (5362L/30K).

1  
static LS getJavaLineCommentsWithoutNestedBlocks(LS tok) {
2  
  int curlyLevel = 0;
3  
  new LS comments;
4  
  for i over tok: {
5  
    if (curlyLevel == 0 && even(i))
6  
      addAll(comments, getJavaLineComments(tok.get(i));
7  
    else
8  
      curlyLevel += curlyLevel(tok.get(i));
9  
  }
10  
  ret comments;
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034733
Snippet name: getJavaLineCommentsWithoutNestedBlocks
Eternal ID of this version: #1034733/2
Text MD5: ab798191c9df4d8de5681438c81823af
Transpilation MD5: 94cfb1b7710b0aefe8d0de4acd44ea00
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-07 22:00:50
Source code size: 296 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 72 / 116
Version history: 1 change(s)
Referenced in: [show references]