diff --git a/dist/basicv2.jar b/dist/basicv2.jar index e5a8b415..0448fa43 100644 Binary files a/dist/basicv2.jar and b/dist/basicv2.jar differ diff --git a/src/main/java/com/sixtyfour/cbmnative/mos6502/AbstractTransformer.java b/src/main/java/com/sixtyfour/cbmnative/mos6502/AbstractTransformer.java index 038a36ab..6c68f8d0 100644 --- a/src/main/java/com/sixtyfour/cbmnative/mos6502/AbstractTransformer.java +++ b/src/main/java/com/sixtyfour/cbmnative/mos6502/AbstractTransformer.java @@ -73,7 +73,7 @@ protected void addLabels(List res, String[] labels) { res.add(label); } } - + protected void addMemoryLocations(List res) { String[] labels = Loader.loadProgram(TransformerX16.class.getResourceAsStream("/rommap/memloc-c64.map")); addLabels(res, labels); diff --git a/src/main/java/com/sixtyfour/cbmnative/shell/MoSpeedCL.java b/src/main/java/com/sixtyfour/cbmnative/shell/MoSpeedCL.java index c406d730..73bc0334 100644 --- a/src/main/java/com/sixtyfour/cbmnative/shell/MoSpeedCL.java +++ b/src/main/java/com/sixtyfour/cbmnative/shell/MoSpeedCL.java @@ -124,7 +124,7 @@ public static void main(String[] args) { PlatformProvider platform = new Platform64(); String appendix = ".prg"; - boolean multiByteTokens=false; + boolean multiByteTokens = false; if (cmds.containsKey("platform")) { String pl = cmds.get("platform"); if (pl.equalsIgnoreCase("c64")) { @@ -137,7 +137,7 @@ public static void main(String[] args) { platform = new PlatformX16(); Basic.registerExtension(new X16Extensions()); cfg.setNonDecimalNumbersAware(true); - multiByteTokens=true; + multiByteTokens = true; appendix = ".prg"; } else if (pl.equalsIgnoreCase("ps")) { platform = new PlatformPs(); diff --git a/src/main/java/com/sixtyfour/elements/Variable.java b/src/main/java/com/sixtyfour/elements/Variable.java index 09f80c1b..c39b263e 100644 --- a/src/main/java/com/sixtyfour/elements/Variable.java +++ b/src/main/java/com/sixtyfour/elements/Variable.java @@ -94,14 +94,9 @@ public Variable(String name, Object value) { findType(c); if (type == null) { - int pos = woa.indexOf("{"); - if (pos != -1) { - // This is trying to detect the type of something like L${T4}, which actually shouldn't occur - // in the first place, but for some reason still does. - c = woa.substring(pos - 1, pos).charAt(0); - findType(c); - } - if (type == null) { + if (!Character.isAlphabetic(c) && !Character.isDigit(c)) { + throw new RuntimeException("Syntax error: " + name + "/" + woa); + } else { throw new RuntimeException("Unknown variable type for: " + name + "/" + woa); } } diff --git a/src/main/java/com/sixtyfour/extensions/x16/functions/Joy.java b/src/main/java/com/sixtyfour/extensions/x16/functions/Joy.java index d9b45fba..689bde40 100644 --- a/src/main/java/com/sixtyfour/extensions/x16/functions/Joy.java +++ b/src/main/java/com/sixtyfour/extensions/x16/functions/Joy.java @@ -68,9 +68,13 @@ public String toCode(Machine machine) { public int getParameterCount() { return 1; } - - /* (non-Javadoc) - * @see com.sixtyfour.elements.functions.AbstractFunction#addNativeFunctionCall(java.util.List) + + /* + * (non-Javadoc) + * + * @see + * com.sixtyfour.elements.functions.AbstractFunction#addNativeFunctionCall(java. + * util.List) */ @Override public boolean addNativeFunctionCall(List code) { diff --git a/src/main/java/com/sixtyfour/parser/cbmnative/UnTokenizer.java b/src/main/java/com/sixtyfour/parser/cbmnative/UnTokenizer.java index cf455058..8f1ea881 100644 --- a/src/main/java/com/sixtyfour/parser/cbmnative/UnTokenizer.java +++ b/src/main/java/com/sixtyfour/parser/cbmnative/UnTokenizer.java @@ -96,7 +96,7 @@ public class UnTokenizer { this.put(201, "RIGHT$"); this.put(202, "MID$"); this.put(203, "GO"); - + // Add X16-Tokens to the mix... this.putAll(X16Extensions.getTokens()); } @@ -138,18 +138,18 @@ public List getText(byte[] program, boolean multiByte) { if (c == '"') { inString = !inString; } - if (b < 128 || inString || (b > 203 && (!multiByte || b!=206))) { + if (b < 128 || inString || (b > 203 && (!multiByte || b != 206))) { if (inString && isSpecialChar(c)) { line.append(ControlCodes.getPlaceHolder(b)); } else { line.append(convertChar(c)); } } else { - String token = TOKENS.get(b); - if (multiByte && b==206) { - int mb = b*256+(program[(addr++) - start] & 0xff); - token=TOKENS.get(mb); - } + String token = TOKENS.get(b); + if (multiByte && b == 206) { + int mb = b * 256 + (program[(addr++) - start] & 0xff); + token = TOKENS.get(mb); + } if (token == null) { throw new RuntimeException("Unknown token: " + b); } diff --git a/src/main/java/com/sixtyfour/util/rommap/CallMapper.java b/src/main/java/com/sixtyfour/util/rommap/CallMapper.java index b7823989..d4e5dc3d 100644 --- a/src/main/java/com/sixtyfour/util/rommap/CallMapper.java +++ b/src/main/java/com/sixtyfour/util/rommap/CallMapper.java @@ -142,7 +142,7 @@ public static Mapping mapCalls(CompilerConfig config, boolean verbose) { } mappedCalls.put(uLabel, "$" + newAddr.toUpperCase(Locale.ENGLISH)); } - + if (verbose) { Logger.log("---------------------------------------------------------"); } diff --git a/src/main/java/com/sixtyfour/util/rommap/MapLoader.java b/src/main/java/com/sixtyfour/util/rommap/MapLoader.java index dde5cdba..be0333c3 100644 --- a/src/main/java/com/sixtyfour/util/rommap/MapLoader.java +++ b/src/main/java/com/sixtyfour/util/rommap/MapLoader.java @@ -51,14 +51,14 @@ public static Map getRomCalls(InputStream file) { String[] lines = Loader.loadProgram(file); for (String line : lines) { String[] parts = line.split("="); - if (parts.length<2) { + if (parts.length < 2) { continue; } String label = parts[0].trim(); String addr = parts[1].trim(); - int pos=addr.indexOf(";"); - if (pos!=-1) { - addr=addr.substring(0, pos).trim(); + int pos = addr.indexOf(";"); + if (pos != -1) { + addr = addr.substring(0, pos).trim(); } if (addr.startsWith("$")) { addr = addr.substring(1);