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 {
442
442
443
443
foreach (i, ref array ; arrays) {
444
444
if (useGas) {
445
- output ~= format(" __array_%d: skip %d\n " , i, array.Size());
445
+ output ~= format(" __array_%d: . skip %d\n " , i, array.Size());
446
446
}
447
447
else {
448
448
output ~= format(" __array_%d: resb %d\n " , i, array.Size());
@@ -454,7 +454,7 @@ class BackendX86_64 : CompilerBackend {
454
454
}
455
455
456
456
// create array source
457
- output ~= " section .text\n " ;
457
+ output ~= format( " %ssection .text\n " , useGas? " . " : " " ) ;
458
458
foreach (i, ref array ; arrays) {
459
459
output ~= format(" __array_src_%d: " , i);
460
460
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import std.format;
6
6
import std.string ;
7
7
import std.algorithm ;
8
8
import core.stdc.stdlib : exit;
9
+ import callisto.util;
9
10
10
11
// this will eventually be used for generating ASMMod files
11
12
// but for now i'm using it because GNU Assembler is the worst piece of software to
@@ -51,6 +52,22 @@ class Output {
51
52
output ~= macros[macroName];
52
53
i = macroName.length + i + 2 ;
53
54
}
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
+ }
54
71
else {
55
72
output ~= text[i];
56
73
}
You can’t perform that action at this time.
0 commit comments