@Test public void scss_variable() { assertToken("$font-stack: Helvetica;", 0, "$font-stack", CssTokenType.DOLLAR_IDENTIFIER); assertToken("$message-color: blue !default;", 4, "default", CssTokenType.IDENTIFIER); List<CssToken> tokenList = tokenizer.tokenize("p.message-#{$alertClass} { color: red; }"); assertThat(tokenList.size()).isEqualTo(13); assertToken(tokenList, 0, "p", CssTokenType.IDENTIFIER); assertToken(tokenList, 1, ".", CssTokenType.PUNCTUATOR); assertToken(tokenList, 2, "message-", CssTokenType.IDENTIFIER); assertToken(tokenList, 3, "#", CssTokenType.PUNCTUATOR); assertToken(tokenList, 4, "{", CssTokenType.PUNCTUATOR); assertToken(tokenList, 5, "$alertClass", CssTokenType.DOLLAR_IDENTIFIER); assertToken(tokenList, 6, "}", CssTokenType.PUNCTUATOR); assertToken(tokenList, 7, "{", CssTokenType.PUNCTUATOR); assertToken(tokenList, 8, "color", CssTokenType.IDENTIFIER); assertToken(tokenList, 9, ":", CssTokenType.PUNCTUATOR); assertToken(tokenList, 10, "red", CssTokenType.IDENTIFIER); assertToken(tokenList, 11, ";", CssTokenType.PUNCTUATOR); assertToken(tokenList, 12, "}", 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);  }