bugnyacc parser generator - Bugs: bug #54802, problem with routine,...

 
 

bug #54802: problem with routine, convert-line, that parses #define outputs from compiler

Submitter:  None
Submitted:  Sun 07 Oct 2018 05:50:10 PM UTC
   
 
Category:  None Severity:  4 - Important
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  mwette
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 07 Oct 2018 06:55:47 PM UTC, comment #1: 

Oh yes.  Dumb mistake.  I don't know how this was working. I'll apply for 0.86.2

Matt Wette <mwette>
Group administrator
Sun 07 Oct 2018 05:50:10 PM UTC, original submission:  

hi

the following patch appears to do the right thing, what do you think?

$ git diff
diff --git a/module/nyacc/lang/c99/util1.scm b/module/nyacc/lang/c99/util1.scm
index 82b74ca..b13016c 100644
--- a/module/nyacc/lang/c99/util1.scm
+++ b/module/nyacc/lang/c99/util1.scm
@@ -83,15 +83,15 @@
       (let loop ((term '()) (acc '()) (st 0) (ch (read-char)))
        (case st
          ((0) ;; skip #define
-          (if (char=? #\space)
+          (if (char=? ch #\space)
               (loop term acc 1 (read-char))
               (loop term acc 0 (read-char))))
          ((1) ;; read term
-          (if (char=? #\space)
+          (if (char=? ch #\space)
               (loop (reverse-list->string acc) '() 2 (read-char))
               (loop term (cons ch acc) st (read-char))))
          ((2) ;; read rest
-          (if (char=? #\newline)
+          (if (or (eof-object? ch) (char=? ch #\newline))
               (string-append term "=" (reverse-list->string acc))
               (loop term (cons ch acc) st (read-char)))))))))
 

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mwette (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-20 mwette Open/ClosedOpen Closed
    2018-10-07 mwette StatusIn Progress Fixed
    2018-10-07 mwette Severity3 - Normal 4 - Important
        StatusNone In Progress
        Assigned toNone mwette

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code