Skip to content

Commit 550b12e

Browse files
committed
Spaces around '=' in named arguments in documentation and tests
1 parent 61c91ce commit 550b12e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+67
-67
lines changed

docs/manual.md

Lines changed: 3 additions & 3 deletions

test/bad/classes/method03.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ class Test def
33
func f(b: Int = 0): Void def
44
skip
55

6-
Test().f(a=3)
6+
Test().f(a = 3)

test/bad/classes/struct09.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
class A def
33
x: Int
44

5-
A(y=0)
5+
A(y = 0)

test/bad/functions/call06.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:5:5: No implicit conversion from `Bool` to `Int`.
1+
:5:7: No implicit conversion from `Bool` to `Int`.

test/bad/functions/call06.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(x: Int): Void def
33
return
44

5-
f(x=false)
5+
f(x = false)

test/bad/functions/call07.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(x: Int = 0): Void def
33
return
44

5-
f(y=2)
5+
f(y = 2)

test/bad/functions/call08.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(a: Int, b: Bool, c: Char = 'd', s: String = ""): Void def
33
return
44

5-
f(a=6, s="s", c='x')
5+
f(a = 6, s = "s", c = 'x')

test/bad/functions/call09.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:5:8: Positional argument cannot follow named arguments.
1+
:5:10: Positional argument cannot follow named arguments.

test/bad/functions/call09.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(a: Int = 5, b: Int = 10): Void def
33
return
44

5-
f(a=3, 7)
5+
f(a = 3, 7)

test/bad/functions/call10.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:5:11: Repeated argument `b`.
1+
:5:13: Repeated argument `b`.

test/bad/functions/call10.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(b: Bool): Void def
33
return
44

5-
f(b=true, b=true)
5+
f(b = true, b = true)

test/bad/functions/call11.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(s: String): Void def
33
return
44

5-
f("", s="")
5+
f("", s = "")

test/bad/functions/placeholder01.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:5:4: Syntax error.
1+
:5:5: Syntax error.

test/bad/functions/placeholder01.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(_: Int): Void def
33
return
44

5-
f(_=0)
5+
f(_ = 0)

test/bad/functions/type07.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ func f(y: Int = 0): Void def
33
return
44

55
g = f
6-
g(y=1)
6+
g(y = 1)

test/bad/functions/type09.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ func neg(b: Bool = false): Bool def
33
return not b
44

55
func f(g: Bool->Bool): Bool def
6-
return g(b=true)
6+
return g(b = true)
77

88
print f(neg)

test/bad/functions/variadic06.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(...args: [Int]): Void def
33
return
44

5-
f(2, args=[3])
5+
f(2, args = [3])

test/bad/functions/variadic07.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:5:8: No implicit conversion from `{Int}` to `[Int]`.
1+
:5:10: No implicit conversion from `{Int}` to `[Int]`.

test/bad/functions/variadic07.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(...args: [Int]): Void def
33
return
44

5-
f(args={3})
5+
f(args = {3})

test/good/arrays/empty06.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
func f(a: [Int], b: [[Bool]], c: [[[Char]]] = [[[]]]): Int*Int*Int def
33
return a.length, b.length, c[0][0].length
44

5-
print f([], b=[[]])
5+
print f([], b = [[]])

test/good/arrays/method10.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
a = [1..10^^6]
33
print a.find(0), a.find(10)
4-
print a.find(1, 1), (a*2).find(723641, start=-1200000)
4+
print a.find(1, 1), (a*2).find(723641, start = -1200000)
55
print a.count(-2), (a*5).count(9358)

test/good/arrays/method12.px

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
a = ["abc", "a", "bc"]
33
print a.sort()
4-
print a.sort(reverse=true)
5-
print a.sort(key=_.length)
4+
print a.sort(reverse = true)
5+
print a.sort(key = _.length)

test/good/arrays/method13.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class C def
66
n = 10^^5
77

88
c = [for i in 0...n yield C(i, 1.25f)] + [for i in n...3*n yield C(i, 1.5f)]
9-
c.sort(reverse=true, key=_.x)
9+
c.sort(reverse = true, key = _.x)
1010

1111
print c.length
1212
print [for i in 0...2*n yield c[i].id == n+i and c[i].x == 1.5f].all()

test/good/classes/inheritance04.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ class Y: Z def
77
x: Int
88

99
Y().f('Y')
10-
Y().f(x='Y')
10+
Y().f(x = 'Y')
1111
Y().f()

test/good/classes/inheritance05.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ class B: A def
99
x: Int
1010

1111
B("B")
12-
B(s="B")
12+
B(s = "B")
1313
B()

test/good/classes/inheritance06.px

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ func f(a: A): Void def
2525
print a.toString()
2626

2727
f(A('A'))
28-
f(B('B', b=true))
29-
f(C(c='C'))
28+
f(B('B', b = true))
29+
f(C(c = 'C'))
3030
f(D())

test/good/classes/inheritance10.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ B().f()
1717
b = B(true, 'y')
1818
print b.x, b.y
1919

20-
c = C(z="xyz")
20+
c = C(z = "xyz")
2121
print c.x, c.y, c.z

test/good/classes/method03.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ t = Test(3)
1212
t.add()
1313
t.add(1)
1414
t.multiply()
15-
t.multiply(v=4)
15+
t.multiply(v = 4)
1616
print t.value

test/good/classes/method10.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ class A def
88
y: Float
99

1010
print A(1, 2).f()
11-
print A(y=3.6, x=4).f()
11+
print A(y = 3.6, x = 4).f()

test/good/classes/struct01.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class Struct def
66
r = Struct(2, "abc")
77
print r.n, r.s
88

9-
r = Struct(s="s", n=5)
9+
r = Struct(s = "s", n = 5)
1010
print r.n, r.s

test/good/classes/struct08.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ print a.f(".")
1010
a.f = _.length
1111
print a.f("zxcvb")
1212

13-
a = A(f=_[-1].code)
13+
a = A(f = _[-1].code)
1414
print a.c
1515
print a.f("XY")

test/good/classes/super03.px

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ class A def
99

1010
class B: A def
1111
func add(v: Int = 0, c: Char = 'B'): Int def
12-
return super(v, c=c)
12+
return super(v, c = c)
1313

1414
class B': B def
1515
func add(v: Int = 0, c: Char = 'B'): Int def
1616
if c != 'B' do
1717
print c
18-
super(v=v)
18+
super(v = v)
1919
return this.x + 100
2020

2121
b = B()
2222
b = B'()
2323
b.add()
2424
b.add(11)
25-
b.add(v=42)
25+
b.add(v = 42)
2626
print b.x
2727

2828
a = A()

test/good/functions/args04.px

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
func div(a: Int, b: Int): Int def
33
return a // b
44

5-
print div(a=18, b=3)
6-
print div(-50, b=10)
7-
print div(b=14, a=42)
5+
print div(a = 18, b = 3)
6+
print div(-50, b = 10)
7+
print div(b = 14, a = 42)

test/good/functions/args05.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ func f(x: String, y: Int, z: Int = v(), a: [Bool] = [false]): Char def
1010
return x[0]
1111

1212
f("", 0, 4)
13-
print f("str", a=[true], y=15)
13+
print f("str", a = [true], y = 15)

test/good/functions/args06.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ func f(x': Int = 0): Bool def
33
return x' >= 0
44

55
print f(), f(3)
6-
print f(x'=-1)
6+
print f(x' = -1)

test/good/functions/args07.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ func f(x: [Float] = [0]): Void def
33
print x
44

55
f()
6-
f(x=[8, 10^^16])
6+
f(x = [8, 10^^16])

test/good/functions/args08.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ func f(s: String = "abc", n: Int): Int def
33
return s.length + n
44

55
print f("", 4)
6-
print f(n=10)
6+
print f(n = 10)

test/good/functions/variadic02.px

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ func f(a: Char, ...b: [String], c: Float, d: Int = 4): Void def
33
print a, c + d
44
print b.join()
55

6-
f('x', c=1)
7-
f('x', 'y', "abc", d=5, c=3.25)
6+
f('x', c = 1)
7+
f('x', 'y', "abc", d = 5, c = 3.25)

test/good/functions/variadic05.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ b = false
1111
f(b)
1212
print b
1313

14-
f(args=a)
14+
f(args = a)
1515
print a

test/good/functions/variadic07.px

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ func f(x: Int = 0, ...a: [String]): Int def
33
return x + a.length
44

55
print f()
6-
print f(x=1)
6+
print f(x = 1)
77
print f(5, 'x', "qwerty")
8-
print f(a=[])
9-
print f(2, a=['A'..'D'])
8+
print f(a = [])
9+
print f(2, a = ['A'..'D'])

test/good/generators/generator05.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ func f(a: Int, b: String = "", c: [Float] = []): Int... def
44
yield a + b.length + c.length
55

66
print {...f(3)}
7-
print {...f(c=[5], a=5)}
7+
print {...f(c = [5], a = 5)}

test/good/generics/complex06.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ func f<T>(x: T?): T? def
44
return null
55
return x!
66

7-
print f(3), f(x=-7.89), f(null)
7+
print f(3), f(x = -7.89), f(null)

test/good/generics/default03.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ func f<T>(x: T = 10^^15, y: T = 1f): Void def
44

55
f(3.5)
66
f()
7-
f(y=-2)
7+
f(y = -2)

test/good/generics/default04.px

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ func apply<A,B>(x: A = 0, f: A->B = _+1): B def
33
return f(x)
44

55
print apply()
6-
print apply(x=1)
7-
print apply(f=_)
8-
print apply("test", f=_.length)
6+
print apply(x = 1)
7+
print apply(f = _)
8+
print apply("test", f = _.length)

test/good/generics/default05.px

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
func apply<A,B,C>(x: A, f: A->B->C = min, y: B = 0): C def
33
return f(x, y)
44

5-
print apply(5), apply(-4, y=-3)
6-
print apply(3, max), apply(2.5, f=max, y=7.5)
7-
print apply("abc", _*_), apply("abc", _*_, y=1)
8-
print apply([true], y=[false], f=_+_)
5+
print apply(5), apply(-4, y = -3)
6+
print apply(3, max), apply(2.5, f = max, y = 7.5)
7+
print apply("abc", _*_), apply("abc", _*_, y = 1)
8+
print apply([true], y = [false], f = _+_)

test/good/generics/implicit03.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ func f(x, y = 0) def
33
print x*2 + y
44

55
f("ab", 'c')
6-
f(y=1/2, x=3e-1)
6+
f(y = 1/2, x = 3e-1)
77
f(4)

test/good/generics/variadic02.px

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ func join(...strings, sep = "") def
33
return strings.join(sep)
44

55
print join("qwe", 'r', "ty")
6-
print join('x', 'y', 'z', sep='.')
6+
print join('x', 'y', 'z', sep = '.')
77
print join()
8-
print join(sep="---")
8+
print join(sep = "---")

test/good/lambdas/partial01.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ func f(a: Int, b: Bool, c: Char, d: String = "---"): Void def
66
print a, b, c, d
77

88
call(lambda b, d: f(6, b, 'a'))
9-
call(f@(42, _, d=_, c='x'))
9+
call(f@(42, _, d = _, c = 'x'))

test/good/nullables/op14.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ a: A?
1212
print a?.f()
1313

1414
a = A()
15-
print a?.f(x=10)
15+
print a?.f(x = 10)
1616
a?.g()

test/good/strings/method03.px

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ print "abab".count('c')
77

88
print "XYZYZXYZ".find("YZ", 4)
99
print "XYZYZXYZ".find("Z", -1)
10-
print "XYZYZXYZ".find("X", start=-2)
10+
print "XYZYZXYZ".find("X", start = -2)

0 commit comments

Comments
 (0)