Skip to content

Commit eb17b23

Browse files
alecthomasclaude
andcommitted
chore: delete commented-out XML generation block in NewLexer
Superseded by the --xml flag in cmd/chroma; it lives on in git history. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ecca99e commit eb17b23

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

regexp.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -100,35 +100,6 @@ func NewLexer(config *Config, rulesFunc func() Rules) (*RegexLexer, error) {
100100
config: config,
101101
fetchRulesFunc: func() (Rules, error) { return rulesFunc(), nil },
102102
}
103-
// One-off code to generate XML lexers in the Chroma source tree.
104-
// var nameCleanRe = regexp.MustCompile(`[^-+A-Za-z0-9_]`)
105-
// name := strings.ToLower(nameCleanRe.ReplaceAllString(config.Name, "_"))
106-
// data, err := Marshal(r)
107-
// if err != nil {
108-
// if errors.Is(err, ErrNotSerialisable) {
109-
// fmt.Fprintf(os.Stderr, "warning: %q: %s\n", name, err)
110-
// return r, nil
111-
// }
112-
// return nil, err
113-
// }
114-
// _, file, _, ok := runtime.Caller(2)
115-
// if !ok {
116-
// panic("??")
117-
// }
118-
// fmt.Println(file)
119-
// if strings.Contains(file, "/lexers/") {
120-
// dir := filepath.Join(filepath.Dir(file), "embedded")
121-
// err = os.MkdirAll(dir, 0700)
122-
// if err != nil {
123-
// return nil, err
124-
// }
125-
// filename := filepath.Join(dir, name) + ".xml"
126-
// fmt.Println(filename)
127-
// err = ioutil.WriteFile(filename, data, 0600)
128-
// if err != nil {
129-
// return nil, err
130-
// }
131-
// }
132103
return r, nil
133104
}
134105

0 commit comments

Comments
 (0)