| 30 | } |
| 31 | |
| 32 | const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) { |
| 33 | std::string tag; |
| 34 | canBeHandle = true; |
| 35 | Mark firstNonWordChar; |
| 36 | |
| 37 | while (INPUT) { |
| 38 | if (INPUT.peek() == Keys::Tag) { |
| 39 | if (!canBeHandle) |
| 40 | throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE); |
| 41 | break; |
| 42 | } |
| 43 | |
| 44 | int n = 0; |
| 45 | if (canBeHandle) { |
| 46 | n = Exp::Word().Match(INPUT); |
| 47 | if (n <= 0) { |
| 48 | canBeHandle = false; |
| 49 | firstNonWordChar = INPUT.mark(); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | if (!canBeHandle) |
| 54 | n = Exp::Tag().Match(INPUT); |
| 55 | |
| 56 | if (n <= 0) |
| 57 | break; |
| 58 | |
| 59 | tag += INPUT.get(n); |
| 60 | } |
| 61 | |
| 62 | return tag; |
| 63 | } |
| 64 | |
| 65 | const std::string ScanTagSuffix(Stream& INPUT) { |
| 66 | std::string tag; |