pub enum ScanningError {
UnterminatedString(usize),
InvalidNumber(usize),
InvalidFloat(usize),
UnknownToken(usize, char),
UnknownEscape(usize, char),
Unknown,
}
Expand description
Errors for the crate::frontend::lexer module.
Variants§
UnterminatedString(usize)
When a string was started but jingo reached the end of the file without it being closed.
§Examples
fn awesome(input) {
return input * 2;
}
var x = "following string never closes
fn broken_func(fix_string) {
print fix_string;
}
InvalidNumber(usize)
A number was given that was not valid, possibly looking like 0-2-30
.
InvalidFloat(usize)
A float was given that was not valid, possibly looking like 0...3221.
.
UnknownToken(usize, char)
An unknown token was given, user error (usize
is line num, char
is
bad token).
UnknownEscape(usize, char)
Unknown escape sequence (e.g. \9
isn’t an escape sequence like \n
).
Unknown
See crate::error documentation for more on this.
Trait Implementations§
Source§impl Clone for ScanningError
impl Clone for ScanningError
Source§fn clone(&self) -> ScanningError
fn clone(&self) -> ScanningError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ScanningError
impl Debug for ScanningError
Source§impl PartialEq for ScanningError
impl PartialEq for ScanningError
Source§impl PartialOrd for ScanningError
impl PartialOrd for ScanningError
impl StructuralPartialEq for ScanningError
Auto Trait Implementations§
impl Freeze for ScanningError
impl RefUnwindSafe for ScanningError
impl Send for ScanningError
impl Sync for ScanningError
impl Unpin for ScanningError
impl UnwindSafe for ScanningError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more