Don't replace double with float if it's immediately followed by a word starting 'click'

Otherwise we advise people about 'float clicking' and other difficult endeavours
See http://trac.wxwidgets.org/ticket/16904
This commit is contained in:
David Fraser
2015-03-17 14:59:49 +00:00
parent 2c3b7a813d
commit 144992dd9b

View File

@@ -198,9 +198,10 @@ def ReplaceCppItems(line):
:rtype: `string`
"""
items = RE_KEEP_SPACES.split(line)
newstr = []
for item in RE_KEEP_SPACES.split(line):
for n, item in enumerate(items):
if item in CPP_ITEMS:
continue
@@ -210,7 +211,8 @@ def ReplaceCppItems(line):
elif item == 'char':
item = 'int'
elif item == 'double':
item = 'float'
if len(items) > n+2 and not items[n+2].lower().startswith("click"):
item = 'float'
if len(item.replace('``', '')) > 2:
if '*' in item: