mescc: prefix string labels with _.

* module/mes/M1.mes (object->M1): Prefix string lables with _.
This commit is contained in:
Jan Nieuwenhuizen 2017-12-02 14:04:41 +01:00
parent 60b7048e21
commit 3636818b1a

View file

@ -93,7 +93,7 @@
(strings (filter (lambda (g) (and (pair? g) (eq? (car g) #:string))) global-names))) (strings (filter (lambda (g) (and (pair? g) (eq? (car g) #:string))) global-names)))
(define (string->label o) (define (string->label o)
(let ((index (list-index (lambda (s) (equal? s o)) strings))) (let ((index (list-index (lambda (s) (equal? s o)) strings)))
(format #f "string_~a_~a" file-name index))) (format #f "_string_~a_~a" file-name index)))
(define (text->M1 o) (define (text->M1 o)
(pmatch o (pmatch o
;; FIXME ;; FIXME
@ -135,7 +135,7 @@
(let* ((label o) (let* ((label o)
(function? (member label function-names)) (function? (member label function-names))
(string-label (string->label label)) (string-label (string->label label))
(string? (not (equal? string-label "string_#f"))) (string? (not (equal? string-label "_string_#f")))
(global? (member label global-names))) (global? (member label global-names)))
(if (or global? string?) (format #f "&~a" label) (if (or global? string?) (format #f "&~a" label)
(begin (if (not function?) (stderr "warning: unresolved label: ~s\n" label)) (begin (if (not function?) (stderr "warning: unresolved label: ~s\n" label))