Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d1e103

Browse files
author
Troy Melhase
committed
Extends typeSubs map with types listed in natural#9.
1 parent a82653a commit 0d1e103

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

java2python/config/default.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@
154154
(Type('TYPE') > Type('BYTE'), transform.typeSub),
155155
(Type('TYPE') > Type('CHAR'), transform.typeSub),
156156
(Type('TYPE') > Type('DOUBLE'), transform.typeSub),
157+
(Type('TYPE') > Type('INT'), transform.typeSub),
157158
(Type('TYPE') > Type('SHORT'), transform.typeSub),
159+
(Type('TYPE') > Type('LONG'), transform.typeSub),
160+
(Type('TYPE') > Type('DOUBLE'), transform.typeSub),
158161

159162
(Type('TYPE') > Type('QUALIFIED_TYPE_IDENT') > Type('IDENT'),
160163
transform.typeSub),
@@ -204,13 +207,28 @@
204207
typeSubs = {
205208
'Boolean' : 'bool',
206209
'boolean' : 'bool',
207-
'IndexOutOfBoundsException' : 'IndexError',
208-
'Integer' : 'int',
209-
'short' : 'int',
210+
211+
'Byte' : 'int',
210212
'byte' : 'int',
211-
'Object' : 'object',
212-
'String' : 'str',
213+
214+
'Char' : 'str',
213215
'char' : 'str',
216+
217+
'Integer' : 'int',
218+
'int' : 'int',
219+
220+
'Short' : 'int',
221+
'short' : 'int',
222+
223+
'Long' : 'long',
224+
'long' : 'long',
225+
226+
'Double' : 'float',
214227
'double' : 'float',
228+
229+
'String' : 'str',
215230
'java.lang.String' : 'str',
216-
}
231+
232+
'Object' : 'object',
233+
'IndexOutOfBoundsException' : 'IndexError',
234+
}

0 commit comments

Comments
 (0)