Experimenting with parsing AST from Python using cindex.py, I discovered
that a CursorKind defintion for fixed point literals was missing. This
change simply adds this defintion following the defintion in
clang/include/clang-c/Index.h
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Polite ping. This is a small and simple change, my only doubt is the test coverage. But frankly I see none of the literals are covered in any of the test cases (unless I'm missing something). Could I get some guidance on required test coverage for this simple change, or a LGTM?
Thanks - Vince
Comment Actions
LGTM.
I think if you really wish to test this, I think you should do something similar to c-index-getCursor-pp.
You could call it like c-index-getCursor-fixed-point.c:
long _Fract longfractliteral = 0.99999999lr; unsigned _Accum uliteral1 = 2.5uk; _Accum literal8 = -2.5k; // RUN: c-index-test -cursor-at=%s:1:1 -ffixed-point %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: 1:13 VarDecl=longfractliteral:1:13 (Definition) Extent=[1:1 - 1:44] Spelling=longfractliteral ([1:13 - 1:29]) // CHECK-1-NEXT: Completion string: {ResultType long _Fract}{TypedText longfractliteral} // RUN: c-index-test -cursor-at=%s:2:1 -ffixed-point %s | FileCheck -check-prefix=CHECK-2 %s // CHECK-2: 2:17 VarDecl=uliteral1:2:17 (Definition) Extent=[2:1 - 2:34] Spelling=uliteral1 ([2:17 - 2:26]) // CHECK-2-NEXT: Completion string: {ResultType unsigned _Accum}{TypedText uliteral1} // RUN: c-index-test -cursor-at=%s:3:1 -ffixed-point %s | FileCheck -check-prefix=CHECK-3 %s // CHECK-3: 3:8 VarDecl=literal8:3:8 (Definition) Extent=[3:1 - 3:24] Spelling=literal8 ([3:8 - 3:16]) // CHECK-3-NEXT: Completion string: {ResultType _Accum}{TypedText literal8}
But I haven't used this binding stuff ever. Take my comments with a pinch of salt.
Comment Actions
Hmm, to be honest, this was probably not what you wanted to test.
What about simply inserting your own use-case which uncovered this issue in the first place?