Skip to content
Browse files

Fixed default code compilation

  • Loading branch information...
1 parent 0b8017f commit 28776bb57cdb1dd5faf25ea52a83c88915552987 @deNULL committed
Showing with 6 additions and 4 deletions.
  1. +3 −1 index.htm
  2. +3 −3 js/assembler.js
View
4 index.htm
@@ -118,7 +118,9 @@
if (isset($_REQUEST['code'])) {
$code = $_REQUEST['code'];
}
-echo htmlspecialchars($code);?></div>
+$code = htmlspecialchars($code);
+$code = str_replace(array(" ", "\n"), array("&nbsp;", "<br/>"), $code);
+echo $code;?></div>
</div>
</div>
<div id="tab1_content">
View
6 js/assembler.js
@@ -384,7 +384,7 @@ var Assembler = {
if (line.directive == "macro") {
// #macro directive
- line.macro = text.substr(pos, end - pos).match(/^[^ (]*/);
+ line.macro = text.substr(pos, end - pos).match(/^[^\s(]*/);
if (!line.macro || line.macro[0].length == 0 || this.OP_RESERVED.indexOf(line.macro[0].toLowerCase()) > -1) {
logger(pos, "Invalid macro name: " + line.macro[0], true);
return false;
@@ -449,7 +449,7 @@ var Assembler = {
ppos = pos;
if (pos >= end) return line;
- var word = text.substr(pos, end - pos).match(/^[^ (]+/);
+ var word = text.substr(pos, end - pos).match(/^[^\s(]+/);
if (!word) {
logger(pos, "Inscrutable opcode", true);
return false;
@@ -949,7 +949,7 @@ var Assembler = {
}
return info;
}
-
+
if (info.a !== undefined) {
if (info.a.expr !== undefined) {
var a = this.resolveOperand(info.a, labels, logger);

0 comments on commit 28776bb

Please sign in to comment.
Something went wrong with that request. Please try again.