[geany/geany] 6814fc: Update Rust keywords.

Pavel Sountsov git-noreply at xxxxx
Sat Aug 22 04:17:59 UTC 2015


Branch:      refs/heads/master
Author:      Pavel Sountsov <siege at google.com>
Committer:   SiegeLord <slabode at aim.com>
Date:        Sat, 22 Aug 2015 04:17:59 UTC
Commit:      6814fc1a6210b257cb76396474c8e20ea602432a
             https://github.com/geany/geany/commit/6814fc1a6210b257cb76396474c8e20ea602432a

Log Message:
-----------
Update Rust keywords.


Modified Paths:
--------------
    data/filetypes.rust
    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: tests/ctags/test_input.rs
71 lines changed, 34 insertions(+), 37 deletions(-)
===================================================================
@@ -2,16 +2,14 @@
 #![feature(globs)]
 #![feature(macro_rules)]
 use std::*;
-use std::io::stdio::println;
 use test_input2::*;
 mod test_input2;
 
-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 +17,15 @@ 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
 }
 
 /*
@@ -41,11 +39,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 +51,28 @@ 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::fruit::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());
+	println!("{}", foo_bar_test_func(SomeStruct{red_value:1,green_value:2,blue_value:3},(4,5)).to_string());
 	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 +86,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 +120,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 +142,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 +165,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
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -27,9 +27,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
@@ -49,4 +49,4 @@ test_macro
 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::fruit::SomeStruct) -> String�0


Modified: tests/ctags/test_input2.rs
15 lines changed, 7 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
 	}
 }


Modified: tests/ctags/test_input2.rs.tags
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -2,11 +2,11 @@
 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



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list