introduction of macroArg command#1481
introduction of macroArg command#1481mhantsch wants to merge 160 commits intoUltimateHackingKeyboard:masterfrom
Conversation
Macro args declarations
attempt at macroArg parser
improved error messages
sync with origin
sync to origin
…eyboard/fix/gperf-arg-expansion Fix gperf token vs argument expansion bug.
resync with origin
sync from origin
…firmware into macroArgs-declarations
…ut already. Also, moving additional bit into existing bitfield in macro_state_t to avoid additional alignment bytes to next 4-aligned boundary.
…firmware into macroArgs-declarations
Macro args declarations
Merge branch 'UltimateHackingKeyboard:master' into macroArgs-declarations
…firmware into macroArgs-declarations
Macro args declarations
user manual update
refactor goto
Macro args declarations
improved safety of context boundary check
| //skip labels | ||
| ConsumeAnyToken(ctx); | ||
| if (ctx->at == ctx->end && IsEnd(ctx)) { | ||
| // TODO: why not just IsEnd() in this condition? |
kareltucek
left a comment
There was a problem hiding this comment.
Just a quick peek and some replies to some questions.
I am generally missing documentation, but we can talk about all that I guess.
|
|
||
| macro_result_t Macros_ProcessSetLedTxtCommand(parser_context_t* ctx) | ||
| { | ||
| // TODO: I guess ATTR_UNUSED is not correct here? |
There was a problem hiding this comment.
Indeed probably no longer needed.
| const char* end1 = IdentifierEnd(ctx); | ||
| const lookup_record_t* record = lookup(0, lookup_size-1, ctx->at, end1); | ||
|
|
||
| // TODO: WHY this second attempt with dot?? |
There was a problem hiding this comment.
Because there are abbreviations like rightModule.leftButton.
| } | ||
|
|
||
| CTX_COPY(bakCtx, *ctx); | ||
| // TODO: Is this needed at all? Looks like something left over |
There was a problem hiding this comment.
Probably left over, yes.
| { | ||
| // TODO: would there be any way to trace the current position down the | ||
| // context stack and report it here? | ||
| Macros_ReportErrorNum("Unexpected variable type:", type, NULL); |
There was a problem hiding this comment.
You mean the expansion stack? That should be reported automatically.
There was a problem hiding this comment.
I mean, if the context is provided. Migrate it to a more modern Macros_Report.* format that takes ctx pointer.
| } string_type_t; | ||
| // new code: | ||
|
|
||
| static char consumeExpressionCharOfInt(const macro_variable_t* variable, uint16_t* idx); |
There was a problem hiding this comment.
Do I understand correctly that you have here just copied the code so that you have an original reference for coding?
macroArgdeclaration command, introduction of argument types, parsing of$macroArg.nameand$macroArg.number, processing of$macroArgvalues for typed values ofint,float,bool,string,keyidand (modded)scancode(=shortcut), in addition to backwards-compatible behaviour foranytype.¯oArgsyntax is left unmodified by this PR.The PR also contains some cleanup / refactoring (mainly in str_utils) but also a few other places to improve consistent code style and ensure consistent safety checks of context bounds.
User manual and reference docs have been updated as well.