Skip to content

Write values to register#7

Merged
f1ammable merged 10 commits intomainfrom
feature/write-registers
Mar 23, 2026
Merged

Write values to register#7
f1ammable merged 10 commits intomainfrom
feature/write-registers

Conversation

@f1ammable
Copy link
Copy Markdown
Owner

@f1ammable f1ammable commented Mar 23, 2026

Also refactored some bits of the command parser

  • Subcommand handling is now moved to a parent class, no longer needing to override Callable::call with the same if statements
  • Properly handle hex literals in the scanner, no longer needing to write out addresses as strings ("0x10000")
  • Subcommands now take their arguments in the form of std::vector<Object>& args with extraction helpers in src/cmd/util.hpp with detail::AsString and detail::AsU64
  • Subcommands no longer need to check for a running/valid target, that's been moved into a lambda wrapper

@github-actions
Copy link
Copy Markdown

Code Coverage Report

### Per-File Coverage Summary
Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cmd/callable.hpp                   17                 4    76.47%           5                 0   100.00%          22                 1    95.45%           8                 5    37.50%
cmd/environment.cpp                19                 0   100.00%           5                 0   100.00%          41                 0   100.00%          10                 0   100.00%
cmd/environment.hpp                 2                 0   100.00%           1                 0   100.00%           9                 0   100.00%           0                 0         -
cmd/expr.hpp                       38                 3    92.11%          25                 3    88.00%          64                 7    89.06%           2                 0   100.00%
cmd/interpreter.cpp                55                 2    96.36%          18                 0   100.00%         147                 5    96.60%          46                 3    93.48%
cmd/object.hpp                     25                 1    96.00%          17                 1    94.12%         120                 2    98.33%           2                 0   100.00%
cmd/parser.cpp                    102                 2    98.04%          21                 0   100.00%         144                 0   100.00%          62                 6    90.32%
cmd/parser.hpp                     19                 0   100.00%           1                 0   100.00%           3                 0   100.00%          16                 0   100.00%
cmd/scanner.cpp                    87                 3    96.55%          12                 0   100.00%         130                 9    93.08%          74                 6    91.89%
cmd/scanner.hpp                     1                 0   100.00%           1                 0   100.00%           4                 0   100.00%           0                 0         -
cmd/stdlib.hpp                    116                93    19.83%          32                16    50.00%         194               138    28.87%          54                51     5.56%
cmd/stmnt.hpp                      13                 1    92.31%           8                 1    87.50%          14                 1    92.86%           0                 0         -
cmd/subcommand.hpp                  7                 0   100.00%           2                 0   100.00%          10                 0   100.00%           2                 0   100.00%
cmd/token.hpp                       4                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
cmd/util.cpp                       32                22    31.25%           4                 3    25.00%          54                39    27.78%          28                24    14.29%
cmd/util.hpp                       18                18     0.00%           2                 2     0.00%          22                22     0.00%          10                10     0.00%
core/context.hpp                    3                 2    33.33%           3                 2    33.33%           8                 7    12.50%           0                 0         -
core/macho/macho.hpp                2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
core/platform.hpp                  16                15     6.25%           7                 6    14.29%          51                48     5.88%          11                11     0.00%
core/target.cpp                    23                23     0.00%           6                 6     0.00%          59                59     0.00%          12                12     0.00%
core/target.hpp                     5                 5     0.00%           5                 5     0.00%           5                 5     0.00%           0                 0         -
core/util.hpp                       7                 7     0.00%           7                 7     0.00%         104               104     0.00%           0                 0         -
error.cpp                           6                 3    50.00%           6                 3    50.00%          24                12    50.00%           0                 0         -
error.hpp                           8                 0   100.00%           2                 0   100.00%          21                 0   100.00%           0                 0         -
expected.hpp                       13                13     0.00%           9                 9     0.00%           9                 9     0.00%           0                 0         -
formatter.hpp                      58                 0   100.00%           9                 0   100.00%          99                 2    97.98%           2                 0   100.00%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             696               219    68.53%         211                66    68.72%        1363               472    65.37%         339               128    62.24%

Detailed HTML report available in artifacts.

@f1ammable f1ammable merged commit a427aab into main Mar 23, 2026
1 check passed
@f1ammable f1ammable deleted the feature/write-registers branch March 23, 2026 03:38
@github-actions
Copy link
Copy Markdown

Code Coverage Report

### Per-File Coverage Summary
Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cmd/callable.hpp                   17                 4    76.47%           5                 0   100.00%          22                 1    95.45%           8                 5    37.50%
cmd/environment.cpp                19                 0   100.00%           5                 0   100.00%          41                 0   100.00%          10                 0   100.00%
cmd/environment.hpp                 2                 0   100.00%           1                 0   100.00%           9                 0   100.00%           0                 0         -
cmd/expr.hpp                       38                 3    92.11%          25                 3    88.00%          64                 7    89.06%           2                 0   100.00%
cmd/interpreter.cpp                55                 2    96.36%          18                 0   100.00%         147                 5    96.60%          46                 3    93.48%
cmd/object.hpp                     25                 1    96.00%          17                 1    94.12%         120                 2    98.33%           2                 0   100.00%
cmd/parser.cpp                    102                 2    98.04%          21                 0   100.00%         144                 0   100.00%          62                 6    90.32%
cmd/parser.hpp                     19                 0   100.00%           1                 0   100.00%           3                 0   100.00%          16                 0   100.00%
cmd/scanner.cpp                    87                 3    96.55%          12                 0   100.00%         130                 9    93.08%          74                 6    91.89%
cmd/scanner.hpp                     1                 0   100.00%           1                 0   100.00%           4                 0   100.00%           0                 0         -
cmd/stdlib.hpp                    116                93    19.83%          32                16    50.00%         194               138    28.87%          54                51     5.56%
cmd/stmnt.hpp                      13                 1    92.31%           8                 1    87.50%          14                 1    92.86%           0                 0         -
cmd/subcommand.hpp                  7                 0   100.00%           2                 0   100.00%          10                 0   100.00%           2                 0   100.00%
cmd/token.hpp                       4                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
cmd/util.cpp                       32                22    31.25%           4                 3    25.00%          54                39    27.78%          28                24    14.29%
cmd/util.hpp                       18                18     0.00%           2                 2     0.00%          22                22     0.00%          10                10     0.00%
core/context.hpp                    3                 2    33.33%           3                 2    33.33%           8                 7    12.50%           0                 0         -
core/macho/macho.hpp                2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
core/platform.hpp                  16                15     6.25%           7                 6    14.29%          51                48     5.88%          11                11     0.00%
core/target.cpp                    23                23     0.00%           6                 6     0.00%          59                59     0.00%          12                12     0.00%
core/target.hpp                     5                 5     0.00%           5                 5     0.00%           5                 5     0.00%           0                 0         -
core/util.hpp                       7                 7     0.00%           7                 7     0.00%         104               104     0.00%           0                 0         -
error.cpp                           6                 3    50.00%           6                 3    50.00%          24                12    50.00%           0                 0         -
error.hpp                           8                 0   100.00%           2                 0   100.00%          21                 0   100.00%           0                 0         -
expected.hpp                       13                13     0.00%           9                 9     0.00%           9                 9     0.00%           0                 0         -
formatter.hpp                      58                 0   100.00%           9                 0   100.00%          99                 2    97.98%           2                 0   100.00%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             696               219    68.53%         211                66    68.72%        1363               472    65.37%         339               128    62.24%

Detailed HTML report available in artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant