Skip to content

Commit

Permalink
Revert D70342616: Multisect successfully blamed "D70342616: [Thrift] …
Browse files Browse the repository at this point in the history
…Merge fbcode and xplat copies of thrift/parse" for one test failure

Summary:
This diff reverts D70342616
D70342616: [Thrift] Merge fbcode and xplat copies of thrift/parse by vitaut causes the following test failure:

Tests affected:
- [cogwheel:cogwheel_blackbird#main](https://www.internalfb.com/intern/test/844424930579139/)

Here's the Multisect link:
https://www.internalfb.com/multisect/21970461
Here are the tasks that are relevant to this breakage:
T191387297: 10+ CI signals unhealthy for blackbird_ingestion_and_detection

The backout may land if someone accepts it.

If this diff has been generated in error, you can Commandeer and Abandon it.

Reviewed By: vitaut

Differential Revision: D70382891

fbshipit-source-id: 1ebacf1498d5c134abe4dd31361c8e556b57c9ba
  • Loading branch information
Dark Knight authored and facebook-github-bot committed Feb 28, 2025
1 parent 76a30db commit b5814d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion thrift/compiler/parse/lexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ const std::unordered_map<std::string_view, tok> keywords = {
{"const", tok::kw_const},
{"required", tok::kw_required},
{"optional", tok::kw_optional},
{"as", tok::kw_as},
};

} // namespace
Expand Down
33 changes: 4 additions & 29 deletions thrift/compiler/parse/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,15 @@ class parser {
auto str_range = token_.range;
consume_token();
switch (kind) {
case tok::kw_include:{
auto alias = try_parse_include_alias();
actions_.on_include(range, str, alias, str_range);
case tok::kw_include:
actions_.on_include(range, str, std::nullopt, str_range);
break;
}
case tok::kw_cpp_include: {
case tok::kw_cpp_include:
actions_.on_cpp_include(range, str);
break;
}
case tok::kw_hs_include: {
case tok::kw_hs_include:
actions_.on_hs_include(range, str);
break;
}
default:
assert(false);
}
Expand Down Expand Up @@ -1074,7 +1070,6 @@ class parser {
case tok::kw_permanent:
case tok::kw_server:
case tok::kw_client:
case tok::kw_as:
return identifier{to_string(consume_token().kind), range};
default:
return {};
Expand All @@ -1093,26 +1088,6 @@ class parser {
return try_consume_token(',') || try_consume_token(';');
}

std::optional<std::string_view> try_parse_include_alias() {
if (!try_consume_token(tok::kw_as)) {
return std::nullopt;
}

auto alias = try_parse_identifier();
if (!alias.has_value()) {
if (token_.kind == ';') {
report_error("Include alias cannot be empty");
} else {
const auto invalid_alias = consume_token();
report_error(
"Invalid include alias '{}'", to_string(invalid_alias.kind.value));
}
return std::nullopt;
}

return alias.value().str;
}

public:
parser(lexer& lex, parser_actions& actions, diagnostics_engine& diags)
: lexer_(lex), actions_(actions), diags_(diags) {}
Expand Down

0 comments on commit b5814d8

Please sign in to comment.