private void extractCoffeeScriptFromHTML(Snapshot snapshot, TokenSequence<? extends HTMLTokenId> ts, List<Embedding> embeddings) {
boolean inCoffeeScript = false;
ts.moveStart();
while (ts.moveNext()) {
Token<? extends HTMLTokenId> htmlToken = ts.token();
HTMLTokenId htmlId = htmlToken.id();
if (htmlId == HTMLTokenId.TAG_OPEN) {
String text = htmlToken.text().toString();
if ("script".equals(text)) {
TokenSequence<? extends HTMLTokenId> ets = ts.subSequence(ts.offset());
ets.moveStart();
boolean foundSrc = false;
boolean foundType = false;
String type = null;
String src = null;
while (ets.moveNext()) {
Token<? extends HTMLTokenId> t = ets.token();
HTMLTokenId id = t.id();
if (id == HTMLTokenId.TAG_CLOSE_SYMBOL) {
break;
} else if (foundSrc || foundType) {
if (id == HTMLTokenId.ARGUMENT) {
break;