Skip to content

Commit

Permalink
fix: Incorrect parsing of attributes in macro operands
Browse files Browse the repository at this point in the history
  • Loading branch information
slavek-kucera authored Nov 12, 2024
1 parent f82a055 commit ef046d5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions clients/vscode-hlasmplugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Operand parsing errors reported for operandless instructions used in macros
- Language server does not recognize symbolic links as available macros (WASM)
- The language server crashes while processing an invalid prototype of a nested macro
- Incorrect parsing of attributes in macro operands

## [1.15.0](https://github.com/eclipse-che4z/che-che4z-lsp-for-hlasm/compare/1.14.0...1.15.0) (2024-09-20)

Expand Down
11 changes: 5 additions & 6 deletions parser_library/src/parsing/grammar/macro_operand_rules.g4
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,11 @@ mac_entry returns [concat_chain chain]
collector.add_hl_symbol(token_info(provider.get_range($at),hl_scopes::operator_symbol));
}
(
(
equals
{
$chain.emplace_back(equals_conc(provider.get_range($equals.ctx)));
}
)?
equals
{
$chain.emplace_back(equals_conc(provider.get_range($equals.ctx)));
}
|
ORDSYMBOL
{
auto r = provider.get_range($ORDSYMBOL);
Expand Down
16 changes: 16 additions & 0 deletions parser_library/test/context/macro_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,3 +1292,19 @@ TEST(macro, nested_parenthesis_with_attributes)

EXPECT_TRUE(a.diags().empty());
}

TEST(macro, allowed_incomplete_literal)
{
std::string input = R"(
MACRO
MAC
MEND
MAC L'=
MAC "L'=
)";
analyzer a(input);
a.analyze();

EXPECT_TRUE(a.diags().empty());
}

0 comments on commit ef046d5

Please sign in to comment.