Skip to content

Commit

Permalink
Added a check in isDirective whether str is longer than 1 char
Browse files Browse the repository at this point in the history
  • Loading branch information
FlatAssembler committed Sep 26, 2024
1 parent 71724e3 commit 7c5ea3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function isDirective(str) {
for (const directive of preprocessor)
if (RegExp("^" + directive + "$", "i").test(str))
return true;
if (/:$/.test(str))
if (/:$/.test(str) && str.length > 1) // To the core of the assembler, labels
// are preprocessor directives.
return true;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "picoblaze-simulator-js",
"version": "4.7.0",
"version": "4.7.1",
"description": "A PicoBlaze simulator in JS",
"main": "app.js",
"scripts": {
Expand Down

0 comments on commit 7c5ea3c

Please sign in to comment.