-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow non ascii chars according to go spec #36
Conversation
See following script for demo. #!/usr/bin/env python3
import re
# pattern = r'(?:[a-zA-Z_]\w*|[\]\)])\.(?:[a-zA-Z_]\w*)?'
pattern = r'(?:[^\W\d]\w*|[\]\)])\.(?:[^\W\d]\w*)?'
prog = re.compile(pattern)
tests = {
'a.': True,
'_x9.': True,
'ThisVariableIsExported.': True,
'αβ.': True,
'].a': True,
']._x9': True,
'].ThisVariableIsExported': True,
'].αβ': True,
').a': True,
')._x9': True,
').ThisVariableIsExported': True,
').αβ': True,
'9.': False,
}
for k, v in tests.items():
match = prog.match(k) is not None
if v == match:
print('"%s" expected: %s, got: %s' % (k, v, match))
else:
print()
print('!!!! "%s" expected: %s, got: %s !!!!' % (k, v, match))
print() |
/cc @Shougo @svanharmelen |
Yeah... Looks good! 👍 @mmlb while your at it, could you maybe trow in a
|
and /cc @nhooyr |
@svanharmelen do you mean that you saw this while testing in nvim? I added the |
@mmlb are you sure? It should match without the |
@mmlb @svanharmelen Thanks for assistance :) I do not quite understand the regexp, because I can not determine... 😅 |
LGTM Edit: But yes, |
updated |
LGTM! Thanks @mmlb |
@mmlb @Shougo @svanharmelen |
allow non ascii chars according to go spec
hopefully last of the regex PRs for a while ;) |
@mmlb Thanks, I'm relieved to hear that :) |
See https://golang.org/ref/spec#Identifiers