]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/util/parser.rs
move syntax::parse -> librustc_parse
[rust.git] / src / libsyntax / util / parser.rs
index fceaed360cdb4d408a333e764ecd9e4e61ae19a3..df72fdc801423a2f2bb1012afcaac4062cc5b572 100644 (file)
@@ -1,4 +1,4 @@
-use crate::parse::token::{self, Token, BinOpToken};
+use crate::token::{self, Token, BinOpToken};
 use crate::symbol::kw;
 use crate::ast::{self, BinOpKind};
 
@@ -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 @@ pub fn order(self) -> i8 {
 }
 
 /// 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()
 }
 
@@ -375,7 +375,7 @@ pub fn order(self) -> i8 {
 /// parens or other delimiters, e.g., `X { y: 1 }`, `X { y: 1 }.method()`, `foo == X { y: 1 }` and
 /// `X { y: 1 } == foo` all do, but `(X { y: 1 }) == foo` does not.
 pub fn contains_exterior_struct_lit(value: &ast::Expr) -> bool {
-    match value.node {
+    match value.kind {
         ast::ExprKind::Struct(..) => true,
 
         ast::ExprKind::Assign(ref lhs, ref rhs) |