GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Extends AST type replacements with remaining primitive types. · hellcoderz/java2python@764be76

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • java2python/config
    • default.py
  • test
    • BasicTypes1.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎java2python/config/default.py‎

Copy file name to clipboardExpand all lines: java2python/config/default.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,13 @@
148148
(Type('TRUE'), transform.true2True),
149149
(Type('IDENT'), transform.keywordSafeIdent),
150150

151+
(Type('FLOATING_POINT_LITERAL'), transform.syntaxSafeFloatLiteral),
151152

152-
(Type('FLOATING_POINT_LITERAL'),
153-
transform.syntaxSafeFloatLiteral),
154-
155-
(Type('TYPE') > Type('BOOLEAN'),
156-
transform.typeSub),
157-
158-
(Type('TYPE') > Type('DOUBLE'),
159-
transform.typeSub),
153+
(Type('TYPE') > Type('BOOLEAN'), transform.typeSub),
154+
(Type('TYPE') > Type('BYTE'), transform.typeSub),
155+
(Type('TYPE') > Type('CHAR'), transform.typeSub),
156+
(Type('TYPE') > Type('DOUBLE'), transform.typeSub),
157+
(Type('TYPE') > Type('SHORT'), transform.typeSub),
160158

161159
(Type('TYPE') > Type('QUALIFIED_TYPE_IDENT') > Type('IDENT'),
162160
transform.typeSub),
@@ -202,6 +200,8 @@
202200
'boolean' : 'bool',
203201
'IndexOutOfBoundsException' : 'IndexError',
204202
'Integer' : 'int',
203+
'short' : 'int',
204+
'byte' : 'int',
205205
'Object' : 'object',
206206
'String' : 'str',
207207
'char' : 'str',
Collapse file

‎test/BasicTypes1.java‎

Copy file name to clipboard
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class BasicTypes1 {
2+
char chr;
3+
byte byt;
4+
short shr;
5+
int in_t;
6+
long lng;
7+
float flt;
8+
double dbl;
9+
10+
public static void main(String[] args) {
11+
BasicTypes1 bt1 = new BasicTypes1();
12+
System.out.println(bt1.byt);
13+
System.out.println(bt1.shr);
14+
System.out.println(bt1.in_t);
15+
}
16+
17+
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.