Copilot commented on code in PR #3786:
URL: https://github.com/apache/thrift/pull/3786#discussion_r3917272218
##########
compiler/cpp/src/thrift/thriftl.ll:
##########
@@ -298,6 +298,12 @@ literal_begin (['\"])
case '\\':
ch = yyinput();
switch (ch) {
+ case EOF:
+ yyerror("End of file while read string at %d\n", yylineno);
+ exit(1);
+ case '\n':
+ yyerror("End of line while read string at %d\n", yylineno - 1);
+ exit(1);
Review Comment:
The new yyerror strings repeat the existing "while read string" phrasing;
"while reading string" is grammatically correct and would improve these
user-facing diagnostics. Consider updating both the existing and newly added
occurrences in this block for consistency.
##########
compiler/cpp/tests/cpp/t_cpp_parser_string_constant_tests.cc:
##########
@@ -0,0 +1,49 @@
+// Licensed to the Apache Software Foundation(ASF) under one
+// or more contributor license agreements.See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
Review Comment:
The ASF license header comment has multiple missing spaces (e.g.,
"Foundation(ASF)", "agreements.See", "ownership.The"), which deviates from the
standard header used elsewhere in this test suite and makes the notice harder
to read.
##########
compiler/cpp/tests/cpp/t_cpp_parser_string_constant_tests.cc:
##########
@@ -0,0 +1,49 @@
+// Licensed to the Apache Software Foundation(ASF) under one
+// or more contributor license agreements.See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "t_cpp_generator_test_utils.h"
+
+#include <cstdio>
+#include <fstream>
+#include <memory>
+
Review Comment:
This test uses std::vector but does not include <vector> directly. Relying
on transitive includes can break builds when headers change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]