Skip to content

Commit f1654cb

Browse files
committed
Migrated the project to the Rust 2018 edition
1 parent 33d272f commit f1654cb

File tree

14 files changed

+21
-20
lines changed

14 files changed

+21
-20
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustpython"
33
version = "0.0.1"
44
authors = ["Windel Bouwman", "Shing Lyu <shing.lyu@gmail.com>"]
5+
edition = "2018"
56

67
[workspace]
78
members = [".", "vm", "wasm/lib", "parser"]

parser/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "rustpython_parser"
33
version = "0.0.1"
44
authors = [ "Shing Lyu", "Windel Bouwman" ]
55
build = "build.rs"
6+
edition = "2018"
67

78
[build-dependencies]
89
lalrpop="0.15.1"

parser/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
extern crate lalrpop;
1+
use lalrpop;
22

33
fn main() {
44
lalrpop::process_root().unwrap();

parser/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
extern crate lalrpop_util;
44
use self::lalrpop_util::ParseError as InnerError;
55

6-
use lexer::{LexicalError, Location};
7-
use token::Tok;
6+
use crate::lexer::{LexicalError, Location};
7+
use crate::token::Tok;
88

99
use std::error::Error;
1010
use std::fmt;

parser/src/lexer.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -541,27 +541,27 @@ where
541541

542542
fn is_char(&self) -> bool {
543543
match self.chr0 {
544-
Some('a'...'z') | Some('A'...'Z') | Some('_') | Some('0'...'9') => true,
544+
Some('a'..='z') | Some('A'..='Z') | Some('_') | Some('0'..='9') => true,
545545
_ => false,
546546
}
547547
}
548548

549549
fn is_number(&self, radix: u32) -> bool {
550550
match radix {
551551
2 => match self.chr0 {
552-
Some('0'...'1') => true,
552+
Some('0'..='1') => true,
553553
_ => false,
554554
},
555555
8 => match self.chr0 {
556-
Some('0'...'7') => true,
556+
Some('0'..='7') => true,
557557
_ => false,
558558
},
559559
10 => match self.chr0 {
560-
Some('0'...'9') => true,
560+
Some('0'..='9') => true,
561561
_ => false,
562562
},
563563
16 => match self.chr0 {
564-
Some('0'...'9') | Some('a'...'f') | Some('A'...'F') => true,
564+
Some('0'..='9') | Some('a'..='f') | Some('A'..='F') => true,
565565
_ => false,
566566
},
567567
x => unimplemented!("Radix not implemented: {}", x),
@@ -686,8 +686,8 @@ where
686686
}
687687

688688
match self.chr0 {
689-
Some('0'...'9') => return Some(self.lex_number()),
690-
Some('_') | Some('a'...'z') | Some('A'...'Z') => return Some(self.lex_identifier()),
689+
Some('0'..='9') => return Some(self.lex_number()),
690+
Some('_') | Some('a'..='z') | Some('A'..='Z') => return Some(self.lex_identifier()),
691691
Some('#') => {
692692
self.lex_comment();
693693
continue;

parser/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#[macro_use]
22
extern crate log;
33

4-
extern crate num_bigint;
5-
extern crate num_traits;
6-
74
pub mod ast;
85
pub mod error;
96
pub mod lexer;

parser/src/parser.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate lalrpop_util;
2-
31
use std::iter;
42

53
use super::ast;

py_code_object/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "py_code_object"
33
version = "0.1.0"
44
authors = ["Shing Lyu <shing.lyu@gmail.com>"]
5+
edition = "2018"
56

67
[dependencies]
78
log = "0.3"

py_code_object/python_compiler/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "python_compiler"
33
version = "0.1.0"
44
authors = ["Shing Lyu <shing.lyu@gmail.com>"]
5+
edition = "2018"
56

67
[dependencies]
78
cpython = { git = "https://github.com/dgrunwald/rust-cpython.git" }

vm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "rustpython_vm"
33
version = "0.1.0"
44
authors = ["Shing Lyu <shing.lyu@gmail.com>"]
5+
edition = "2018"
56

67
[dependencies]
78
bitflags = "1.0.4"

0 commit comments

Comments
 (0)