word: Add context to "not implemented" errors.

* geesh/word.scm (word->qword): Include the word form in "not
implemented" error messages.
This commit is contained in:
Jan Nieuwenhuizen 2018-12-19 15:02:27 +01:00 committed by Timothy Sample
parent 2d99ab62d0
commit c6a3d13c69
1 changed files with 12 additions and 6 deletions

View File

@ -271,8 +271,10 @@ and arithmetic substitions."
#:output 'string #:rhs-tildes? #t)))
(setvar! name new-value)
new-value))))
(('<sh-ref-assert> name message) (error "Not implemented"))
(('<sh-ref-assert*> name message) (error "Not implemented"))
(('<sh-ref-assert> name message)
(error (format #f "Not implemented: ~s" word)))
(('<sh-ref-assert*> name message)
(error (format #f "Not implemented: ~s" word)))
(('<sh-ref-and> name value)
(if (string-not-null? (parameter-ref name))
(word->qword (or value ""))
@ -281,10 +283,14 @@ and arithmetic substitions."
(or (and (parameter-ref name)
(word->qword (or value "")))
""))
(('<sh-ref-except-min> name pattern) (error "Not implemented"))
(('<sh-ref-except-max> name pattern) (error "Not implemented"))
(('<sh-ref-skip-min> name pattern) (error "Not implemented"))
(('<sh-ref-skip-max> name pattern) (error "Not implemented"))
(('<sh-ref-except-min> name pattern)
(error (format #f "Not implemented: ~s" word)))
(('<sh-ref-except-max> name pattern)
(error (format #f "Not implemented: ~s" word)))
(('<sh-ref-skip-min> name pattern)
(error (format #f "Not implemented: ~s" word)))
(('<sh-ref-skip-max> name pattern)
(error (format #f "Not implemented: ~s" word)))
(('<sh-ref-length> name)
(number->string (string-length (parameter-ref name ""))))
(_ (map word->qword word))))