Trait quoted_string::ValidWithoutQuotationCheck [] [src]

pub trait ValidWithoutQuotationCheck {
    fn next_char(&mut self, ch: char) -> bool;

    fn end(&mut self, _all: &str) -> bool { ... }
}

Used to determine 1. if the string needs quoting 2. where the first char which could require quoting appears

Note that a string consisiting only of chars which do not need quoting by them self could still need quoting. For example the string "a." requires quoting if it appears in a position where only a dot-atom or quoted-string is allowed.

Required Methods

should return true if the next char is valid without quotation

Provided Methods

Called after the last char was passed to next_char. It should return true if the whole string is valid without quotation assuming that before all chars where passed in order to next_char and all calls to next_char returned true.

This can be used to checks not possible with on a char by char basis e.g. if it does not end in a ..

Note that because it is only called after one iteration, validation should be done, if possible, in the next_char method.

Implementors