Add patch to work with Nyacc 0.93
This commit is contained in:
parent
602f71c9df
commit
52f8a0004f
|
@ -0,0 +1,124 @@
|
|||
From f599acfc707ea51e2a3caca1fe377ddc1867c309 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
Date: Sun, 9 Jun 2019 19:42:42 +0200
|
||||
Subject: [PATCH] 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.
|
||||
---
|
||||
mes/module/nyacc/lang/c99/parser.mes | 3 +-
|
||||
mes/module/nyacc/lang/c99/util.mes | 45 ++++++++++++++++++++++++++++
|
||||
module/mescc/compile.scm | 4 +++
|
||||
module/mescc/preprocess.scm | 3 +-
|
||||
4 files changed, 53 insertions(+), 2 deletions(-)
|
||||
create mode 100644 mes/module/nyacc/lang/c99/util.mes
|
||||
|
||||
Index: mes/mes/module/nyacc/lang/c99/parser.mes
|
||||
===================================================================
|
||||
--- mes.orig/mes/module/nyacc/lang/c99/parser.mes
|
||||
+++ mes/mes/module/nyacc/lang/c99/parser.mes
|
||||
@@ -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")
|
||||
Index: mes/mes/module/nyacc/lang/c99/util.mes
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ mes/mes/module/nyacc/lang/c99/util.mes
|
||||
@@ -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")
|
||||
Index: mes/module/mescc/compile.scm
|
||||
===================================================================
|
||||
--- mes.orig/module/mescc/compile.scm
|
||||
+++ mes/module/mescc/compile.scm
|
||||
@@ -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))))
|
||||
Index: mes/module/mescc/preprocess.scm
|
||||
===================================================================
|
||||
--- mes.orig/module/mescc/preprocess.scm
|
||||
+++ mes/module/mescc/preprocess.scm
|
||||
@@ -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)
|
|
@ -0,0 +1 @@
|
|||
0001-mes-Update-to-Nyacc-0.93.patch
|
Loading…
Reference in New Issue