mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
Require parentheses around operator and setter arguments.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
+ other { "Foo " + other }
|
||||
+(other) { "Foo " + other }
|
||||
}
|
||||
|
||||
IO.print(new Foo + "value") // expect: Foo value
|
||||
|
||||
@ -3,7 +3,7 @@ class Foo {
|
||||
IO.print("getter")
|
||||
}
|
||||
|
||||
setter = value {
|
||||
setter=(value) {
|
||||
IO.print("setter")
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ class Foo {
|
||||
IO.print("getter")
|
||||
}
|
||||
|
||||
setter = value {
|
||||
setter=(value) {
|
||||
IO.print("setter")
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value {
|
||||
bar=(value) {
|
||||
IO.print("setter")
|
||||
return value
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ class Outer {
|
||||
IO.print("outer getter")
|
||||
}
|
||||
|
||||
setter = value {
|
||||
setter=(value) {
|
||||
IO.print("outer setter")
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ class Outer {
|
||||
IO.print("inner getter")
|
||||
}
|
||||
|
||||
setter = value {
|
||||
setter=(value) {
|
||||
IO.print("inner setter")
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ class Foo {
|
||||
IO.print("getter")
|
||||
}
|
||||
|
||||
static setter = value {
|
||||
static setter=(value) {
|
||||
IO.print("setter")
|
||||
}
|
||||
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
class Foo {
|
||||
+ other { "infix + " + other }
|
||||
- other { "infix - " + other }
|
||||
* other { "infix * " + other }
|
||||
/ other { "infix / " + other }
|
||||
% other { "infix % " + other }
|
||||
< other { "infix < " + other }
|
||||
> other { "infix > " + other }
|
||||
<= other { "infix <= " + other }
|
||||
>= other { "infix >= " + other }
|
||||
== other { "infix == " + other }
|
||||
!= other { "infix != " + other }
|
||||
& other { "infix & " + other }
|
||||
| other { "infix | " + other }
|
||||
+(other) { "infix + " + other }
|
||||
-(other) { "infix - " + other }
|
||||
*(other) { "infix * " + other }
|
||||
/(other) { "infix / " + other }
|
||||
%(other) { "infix % " + other }
|
||||
<(other) { "infix < " + other }
|
||||
>(other) { "infix > " + other }
|
||||
<=(other) { "infix <= " + other }
|
||||
>=(other) { "infix >= " + other }
|
||||
==(other) { "infix == " + other }
|
||||
!=(other) { "infix != " + other }
|
||||
&(other) { "infix & " + other }
|
||||
|(other) { "infix | " + other }
|
||||
|
||||
! { "prefix !" }
|
||||
- { "prefix -" }
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
class Foo {
|
||||
new(value) { _value = value }
|
||||
toString { _value }
|
||||
bar = value {
|
||||
bar=(value) {
|
||||
_value = value
|
||||
return value
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value { value }
|
||||
bar=(value) { value }
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value { value }
|
||||
bar=(value) { value }
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value {
|
||||
bar=(value) {
|
||||
IO.print(value)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value { value }
|
||||
bar=(value) { value }
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value { value }
|
||||
bar=(value) { value }
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value { "result" }
|
||||
bar=(value) { "result" }
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
bar = value { IO.print("set") }
|
||||
bar=(value) { IO.print("set") }
|
||||
bar { IO.print("get") }
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
static bar = value {
|
||||
static bar=(value) {
|
||||
IO.print(value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user