Closed
Description
Ideas for more scanners.
Self scanners:
-
- decided that there isn't enough benefit here over just using a regular string scanner of some description. Once Rustc confuses lifetimes of different unrelated variables of type &'static str when implementing a trait for &'a str rust-lang/rust#26448 gets fixed, they should all just work for paths, anyway.std::path::Path[Buf]
-Path
would probably only work on paths without spaces in them. You could also quote them, but that would only work forPathBuf
. One other edge case is handling path separators for the current platform (for parsingPATH
). There's enough variance that it might be simpler to just require the use of an abstract scanner.
Abstract scanners:
-
Various forstd::time::Duration
-Duration
doesn't have a very niceDebug
representation (although it could be parsed).Would probably be nicer to just have scanners for various units of time (ISO 8601 is a bit ugly, but covers all the usual bases. If there's demand, shorthandSeconds
,Days
, etc.).f64 -> Duration
scanners can be added. -
HorizontalSpace
- match any horizontal spaces:\x20
,\t
, etc., but not newlines or vertical tabs. -
Newline
- match any of\r
,\r\n
,\n
.
Runtime scanners:
-
until(impl Pattern)
- slice until a givenstd::str::pattern::Pattern
matches. -
- impossible given currentpat(impl Pattern)
- usestr::starts_with
.Pattern
design.
Metadata
Metadata
Assignees
Labels
No labels