From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Matt Wette <matt.wette@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Nyacc patches for Mes to avoid bundling?
Date: Wed, 10 May 2017 23:01:31 +0200 [thread overview]
Message-ID: <87fugc5sus.fsf@gnu.org> (raw)
In-Reply-To: <87lgq7e4vy.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Mon, 08 May 2017 17:37:37 +0200")
[-- Attachment #1: Type: text/plain, Size: 469 bytes --]
Jan Nieuwenhuizen writes:
Hi Matt,
> Wow, great; that's real simple! I fixed two typos (see attached patch
> 1) and created a Guix[SD] package description in guix.scm (patch 2) that
> I intend to submit for inclusion into Guix, so that I can unbundle
> Nyacc from the Mes package.
I just tested Mes with a very simple main and tonight I found that when
I use #include, mes fails. The attached patch which also prefixes
raw-parser, fixes that.
Greetings,
janneke
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Prefix-raw-parser-to-make-them-unique-for-Mes.patch --]
[-- Type: text/x-patch, Size: 2568 bytes --]
From 65f3856766a64b6e13b329a46278444db1512441 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Tue, 9 May 2017 20:32:23 +0200
Subject: [PATCH] Prefix `raw-parser' to make them unique for Mes.
* module/nyacc/lang/c99/cpp.scm (cpp-raw-parser): Rename from
raw-parser. Update callers.
* module/nyacc/lang/c99/parser.scm (c99-raw-parser): Likewise.
---
module/nyacc/lang/c99/cpp.scm | 4 ++--
module/nyacc/lang/c99/parser.scm | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/module/nyacc/lang/c99/cpp.scm b/module/nyacc/lang/c99/cpp.scm
index 2c97585..7ea57f7 100644
--- a/module/nyacc/lang/c99/cpp.scm
+++ b/module/nyacc/lang/c99/cpp.scm
@@ -151,7 +151,7 @@
(include-from-path "nyacc/lang/c99/mach.d/cpptab.scm")
(include-from-path "nyacc/lang/c99/mach.d/cppact.scm")
-(define raw-parser
+(define cpp-raw-parser
(make-lalr-parser
(list (cons 'len-v cpp-len-v) (cons 'pat-v cpp-pat-v) (cons 'rto-v cpp-rto-v)
(cons 'mtab cpp-mtab) (cons 'act-v cpp-act-v))))
@@ -183,7 +183,7 @@
'nyacc-error
(lambda ()
(with-input-from-string text
- (lambda () (raw-parser (gen-cpp-lexer)))))
+ (lambda () (cpp-raw-parser (gen-cpp-lexer)))))
(lambda (key fmt . args)
(apply throw 'cpp-error fmt args))))
diff --git a/module/nyacc/lang/c99/parser.scm b/module/nyacc/lang/c99/parser.scm
index 9e1ba4c..203b5a5 100644
--- a/module/nyacc/lang/c99/parser.scm
+++ b/module/nyacc/lang/c99/parser.scm
@@ -31,7 +31,7 @@
;; Parse given a token generator. Uses fluid @code{*info*}.
;; A little ugly wrt re-throw but
-(define raw-parser
+(define c99-raw-parser
(let ((parser (make-lalr-parser
(list (cons 'len-v c99-len-v) (cons 'pat-v c99-pat-v)
(cons 'rto-v c99-rto-v) (cons 'mtab c99-mtab)
@@ -48,7 +48,7 @@
;; This is used to parse included files at top level.
(define (run-parse)
(let ((info (fluid-ref *info*)))
- (raw-parser (gen-c-lexer #:mode 'decl) #:debug (cpi-debug info))))
+ (c99-raw-parser (gen-c-lexer #:mode 'decl) #:debug (cpi-debug info))))
;; @deffn {Procedure} parse-c99 [#:cpp-defs def-a-list] [#:inc-dirs dir-list] \
;; [#:mode ('code|'file|'decl)] [#:debug bool]
@@ -82,8 +82,8 @@
(with-fluid*
*info* info
(lambda ()
- (raw-parser (gen-c-lexer #:mode mode #:xdef? xdef?)
- #:debug debug)))))
+ (c99-raw-parser (gen-c-lexer #:mode mode #:xdef? xdef?)
+ #:debug debug)))))
(lambda (key fmt . rest)
(report-error fmt rest)
#f)))
--
2.12.2
[-- Attachment #3: Type: text/plain, Size: 154 bytes --]
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.nl
next prev parent reply other threads:[~2017-05-10 21:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 17:59 Nyacc patches for Mes to avoid bundling? Jan Nieuwenhuizen
2017-05-04 0:07 ` Matt Wette
2017-05-05 2:09 ` Matt Wette
2017-05-05 6:07 ` Jan Nieuwenhuizen
2017-05-05 12:44 ` Matt Wette
2017-05-05 13:33 ` Jan Nieuwenhuizen
2017-05-05 22:59 ` Matt Wette
2017-05-06 15:21 ` Matt Wette
2017-05-06 16:00 ` Jan Nieuwenhuizen
2017-05-06 16:21 ` Matt Wette
2017-05-06 16:33 ` Jan Nieuwenhuizen
2017-05-07 7:54 ` Jan Nieuwenhuizen
2017-05-07 14:16 ` Matt Wette
2017-05-08 15:37 ` Jan Nieuwenhuizen
2017-05-10 21:01 ` Jan Nieuwenhuizen [this message]
2017-05-11 0:21 ` Matt Wette
2017-05-12 3:52 ` Matt Wette
2017-05-12 6:00 ` Jan Nieuwenhuizen
2017-05-12 15:10 ` Matt Wette
2017-05-05 13:19 ` Ludovic Courtès
2017-05-05 19:56 ` Jan Nieuwenhuizen
2017-05-05 20:22 ` Ludovic Courtès
2017-05-06 15:49 ` Jan Nieuwenhuizen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fugc5sus.fsf@gnu.org \
--to=janneke@gnu.org \
--cc=guile-user@gnu.org \
--cc=matt.wette@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).