about summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
diff options
context:
space:
mode:
authorDaniel Grunwald <daniel@danielgrunwald.de>2015-01-18 21:43:03 +0100
committerDaniel Grunwald <daniel@danielgrunwald.de>2015-01-22 19:55:15 +0100
commitdb013f9f45a3083ccc9dd79299f110ec62e29704 (patch)
tree7a716ac5c0f4082611d34561f5597f8b7c3e92f9 /src/libsyntax/ast_util.rs
parentb7930d93d9b57beaeabfeb43cf78fc8161ecd46c (diff)
downloadrust-db013f9f45a3083ccc9dd79299f110ec62e29704.tar.gz
rust-db013f9f45a3083ccc9dd79299f110ec62e29704.zip
Fix some grammar inconsistencies for the '..' range notation.
Grammar changes:
* allow 'for _ in 1..i {}' (fixes #20241)
* allow 'for _ in 1.. {}' as infinite loop
* prevent use of range notation in contexts where only operators of high
  precedence are expected (fixes #20811)

Parser code cleanup:
* remove RESTRICTION_NO_DOTS
* make AS_PREC const and follow naming convention
* make min_prec inclusive
Diffstat (limited to 'src/libsyntax/ast_util.rs')
-rw-r--r--src/libsyntax/ast_util.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index 892b3c1e7f2..cf0aac5bf4a 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -336,8 +336,7 @@ pub fn operator_prec(op: ast::BinOp) -> usize {
 
 /// Precedence of the `as` operator, which is a binary operator
 /// not appearing in the prior table.
-#[allow(non_upper_case_globals)]
-pub static as_prec: usize = 12us;
+pub const AS_PREC: usize = 12us;
 
 pub fn empty_generics() -> Generics {
     Generics {