PopValue pops a value token, or returns an error. "context" is used to assist the user if the value can not be popped, eg. "expected value but got "
(context string)
| 170 | // |
| 171 | // "context" is used to assist the user if the value can not be popped, eg. "expected <context> value but got <type>" |
| 172 | func (s *Scanner) PopValue(context string) (Token, error) { |
| 173 | t := s.Pop() |
| 174 | if !s.allowHyphenated && !t.IsValue() { |
| 175 | return t, &expectedError{context, t} |
| 176 | } |
| 177 | return t, nil |
| 178 | } |
| 179 | |
| 180 | // PopValueInto pops a value token into target or returns an error. |
| 181 | // |
no test coverage detected