lexer.yaccValue = new Token(marker, lexer.getPosition());
return Tokens.tSTRING_END;
}
ByteList str = new ByteList();
ISourcePosition position;
if ((flags & RubyYaccLexer.STR_FUNC_EXPAND) == 0) {
do {
str.append(src.readLineBytes());
str.append('\n');
if (src.peek(RubyYaccLexer.EOF)) syntaxError(src);
position = lexer.getPosition();
} while (!src.matchMarker(marker, indent, true));
} else {
int c = src.read();
if (c == '#') {
switch (c = src.read()) {
case '$':
case '@':
src.unread(c);
lexer.setValue(new Token("#" + c, lexer.getPosition()));
return Tokens.tSTRING_DVAR;
case '{':
lexer.setValue(new Token("#" + c, lexer.getPosition()));
return Tokens.tSTRING_DBEG;
}
str.append('#');
}
src.unread(c);
// MRI has extra pointer which makes our code look a little bit
// more strange in
// comparison
do {
if ((c = new StringTerm(flags, '\0', '\n').parseStringIntoBuffer(lexer, src, str)) == RubyYaccLexer.EOF) {
syntaxError(src);
}
if (c != '\n') {
lexer.yaccValue = new StrNode(lexer.getPosition(), str);
return Tokens.tSTRING_CONTENT;
}
str.append(src.read());
if (src.peek(RubyYaccLexer.EOF)) syntaxError(src);
position = lexer.getPosition();
} while (!src.matchMarker(marker, indent, true));
}