@Test public void scss_role() { List<CssToken> tokenList = tokenizer.tokenize("article[role=\"main\"] { width: 1px; }"); assertThat(tokenList.size()).isEqualTo(12); assertToken(tokenList, 0, "article", CssTokenType.IDENTIFIER); assertToken(tokenList, 1, "[", CssTokenType.PUNCTUATOR); assertToken(tokenList, 2, "role", CssTokenType.IDENTIFIER); assertToken(tokenList, 3, "=", CssTokenType.PUNCTUATOR); assertToken(tokenList, 4, "\"main\"", CssTokenType.STRING); assertToken(tokenList, 5, "]", CssTokenType.PUNCTUATOR); }
public List<CssToken> tokenize(String css) { List<Token> tokenList = CssLexer.create().lex(css); List<Token> cloneTokenList = new ArrayList<>(tokenList); cloneTokenList.remove(cloneTokenList.size() - 1); return cloneTokenList.stream().map(CssToken::new).collect(Collectors.toList()); }
Tokenizer { public List<CssToken> tokenize(String css) { List<Token> tokenList = CssLexer.create().lex(css); List<Token> cloneTokenList = new ArrayList<>(tokenList); cloneTokenList.remove(cloneTokenList.size() - 1); return cloneTokenList.stream().map(CssToken::new).collect(Collectors.toList()); } }
Tokenizer { public List<CssToken> tokenize(String css) { List<Token> tokenList = CssLexer.create().lex(css); List<Token> cloneTokenList = new ArrayList<>(tokenList); cloneTokenList.remove(cloneTokenList.size() - 1); return cloneTokenList.stream().map(CssToken::new).collect(Collectors.toList()); }  }
Tokenizer { public List<CssToken> tokenize(String css) { List<Token> tokenList = CssLexer.create().lex(css); List<Token> cloneTokenList = new ArrayList<>(tokenList); cloneTokenList.remove(cloneTokenList.size() - 1); return cloneTokenList.stream().map(CssToken::new).collect(Collectors.toList()); }  List<CssToken> tokenize(String css); }
Tokenizer { public List<CssToken> tokenize(String css) { List<Token> tokenList = CssLexer.create().lex(css); List<Token> cloneTokenList = new ArrayList<>(tokenList); cloneTokenList.remove(cloneTokenList.size() - 1); return cloneTokenList.stream().map(CssToken::new).collect(Collectors.toList()); }  List<CssToken> tokenize(String css);  }