From 303200b9e863d2a1ff07180b5211a6826ea75f36 Mon Sep 17 00:00:00 2001 From: Ludovic Courtes Date: Sun, 1 Jul 2007 23:49:09 +0000 Subject: `base' package: Honor `:line #f' in `prog'. * src/guile/skribilo/prog.scm: Use `srfi-11' instead of `receive'. (make-prog-body): When creating a `&prog-line', set the `:number' option only if `lnum-init' is true. git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-130 --- ChangeLog | 18 ++++++++++++++++++ src/guile/skribilo/prog.scm | 32 ++++++++++++++++---------------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index e993ff3..8a5a0e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,24 @@ # arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2 # +2007-07-01 23:49:09 GMT Ludovic Courtes patch-130 + + Summary: + `base' package: Honor `:line #f' in `prog'. + Revision: + skribilo--devo--1.2--patch-130 + + * src/guile/skribilo/prog.scm: Use `srfi-11' instead of `receive'. + (make-prog-body): When creating a `&prog-line', set the `:number' + option only if `lnum-init' is true. + + modified files: + ChangeLog src/guile/skribilo/prog.scm + + new patches: + lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-114 + + 2007-07-01 23:48:43 GMT Ludovic Courtes patch-129 Summary: diff --git a/src/guile/skribilo/prog.scm b/src/guile/skribilo/prog.scm index 0113db6..9ea334d 100644 --- a/src/guile/skribilo/prog.scm +++ b/src/guile/skribilo/prog.scm @@ -1,7 +1,7 @@ ;;; prog.scm -- All the stuff for the prog markup ;;; -;;; Copyright 2003 Erick Gallesio - I3S-CNRS/ESSI -;;; Copyright 2006 Ludovic Courtès +;;; Copyright 2003 Erick Gallesio - I3S-CNRS/ESSI +;;; Copyright 2006, 2007 Ludovic Courtès ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -21,7 +21,8 @@ (define-module (skribilo prog) :use-module (ice-9 regex) - :autoload (ice-9 receive) (receive) + :use-module (srfi srfi-11) + :use-module (skribilo lib) ;; `new' :use-module (skribilo ast) :use-module (skribilo utils syntax) @@ -32,11 +33,10 @@ (fluid-set! current-reader %skribilo-module-reader) -;;; ====================================================================== ;;; -;;; COMPATIBILITY +;;; Bigloo compatibility. ;;; -;;; ====================================================================== + (define pregexp-match string-match) (define pregexp-replace (lambda (rx str what) (regexp-substitute/global #f rx str @@ -54,7 +54,7 @@ ;*---------------------------------------------------------------------*/ ;* *lines* ... */ ;*---------------------------------------------------------------------*/ -;; FIXME: Removed that global. Rework the thing. +;; FIXME: Remove that global. Rework the thing. (define *lines* (make-hash-table)) ;*---------------------------------------------------------------------*/ @@ -99,14 +99,14 @@ (res '())) (if (null? ls) (values #f line) - (receive (m l) - (extract-mark (car ls) mark regexp) + (let-values (((m l) + (extract-mark (car ls) mark regexp))) (if (not m) (loop (cdr ls) (cons l res)) (values m (append (reverse! res) (cons l (cdr ls))))))))) ((node? line) - (receive (m l) - (extract-mark (node-body line) mark regexp) + (let-values (((m l) + (extract-mark (node-body line) mark regexp))) (if (not m) (values #f line) (begin @@ -200,17 +200,17 @@ lnum) (length lines))))) (let loop ((lines lines) - (lnum lnum) - (res '())) + (lnum lnum) + (res '())) (if (null? lines) (reverse! res) - (receive (m l) - (extract-mark (car lines) mark regexp) + (let-values (((m l) + (extract-mark (car lines) mark regexp))) (let* ((line-ident (symbol->string (gensym "&prog-line"))) (n (new markup (markup '&prog-line) (ident line-ident) - (options `((:number ,lnum))) + (options `((:number ,(and lnum-init lnum)))) (body (if m (make-line-mark m line-ident l) l))))) (loop (cdr lines) (+ lnum 1) -- cgit v1.2.3