mirror of
https://github.com/ksherlock/x65.git
synced 2025-01-15 17:31:19 +00:00
Fixed macro issue that defines a label ending with :
This commit is contained in:
parent
d5080e925d
commit
2243803116
@ -74,7 +74,7 @@ goto exit
|
||||
:x65macro_test_pass
|
||||
|
||||
echo x65 Scope Test >>results\unittest.txt
|
||||
..\bin\x64\x65 x65scope.s results\x65scope.prg -lst -sym results\x65scope.sym
|
||||
..\bin\x64\x65 x65scope.s results\x65scope.prg -lst -sym results\x65scope.sym >>results\unittest.txt
|
||||
if %errorlevel% GTR 0 goto x65scope_test_fail
|
||||
fc /B compare\x65scope.prg results\x65scope.prg >>results\unittest.txt
|
||||
if %errorlevel% GTR 0 goto x65scope_test_fail
|
||||
|
@ -1,3 +1,16 @@
|
||||
; Test macro defining a label
|
||||
macro LabelMacro( lbl, str, len ) {
|
||||
lbl:
|
||||
TEXT str
|
||||
const len = * - lbl
|
||||
}
|
||||
|
||||
dc.w Label1
|
||||
dc.b Label1_Len
|
||||
|
||||
|
||||
LabelMacro Label1, "Hey!", Label1_Len
|
||||
|
||||
include "../macros/x65macro.i"
|
||||
|
||||
sec
|
||||
|
3
x65.cpp
3
x65.cpp
@ -868,6 +868,7 @@ static const int nCPUs = sizeof(aCPUs) / sizeof(aCPUs[0]);
|
||||
// hardtexted strings
|
||||
static const strref c_comment("//");
|
||||
static const strref word_char_range("!0-9a-zA-Z_@$!#");
|
||||
static const strref macro_arg_bookend("!0-9a-zA-Z_@$!.");
|
||||
static const strref label_end_char_range("!0-9a-zA-Z_@$!.!:");
|
||||
static const strref label_end_char_range_merlin("!0-9a-zA-Z_@$]:?");
|
||||
static const strref filename_end_char_range("!0-9a-zA-Z_!@#$%&()/\\-.");
|
||||
@ -2934,7 +2935,7 @@ StatusCode Asm::BuildMacro(Macro &m, strref arg_list) {
|
||||
macexp.copy(macro_src);
|
||||
while (strref param = params.split_token_trim(token_macro)) {
|
||||
strref a = arg_list.split_token_trim(token);
|
||||
macexp.replace_bookend(param, a, label_end_char_range);
|
||||
macexp.replace_bookend(param, a, macro_arg_bookend);
|
||||
}
|
||||
PushContext(m.source_name, macexp.get_strref(), macexp.get_strref());
|
||||
return STATUS_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user