mes: Update to Nyacc 0.93.

* mes/module/nyacc/lang/c99/util.mes: New file.
* mes/module/nyacc/lang/c99/parser.mes: Use it.
* module/mescc/compile.scm (ast->info): Update for Nyacc 0.93.0.
* module/mescc/preprocess.scm (need-progress):  Likewise.
(ast-strip-comment): Likewise.
This commit is contained in:
Jan Nieuwenhuizen 2019-06-09 19:42:42 +02:00
parent dd34569751
commit 7670d6be38
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
4 changed files with 53 additions and 2 deletions

View file

@ -1,7 +1,7 @@
;;; -*-scheme-*-
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016,2017,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Mes.
;;;
@ -35,5 +35,6 @@
(mes-use-module (nyacc lang sx-util))
(mes-use-module (nyacc lang util))
(mes-use-module (nyacc lang c99 cpp))
(mes-use-module (nyacc lang c99 util))
(include-from-path "nyacc/lang/c99/parser.scm")

View file

@ -0,0 +1,45 @@
;;; -*-scheme-*-
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Mes.
;;;
;;; GNU Mes is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Mes is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(mes-use-module (mes guile))
(mes-use-module (mes catch))
(mes-use-module (mes fluids))
(mes-use-module (mes pretty-print))
(mes-use-module (mes optargs))
(mes-use-module (srfi srfi-1))
(mes-use-module (srfi srfi-9))
(mes-use-module (sxml xpath))
;; FIXME: Nyacc 0.93.0:
;; FIXME: (mes-use-module (srfi srfi-2))
;; FIXME: (mes-use-module (sxml fold))
;; FIXME: (ice-9 popen)
;; FIXME: (ice-9 rdelim)
(define (export . rest) #t)
(define (close-port port) #t)
(mes-use-module (nyacc lang util))
(mes-use-module (nyacc lang sx-util))
(include-from-path "nyacc/lang/c99/util.scm")

View file

@ -1713,6 +1713,10 @@
((asm-expr ,gnuc (,null ,arg0 . string))
(append-text info (wrap-as (asm->m1 arg0))))
;; Nyacc 0.90.2
((asm-expr ,gnuc (string ,arg0))
(append-text info (wrap-as (asm->m1 arg0))))
((expr-stmt (fctn-call (p-expr (ident ,name)) (expr-list . ,expr-list)))
(if (equal? name "asm") (let ((arg0 (cadr (cadar expr-list))))
(append-text info (wrap-as (asm->m1 arg0))))

View file

@ -40,7 +40,7 @@
'(("0.85.3" (1 2 3))
("0.86.0" (1 2 3)))
*nyacc-version*)
'(1 2 3)))
'((1 2 3))))
(define (progress o)
(when (and o (getenv "NYACC_DEBUG"))
@ -114,6 +114,7 @@
(define (ast-strip-comment o)
(pmatch o
((@ (comment . ,comment)) #f) ; Nyacc 0.90.2/0.93.0?
((comment . ,comment) #f)
(((comment . ,comment) . ,t) (filter-map ast-strip-comment t))
(((comment . ,comment) . ,cdr) cdr)