Lines Matching full:position
197 StringRef::iterator Position= Range.begin(); in decodeUTF8() local
201 if (Position < End && (*Position & 0x80) == 0) { in decodeUTF8()
202 return std::make_pair(*Position, 1); in decodeUTF8()
206 if (Position + 1 < End && ((*Position & 0xE0) == 0xC0) && in decodeUTF8()
207 ((*(Position + 1) & 0xC0) == 0x80)) { in decodeUTF8()
208 uint32_t codepoint = ((*Position & 0x1F) << 6) | in decodeUTF8()
209 (*(Position + 1) & 0x3F); in decodeUTF8()
215 if (Position + 2 < End && ((*Position & 0xF0) == 0xE0) && in decodeUTF8()
216 ((*(Position + 1) & 0xC0) == 0x80) && in decodeUTF8()
217 ((*(Position + 2) & 0xC0) == 0x80)) { in decodeUTF8()
218 uint32_t codepoint = ((*Position & 0x0F) << 12) | in decodeUTF8()
219 ((*(Position + 1) & 0x3F) << 6) | in decodeUTF8()
220 (*(Position + 2) & 0x3F); in decodeUTF8()
229 if (Position + 3 < End && ((*Position & 0xF8) == 0xF0) && in decodeUTF8()
230 ((*(Position + 1) & 0xC0) == 0x80) && in decodeUTF8()
231 ((*(Position + 2) & 0xC0) == 0x80) && in decodeUTF8()
232 ((*(Position + 3) & 0xC0) == 0x80)) { in decodeUTF8()
233 uint32_t codepoint = ((*Position & 0x07) << 18) | in decodeUTF8()
234 ((*(Position + 1) & 0x3F) << 12) | in decodeUTF8()
235 ((*(Position + 2) & 0x3F) << 6) | in decodeUTF8()
236 (*(Position + 3) & 0x3F); in decodeUTF8()
266 void setError(const Twine &Message, StringRef::iterator Position) { in setError() argument
267 if (Position >= End) in setError()
268 Position = End - 1; in setError()
277 printError(SMLoc::getFromPointer(Position), SourceMgr::DK_Error, Message); in setError()
294 /// at \a Position.
296 /// If the UTF-8 code units starting at Position do not form a well-formed
299 UTF8Decoded decodeUTF8(StringRef::iterator Position) { in decodeUTF8() argument
300 return ::decodeUTF8(StringRef(Position, End - Position)); in decodeUTF8()
323 /// Skip a single nb-char[27] starting at Position.
328 /// @returns The code unit after the nb-char, or Position if it's not an
330 StringRef::iterator skip_nb_char(StringRef::iterator Position);
332 /// Skip a single b-break[28] starting at Position.
336 /// @returns The code unit after the b-break, or Position if it's not a
338 StringRef::iterator skip_b_break(StringRef::iterator Position);
340 /// Skip a single s-space[31] starting at Position.
344 /// @returns The code unit after the s-space, or Position if it's not a
346 StringRef::iterator skip_s_space(StringRef::iterator Position);
348 /// Skip a single s-white[33] starting at Position.
352 /// @returns The code unit after the s-white, or Position if it's not a
354 StringRef::iterator skip_s_white(StringRef::iterator Position);
356 /// Skip a single ns-char[34] starting at Position.
360 /// @returns The code unit after the ns-char, or Position if it's not a
362 StringRef::iterator skip_ns_char(StringRef::iterator Position);
372 , StringRef::iterator Position);
393 bool isBlankOrBreak(StringRef::iterator Position);
397 bool isPlainSafeNonBlank(StringRef::iterator Position);
402 /// Consume a single b-break[28] if it's present at the current position.
404 /// Return false if the code unit at the current position isn't a line break.
432 /// position of the scanner.
528 /// The current position of the scanner.
927 StringRef::iterator Scanner::skip_nb_char(StringRef::iterator Position) { in skip_nb_char() argument
928 if (Position == End) in skip_nb_char()
929 return Position; in skip_nb_char()
931 if ( *Position == 0x09 in skip_nb_char()
932 || (*Position >= 0x20 && *Position <= 0x7E)) in skip_nb_char()
933 return Position + 1; in skip_nb_char()
936 if (uint8_t(*Position) & 0x80) { in skip_nb_char()
937 UTF8Decoded u8d = decodeUTF8(Position); in skip_nb_char()
947 return Position + u8d.second; in skip_nb_char()
949 return Position; in skip_nb_char()
952 StringRef::iterator Scanner::skip_b_break(StringRef::iterator Position) { in skip_b_break() argument
953 if (Position == End) in skip_b_break()
954 return Position; in skip_b_break()
955 if (*Position == 0x0D) { in skip_b_break()
956 if (Position + 1 != End && *(Position + 1) == 0x0A) in skip_b_break()
957 return Position + 2; in skip_b_break()
958 return Position + 1; in skip_b_break()
961 if (*Position == 0x0A) in skip_b_break()
962 return Position + 1; in skip_b_break()
963 return Position; in skip_b_break()
966 StringRef::iterator Scanner::skip_s_space(StringRef::iterator Position) { in skip_s_space() argument
967 if (Position == End) in skip_s_space()
968 return Position; in skip_s_space()
969 if (*Position == ' ') in skip_s_space()
970 return Position + 1; in skip_s_space()
971 return Position; in skip_s_space()
974 StringRef::iterator Scanner::skip_s_white(StringRef::iterator Position) { in skip_s_white() argument
975 if (Position == End) in skip_s_white()
976 return Position; in skip_s_white()
977 if (*Position == ' ' || *Position == '\t') in skip_s_white()
978 return Position + 1; in skip_s_white()
979 return Position; in skip_s_white()
982 StringRef::iterator Scanner::skip_ns_char(StringRef::iterator Position) { in skip_ns_char() argument
983 if (Position == End) in skip_ns_char()
984 return Position; in skip_ns_char()
985 if (*Position == ' ' || *Position == '\t') in skip_ns_char()
986 return Position; in skip_ns_char()
987 return skip_nb_char(Position); in skip_ns_char()
991 , StringRef::iterator Position) { in skip_while() argument
993 StringRef::iterator i = (this->*Func)(Position); in skip_while()
994 if (i == Position) in skip_while()
996 Position = i; in skip_while()
998 return Position; in skip_while()
1054 bool Scanner::isBlankOrBreak(StringRef::iterator Position) { in isBlankOrBreak() argument
1055 if (Position == End) in isBlankOrBreak()
1057 return *Position == ' ' || *Position == '\t' || *Position == '\r' || in isBlankOrBreak()
1058 *Position == '\n'; in isBlankOrBreak()
1061 bool Scanner::isPlainSafeNonBlank(StringRef::iterator Position) { in isPlainSafeNonBlank() argument
1062 if (Position == End || isBlankOrBreak(Position)) in isPlainSafeNonBlank()
1065 StringRef(Position, 1).find_first_of(",[]{}") != StringRef::npos) in isPlainSafeNonBlank()
1071 for (const auto *Position = Line.begin(); Position != Line.end(); ++Position) in isLineEmpty() local
1072 if (!isBlankOrBreak(Position)) in isLineEmpty()
1382 wasEscaped(StringRef::iterator First, StringRef::iterator Position);
1384 // Returns whether a character at 'Position' was escaped with a leading '\'.
1385 // 'First' specifies the position of the first character in the string.
1387 StringRef::iterator Position) { in wasEscaped() argument
1388 assert(Position - 1 >= First); in wasEscaped()
1389 StringRef::iterator I = Position - 1; in wasEscaped()
1390 // We calculate the number of consecutive '\'s before the current position in wasEscaped()
1393 // (Position - 1 - I) now contains the number of '\'s before the current in wasEscaped()
1394 // position. If it is odd, the character at 'Position' was escaped. in wasEscaped()
1395 return (Position - 1 - I) % 2 == 1; in wasEscaped()