Lines Matching defs:string
188 f.write_str("cannot parse string into token stream")
304 /// Get the path to this source file as a string.
406 /// Computes the offsets of each line in the given source string
464 format!("<parsed string {}>", i)
759 pub fn new_checked(string: &str, span: Span) -> Self {
760 validate_ident(string);
761 Ident::new_unchecked(string, span)
764 pub fn new_unchecked(string: &str, span: Span) -> Self {
766 sym: string.to_owned(),
773 pub fn new_raw_checked(string: &str, span: Span) -> Self {
774 validate_ident_raw(string);
775 Ident::new_raw_unchecked(string, span)
778 pub fn new_raw_unchecked(string: &str, span: Span) -> Self {
780 sym: string.to_owned(),
804 fn validate_ident(string: &str) {
805 if string.is_empty() {
809 if string.bytes().all(|digit| b'0' <= digit && digit <= b'9') {
813 fn ident_ok(string: &str) -> bool {
814 let mut chars = string.chars();
827 if !ident_ok(string) {
828 panic!("{:?} is not a valid Ident", string);
833 fn validate_ident_raw(string: &str) {
834 validate_ident(string);
836 match string {
838 panic!("`r#{}` cannot be a raw identifier", string);
979 pub fn string(t: &str) -> Literal {