File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -442,7 +442,7 @@ class BackendX86_64 : CompilerBackend {
442442
443443 foreach (i, ref array ; arrays) {
444444 if (useGas) {
445- output ~= format(" __array_%d: skip %d\n " , i, array.Size());
445+ output ~= format(" __array_%d: . skip %d\n " , i, array.Size());
446446 }
447447 else {
448448 output ~= format(" __array_%d: resb %d\n " , i, array.Size());
@@ -454,7 +454,7 @@ class BackendX86_64 : CompilerBackend {
454454 }
455455
456456 // create array source
457- output ~= " section .text\n " ;
457+ output ~= format( " %ssection .text\n " , useGas? " . " : " " ) ;
458458 foreach (i, ref array ; arrays) {
459459 output ~= format(" __array_src_%d: " , i);
460460
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import std.format;
66import std.string ;
77import std.algorithm ;
88import core.stdc.stdlib : exit;
9+ import callisto.util;
910
1011// this will eventually be used for generating ASMMod files
1112// but for now i'm using it because GNU Assembler is the worst piece of software to
@@ -51,6 +52,22 @@ class Output {
5152 output ~= macros[macroName];
5253 i = macroName.length + i + 2 ;
5354 }
55+ else if (text[i .. $].startsWith(" ${" )) {
56+ if (text[i .. $].length == 2 ) {
57+ Error(text, " Incomplete sanitise statement" );
58+ }
59+
60+ string input = text[i + 2 .. $];
61+
62+ if (! input.canFind(' }' )) {
63+ Error(text, " Incomplete sanitise statement" );
64+ }
65+
66+ input = input[0 .. input.indexOf(' }' )];
67+
68+ output ~= input.Sanitise();
69+ i = input.length + i + 2 ;
70+ }
5471 else {
5572 output ~= text[i];
5673 }
You can’t perform that action at this time.
0 commit comments