File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
antlr4/convex/core/json/reader/antlr Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 63
63
;
64
64
65
65
fragment ESC
66
- : ' \\ ' ([" \\ /bfnrt ] | UNICODE)
66
+ : ' \\ ' ([" \\ /bfnrtv0 ] | UNICODE)
67
67
;
68
68
69
69
fragment UNICODE
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ public AType getType() {
93
93
@ Override
94
94
public boolean equals (ACell o ) {
95
95
if (o ==this ) return true ;
96
- if (o instanceof Address ) {
97
- return value ==(( Address ) o ) .value ;
96
+ if (o instanceof Address addr ) {
97
+ return value ==addr .value ;
98
98
} else {
99
99
return Cells .equalsGeneric (this , o );
100
100
}
@@ -158,14 +158,13 @@ public static Address parse(String s) {
158
158
*/
159
159
public static Address parse (Object o ) {
160
160
if (o ==null ) return null ;
161
- if (o instanceof ACell ) {
162
- Address add =RT .castAddress (( ACell ) o );
161
+ if (o instanceof ACell cell ) {
162
+ Address add =RT .castAddress (cell );
163
163
if (add !=null ) return add ;
164
- o =RT .jvm ((ACell )o ); // convert to JVM type
164
+ o =RT .jvm ((ACell )o ); // convert to JVM type, last try (e.g. BigInteger)
165
165
}
166
- if (o instanceof String ) return parse ((String )o );
167
- if (o instanceof Number ) {
168
- Number n =(Number )o ;
166
+ if (o instanceof String s ) return parse (s );
167
+ if (o instanceof Number n ) {
169
168
long l =n .longValue ();
170
169
if (l ==n .doubleValue ()) return Address .create (l );
171
170
}
You can’t perform that action at this time.
0 commit comments