Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Data definition grammar is too greedy #223

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
"ctestCommandArgs": "",
"variables": []
},
{
"name": "x64-Release-Profile",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\build\\${name}",
"installRoot": "${projectDir}\\install\\${name}",
"cmakeCommandArgs": "-DCMAKE_EXE_LINKER_FLAGS=\"/PROFILE\"",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": []
},
{
"name": "WSL-GNU-Release",
"generator": "Ninja",
Expand Down
1 change: 1 addition & 0 deletions clients/vscode-hlasmplugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#### Fixed
- Highlighting now fully works with themes, not just categories dark, light and contrast.
- Incorrect module layout generated when data defintion operands have different alignments
- Data definition grammar is too greedy

## [0.15.1](https://github.com/eclipse/che-che4z-lsp-for-hlasm/compare/0.15.0...0.15.1) (2021-11-11)

Expand Down
33 changes: 17 additions & 16 deletions parser_library/src/diagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1363,15 +1363,16 @@ diagnostic_op diagnostic_op::error_D003(const range& range)
diagnostic_severity::error, "D003", "Expected an integer or an expression after modifier", range);
}

diagnostic_op diagnostic_op::error_D004(const range& range)
{
return diagnostic_op(diagnostic_severity::error, "D004", "Wrong order of modifiers", range);
}
// diagnostic_op diagnostic_op::error_D004(const range& range)
// {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to keep this commented code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd like to keep it as documentation that those messages existed and optionally that we could reuse them.

// return diagnostic_op(diagnostic_severity::error, "D004", "Wrong order of modifiers", range);
// }

// diagnostic_op diagnostic_op::error_D005(const range& range)
// {
// return diagnostic_op(diagnostic_severity::error, "D005", "Unexpected '.' in modifier other than length", range);
// }

diagnostic_op diagnostic_op::error_D005(const range& range)
{
return diagnostic_op(diagnostic_severity::error, "D005", "Unexpected '.' in modifier other than length", range);
}
diagnostic_op diagnostic_op::error_D006(const range& range)
{
return diagnostic_op(
Expand Down Expand Up @@ -1493,14 +1494,6 @@ diagnostic_op diagnostic_op::warn_D025(const range& range, const std::string& ty
diagnostic_severity::warning, "D025", "The " + modifier + " modifier is ignored with type " + type, range);
}

diagnostic_op diagnostic_op::warn_D031(const range& range, const std::string& operand_value)
{
return diagnostic_op(diagnostic_severity::warning,
"D031",
"Using absolute value '" + operand_value + "' as relative immediate value",
range);
}

diagnostic_op diagnostic_op::error_D026(const range& range)
{
return diagnostic_op(diagnostic_severity::error, "D026", "Invalid round mode", range);
Expand Down Expand Up @@ -1534,6 +1527,14 @@ diagnostic_op diagnostic_op::error_D031(const range& range)
return diagnostic_op(diagnostic_severity::error, "D031", "Duplication factor in literals must be positive", range);
}

diagnostic_op diagnostic_op::warn_D032(const range& range, const std::string& operand_value)
{
return diagnostic_op(diagnostic_severity::warning,
"D032",
"Using absolute value '" + operand_value + "' as relative immediate value",
range);
}


diagnostic_op diagnostic_op::error_M135(const std::string& instr_name, long long from, long long to, const range& range)
{
Expand Down
6 changes: 3 additions & 3 deletions parser_library/src/diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ struct diagnostic_op
static diagnostic_op error_D001(const range& range);
static diagnostic_op error_D002(const range& range);
static diagnostic_op error_D003(const range& range);
static diagnostic_op error_D004(const range& range);
static diagnostic_op error_D005(const range& range);
// static diagnostic_op error_D004(const range& range);
// static diagnostic_op error_D005(const range& range);
static diagnostic_op error_D006(const range& range);
static diagnostic_op error_D007(const range& range, const std::string& type);
static diagnostic_op error_D008(
Expand Down Expand Up @@ -446,7 +446,7 @@ struct diagnostic_op
static diagnostic_op error_D029(const range& range);
static diagnostic_op error_D030(const range& range, const std::string& type);
static diagnostic_op error_D031(const range& range);
static diagnostic_op warn_D031(const range& range, const std::string& modifier);
static diagnostic_op warn_D032(const range& range, const std::string& modifier);

static diagnostic_op error_M102(const std::string& instr_name, const range& range);

Expand Down
Loading