diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/token.cpp | 15 | ||||
| -rw-r--r-- | lib/token.h | 2 |
2 files changed, 17 insertions, 0 deletions
| diff --git a/lib/token.cpp b/lib/token.cpp index b794ff8..3cc77e5 100644 --- a/lib/token.cpp +++ b/lib/token.cpp | |||
| @@ -627,4 +627,19 @@ namespace verbly { | |||
| 627 | _string._str = _str; | 627 | _string._str = _str; |
| 628 | } | 628 | } |
| 629 | 629 | ||
| 630 | std::ostream& operator<<(std::ostream& os, token::type _type) | ||
| 631 | { | ||
| 632 | switch (_type) | ||
| 633 | { | ||
| 634 | case token::type::verb: return os << "verb"; | ||
| 635 | case token::type::noun: return os << "noun"; | ||
| 636 | case token::type::adjective: return os << "adjective"; | ||
| 637 | case token::type::adverb: return os << "adverb"; | ||
| 638 | case token::type::preposition: return os << "preposition"; | ||
| 639 | case token::type::fillin: return os << "fillin"; | ||
| 640 | case token::type::utterance: return os << "utterance"; | ||
| 641 | case token::type::string: return os << "string"; | ||
| 642 | } | ||
| 643 | } | ||
| 644 | |||
| 630 | }; | 645 | }; |
| diff --git a/lib/token.h b/lib/token.h index 788a106..ff3c37b 100644 --- a/lib/token.h +++ b/lib/token.h | |||
| @@ -163,6 +163,8 @@ namespace verbly { | |||
| 163 | } _utterance; | 163 | } _utterance; |
| 164 | }; | 164 | }; |
| 165 | }; | 165 | }; |
| 166 | |||
| 167 | std::ostream& operator<<(std::ostream& os, token::type _type); | ||
| 166 | 168 | ||
| 167 | }; | 169 | }; |
| 168 | 170 | ||
