aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-06-05 07:24:19 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-06-05 07:24:19 +0000
commit2b70000c0d1631eccb216e2d9aa2552765261506 (patch)
tree89568b4dc919270bf4e9d776718abbc6a08b43bd
parent7d2e76b54b5951bbbb094c544bd0b741ddc95833 (diff)
parent321c5fc0e22706a109aa505735cbb3397ce2c7a6 (diff)
downloadhidl-2b70000c0d1631eccb216e2d9aa2552765261506.tar.gz
Snap for 4821244 from 321c5fc0e22706a109aa505735cbb3397ce2c7a6 to pi-releaseandroid-wear-9.0.0_r9android-wear-9.0.0_r8android-wear-9.0.0_r7android-wear-9.0.0_r6android-wear-9.0.0_r5android-wear-9.0.0_r4android-wear-9.0.0_r34android-wear-9.0.0_r33android-wear-9.0.0_r32android-wear-9.0.0_r31android-wear-9.0.0_r30android-wear-9.0.0_r3android-wear-9.0.0_r29android-wear-9.0.0_r28android-wear-9.0.0_r27android-wear-9.0.0_r26android-wear-9.0.0_r25android-wear-9.0.0_r24android-wear-9.0.0_r23android-wear-9.0.0_r22android-wear-9.0.0_r21android-wear-9.0.0_r20android-wear-9.0.0_r2android-wear-9.0.0_r19android-wear-9.0.0_r18android-wear-9.0.0_r17android-wear-9.0.0_r16android-wear-9.0.0_r15android-wear-9.0.0_r14android-wear-9.0.0_r13android-wear-9.0.0_r12android-wear-9.0.0_r11android-wear-9.0.0_r10android-wear-9.0.0_r1android-vts-9.0_r9android-vts-9.0_r8android-vts-9.0_r7android-vts-9.0_r6android-vts-9.0_r5android-vts-9.0_r4android-vts-9.0_r19android-vts-9.0_r18android-vts-9.0_r17android-vts-9.0_r16android-vts-9.0_r15android-vts-9.0_r14android-vts-9.0_r13android-vts-9.0_r12android-vts-9.0_r11android-vts-9.0_r10android-cts-9.0_r9android-cts-9.0_r8android-cts-9.0_r7android-cts-9.0_r6android-cts-9.0_r5android-cts-9.0_r4android-cts-9.0_r3android-cts-9.0_r20android-cts-9.0_r2android-cts-9.0_r19android-cts-9.0_r18android-cts-9.0_r17android-cts-9.0_r16android-cts-9.0_r15android-cts-9.0_r14android-cts-9.0_r13android-cts-9.0_r12android-cts-9.0_r11android-cts-9.0_r10android-cts-9.0_r1android-9.0.0_r9android-9.0.0_r8android-9.0.0_r7android-9.0.0_r6android-9.0.0_r5android-9.0.0_r3android-9.0.0_r2android-9.0.0_r18android-9.0.0_r17android-9.0.0_r10android-9.0.0_r1pie-vts-releasepie-s2-releasepie-release-2pie-releasepie-r2-s2-releasepie-r2-s1-releasepie-r2-releasepie-cts-release
Change-Id: Ic509368fb7432dc385d9804177c18fdf89df7bab
-rw-r--r--hidl-gen_y.yy5
-rw-r--r--test/error_test/doc_comment_ends_block/1.0/IFoo.hal23
-rw-r--r--test/error_test/doc_comment_ends_block/1.0/required_error1
3 files changed, 29 insertions, 0 deletions
diff --git a/hidl-gen_y.yy b/hidl-gen_y.yy
index da458231..f445199c 100644
--- a/hidl-gen_y.yy
+++ b/hidl-gen_y.yy
@@ -338,6 +338,11 @@ doc_comments
$1->merge($2);
$$ = $1;
}
+ | doc_comments '}'
+ {
+ std::cerr << "ERROR: Doc comments must preceed what they describe at " << @1 << "\n";
+ YYERROR;
+ }
;
valid_identifier
diff --git a/test/error_test/doc_comment_ends_block/1.0/IFoo.hal b/test/error_test/doc_comment_ends_block/1.0/IFoo.hal
new file mode 100644
index 00000000..26c768e2
--- /dev/null
+++ b/test/error_test/doc_comment_ends_block/1.0/IFoo.hal
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed 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.
+ */
+package test.empty_generates@1.0;
+
+interface IFoo {
+ doFoo();
+ /**
+ * Does foo!
+ */
+};
diff --git a/test/error_test/doc_comment_ends_block/1.0/required_error b/test/error_test/doc_comment_ends_block/1.0/required_error
new file mode 100644
index 00000000..94c947a9
--- /dev/null
+++ b/test/error_test/doc_comment_ends_block/1.0/required_error
@@ -0,0 +1 @@
+Doc comments must preceed what they describe at \ No newline at end of file