浏览代码

Improved format of stack-effect strings.

Paul Onions 11 年之前
父节点
当前提交
5a1eaf2c25
共有 5 个文件被更改,包括 18 次插入5 次删除
  1. 0 0
      data/sysrpl-data.38G.el
  2. 0 0
      data/sysrpl-data.39G.el
  3. 0 0
      data/sysrpl-data.48G.el
  4. 0 0
      data/sysrpl-data.49G.el
  5. 18 5
      rpl-edb.el

文件差异内容过多而无法显示
+ 0 - 0
data/sysrpl-data.38G.el


文件差异内容过多而无法显示
+ 0 - 0
data/sysrpl-data.39G.el


文件差异内容过多而无法显示
+ 0 - 0
data/sysrpl-data.48G.el


文件差异内容过多而无法显示
+ 0 - 0
data/sysrpl-data.49G.el


+ 18 - 5
rpl-edb.el

@@ -38,7 +38,7 @@ As a side-effect set point to the start of the next line."
 
 
 ;;; Parsing identifier lines
 ;;; Parsing identifier lines
 ;;;
 ;;;
-(defun rpl-trim-stack-effect-description (lines)
+(defun rpl-trim-stack-effect-lines (lines)
   "Trim leading and trailing fluff from strings in LINES list."
   "Trim leading and trailing fluff from strings in LINES list."
   (let ((left-edge 1000))
   (let ((left-edge 1000))
     (dolist (s lines)
     (dolist (s lines)
@@ -51,6 +51,13 @@ As a side-effect set point to the start of the next line."
                 (substring s left-edge)))
                 (substring s left-edge)))
             lines)))
             lines)))
 
 
+(defun rpl-tidy-stack-effect-lines (lines)
+  "Tidy-up stack-effect lines."
+  (rpl-trim-stack-effect-lines
+   (mapcar (lambda (ln)
+             (replace-regexp-in-string "\\\\->" "-->" ln))
+           lines)))
+
 (defun rpl-edb-consume-ident-line ()
 (defun rpl-edb-consume-ident-line ()
   "Consume an EDB identifier line.
   "Consume an EDB identifier line.
 Return a list of two strings: the identifier and its stack effect
 Return a list of two strings: the identifier and its stack effect
@@ -65,7 +72,7 @@ description.  Move point to the start of the next line."
              (while (and (> (length (car desc)) 0)
              (while (and (> (length (car desc)) 0)
                          (string-match ".*\\\\[[:blank:]]*$" (car desc)))
                          (string-match ".*\\\\[[:blank:]]*$" (car desc)))
                (setq desc (cons (rpl-edb-get-line) desc)))
                (setq desc (cons (rpl-edb-get-line) desc)))
-             (list name (rpl-trim-stack-effect-description (reverse desc)))))
+             (list name (rpl-tidy-stack-effect-lines (reverse desc)))))
           (t
           (t
            (list nil nil)))))
            (list nil nil)))))
 
 
@@ -140,7 +147,7 @@ Return a string.  Move point to the start of the next line."
   "A place on which to push the entries parsed from the EDB file.")
   "A place on which to push the entries parsed from the EDB file.")
 
 
 (defun rpl-edb-parse-buffer ()
 (defun rpl-edb-parse-buffer ()
-  "Parse the current buffer, assumed to be the entries.db file.
+  "Parse the current buffer, assumed to be the ``entries.db'' file.
 Set `rpl-edb-entries' to the parsed results, a list of EDB
 Set `rpl-edb-entries' to the parsed results, a list of EDB
 entries, where each entry has the format:
 entries, where each entry has the format:
   (NAMES STACK-EFFECT DESCRIPTION CALC-INFOS)
   (NAMES STACK-EFFECT DESCRIPTION CALC-INFOS)
@@ -240,13 +247,19 @@ calculator model, e.g. :48G, :49G etc."
   (concat "sysrpl-data." (substring (symbol-name calculator) 1) ".el"))
   (concat "sysrpl-data." (substring (symbol-name calculator) 1) ".el"))
 
 
 (defun rpl-edb-make-calculator-data-file (calculator)
 (defun rpl-edb-make-calculator-data-file (calculator)
-  ""
+  "Make the appropriate SysRPL data file for CALCULATOR.
+The CALCULATOR is identified by keyword: :38G, :39G, :48G
+or :49G."
   (cl-assert (keywordp calculator))
   (cl-assert (keywordp calculator))
   (rpl-write-data-file (rpl-edb-generate-calculator-data calculator)
   (rpl-write-data-file (rpl-edb-generate-calculator-data calculator)
                        (rpl-edb-make-data-filename calculator)))
                        (rpl-edb-make-data-filename calculator)))
 
 
 (defun rpl-edb-make-all-data-files ()
 (defun rpl-edb-make-all-data-files ()
-  ""
+  "Create all SysRPL data files.
+Assumes the current buffer contains the ``entries.db'' file
+created by Carsten Dominik, parsing it if necessary to set the
+`rpl-edb-entries' variable, then writing captured data to the
+SysRPL data files, one for each calculator type."
   (interactive)
   (interactive)
   (unless rpl-edb-entries
   (unless rpl-edb-entries
     (rpl-edb-parse-buffer))
     (rpl-edb-parse-buffer))

部分文件因为文件数量过多而无法显示