Skip to content

Commit c302d57

Browse files
author
Randall C. O'Reilly
committed
updates from me
1 parent 26f75ab commit c302d57

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ The `-gogi` flag generates [GoGi](https:://github.com/goki/gi) specific Python c
1919

2020
* switch -> ifs.. -- grab switch expr and put into each if
2121

22+
* string .contains -> "el" in str
23+
24+
* map access with 2 vars = if el in map: mv = map[el]
25+
26+
* for range with 2 vars = enumerate(slice)
2227

pyedits.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ func pyEditsReplace(lines [][]byte) {
156156
goslicefloat32 := []byte("go.Slice_float32([")
157157
stringsdot := []byte("strings.")
158158
copyp := []byte("copy(")
159+
eqgonil := []byte(" == go.nil")
160+
eqgonil0 := []byte(" == 0")
161+
negonil := []byte(" != go.nil")
162+
negonil0 := []byte(" != 0")
159163

160164
gopy := (printerMode&pyprint.GoPy != 0)
161165
// gogi := (printerMode&pyprint.GoGi != 0)
@@ -165,6 +169,8 @@ func pyEditsReplace(lines [][]byte) {
165169
ln = bytes.Replace(ln, float32p, floatp, -1)
166170
ln = bytes.Replace(ln, stringp, strp, -1)
167171
ln = bytes.Replace(ln, forblank, fornoblank, -1)
172+
ln = bytes.Replace(ln, eqgonil, eqgonil0, -1)
173+
ln = bytes.Replace(ln, negonil, negonil0, -1)
168174

169175
if bytes.Contains(ln, fmtSprintf) {
170176
if bytes.Contains(ln, []byte("%")) {

0 commit comments

Comments
 (0)