NewMacroProcessor returns a new MacroProcessor object for parsing macros.
()
| 6 | |
| 7 | // NewMacroProcessor returns a new MacroProcessor object for parsing macros. |
| 8 | func NewMacroProcessor() *MacroProcessor { |
| 9 | macros := make(map[string][]*Attr) |
| 10 | |
| 11 | // This is built into Git. |
| 12 | macros["binary"] = []*Attr{ |
| 13 | &Attr{K: "diff", V: "false"}, |
| 14 | &Attr{K: "merge", V: "false"}, |
| 15 | &Attr{K: "text", V: "false"}, |
| 16 | } |
| 17 | |
| 18 | return &MacroProcessor{ |
| 19 | macros: macros, |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | // ProcessLines reads the specified lines, returning a new set of lines which |
| 24 | // all have a valid pattern. If readMacros is true, it additionally loads any |
no outgoing calls