Changeset 38598 in project for release


Ignore:
Timestamp:
04/07/20 05:52:30 (4 months ago)
Author:
Kon Lovett
Message:

hide *output-grammar*, ... behind active-grammar

Location:
release/5/slib-prec/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/slib-prec/trunk/slib-grammar.scm

    r38563 r38598  
    2828;;from jacal unparse.scm
    2929(define (print-using-grammar sexp grm)
    30   (print "[" (grammar-name grm) "] " sexp)
    31   #;
    32   (template-print sexp (grammar-write-tab grm)))
     30  ;(print "[" (grammar-name grm) "] " sexp)
     31  (pretty-print sexp)
     32  #; ;needs most of jacal!
     33  (template-print sexp (grammar-write-tab grm)) )
    3334
    34 ;#|
    3535; supplies module based struct tag & other identifiers
    3636(define-record grammar name reader read-tab writer write-tab)
     
    8484       col)
    8585    (read-char port)))
    86 ;|#
    8786
    8887;;
     
    106105      (grammar-reader-set! grm tmp)
    107106      res ) ) )
    108 
    109 ;from jacal toploads.scm
    110 (define *input-grammar* (get-grammar 'scheme))
    111 (define *output-grammar* (get-grammar 'scheme))
    112 (define *echo-grammar* (get-grammar 'null))
    113 (define tran:translations '())
    114 ;(define Language #f)
    115 (define math:debug #f)
    116 (define math:phases #f)
    117 (define math:trace #f)
    118 ;(define linkradicals #f)
    119 (define horner #f)
    120 (define page-height #f)
    121 (define page-width #f)
    122 ;(define newextstr #f)
    123 ;(define newlabelstr #f)
    124 ;(define newlabelsym #f)
    125 ;(define % #f)
    126 ;(define *modulus* 0)
    127 
    128 ;
    129 (define (math:error . args) (apply slib:error 'math: args))
    130 (define (math:warn . args) (apply slib:warn 'math: args))
    131 (define (math:exit b) #;(cleanup-handlers!) (slib:error "error in math system"))
  • release/5/slib-prec/trunk/slib-prec-grammar.scm

    r38563 r38598  
    77(;export
    88  ;
    9   *input-grammar*
    10   *output-grammar*
    11   *echo-grammar*
     9  active-grammar
    1210  active-grammar-set!
    1311  read-syntax-setup!
     
    5048
    5149(include "slib-compat")
     50
     51(define (math:error . args) (apply slib:error 'math: args))
     52(define (math:warn . args) (apply slib:warn 'math: args))
     53(define (math:exit b) #;(cleanup-handlers!) (slib:error "error in math system"))
     54
    5255(include "slib-grammar")
     56
     57(define *input-grammar*)
     58(define *output-grammar*)
     59(define *echo-grammar*)
     60
    5361(include "output-grammars")
    5462(include "input-grammars")
     
    8896  (set! *echo-grammar* echo) )
    8997
     98(define (active-grammar) (values *input-grammar* *output-grammar* *echo-grammar*))
     99
    90100;;
    91101
  • release/5/slib-prec/trunk/tests/slib-prec-test.scm

    r38563 r38598  
    1919(define ^ expt)
    2020
     21(define (active-input-grammar) (receive (i o e) (active-grammar) i))
     22
    2123;;
    2224
     
    2931;;
    3032
    31 (define (read-sexp/string str #!optional (grm *input-grammar*) (icol 0))
     33(define (read-sexp/string str #!optional (grm (active-input-grammar)) (icol 0))
    3234 (import (only (chicken port) with-input-from-string))
    3335 (with-input-from-string str (lambda () (read-sexp grm icol))) )
Note: See TracChangeset for help on using the changeset viewer.