feat: require parentheses around operator and setter method parameters in Wren
Enforce syntactic requirement for parentheses in operator method signatures (e.g., `+(other)` instead of `+ other`) and setter definitions (e.g., `bar=(value)` instead of `bar = value`). Update the compiler's `infixSignature`, `mixedSignature`, and `namedSignature` functions to consume explicit `(` and `)` tokens around parameter names. Migrate all built-in core library operator definitions and test fixtures to the new parenthesized syntax.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user