* fix #19580; add warning for bare except: clause * fixes some easy ones * Update doc/manual.md * fixes docs * Update changelog.md * addition * Apply suggestions from code review Co-authored-by: Jacek Sieka <arnetheduck@gmail.com> * Update doc/tut2.md Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>
This commit is contained in:
parent
9a50033d5b
commit
91ce8c385d
14 changed files with 50 additions and 26 deletions
|
|
@ -394,10 +394,10 @@ proc entityToRune*(entity: string): Rune =
|
|||
case entity[1]
|
||||
of '0'..'9':
|
||||
try: runeValue = parseInt(entity[1..^1])
|
||||
except: discard
|
||||
except ValueError: discard
|
||||
of 'x', 'X': # not case sensitive here
|
||||
try: runeValue = parseHexInt(entity[2..^1])
|
||||
except: discard
|
||||
except ValueError: discard
|
||||
else: discard # other entities are not defined with prefix `#`
|
||||
if runeValue notin 0..0x10FFFF: runeValue = 0 # only return legal values
|
||||
return Rune(runeValue)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue