Skip to content

Commit

Permalink
Partial update to Rust 1.0 beta
Browse files Browse the repository at this point in the history
Not a full update because a rustc ICE is blocking further progress.
  • Loading branch information
Valloric committed Apr 5, 2015
1 parent d4c9861 commit fd59694
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 23 deletions.
16 changes: 12 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion base/char_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use super::{Expression, ParseState, ParseResult};

macro_rules! class( ( $ex:expr ) => ( {
use base;
use std::str::StrExt;
&base::CharClass::new( $ex.as_bytes() ) } ) );


Expand Down
1 change: 0 additions & 1 deletion base/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use super::{Expression, ParseState, ParseResult};

macro_rules! lit( ( $ex:expr ) => ( {
use base;
use std::str::StrExt;
&base::Literal::new( $ex.as_bytes() ) } ) );


Expand Down
2 changes: 1 addition & 1 deletion base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ pub trait Expression {
-> Option< ParseResult<'a> >;
}

type Rule = for<'a> fn( &ParseState<'a> ) -> Option< ParseResult<'a> >;
pub type Rule = for<'a> fn( &ParseState<'a> ) -> Option< ParseResult<'a> >;
8 changes: 4 additions & 4 deletions base/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct Node<'a> {

fn indent( formatter: &mut fmt::Formatter, indent_spaces: u32 )
-> fmt::Result {
for _ in range( 0, indent_spaces ) {
for _ in 0 .. indent_spaces {
try!( write!( formatter, " " ) )
}
Ok(())
Expand Down Expand Up @@ -184,7 +184,7 @@ impl<'a> Node<'a> {
Children( ref children ) => {
let mut out : Vec<u8> = vec!();
for child in children.iter() {
out.push_all( &child.matchedData() );
out.extend( child.matchedData() );
}
out
}
Expand Down Expand Up @@ -242,8 +242,8 @@ mod tests {
fn preOrder_FullIteration() {
let root = testTree();
let names =
root.preOrder().map( |x| x.name.char_at( 0 ) ).collect::<Vec<_>>();
assert_eq!( names, vec!( 'a', 'b', 'e', 'f', 'c', 'g', 'd' ) )
root.preOrder().map( |x| x.name ).collect::<Vec<_>>();
assert_eq!( names, vec!( "a", "b", "e", "f", "c", "g", "d" ) )
}


Expand Down
1 change: 0 additions & 1 deletion base/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ pub fn ToParseState<'a>( bytes: &'a [u8] ) -> ParseState<'a> {

macro_rules! input_state( ( $ex:expr ) => ( {
use base::ParseState;
use std::str::StrExt;
ParseState { input: $ex.as_bytes(), offset: 0 }
} ) );
2 changes: 1 addition & 1 deletion base/unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn readCodepoint( input: &[u8] ) -> Option< char > {
Some( num_following ) => {
let mut codepoint: u32 =
codepointBitsFromLeadingByte( *first_byte ) << 6 * num_following;
for i in range( 1, num_following + 1 ) {
for i in 1 .. num_following + 1 {
match input.get( i ) {
Some( byte ) if isContinuationByte( *byte ) => {
codepoint |= codepointBitsFromContinuationByte( *byte ) <<
Expand Down
3 changes: 0 additions & 3 deletions inlined_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ mod base {

macro_rules! input_state( ( $ex:expr ) => ( {
use base::ParseState;
use std::str::StrExt;
ParseState { input: $ex.as_bytes(), offset: 0 }
} ) );
}
Expand All @@ -231,7 +230,6 @@ mod base {

macro_rules! lit( ( $ex:expr ) => ( {
use base;
use std::str::StrExt;
&base::Literal::new( $ex.as_bytes() ) } ) );


Expand Down Expand Up @@ -266,7 +264,6 @@ mod base {

macro_rules! class( ( $ex:expr ) => ( {
use base;
use std::str::StrExt;
&base::CharClass::new( $ex.as_bytes() ) } ) );


Expand Down
5 changes: 1 addition & 4 deletions parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![feature(core)]
#![feature(collections)]
#![allow(non_snake_case)]
#![deny(deprecated)]

Expand Down Expand Up @@ -111,7 +109,6 @@ mod rules {
{
use base::ParseResult;
use std::option::Option::Some;
use std::slice::SliceExt;

match $name( &input_state!( $input ) ) {
Some( ParseResult{ nodes: _, parse_state } ) => {
Expand Down Expand Up @@ -247,4 +244,4 @@ mod rules {
assert!( !matches!( EndOfFile, "a" ) );
}
}
}
}
3 changes: 0 additions & 3 deletions prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ mod base {
macro_rules! input_state( ( $ex:expr ) => ( {
use base::ParseState;
use std::str::StrExt;
ParseState { input: $ex.as_bytes(), offset: 0 }
} ) );
}
Expand All @@ -245,7 +244,6 @@ mod base {
macro_rules! lit( ( $ex:expr ) => ( {
use base;
use std::str::StrExt;
&base::Literal::new( $ex.as_bytes() ) } ) );
Expand Down Expand Up @@ -280,7 +278,6 @@ mod base {
macro_rules! class( ( $ex:expr ) => ( {
use base;
use std::str::StrExt;
&base::CharClass::new( $ex.as_bytes() ) } ) );
Expand Down

0 comments on commit fd59694

Please sign in to comment.