Lines Matching refs:assignment
1 # Tests of Starlark assignment.
5 # tuple assignment
17 (a, b, c) = 1 ### "got int in sequence assignment"
27 () = 1 ### "got int in sequence assignment"
33 # list assignment
45 [a, b, c] = 1 ### "got int in sequence assignment"
55 [] = 1 ### "got int in sequence assignment"
61 # list-tuple assignment
93 # misc assignment
96 def assignment():
110 assignment()
113 # augmented assignment
153 # The right side is evaluated before the left in an ordinary assignment.
162 # Left side is evaluated first (and only once) in an augmented assignment.
168 # global referenced before assignment
171 return g ### "global variable g referenced before assignment"
199 print(x) # dynamic error: local var referenced before assignment
203 assert.fails(use_before_def, 'local variable x referenced before assignment')
211 x += [4] ### "local variable x referenced before assignment"
217 z += 3 ### "global variable z referenced before assignment"
229 assert.fails(lambda: tuple, "global variable tuple referenced before assignment")
253 _ = [x for _ in [3] for x in x] ### "local variable x referenced before assignment"
275 # assignment to/from fields.
293 # destucturing assignment in a for loop.
311 # parenthesized LHS in augmented assignment (success)
320 # parenthesized LHS in augmented assignment (error)
322 (a) += 5 ### "global variable a referenced before assignment"
338 _ = assert ### "global variable assert referenced before assignment"
342 _ = assert ### "local variable assert referenced before assignment"