From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.lisp.guile.user Subject: Re: Nyacc patches for Mes to avoid bundling? Date: Wed, 10 May 2017 23:01:31 +0200 Organization: AvatarAcademy.nl Message-ID: <87fugc5sus.fsf@gnu.org> References: <87bmr93jot.fsf@gnu.org> <1B4686A9-DAC0-4DD4-B11B-78629E0C5339@gmail.com> <20B29595-EC72-4660-815A-0261AD88B519@gmail.com> <87shkj96qi.fsf@gnu.org> <500F7340-E32F-4F6D-89EB-66B94DFF1754@gmail.com> <87o9v78m2y.fsf@gnu.org> <87wp9u6kn2.fsf@gnu.org> <1153D978-92D7-4F34-A5EB-0A0287F4009F@gmail.com> <87pofm6j2j.fsf@gnu.org> <87k25t6r05.fsf@gnu.org> <70FFAE28-410D-4D1A-AF9C-21FC52C895C2@gmail.com> <87lgq7e4vy.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1494450140 15528 195.159.176.226 (10 May 2017 21:02:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 May 2017 21:02:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: guile-user@gnu.org To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed May 10 23:02:15 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8YkP-0003nL-M2 for guile-user@m.gmane.org; Wed, 10 May 2017 23:02:13 +0200 Original-Received: from localhost ([::1]:44792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8YkQ-0002Vx-Di for guile-user@m.gmane.org; Wed, 10 May 2017 17:02:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8Yk4-0002Vs-Rs for guile-user@gnu.org; Wed, 10 May 2017 17:01:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8Yk1-0004Oa-Nh for guile-user@gnu.org; Wed, 10 May 2017 17:01:52 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8Yjo-0004Fx-Sr; Wed, 10 May 2017 17:01:36 -0400 Original-Received: from peder.onsbrabantnet.nl ([88.159.206.46]:58746 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d8Yjo-0007HU-3n; Wed, 10 May 2017 17:01:36 -0400 X-Url: http://AvatarAcademy.nl In-Reply-To: <87lgq7e4vy.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Mon, 08 May 2017 17:37:37 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13706 Archived-At: --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Prefix-raw-parser-to-make-them-unique-for-Mes.patch >From 65f3856766a64b6e13b329a46278444db1512441 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20 --=-=-=--