about summary refs log tree commit diff
path: root/src/libsyntax/util
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-15 22:48:13 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-11-10 03:57:18 +0100
commit4ae2728fa8052915414127dce28245eb8f70842a (patch)
tree27cc54d90904091e4dc9bf7ae5fa3b41be4b6187 /src/libsyntax/util
parentbe023ebe850261c6bb202a02a686827d821c3697 (diff)
downloadrust-4ae2728fa8052915414127dce28245eb8f70842a.tar.gz
rust-4ae2728fa8052915414127dce28245eb8f70842a.zip
move syntax::parse -> librustc_parse
also move MACRO_ARGUMENTS -> librustc_parse
Diffstat (limited to 'src/libsyntax/util')
-rw-r--r--src/libsyntax/util/comments.rs4
-rw-r--r--src/libsyntax/util/literal.rs10
-rw-r--r--src/libsyntax/util/parser.rs4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/util/comments.rs b/src/libsyntax/util/comments.rs
index ef9226a8879..5e9b7bf8322 100644
--- a/src/libsyntax/util/comments.rs
+++ b/src/libsyntax/util/comments.rs
@@ -32,14 +32,14 @@ pub struct Comment {
     pub pos: BytePos,
 }
 
-crate fn is_line_doc_comment(s: &str) -> bool {
+pub fn is_line_doc_comment(s: &str) -> bool {
     let res = (s.starts_with("///") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'/') ||
               s.starts_with("//!");
     debug!("is {:?} a doc comment? {}", s, res);
     res
 }
 
-crate fn is_block_doc_comment(s: &str) -> bool {
+pub fn is_block_doc_comment(s: &str) -> bool {
     // Prevent `/**/` from being parsed as a doc comment
     let res = ((s.starts_with("/**") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'*') ||
                s.starts_with("/*!")) && s.len() >= 5;
diff --git a/src/libsyntax/util/literal.rs b/src/libsyntax/util/literal.rs
index d4c9b7850c5..af7afab6b9b 100644
--- a/src/libsyntax/util/literal.rs
+++ b/src/libsyntax/util/literal.rs
@@ -14,7 +14,7 @@ use rustc_lexer::unescape::{unescape_raw_str, unescape_raw_byte_str};
 
 use std::ascii;
 
-crate enum LitError {
+pub enum LitError {
     NotLiteral,
     LexerError,
     InvalidSuffix,
@@ -185,12 +185,12 @@ impl LitKind {
 
 impl Lit {
     /// Converts literal token into an AST literal.
-    crate fn from_lit_token(token: token::Lit, span: Span) -> Result<Lit, LitError> {
+    pub fn from_lit_token(token: token::Lit, span: Span) -> Result<Lit, LitError> {
         Ok(Lit { token, kind: LitKind::from_lit_token(token)?, span })
     }
 
     /// Converts arbitrary token into an AST literal.
-    crate fn from_token(token: &Token) -> Result<Lit, LitError> {
+    pub fn from_token(token: &Token) -> Result<Lit, LitError> {
         let lit = match token.kind {
             token::Ident(name, false) if name.is_bool_lit() =>
                 token::Lit::new(token::Bool, name, None),
@@ -217,8 +217,8 @@ impl Lit {
         Lit { token: kind.to_lit_token(), kind, span }
     }
 
-    /// Losslessly convert an AST literal into a token tree.
-    crate fn token_tree(&self) -> TokenTree {
+    /// Losslessly convert an AST literal into a token stream.
+    pub fn token_tree(&self) -> TokenTree {
         let token = match self.token.kind {
             token::Bool => token::Ident(self.token.symbol, false),
             _ => token::Literal(self.token),
diff --git a/src/libsyntax/util/parser.rs b/src/libsyntax/util/parser.rs
index edb708d7e97..df72fdc8014 100644
--- a/src/libsyntax/util/parser.rs
+++ b/src/libsyntax/util/parser.rs
@@ -69,7 +69,7 @@ pub enum Fixity {
 
 impl AssocOp {
     /// Creates a new AssocOP from a token
-    crate fn from_token(t: &Token) -> Option<AssocOp> {
+    pub fn from_token(t: &Token) -> Option<AssocOp> {
         use AssocOp::*;
         match t.kind {
             token::BinOpEq(k) => Some(AssignOp(k)),
@@ -358,7 +358,7 @@ impl ExprPrecedence {
 }
 
 /// In `let p = e`, operators with precedence `<=` this one requires parenthesis in `e`.
-crate fn prec_let_scrutinee_needs_par() -> usize {
+pub fn prec_let_scrutinee_needs_par() -> usize {
     AssocOp::LAnd.precedence()
 }