[llvm-bugs] [Bug 33394] New: Editor placeholder check is too lax
llvm-bugs at lists.llvm.org
Fri Jun 9 17:04:36 PDT 2017
Bug ID: 33394
Summary: Editor placeholder check is too lax
OS: MacOS X
Assignee: unassignedclangbugs at nondot.org
Reporter: mistydemeo at github.com
CC: llvm-bugs at lists.llvm.org
Created attachment 18606
Proposed patch to improve editor placeholder check
The new support for editor placeholders, added in
aac41bcdb19f21fb20a2efdc19494b622ba29171, is too lax in its definition of
editor placeholders. I noticed this when the current check (begins with "<#"
and ends with "#>") caught <#> (a Haskell operator) in some Haskell with GHC,
uses the C preprocessor for certain Haskell code. According to the comment in
IdentifierTable.h, editor placeholders are "characters between '<#' and '#>'",
for example "<#int x#>" - this shouldn't be matching <#>.
The attached patch adds an extra check to see if the matched code has more than
one #, in addition to checking the beginning and ending of the string. I'm not
sure if the additions to the test in my patch are an appropriate way to check
for this - please let me know if there's something else you'd rather see.
A sample error, as reported at https://ghc.haskell.org/trac/ghc/ticket/13805
(before I identified the source of the problem) is:
error: editor placeholder in source file
then termText (location db) <#> termText "\n (no packages)\n"
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs