func (r *Result) Emit(c token.Code, s string) error { if r.Verbose { r.t.Logf("%s %#v", c.Name(), s) } r.Tokens = append(r.Tokens, c, s) return nil }
// GetStyle returns Style for token.Code. func (t *Definition) GetStyle(tc token.Code) Style { // FIXME: style cascading s := t.findStyle(tc) for s == nil { tc = tc.Parent() if tc == 0 { return Style{} } s = t.findStyle(tc) } return *s }
func (f *htmlFormatter) Emit(c token.Code, s string) (err error) { // FIXME: support lineNumbers option. _, err = fmt.Fprintf(f.writer, `<span class="%s">%s</span>`, c.ShortName(), html.EscapeString(s)) return }