-
Notifications
You must be signed in to change notification settings - Fork 25
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: Various fixes #166
Merged
Merged
fix: Various fixes #166
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2cdf487
tests for macro param apostrophe parsing
michalbali256 eabdaad
fix: lexer generates ATTR only on data attributes that always consume…
michalbali256 b4d29b6
fix: fix format of STNSM and STOSM instructions
michalbali256 72680c4
refactoring
michalbali256 5678687
fix: CUUTF and CU21 have last parameter optional
michalbali256 2a672a0
fix: evaluation of T'&VAR(num), where VAR is type C var symbol
michalbali256 b1999a6
test: type attribute of setc array
michalbali256 d339013
Merge remote-tracking branch 'origin/mb/fix_setc_subscript_type_attr'…
michalbali256 5653e1a
test: a disabled test for a bug I found
michalbali256 d5b2653
fix: instruction format of LLI[LH][LH]
michalbali256 256bc92
feat: limited CNOP instruction implementation
michalbali256 290f6aa
Merge branch 'development' into mb/fix-apostrophe-lexing
michalbali256 f3e65a8
format
michalbali256 2a0db9c
Revert "test: a disabled test for a bug I found"
michalbali256 dfc7d4e
add highlighting to data attributes
michalbali256 c56498a
Merge remote-tracking branch 'origin/development' into mb/fix-apostro…
michalbali256 a59a726
additional tests
michalbali256 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,89 @@ TEST(parser, ca_string_double_ampersand) | |
auto it = ctx.ids().find("A"); | ||
|
||
ASSERT_EQ(ctx.get_var_sym(it)->access_set_symbol_base()->access_set_symbol<context::C_t>()->get_value(), "&&"); | ||
} | ||
} | ||
|
||
namespace { | ||
|
||
struct test_param | ||
{ | ||
std::string name; | ||
std::string parameter; | ||
std::string expected; | ||
}; | ||
|
||
struct stringer | ||
{ | ||
std::string operator()(::testing::TestParamInfo<test_param> p) { return p.param.name; } | ||
}; | ||
|
||
class parser_string_fixture : public ::testing::TestWithParam<test_param> | ||
{}; | ||
|
||
INSTANTIATE_TEST_SUITE_P(parser, | ||
parser_string_fixture, | ||
::testing::Values(test_param { "A_no_attr", "A'SYM 93'", "A'SYM 93'" }, | ||
test_param { "D_attr", "D'SYM 93'", "D'SYM 93'" }, | ||
test_param { "I_attr", "I'SYM 93'", "I'SYM" }, | ||
test_param { "K_attr", "K'SYM 93'", "K'SYM 93'" }, | ||
test_param { "L_attr", "L'SYM 93'", "L'SYM" }, | ||
test_param { "N_attr", "N'SYM 93'", "N'SYM 93'" }, | ||
test_param { "O_attr", "O'SYM 93'", "O'SYM" }, | ||
test_param { "S_attr", "S'SYM 93'", "S'SYM" }, | ||
test_param { "T_attr", "T'SYM 93'", "T'SYM" }, | ||
test_param { "attr_and_string", "S'SYM' STH'", "S'SYM' STH'" }, | ||
test_param { "literal_FD", "=FD'SYM STH'", "=FD'SYM STH'" }, | ||
test_param { "literal_FS", "=FS'SYM STH'", "=FS'SYM STH'" }, | ||
test_param { "number_before_attr_L", "=4L'SYM 93'", "=4L'SYM 93'" }, | ||
test_param { "quote_before_attr_L", "\"L'SYM 93'", "\"L'SYM" }, | ||
test_param { "quote_before_attr_D", "\"D'SYM 93'", "\"D'SYM 93'" }, | ||
|
||
// Invalid inputs are currently parsed as remark, therefore the variable symbol is empty. | ||
test_param { "no_ending_apostrophe", "\"N'SYM", "" }, | ||
test_param { "no_ending_apostrophe_2", "\"L'SYM' STH", "" }), | ||
stringer()); | ||
} // namespace | ||
|
||
TEST_P(parser_string_fixture, basic) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add also negative tests? |
||
{ | ||
std::string input = R"( | ||
GBLC &PAR | ||
MACRO | ||
MAC &VAR | ||
GBLC &PAR | ||
&PAR SETC &VAR | ||
MEND | ||
|
||
MAC )" + GetParam().parameter; | ||
analyzer a(input); | ||
a.analyze(); | ||
|
||
a.collect_diags(); | ||
EXPECT_EQ(a.diags().size(), 0U); | ||
|
||
auto par_value = get_var_value<C_t>(a.hlasm_ctx(), "PAR"); | ||
ASSERT_TRUE(par_value.has_value()); | ||
EXPECT_EQ(*par_value, GetParam().expected); | ||
} | ||
|
||
|
||
TEST(parser, incomplete_string) | ||
{ | ||
std::string input = R"( | ||
GBLC &PAR | ||
MACRO | ||
MAC &VAR | ||
GBLC &PAR | ||
&PAR SETC &VAR | ||
MEND | ||
|
||
MAC 'A 93)"; | ||
analyzer a(input); | ||
a.analyze(); | ||
|
||
a.collect_diags(); | ||
EXPECT_EQ(a.diags().size(), 0U); | ||
|
||
auto par_value = get_var_value<C_t>(a.hlasm_ctx(), "PAR"); | ||
ASSERT_TRUE(par_value.has_value()); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a unit test?