reader: handle port whose position moves backwards

This commit is contained in:
Matthew Flatt 2018-02-27 05:46:59 -07:00
parent 586feb6df0
commit ada6b8c5d1
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@
(read-config-line config)
(read-config-col config)
(read-config-pos config)
(and (read-config-pos config) end-pos (- end-pos (read-config-pos config)))))
(and (read-config-pos config) end-pos (max 0 (- end-pos (read-config-pos config))))))
(define (reading-at config line col pos)
(struct*-copy read-config config

View File

@ -46105,7 +46105,7 @@ static const char *startup_source =
"(read-config-line config_1)"
"(read-config-col config_1)"
"(read-config-pos config_1)"
"(if(read-config-pos config_1)(if end-pos_0(- end-pos_0(read-config-pos config_1)) #f) #f))))))"
"(if(read-config-pos config_1)(if end-pos_0(max 0(- end-pos_0(read-config-pos config_1))) #f) #f))))))"
"(define-values"
"(reading-at)"
"(lambda(config_2 line_2 col_1 pos_105)"