• Home
  • Raw
  • Download

Lines Matching refs:token

242     ($($token:tt pub struct $name:ident #[$doc:meta])*) => {
312 printing::keyword($token, self.span, tokens);
321 span: parsing::keyword(input, $token)?,
329 parsing::peek_keyword(cursor, $token)
333 concat!("`", $token, "`")
364 ($($token:tt pub struct $name:ident/$len:tt #[$doc:meta])*) => {
437 ($($token:tt pub struct $name:ident/$len:tt #[$doc:meta])*) => {
440 $token pub struct $name/$len #[$doc]
447 printing::punct($token, &self.spans, tokens);
456 spans: parsing::punct(input, $token)?,
464 parsing::peek_punct(cursor, $token)
468 concat!("`", $token, "`")
479 ($($token:tt pub struct $name:ident #[$doc:meta])*) => {
546 printing::delim($token, self.span, tokens, f);
775 [abstract] => { $crate::token::Abstract };
776 [as] => { $crate::token::As };
777 [async] => { $crate::token::Async };
778 [auto] => { $crate::token::Auto };
779 $($await_rule => { $crate::token::Await };)*
780 [become] => { $crate::token::Become };
781 [box] => { $crate::token::Box };
782 [break] => { $crate::token::Break };
783 [const] => { $crate::token::Const };
784 [continue] => { $crate::token::Continue };
785 [crate] => { $crate::token::Crate };
786 [default] => { $crate::token::Default };
787 [do] => { $crate::token::Do };
788 [dyn] => { $crate::token::Dyn };
789 [else] => { $crate::token::Else };
790 [enum] => { $crate::token::Enum };
791 [extern] => { $crate::token::Extern };
792 [final] => { $crate::token::Final };
793 [fn] => { $crate::token::Fn };
794 [for] => { $crate::token::For };
795 [if] => { $crate::token::If };
796 [impl] => { $crate::token::Impl };
797 [in] => { $crate::token::In };
798 [let] => { $crate::token::Let };
799 [loop] => { $crate::token::Loop };
800 [macro] => { $crate::token::Macro };
801 [match] => { $crate::token::Match };
802 [mod] => { $crate::token::Mod };
803 [move] => { $crate::token::Move };
804 [mut] => { $crate::token::Mut };
805 [override] => { $crate::token::Override };
806 [priv] => { $crate::token::Priv };
807 [pub] => { $crate::token::Pub };
808 [ref] => { $crate::token::Ref };
809 [return] => { $crate::token::Return };
810 [Self] => { $crate::token::SelfType };
811 [self] => { $crate::token::SelfValue };
812 [static] => { $crate::token::Static };
813 [struct] => { $crate::token::Struct };
814 [super] => { $crate::token::Super };
815 [trait] => { $crate::token::Trait };
816 [try] => { $crate::token::Try };
817 [type] => { $crate::token::Type };
818 [typeof] => { $crate::token::Typeof };
819 [union] => { $crate::token::Union };
820 [unsafe] => { $crate::token::Unsafe };
821 [unsized] => { $crate::token::Unsized };
822 [use] => { $crate::token::Use };
823 [virtual] => { $crate::token::Virtual };
824 [where] => { $crate::token::Where };
825 [while] => { $crate::token::While };
826 [yield] => { $crate::token::Yield };
827 [+] => { $crate::token::Add };
828 [+=] => { $crate::token::AddEq };
829 [&] => { $crate::token::And };
830 [&&] => { $crate::token::AndAnd };
831 [&=] => { $crate::token::AndEq };
832 [@] => { $crate::token::At };
833 [!] => { $crate::token::Bang };
834 [^] => { $crate::token::Caret };
835 [^=] => { $crate::token::CaretEq };
836 [:] => { $crate::token::Colon };
837 [::] => { $crate::token::Colon2 };
838 [,] => { $crate::token::Comma };
839 [/] => { $crate::token::Div };
840 [/=] => { $crate::token::DivEq };
841 [$] => { $crate::token::Dollar };
842 [.] => { $crate::token::Dot };
843 [..] => { $crate::token::Dot2 };
844 [...] => { $crate::token::Dot3 };
845 [..=] => { $crate::token::DotDotEq };
846 [=] => { $crate::token::Eq };
847 [==] => { $crate::token::EqEq };
848 [>=] => { $crate::token::Ge };
849 [>] => { $crate::token::Gt };
850 [<=] => { $crate::token::Le };
851 [<] => { $crate::token::Lt };
852 [*=] => { $crate::token::MulEq };
853 [!=] => { $crate::token::Ne };
854 [|] => { $crate::token::Or };
855 [|=] => { $crate::token::OrEq };
856 [||] => { $crate::token::OrOr };
857 [#] => { $crate::token::Pound };
858 [?] => { $crate::token::Question };
859 [->] => { $crate::token::RArrow };
860 [<-] => { $crate::token::LArrow };
861 [%] => { $crate::token::Rem };
862 [%=] => { $crate::token::RemEq };
863 [=>] => { $crate::token::FatArrow };
864 [;] => { $crate::token::Semi };
865 [<<] => { $crate::token::Shl };
866 [<<=] => { $crate::token::ShlEq };
867 [>>] => { $crate::token::Shr };
868 [>>=] => { $crate::token::ShrEq };
869 [*] => { $crate::token::Star };
870 [-] => { $crate::token::Sub };
871 [-=] => { $crate::token::SubEq };
872 [~] => { $crate::token::Tilde };
873 [_] => { $crate::token::Underscore };
896 pub fn keyword(input: ParseStream, token: &str) -> Result<Span> { in keyword()
899 if ident == token { in keyword()
903 Err(cursor.error(format!("expected `{}`", token))) in keyword()
907 pub fn peek_keyword(cursor: Cursor, token: &str) -> bool { in peek_keyword()
909 ident == token in peek_keyword()
915 pub fn punct<S: FromSpans>(input: ParseStream, token: &str) -> Result<S> { in punct()
917 punct_helper(input, token, &mut spans)?; in punct()
921 fn punct_helper(input: ParseStream, token: &str, spans: &mut [Span; 3]) -> Result<()> { in punct_helper()
924 assert!(token.len() <= spans.len());
926 for (i, ch) in token.chars().enumerate() {
932 } else if i == token.len() - 1 {
943 Err(Error::new(spans[0], format!("expected `{}`", token)))
947 pub fn peek_punct(mut cursor: Cursor, token: &str) -> bool { in peek_punct()
948 for (i, ch) in token.chars().enumerate() { in peek_punct()
953 } else if i == token.len() - 1 { in peek_punct()