File tree Expand file tree Collapse file tree 2 files changed +51
-3
lines changed Expand file tree Collapse file tree 2 files changed +51
-3
lines changed Original file line number Diff line number Diff line change 1+ # Useful commands:
2+ # "visualize value"
3+ # "visualize value iteration"
4+ # "take value"
5+ # "chuck value"
6+ # "chuck every value"
17
28# the argument value "True" that is part of "b=True"
39# is "value" scope
@@ -19,12 +25,28 @@ def func(b=True, c=True):
1925val = 1.5
2026val /= 25
2127
22- val1 , val2 = 0 , 5
28+ val1 , val2 = 0 , 5
29+ val1 = 0 , val2 = 5
2330val1 = val2
2431
32+ def my_funk (value : str ) -> str :
33+ print (value )
34+
35+ # we can say "change every value" to allow modifying all the values in one go
36+ def foo ():
37+ a = 0
38+ b = 1
39+ c = 2
40+
41+ # But we don't support outside of a function yet
42+ a = 0
43+ b = 1
44+ c = 2
2545
2646# values of a Python "dictionary" are "value" scope
47+ # we can say "chuck every value" to convert the dict into a set
2748d1 = {"a" : 1 , "b" : 2 , "c" : 3 }
49+
2850_ = {value : key for (key , value ) in d1 .items ()}
2951
3052# complex ones
Original file line number Diff line number Diff line change 135135(module) @statement.iteration
136136(module) @namedFunction.iteration @functionName.iteration
137137(class_definition) @namedFunction.iteration @functionName.iteration
138- (_
139- body: (_) @statement.iteration
138+
139+ ;; _ = {value: key for (key, value) in d1.items()}
140+ ;; **********
141+ ;; (_
142+ ;; body: (_) @statement.iteration @value.iteration
143+ ;; )
144+
145+ ;; def foo():
146+ ;; a = 0
147+ ;; *****
148+ ;; b = 1
149+ ;; *****
150+ ;; c = 2
151+ ;; *****
152+ (block) @statement.iteration @value.iteration
153+
154+ ;; {"a": 1, "b": 2, "c": 3}
155+ ;; **********************
156+ (dictionary
157+ "{" @value.iteration.start.endOf
158+ "}" @value.iteration.end.startOf
159+ )
160+
161+ ;; def func(a=0, b=1):
162+ ;; ********
163+ (parameters
164+ "(" @value.iteration.start.endOf
165+ ")" @value.iteration.end.startOf
140166)
You can’t perform that action at this time.
0 commit comments