| 66 | { |
| 67 | |
| 68 | std::string to_string(ScannerError _errorCode) |
| 69 | { |
| 70 | switch (_errorCode) |
| 71 | { |
| 72 | case ScannerError::NoError: return "No error."; |
| 73 | case ScannerError::IllegalToken: return "Invalid token."; |
| 74 | case ScannerError::IllegalHexString: return "Expected even number of hex-nibbles."; |
| 75 | case ScannerError::IllegalHexDigit: return "Hexadecimal digit missing or invalid."; |
| 76 | case ScannerError::IllegalCommentTerminator: return "Expected multi-line comment-terminator."; |
| 77 | case ScannerError::IllegalEscapeSequence: return "Invalid escape sequence."; |
| 78 | case ScannerError::UnicodeCharacterInNonUnicodeString: return "Invalid character in string. If you are trying to use Unicode characters, use a unicode\"...\" string literal."; |
| 79 | case ScannerError::IllegalCharacterInString: return "Invalid character in string."; |
| 80 | case ScannerError::IllegalStringEndQuote: return "Expected string end-quote."; |
| 81 | case ScannerError::IllegalNumberSeparator: return "Invalid use of number separator '_'."; |
| 82 | case ScannerError::IllegalExponent: return "Invalid exponent."; |
| 83 | case ScannerError::IllegalNumberEnd: return "Identifier-start is not allowed at end of a number."; |
| 84 | case ScannerError::OctalNotAllowed: return "Octal numbers not allowed."; |
| 85 | case ScannerError::DirectionalOverrideUnderflow: return "Unicode direction override underflow in comment or string literal."; |
| 86 | case ScannerError::DirectionalOverrideMismatch: return "Mismatching directional override markers in comment or string literal."; |
| 87 | default: |
| 88 | solAssert(false, "Unhandled case in to_string(ScannerError)"); |
| 89 | return ""; |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | |
| 94 | std::ostream& operator<<(std::ostream& os, ScannerError _errorCode) |
no outgoing calls
no test coverage detected