Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 23 Aug 2015 21:48:39 UTC Commit: b7bcf14ddf8ff2f606e5b4c6cd50ec8a31d36bc0 https://github.com/geany/geany/commit/b7bcf14ddf8ff2f606e5b4c6cd50ec8a31d36b...
Log Message: ----------- Merge pull request #613 from SiegeLord/even_more_rust_updates
Rust updates
Modified Paths: -------------- data/filetypes.rust tagmanager/ctags/rust.c tests/ctags/test_input.rs tests/ctags/test_input.rs.tags tests/ctags/test_input2.rs tests/ctags/test_input2.rs.tags
Modified: data/filetypes.rust 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -25,8 +25,8 @@ lexerror=error
[keywords] # all items must be in one line -primary=alignof as be box break const continue crate do else enum extern false fn for if impl in let loop match mod mut offsetof once priv proc pub pure ref return self sizeof static struct super trait true type typeof unsafe unsized use virtual while yield -secondary=bool char f32 f64 i16 i32 i64 i8 int str u16 u32 u64 u8 uint +primary=abstract alignof as become box break const continue crate do else enum extern false final fn for if impl in let loop macro match mod move mut offsetof override priv proc pub pure ref return self sizeof static struct super trait true type typeof unsafe unsized use virtual where while yield +secondary=bool char f32 f64 i16 i32 i64 i8 isize str u16 u32 u64 u8 usize tertiary=Self
[lexer_properties]
Modified: tagmanager/ctags/rust.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -650,7 +650,8 @@ static void parseQualifiedType (lexerState *lexer, vString* name) { if (lexer->cur_token == TOKEN_IDENT) { - if (strcmp(lexer->token_str->buffer, "for") == 0) + if (strcmp(lexer->token_str->buffer, "for") == 0 + || strcmp(lexer->token_str->buffer, "where") == 0) break; vStringClear(name); vStringCat(name, lexer->token_str);
Modified: tests/ctags/test_input.rs 95 lines changed, 55 insertions(+), 40 deletions(-) =================================================================== @@ -2,16 +2,16 @@ #![feature(globs)] #![feature(macro_rules)] use std::*; -use std::io::stdio::println; -use test_input2::*; -mod test_input2; +mod test_input2 +{ + pub struct SomeStruct; +}
-fn lifetime_and_char<'lifetime>(_: &'lifetime int) +fn lifetime_and_char<'lifetime>(_: &'lifetime isize) { let s = '"'; let s = '}'; let s = '''; - let s = '\uffff'; fn not_hidden_by_char() {} }
@@ -19,15 +19,32 @@ fn preserve_string_delims(_bar: extern r#"C"# fn()) {}
pub struct A { - foo: fn() -> int, - bar: int + foo: fn() -> isize, + bar: isize }
pub struct B { #[cfg(test)] - foo: int, - bar: int + foo: isize, + bar: isize +} + +pub struct C<T> where T: Send +{ + a: T +} + +pub trait D<T> where T: Send +{ +} + +impl<T> D<T> for C<T> where T: Send +{ +} + +pub fn where_foo<T>(a: T) where T: Send +{ }
/* @@ -41,11 +58,11 @@ pub struct B fn ignored_in_nested_comment() {} */
-static size: uint = 1; +static size: usize = 1;
#[cfg(test)] struct S1 { - priv only_field: [int, ..size] + only_field: [isize; size] }
macro_rules! test_macro @@ -53,28 +70,27 @@ macro_rules! test_macro () => {1} }
-macro_rules! ignore (($($x:tt)*) => (())) +macro_rules! ignore {($($x:tt)*) => (())}
-fn yada(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> String { +fn yada(a:isize, c:Foo, b:test_input2::SomeStruct) -> String { a.to_string() }
fn main() { - use test_input2::fruit::*; - io::println(foo_bar_test_func(SomeStruct{red_value:1,green_value:2,blue_value:3},(4,5)).to_string().as_slice()); + use test_input2::*; let a=Foo{foo_field_1:2}; a.my_method(1); - let c=a_cat(3); + let c=Animal::a_cat(3); let d=Foo{foo_field_1:a.foo_field_1+2}; a.test(); - println(a.foo_field_1.to_string().as_slice()); + println!("{}", a.foo_field_1.to_string()); ignore! ( fn ignored_inside_macro() {} - ) + ); ignore! [ fn ignored_inside_macro() {} - ] + ]; ignore! { fn ignored_inside_macro() {} @@ -88,26 +104,26 @@ fn main() { fn nested() {} }
-struct Bar(int); +struct Bar(isize);
-struct Baz(int); +struct Baz(isize);
-struct Foo{foo_field_1:int} +struct Foo{foo_field_1:isize}
struct Foo2 { - x:int, - y:int + x:isize, + y:isize }
impl Foo { - fn my_method(&self,_:int){ println("my_method of foo");} + fn my_method(&self,_:isize){ println!("{}", "my_method of foo");} }
enum Animal { - a_anteater(int), - a_bear(int), - a_cat(int), - a_dog(int), + a_anteater(isize), + a_bear(isize), + a_cat(isize), + a_dog(isize), }
trait Testable @@ -122,21 +138,21 @@ trait DoZ {
impl Testable for Foo { fn test(&self) { - println(self.foo_field_1.to_string().as_slice()); + println!("{}", self.foo_field_1.to_string()); }
fn test1(&self) { - println(self.foo_field_1.to_string().as_slice()); + println!("{}", self.foo_field_1.to_string()); }
fn test2(&self) { - println(self.foo_field_1.to_string().as_slice()); + println!("{}", self.foo_field_1.to_string()); } }
impl DoZ for Foo { fn do_z(&self) { - println(self.foo_field_1.to_string().as_slice()); + println!("{}", self.foo_field_1.to_string()); } }
@@ -144,10 +160,10 @@ trait SuperTraitTest:Testable+DoZ { }
fn gfunc<X:Testable+DoZ>(x:&X) { - let a1=a_anteater(1); - let a2=a_bear(1); - let a3=a_cat(1); - let a4=a_dog(1); + let a1=Animal::a_anteater(1); + let a2=Animal::a_bear(1); + let a3=Animal::a_cat(1); + let a4=Animal::a_dog(1); x.test(); x.do_z(); } @@ -167,8 +183,7 @@ impl<T: Clone> ParametrizedTrait<T> for TraitedStructTest<T> {
fn some2(a:Animal) { match a { - a_cat(x)=> println("cat"), - _ => println("not a cat") + Animal::a_cat(x)=> println!("{}", "cat"), + _ => println!("{}", "not a cat") } - }
Modified: tests/ctags/test_input.rs.tags 12 lines changed, 9 insertions(+), 3 deletions(-) =================================================================== @@ -4,16 +4,21 @@ Animal B�2048�0 Bar�2048�0 Baz�2048�0 +C�1�0 +C�2048�0 +D�32�0 DoZ�32�0 Foo�1�0 Foo�2048�0 Foo2�2048�0 ParametrizedTrait�32�0 S1�2048�0 +SomeStruct�2048�test_input2�0 SuperTraitTest�32�0 Testable�32�0 TraitedStructTest�1�0 TraitedStructTest�2048�0 +a�8�C�0 a_anteater�4�Animal�0 a_bear�4�Animal�0 a_cat�4�Animal�0 @@ -27,9 +32,9 @@ foo foo_field_1�8�Foo�0 gfunc�16�<X:Testable+DoZ>(x:&X)�0 ignore�65536�0 -lifetime_and_char�16�<'lifetime>(_: &'lifetime int)�0 +lifetime_and_char�16�<'lifetime>(_: &'lifetime isize)�0 main�16�()�0 -my_method�128�(&self,_:int)�Foo�0 +my_method�128�(&self,_:isize)�Foo�0 nested�16�()�main�0 not_hidden_by_char�16�()�lifetime_and_char�0 only_field�8�S1�0 @@ -46,7 +51,8 @@ test2 test2�128�(&self)�Testable�0 test_input2�256�0 test_macro�65536�0 +where_foo�16�<T>(a: T) where T: Send�0 x�8�Foo2�0 x�8�TraitedStructTest�0 y�8�Foo2�0 -yada�16�(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> String�0 +yada�16�(a:isize, c:Foo, b:test_input2::SomeStruct) -> String�0
Modified: tests/ctags/test_input2.rs 17 lines changed, 9 insertions(+), 8 deletions(-) =================================================================== @@ -1,19 +1,18 @@ #![cfg(not(test))] fn not_hashbang() {}
-pub fn foo_bar_test_func(apples:fruit::SomeStruct,(oranges,lemon):(int,int))->int{ - use std::io::stdio::println; +pub fn foo_bar_test_func(apples:fruit::SomeStruct,(oranges,lemon):(isize,isize))->isize{ let some_var_name=2*oranges; let a=SomeLongStructName{v:0}; - println("a");println("b"); println("c"); + println!("{}", "a"); veg::another_function(apples.red_value,oranges,lemon); some_var_name-apples.red_value+lemon+a.v }
pub mod fruit { pub struct SomeStruct{ - pub red_value: int, - pub green_value: int, - pub blue_value: int + pub red_value: isize, + pub green_value: isize, + pub blue_value: isize } }
@@ -27,10 +26,10 @@ impl SomeLongStructName { } }
-pub struct SomeLongStructName {v:int} +pub struct SomeLongStructName {v:isize}
mod veg{ - pub fn another_function(a:int,b:int,c:int)->int { + pub fn another_function(a:isize,b:isize,c:isize)->isize { a+b+c } } @@ -43,3 +42,5 @@ mod mineral { fn chalk() { } } + +fn main() {}
Modified: tests/ctags/test_input2.rs.tags 5 lines changed, 3 insertions(+), 2 deletions(-) =================================================================== @@ -2,17 +2,18 @@ SomeLongStructName�1�0 SomeLongStructName�2048�0 SomeStruct�2048�fruit�0 -another_function�16�(a:int,b:int,c:int)->int�veg�0 +another_function�16�(a:isize,b:isize,c:isize)->isize�veg�0 baaz�128�()�SomeLongStructName�0 blue_value�8�fruit::SomeStruct�0 chalk�16�()�mineral�0 -foo_bar_test_func�16�(apples:fruit::SomeStruct,(oranges,lemon):(int,int))->int�0 +foo_bar_test_func�16�(apples:fruit::SomeStruct,(oranges,lemon):(isize,isize))->isize�0 fooo�128�()�SomeLongStructName�0 free_func�16�()�0 fruit�256�0 granite�16�()�mineral�0 green_value�8�fruit::SomeStruct�0 limestone�16�()�mineral�0 +main�16�()�0 mineral�256�0 not_hashbang�16�()�0 red_value�8�fruit::SomeStruct�0
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).