my_basic
my_basic copied to clipboard
REM and ENDREM as comment blocks
I thought it would be more consistent to just use REM
and ENDREM
as comment blocks instead of '[ and '] which looks more like arrays. The syntax already has REM as a single line comment.
If there's no plan to change this, perhaps you could provide some pointers on how to do this update.
Reference: https://picaxe.com/basic-commands/directives/hash-endrem/
- Change https://github.com/paladin-t/my_basic/blob/67ef347023fccdeae1081fce9c86d0bf176997a1/core/my_basic.c#L773-#L774 to
MBCONST static const char _MULTI_LINE_COMMENT_PREFIX[] = "'REM";
MBCONST static const char _MULTI_LINE_COMMENT_POSTFIX[] = "'ENDREM";
to use 'REM
and 'ENDREM
.
- Change the comparison from
c == _MULTI_LINE_COMMENT_PREFIX[context->multi_line_comment_count++]
...
c == _MULTI_LINE_COMMENT_POSTFIX[context->multi_line_comment_count++]
to
toupper(c) == _MULTI_LINE_COMMENT_PREFIX[context->multi_line_comment_count++]
...
toupper(c) == _MULTI_LINE_COMMENT_POSTFIX[context->multi_line_comment_count++]
for case-insensitive.
- Change the symbols in 1. to
#REM
and#ENDREM
, then change https://github.com/paladin-t/my_basic/blob/67ef347023fccdeae1081fce9c86d0bf176997a1/core/my_basic.c#L5053-#L5055 to
static bool_t _is_comment_char(char c) {
return (c == '\'') || (c == '#');
}
to use #REM
and #ENDREM
instead. Note that this also enables #
for a single-line comment.
Thanks, but I was aiming for not using symbols before the keyword for this change so without ' or # just plain REM
and ENDREM
.