pub struct Sanitizer;

Implementations§

Removes all leading whitespaces and comments from the given input, returning the sanitized input.

Removes leading whitespaces from the given input.

Removes multiple leading comments from the given input.

Removes the first leading comment from the given input.

Parse a safe character (in the sense explained in [string_parser::is_char_supported]). Returns an error if no character is found or a non-safe character is found. The character is returned, along with the remaining input.

This is used for otherwise unconstrained characters in (line and block) comments and in string literals.

Note also that the nom documentation for anychar says that it matches one byte as a character. However, simple experiments show that it matches a Unicode character, e.g. attempting to parse "\u{4141}" yields one CJK character and exhausts the input, as opposed to returning A and leaving another A in the input.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.