diff --git a/samples/helloworld.ks b/samples/helloworld.ks index c2b5eef..f5b812b 100644 --- a/samples/helloworld.ks +++ b/samples/helloworld.ks @@ -1,14 +1,4 @@ //mod samples/testmod.ks> m; -class MyVec { - a:Buf - .@index_get(i): self.a[i], // 别忘了逗号 - .@index_set(i, v) { - self.a[i] = v; - } -} -let a = MyVec::{a:'233'}; -let a = '233'; -a[1] = 0; -log(a); \ No newline at end of file +log(8u>>3==1) \ No newline at end of file diff --git a/src/scan/charts.rs b/src/scan/charts.rs index d6344e7..0201fe4 100644 --- a/src/scan/charts.rs +++ b/src/scan/charts.rs @@ -4,17 +4,17 @@ pub const fn prec(x:&[u8])-> u8 { match x { b"-."|b"-:" => 16, - b"is"=> 15, - b"::"|b"." => 14, - b"("|b"[" => 13, // 代指调用和索引 - // unary => 12 - b"*" | b"%" | b"/" => 11, - b"+" | b"-" => 10, - b"<<"|b">>" => 9, - b"&" => 8, - b"^" => 7, - b"|" => 6, - b"=="|b"!="|b"<"|b">"|b"<="|b">=" => 5, + b"::"|b"." => 15, + b"("|b"[" => 14, // 代指调用和索引 + // unary => 13 + b"*" | b"%" | b"/" => 12, + b"+" | b"-" => 11, + b"<<"|b">>" => 10, + b"&" => 9, + b"^" => 8, + b"|" => 7, + b"=="|b"!="|b"<"|b">"|b"<="|b">=" => 6, + b"is"=> 5, b"&&" => 4, b"||" => 3, b"="|b"+="|b"-="|b"*="|b"/="|b"%="|b"&="|b"|="|b"^="|b"<<="|b">>=" => 2, @@ -22,7 +22,7 @@ pub const fn prec(x:&[u8])-> u8 { _=> 0 } } -pub const PREC_UNARY:u8 = 12; +pub const PREC_UNARY:u8 = 13; /// 转义符表