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

13
LINES

< > BotCompany Repo | #1032803 // test_tok_leftScanType

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

Libraryless. Click here for Pure Java version (4119L/24K).

svoid test_tok_leftScanType() {
  LS tok = javaTok("a.b.c d");
  assertEqualsVerbose("a", get(tok, tok_leftScanType(tok, indexOf(tok, "d"))));
  
  tok = javaTok("= a c");
  assertEqualsVerbose("a", get(tok, tok_leftScanType(tok, indexOf(tok, "c"))));
  
  tok = javaTok("b[] c");
  assertEqualsVerbose("b", get(tok, tok_leftScanType(tok, indexOf(tok, "c"))));
  
  tok = javaTok("a<b, c>.d e");
  assertEqualsVerbose("a", get(tok, tok_leftScanType(tok, indexOf(tok, "e"))));
}

Author comment

Began life as a copy of #1027998

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1032803
Snippet name: test_tok_leftScanType
Eternal ID of this version: #1032803/5
Text MD5: 8aa094edfb4d2b4512662e3a2648e083
Transpilation MD5: b0b4cb3d3d3d11f6bba719977e88661d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-15 22:05:51
Source code size: 489 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 142 / 211
Version history: 4 change(s)
Referenced in: [show references]