mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Rename a concept from placeholder to generic
This commit is contained in:
1 parent
e0478b1d91
commit
56d46540b1
2 files changed
+6
-6
No files matched your search
@@ -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{
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user