1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// to produce the documentaion
// cargo doc --no-deps --examples
//
/*!
`daisychain`
- provides a library for parsing unicode text
- aims to have a gentle and intuitive API, without sacrificing performance (it can be zero-copy)
- as library, rather than a framework, it can be used alongside and complement other parsing toolkits
Main concepts:
# Cursor - represents
- a point in the file/string being parsed
- the concept of "selected text", which like an editor is a section highlighted
- a sense of whether a parsing matching issue has arisen
# Parser - a function which accepts a cursor/str and produces a result, along with a new cursor position
Typically methods on cursor are invoked in a chained fashion. If a matching issue arises,
subsequent methods has no effect (similar to repeatedly calling next() having reached the end of a fused rust iterator..)
Option<&str> is a simple Cursor (without the ability to select text), but is useful for test harnesses. None is used to represent a matching issue
*/
// #[cfg(any(feature = "cookbook", doc))]
///```
/// assert_eq!(Some(" Hello").ws(), Some("Hello"));
/// assert_eq!(Some("\nHello").ws(), Some("Hello"));
/// assert_eq!(None.ws(), None);
///```