private TokenType lexUtf8Char ( Bytes jsonText , int curChar ) { if ( curChar <= 0x7f ) { /* single byte */ return STRING ; } else if ( ( curChar >> 5 ) == 0x6 ) { /* two byte */ if ( jsonText . readRemaining ( ) == 0 ) return EOF ; curChar = readChar ( jsonText ) ; if ( ( curChar >> 6 ) == 0x2 ) return STRING ; } else if ( ( curChar >> 4 ) == 0x0e ) { /* three byte */ if ( jsonText . readRemaining ( ) == 0 ) return EOF ; curChar = readChar ( jsonText ) ; if ( ( curChar >> 6 ) == 0x2 ) { if ( jsonText . readRemaining ( ) == 0 ) return EOF ; curChar = readChar ( jsonText ) ; if ( ( curChar >> 6 ) == 0x2 ) return STRING ; } } else if ( ( curChar >> 3 ) == 0x1e ) { /* four byte */ if ( jsonText . readRemaining ( ) == 0 ) return EOF ; curChar = readChar ( jsonText ) ; if ( ( curChar >> 6 ) == 0x2 ) { if ( jsonText . readRemaining ( ) == 0 ) return EOF ; curChar = readChar ( jsonText ) ; if ( ( curChar >> 6 ) == 0x2 ) { if ( jsonText . readRemaining ( ) == 0 ) return EOF ; curChar = readChar ( jsonText ) ; if ( ( curChar >> 6 ) == 0x2 ) return STRING ; } } } return ERROR ; }
process a variable length utf8 encoded codepoint .