• Home
  • Raw
  • Download

Lines Matching refs:Span

113             span: fallback::Span::call_site(),  in proc_macro_parse()
251 pub(crate) fn span(&self) -> Span { in span() argument
253 LexError::Compiler(_) => Span::call_site(), in span()
254 LexError::Fallback(e) => Span::Fallback(e.span()), in span()
288 span: fallback::Span::call_site(), in fmt()
333 o.set_span(crate::Span::_new(Span::Compiler(tt.span()))); in next()
401 pub(crate) enum Span { enum
402 Compiler(proc_macro::Span),
403 Fallback(fallback::Span),
406 impl Span { impl
407 pub fn call_site() -> Span { in call_site()
409 Span::Compiler(proc_macro::Span::call_site()) in call_site()
411 Span::Fallback(fallback::Span::call_site()) in call_site()
416 pub fn mixed_site() -> Span { in mixed_site()
418 Span::Compiler(proc_macro::Span::mixed_site()) in mixed_site()
420 Span::Fallback(fallback::Span::mixed_site()) in mixed_site()
425 pub fn def_site() -> Span { in def_site()
427 Span::Compiler(proc_macro::Span::def_site()) in def_site()
429 Span::Fallback(fallback::Span::def_site()) in def_site()
433 pub fn resolved_at(&self, other: Span) -> Span { in resolved_at() argument
436 (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)), in resolved_at()
440 (Span::Compiler(_), Span::Compiler(_)) => other, in resolved_at()
442 (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)), in resolved_at()
447 pub fn located_at(&self, other: Span) -> Span { in located_at() argument
450 (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)), in located_at()
454 (Span::Compiler(_), Span::Compiler(_)) => *self, in located_at()
456 (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)), in located_at()
461 pub fn unwrap(self) -> proc_macro::Span { in unwrap() argument
463 Span::Compiler(s) => s, in unwrap()
464 Span::Fallback(_) => panic!("proc_macro::Span is only available in procedural macros"), in unwrap()
471 Span::Compiler(s) => SourceFile::nightly(s.source_file()), in source_file()
472 Span::Fallback(s) => SourceFile::Fallback(s.source_file()), in source_file()
480 Span::Compiler(s) => { in start()
485 Span::Compiler(_) => LineColumn { line: 0, column: 0 }, in start()
486 Span::Fallback(s) => { in start()
497 Span::Compiler(s) => { in end()
502 Span::Compiler(_) => LineColumn { line: 0, column: 0 }, in end()
503 Span::Fallback(s) => { in end()
510 pub fn join(&self, other: Span) -> Option<Span> { in join() argument
513 (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.join(b)?), in join()
514 (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.join(b)?), in join()
521 pub fn eq(&self, other: &Span) -> bool { in eq()
523 (Span::Compiler(a), Span::Compiler(b)) => a.eq(b), in eq()
524 (Span::Fallback(a), Span::Fallback(b)) => a.eq(b), in eq()
529 fn unwrap_nightly(self) -> proc_macro::Span { in unwrap_nightly() argument
531 Span::Compiler(s) => s, in unwrap_nightly()
532 Span::Fallback(_) => mismatch(), in unwrap_nightly()
537 impl From<proc_macro::Span> for crate::Span { implementation
538 fn from(proc_span: proc_macro::Span) -> crate::Span { in from() argument
539 crate::Span::_new(Span::Compiler(proc_span)) in from()
543 impl From<fallback::Span> for Span { implementation
544 fn from(inner: fallback::Span) -> Span { in from() argument
545 Span::Fallback(inner) in from()
549 impl Debug for Span { implementation
552 Span::Compiler(s) => Debug::fmt(s, f), in fmt()
553 Span::Fallback(s) => Debug::fmt(s, f), in fmt()
558 pub(crate) fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) { in debug_span_field_if_nontrivial() argument
560 Span::Compiler(s) => { in debug_span_field_if_nontrivial()
563 Span::Fallback(s) => fallback::debug_span_field_if_nontrivial(debug, s), in debug_span_field_if_nontrivial()
610 pub fn span(&self) -> Span { in span() argument
612 Group::Compiler(g) => Span::Compiler(g.span()), in span()
613 Group::Fallback(g) => Span::Fallback(g.span()), in span()
617 pub fn span_open(&self) -> Span { in span_open() argument
620 Group::Compiler(g) => Span::Compiler(g.span_open()), in span_open()
622 Group::Compiler(g) => Span::Compiler(g.span()), in span_open()
623 Group::Fallback(g) => Span::Fallback(g.span_open()), in span_open()
627 pub fn span_close(&self) -> Span { in span_close() argument
630 Group::Compiler(g) => Span::Compiler(g.span_close()), in span_close()
632 Group::Compiler(g) => Span::Compiler(g.span()), in span_close()
633 Group::Fallback(g) => Span::Fallback(g.span_close()), in span_close()
637 pub fn set_span(&mut self, span: Span) { in set_span() argument
639 (Group::Compiler(g), Span::Compiler(s)) => g.set_span(s), in set_span()
640 (Group::Fallback(g), Span::Fallback(s)) => g.set_span(s), in set_span()
684 pub fn new(string: &str, span: Span) -> Ident { in new()
686 Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new(string, s)), in new()
687 Span::Fallback(s) => Ident::Fallback(fallback::Ident::new(string, s)), in new()
691 pub fn new_raw(string: &str, span: Span) -> Ident { in new_raw()
693 Span::Compiler(s) => { in new_raw()
704 Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_raw(string, s)), in new_raw()
708 pub fn span(&self) -> Span { in span() argument
710 Ident::Compiler(t) => Span::Compiler(t.span()), in span()
711 Ident::Fallback(t) => Span::Fallback(t.span()), in span()
715 pub fn set_span(&mut self, span: Span) { in set_span() argument
717 (Ident::Compiler(t), Span::Compiler(s)) => t.set_span(s), in set_span()
718 (Ident::Fallback(t), Span::Fallback(s)) => t.set_span(s), in set_span()
876 pub fn span(&self) -> Span { in span() argument
878 Literal::Compiler(lit) => Span::Compiler(lit.span()), in span()
879 Literal::Fallback(lit) => Span::Fallback(lit.span()), in span()
883 pub fn set_span(&mut self, span: Span) { in set_span() argument
885 (Literal::Compiler(lit), Span::Compiler(s)) => lit.set_span(s), in set_span()
886 (Literal::Fallback(lit), Span::Fallback(s)) => lit.set_span(s), in set_span()
891 pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> { in subspan() argument
894 Literal::Compiler(lit) => lit.subspan(range).map(Span::Compiler), in subspan()
897 Literal::Fallback(lit) => lit.subspan(range).map(Span::Fallback), in subspan()