Rename a concept from placeholder to generic

This commit is contained in:
Nigel Tao committed 2018-05-14 15:04:16 +10:00
1 parent e0478b1d91
commit 56d46540b1
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -157,8 +157,8 @@ var Funcs = []string{
// avoid collision with a user-defined "T" type.
const (
PlaceholderOldName = t.IDCapitalT
PlaceholderNewName = t.IDDiamond
GenericOldName = t.IDCapitalT
GenericNewName = t.IDDiamond
)
var SliceFuncs = []string{
+4 -4
View File
@@ -91,7 +91,7 @@ func (c *Checker) builtInSliceFunc(qqid t.QQID) (*a.Func, error) {
return c.builtInSliceFuncs[qqid], nil
}
func (c *Checker) parseBuiltInFuncs(ss []string, placeholder bool) (map[t.QQID]*a.Func, error) {
func (c *Checker) parseBuiltInFuncs(ss []string, generic bool) (map[t.QQID]*a.Func, error) {
m := map[t.QQID]*a.Func{}
buf := []byte(nil)
opts := parse.Options{
@@ -108,10 +108,10 @@ func (c *Checker) parseBuiltInFuncs(ss []string, placeholder bool) (map[t.QQID]*
if err != nil {
return nil, fmt.Errorf("check: could not tokenize built-in funcs: %v", err)
}
if placeholder {
if generic {
for i := range tokens {
if tokens[i].ID == builtin.PlaceholderOldName {
tokens[i].ID = builtin.PlaceholderNewName
if tokens[i].ID == builtin.GenericOldName {
tokens[i].ID = builtin.GenericNewName
}
}
}