diff options
| author | Anthony Towns <aj@erisian.com.au> | 2010-09-05 20:49:34 +1000 |
|---|---|---|
| committer | Anthony Towns <aj@erisian.com.au> | 2010-09-05 20:49:34 +1000 |
| commit | ddc83b4c401be965a9947782becf20cc8c54e6a2 (patch) | |
| tree | 3fa313271f3c3e42ca9cc76f8cca1937067ee907 /ao-tools/altosui/AltosParse.java | |
| parent | afea6c264c5ebf12f1d629bd4bc724da86d11b7a (diff) | |
| parent | 3d49d5f69b41c27003dbc5ccf1899014bd13bd99 (diff) | |
Merge branch 'master' of git://git.gag.com/fw/altos
Diffstat (limited to 'ao-tools/altosui/AltosParse.java')
| -rw-r--r-- | ao-tools/altosui/AltosParse.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ao-tools/altosui/AltosParse.java b/ao-tools/altosui/AltosParse.java index a60dc694..4d82de78 100644 --- a/ao-tools/altosui/AltosParse.java +++ b/ao-tools/altosui/AltosParse.java @@ -20,10 +20,16 @@ package altosui; import java.text.*; import java.lang.*; +import altosui.Altos; + public class AltosParse { + static boolean isdigit(char c) { + return '0' <= c && c <= '9'; + } + static int parse_int(String v) throws ParseException { try { - return Integer.parseInt(v); + return Altos.fromdec(v); } catch (NumberFormatException e) { throw new ParseException("error parsing int " + v, 0); } @@ -31,7 +37,7 @@ public class AltosParse { static int parse_hex(String v) throws ParseException { try { - return Integer.parseInt(v, 16); + return Altos.fromhex(v); } catch (NumberFormatException e) { throw new ParseException("error parsing hex " + v, 0); } |
