parseSmooth parses a "s" decription line: s <0|1>
(fields []string)
| 695 | // parseSmooth parses a "s" decription line: |
| 696 | // s <0|1> |
| 697 | func (dec *Decoder) parseSmooth(fields []string) error { |
| 698 | |
| 699 | if len(fields) < 1 { |
| 700 | return dec.formatError("'s' with no fields") |
| 701 | } |
| 702 | |
| 703 | if fields[0] == "0" || fields[0] == "off" { |
| 704 | dec.smoothCurrent = false |
| 705 | return nil |
| 706 | } |
| 707 | if fields[0] == "1" || fields[0] == "on" { |
| 708 | dec.smoothCurrent = true |
| 709 | return nil |
| 710 | } |
| 711 | return dec.formatError("'s' with invalid value") |
| 712 | } |
| 713 | |
| 714 | /****************************************************************************** |
| 715 | mtl parse functions |
no test coverage detected