@Araq, a further clarification (might be a bug in the **strscans** 
documentation).

The [strscans docs](https://nim-lang.org/docs/strscans.html) state that `$w` 
"Matches an ASCII identifier: `[A-Z-a-z_][A-Za-z_0-9]*`.", but looking at the 
[source code of 
parseutils](https://github.com/nim-lang/Nim/blob/master/lib/pure/parseutils.nim#L23)
 it seems that `IdentChars` does not include the hyphen character:
    
    
    IdentChars = {'a'..'z', 'A'..'Z', '0'..'9', '_'}
    IdentStartChars = {'a'..'z', 'A'..'Z', '_'}
    
    
    Run

(same definition found in **strutils** too). The **strscans** documentation 
seems to imply that the hyphen is a valid identifier character, but this might 
be inexact — personally, I think the hyphen shouldn't be a valid identifier 
character, as in most syntaxes it isn't so. I actually discovered this 
discrepancy because I was looking for a way to reimplement it without the 
hyphen.

If you confirm me that it's a documentation error I can fix it and make a PR 
for it.

Reply via email to