private void readUTF8EscapeIntoBuffer(int codepoint, ByteList buffer, boolean stringLiteral) { if (codepoint >= 0x80) { buffer.setEncoding(UTF8_ENCODING); if (stringLiteral) tokenAddMBC(codepoint, buffer); } else if (stringLiteral) { buffer.append((char) codepoint); } }
private void readUTF8EscapeIntoBuffer(int codepoint, ByteList buffer, boolean stringLiteral) { if (codepoint >= 0x80) { buffer.setEncoding(UTF8_ENCODING); if (stringLiteral) tokenAddMBC(codepoint, buffer); } else if (stringLiteral) { buffer.append((char) codepoint); } }
private int addNonAsciiToBuffer(int c, LexerSource src, Encoding encoding, RubyYaccLexer lexer, ByteList buffer) throws SyntaxException, IOException { c = src.readCodepoint(c, encoding); if (c == -2) { // FIXME: Hack throw new SyntaxException(PID.INVALID_MULTIBYTE_CHAR, lexer.getPosition(), null, "invalid multibyte char (" + encoding + ")"); } // FIXME: We basically go from bytes to codepoint back to bytes to append them...fix this return lexer.tokenAddMBC(c, buffer); } }
private int addNonAsciiToBuffer(int c, LexerSource src, Encoding encoding, RubyYaccLexer lexer, ByteList buffer) throws SyntaxException, IOException { c = src.readCodepoint(c, encoding); if (c == -2) { // FIXME: Hack throw new SyntaxException(PID.INVALID_MULTIBYTE_CHAR, lexer.getPosition(), null, "invalid multibyte char (" + encoding + ")"); } // FIXME: We basically go from bytes to codepoint back to bytes to append them...fix this return lexer.tokenAddMBC(c, buffer); } }
tokenAddMBC(c, oneCharBL); } else { oneCharBL.append(c);
tokenAddMBC(c, oneCharBL); } else { oneCharBL.append(c);