mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-20 11:06:46 +00:00
Fixes #112
This commit is contained in:
parent
cde03af8af
commit
cfb02869bb
@ -54,7 +54,7 @@ public class Assembler {
|
|||||||
*/
|
*/
|
||||||
private static String removeLabel(String line) {
|
private static String removeLabel(String line) {
|
||||||
|
|
||||||
return line.replaceAll("\\b\\w*\\b:", "");
|
return line.replaceAll("^\\s*\\b\\w*\\b:", "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ public class Assembler {
|
|||||||
line = removeComment(line);
|
line = removeComment(line);
|
||||||
|
|
||||||
//Check for labels
|
//Check for labels
|
||||||
Pattern pattern = Pattern.compile("\\b\\w*\\b:");
|
Pattern pattern = Pattern.compile("^\\s*\\b\\w*\\b:");
|
||||||
Matcher matcher = pattern.matcher(line);
|
Matcher matcher = pattern.matcher(line);
|
||||||
|
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user