@@ -44,7 +44,7 @@ def transform_source( source, strip=False ):
4444 if nextchar .strip (): break
4545 j += 1
4646
47- if a and char == ']' and j == i + 1 and nextchar != None and nextchar in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' :
47+ if a and char == ']' and j == i + 1 and nextchar != None and nextchar in '[ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' :
4848 assert '[' in a
4949 gotype = []
5050 b = a .pop ()
@@ -54,7 +54,10 @@ def transform_source( source, strip=False ):
5454 gotype .reverse ()
5555 gotype = '' .join (gotype )
5656 if not gotype :
57- a .append ('__go__array__(' )
57+ if nextchar == '[' :
58+ a .append ('__go__array__<<' )
59+ else :
60+ a .append ('__go__array__(' )
5861 elif gotype .isdigit ():
5962 a .append ('__go__arrayfixed__(%s,' % gotype )
6063 else :
@@ -69,6 +72,10 @@ def transform_source( source, strip=False ):
6972 elif hit_go_typedef and char == '{' :
7073 a .append (')<<{' )
7174 hit_go_typedef = False
75+ elif hit_go_typedef and char == ',' :
76+ a .append ('),' )
77+ hit_go_typedef = False
78+
7279
7380 elif a and char in __whitespace :
7481 b = '' .join (a )
@@ -153,8 +160,15 @@ def transform_source( source, strip=False ):
153160 break
154161 indent = '' .join (indent )
155162 output .append ( indent + '@returns(%s)' % rtype )
156- elif c .startswith ('import ' ) and '-' in c :
157- c = c .replace ('-' , '__DASH__' )
163+
164+ if c .startswith ('import ' ):
165+ if '-' in c :
166+ c = c .replace ('-' , '__DASH__' )
167+ if '/' in c :
168+ c = c .replace ('/' , '__SLASH__' )
169+ if '"' in c :
170+ c = c .replace ('"' , '' )
171+
158172
159173 if ' new ' in c :
160174 c = c .replace (' new ' , ' __new__>>' )
@@ -430,6 +444,8 @@ def f(*args:int, **kwargs:int) ->int:
430444
431445a = []int(x for x in range(3))
432446
447+ y = go.make([]float64, 1000)
448+
433449'''
434450
435451if __name__ == '__main__' :
0 commit comments