Inline image loading

Changelog-Added: Added inline image loading
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-10-16 16:11:27 -07:00
parent 66eefa0ff2
commit a47645929e
16 changed files with 267 additions and 60 deletions

View File

@@ -55,6 +55,15 @@ func parse_str(_ p: Parser, _ s: String) -> Bool {
return false
}
func peek_char(_ p: Parser, _ i: Int) -> Character? {
let offset = p.pos + i
if offset < 0 || offset > p.str.count {
return nil
}
let ind = p.str.index(p.str.startIndex, offsetBy: offset)
return p.str[ind]
}
func parse_char(_ p: Parser, _ c: Character) -> Bool {
if p.pos >= p.str.count {
return false