fixes #12196
This commit is contained in:
parent
8b4c17a140
commit
6c487a6309
2 changed files with 13 additions and 6 deletions
|
|
@ -192,21 +192,21 @@ proc getSymFromList*(list: PNode, ident: PIdent, start: int = 0): PSym =
|
||||||
|
|
||||||
proc sameIgnoreBacktickGensymInfo(a, b: string): bool =
|
proc sameIgnoreBacktickGensymInfo(a, b: string): bool =
|
||||||
if a[0] != b[0]: return false
|
if a[0] != b[0]: return false
|
||||||
var last = a.len - 1
|
var alen = a.len - 1
|
||||||
while last > 0 and a[last] != '`': dec(last)
|
while alen > 0 and a[alen] != '`': dec(alen)
|
||||||
if last == 0: last = a.len - 1
|
if alen <= 0: alen = a.len
|
||||||
|
|
||||||
var i = 1
|
var i = 1
|
||||||
var j = 1
|
var j = 1
|
||||||
while true:
|
while true:
|
||||||
while i < last and a[i] == '_': inc i
|
while i < alen and a[i] == '_': inc i
|
||||||
while j < b.len and b[j] == '_': inc j
|
while j < b.len and b[j] == '_': inc j
|
||||||
var aa = if i < last: toLowerAscii(a[i]) else: '\0'
|
var aa = if i < alen: toLowerAscii(a[i]) else: '\0'
|
||||||
var bb = if j < b.len: toLowerAscii(b[j]) else: '\0'
|
var bb = if j < b.len: toLowerAscii(b[j]) else: '\0'
|
||||||
if aa != bb: return false
|
if aa != bb: return false
|
||||||
|
|
||||||
# the characters are identical:
|
# the characters are identical:
|
||||||
if i >= last:
|
if i >= alen:
|
||||||
# both cursors at the end:
|
# both cursors at the end:
|
||||||
if j >= b.len: return true
|
if j >= b.len: return true
|
||||||
# not yet at the end of 'b':
|
# not yet at the end of 'b':
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,10 @@ discard parsePeg(
|
||||||
line = 1,
|
line = 1,
|
||||||
col = 23)
|
col = 23)
|
||||||
|
|
||||||
|
# bug #12196
|
||||||
|
type
|
||||||
|
Renderer = object
|
||||||
|
|
||||||
|
var xs0, x0, xs1, x1: int
|
||||||
|
proc init(xs=xs0; x=x0; renderer: Renderer; r: byte) = discard
|
||||||
|
init(xs=xs1, x=x1, r=3, renderer=Renderer())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue