source/internal/Errors.protos
- Repository
- guillermomolina/protos
- Commit
379c6fa63685c39a5954cfbd577bfda3b4df8e75- Tree
8cd4f4afe29ae4c3866381f38c1858108e9799f6- Blob
926e95210cb85898b58c3d38f5f0f0942b73addf- Source
- View exact source on GitHub
// THE LICENSED WORK IS PROVIDED UNDER THE TERMS OF THE ADAPTIVE PUBLIC LICENSE
// ("LICENSE") AS FIRST COMPLETED BY: Guillermo Adrián Molina. ANY USE, PUBLIC
// DISPLAY, PUBLIC PERFORMANCE, REPRODUCTION OR DISTRIBUTION OF, OR PREPARATION OF
// DERIVATIVE WORKS BASED ON, THE LICENSED WORK CONSTITUTES RECIPIENT'S ACCEPTANCE
// OF THIS LICENSE AND ITS TERMS, WHETHER OR NOT SUCH RECIPIENT READS THE TERMS OF
// THE LICENSE. "LICENSED WORK" AND "RECIPIENT" ARE DEFINED IN THE LICENSE. A COPY
// OF THE LICENSE IS LOCATED IN THE TEXT FILE ENTITLED "LICENSE.TXT" ACCOMPANYING
// THE CONTENTS OF THIS FILE. IF A COPY OF THE LICENSE DOES NOT ACCOMPANY THIS
// FILE, A COPY OF THE LICENSE MAY ALSO BE OBTAINED AT THE FOLLOWING WEB SITE:
// https://github.com/guillermomolina/protos
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
// the specific language governing rights and limitations under the License.
//! Private package-local Error prototypes and diagnostic codes.
//!
//! Every failure signals a fresh occurrence that delegates to its prototype;
//! the prototypes themselves are never signalled.
LexicalError: Error {}
LexerLimitError: Error {}
UNEXPECTED_SCALAR: "UNEXPECTED_SCALAR"
NON_NFC_IDENTIFIER: "NON_NFC_IDENTIFIER"
INVALID_NUMERIC_LITERAL: "INVALID_NUMERIC_LITERAL"
INVALID_SYMBOLIC_OPERATOR: "INVALID_SYMBOLIC_OPERATOR"
INVALID_STRING_ESCAPE: "INVALID_STRING_ESCAPE"
UNTERMINATED_STRING: "UNTERMINATED_STRING"
STRING_NEWLINE: "STRING_NEWLINE"
INVALID_TRIPLE_INDENTATION: "INVALID_TRIPLE_INDENTATION"
UNTERMINATED_BLOCK_COMMENT: "UNTERMINATED_BLOCK_COMMENT"
// Signals a fresh LexicalError for the scalar interval [first, last).
signalLexical: (diagnosticCode, first, last) => {
occurrence: LexicalError {
code: diagnosticCode
start: first
end: last
}
occurrence.signal()
}
// Signals a fresh LexerLimitError naming the exceeded bound.
signalLimit: (limitName, bound) => {
occurrence: LexerLimitError {
limit: limitName
maximum: bound
}
occurrence.signal()
}
// Signals a fresh ordinary Error for an argument outside its exact domain.
signalArgument: () => {
Error().signal()
}