MatchToken returns true if token matches at given position -- must be a valid position!
(tkey token.KeyToken, pos lexer.Pos)
| 218 | // MatchToken returns true if token matches at given position -- must be |
| 219 | // a valid position! |
| 220 | func (ps *State) MatchToken(tkey token.KeyToken, pos lexer.Pos) bool { |
| 221 | tok := tkey.Token |
| 222 | isCat := tok.Cat() == tok |
| 223 | isSubCat := tok.SubCat() == tok |
| 224 | lx := ps.Src.LexAt(pos) |
| 225 | tkey.Depth = lx.Token.Depth |
| 226 | return ps.MatchLex(lx, tkey, isCat, isSubCat, pos) |
| 227 | } |
| 228 | |
| 229 | // FindTokenReverse looks *backwards* for token in given region, with same depth as reg.Ed-1 end |
| 230 | // where the search starts. Returns position where found, false if not. |