Disallow double underscore names

This commit is contained in:
Nigel Tao committed 2017-12-27 10:35:22 +11:00
1 parent 172bbdbc3f
commit 3eea5914ac
2 files changed
+31 -8

No files matched your search

+3 -1
View File
@@ -125,7 +125,9 @@ func do(r io.Reader, filename string) error {
}
// We don't need the AST node to pretty-print, but it's worth rejecting
// syntax errors early. This is just a parse, not a full type check.
if _, err := parse.Parse(tm, filename, tokens, nil); err != nil {
if _, err := parse.Parse(tm, filename, tokens, &parse.Options{
AllowDoubleUnderscoreNames: true,
}); err != nil {
return err
}
buf := &bytes.Buffer{}