impc:ti:strip-named-type   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmti.xtm

Implementation

(define impc:ti:strip-named-type
  (lambda (t)
    (if (symbol? t) (set! t (symbol->string t)))
    (if (not (string? t))
        (impc:compiler:print-bad-type-error t "Should be named type!")
        (let ((ptrdepth (impc:ir:get-ptr-depth t)))
          (if (regex:match? t "^[A-Za-z0-9]*:")
              (apply string-append (car (regex:type-split t ":")) (make-list ptrdepth "*"))
              (if (regex:match? t "^[A-Za-z0-9]*{")
                  (apply string-append (car (regex:type-split t "{")) (make-list ptrdepth "*")))
              t)))))


Back to Index