Changeset 25672 in project


Ignore:
Timestamp:
12/11/11 17:47:09 (9 years ago)
Author:
Alan Post
Message:

genturfahi: Add utf8 support.

I call string-ref, which is now o(n) rather than o(1). This needs
to be fixed by splitting the string into a list.

I would like to support UTF8 in my grammar, which will require
rebuilding the bootstrap code, now that I support UTF8 in the
parser.

Location:
release/4/genturfahi/trunk
Files:
1 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/genturfahi/trunk/chicken-cmd.scm

    r21822 r25672  
    2020(include "chicken-declare.scm")
    2121
    22 ;(use utf8)
     22(use utf8)
    2323(use srfi-28)    ; Basic Format Strings
    2424(use srfi-37)    ; args-fold
  • release/4/genturfahi/trunk/chicken-csi.scm

    r22502 r25672  
    1818;;;;
    1919
     20(use utf8)
    2021(use srfi-1)
    2122(use srfi-9)
    22 (use srfi-13)    ; String Libraries
    23 (use srfi-14)    ; Character Classes
    24 (use srfi-28)    ; Basic Format Strings
    25 (use srfi-37)    ; args-fold
    26 (use srfi-39)    ; parameter objects
    27 (use srfi-69)    ; hash tables
    28 (use extras)     ; format, pretty-print
     23(use utf8-srfi-13) ; String Libraries
     24(use utf8-srfi-14) ; Character Classes
     25(use srfi-28)      ; Basic Format Strings
     26(use srfi-37)      ; args-fold
     27(use srfi-39)      ; parameter objects
     28(use srfi-69)      ; hash tables
     29(use extras)       ; format, pretty-print
    2930(use matchable)
    30 (use sandbox)    ; safe-eval
     31(use ports)
     32(use stack)
     33(use sandbox)      ; safe-eval
     34(use test)         ; test environment.
    3135
    3236(include "chicken-platform.scm")
  • release/4/genturfahi/trunk/chicken-ext-peg.scm

    r22819 r25672  
    126126(include "chicken-declare.scm")
    127127
    128 ;(require-extension utf8)
     128(require-extension utf8)
    129129
    130130(require-extension srfi-1)
    131 (require-extension srfi-13)
    132 (require-extension srfi-14)
     131(require-extension utf8-srfi-13)
     132(require-extension utf8-srfi-14)
    133133(require-extension srfi-69)
    134134(require-extension ports)
     
    138138(require-library genturfahi)
    139139
     140(import utf8)
    140141(import srfi-1)          ; unzip2
    141 (import srfi-13)         ; string-append, string-copy
    142 (import srfi-14)         ; character set library
     142(import utf8-srfi-13)    ; string-append, string-copy
     143(import utf8-srfi-14)    ; character set library
    143144(import srfi-69)         ; basic hash tables
    144145(import ports)           ; Chicken Scheme srfi-6 and port extensions
  • release/4/genturfahi/trunk/chicken-ext.scm

    r25412 r25672  
    165165(include "chicken-declare.scm")
    166166
    167 ;(require-extension utf8)
     167(require-extension utf8)
    168168
    169169(require-extension srfi-1)
    170170;(require-extension srfi-6)         ; built-in
    171171;(require-extension srfi-9)         ; built-in
    172 (require-extension srfi-13)
    173 (require-extension srfi-14)
     172(require-extension utf8-srfi-13)
     173(require-extension utf8-srfi-14)
    174174(require-extension srfi-18)
    175175;(require-extension srfi-28)        ; built-in
     
    182182(require-extension ports)
    183183
     184(import utf8)
    184185(import srfi-1)          ; filter
    185186;(import srfi-6)          ; string ports
    186187;(import srfi-9)          ; define-record-type
    187 (import srfi-13)         ; string-copy
    188 (import srfi-14)         ; character set library
     188(import utf8-srfi-13)    ; string-copy
     189(import utf8-srfi-14)    ; character set library
    189190(import srfi-18)         ; multi-threading support
    190191;(import srfi-28)         ; basic format strings
  • release/4/genturfahi/trunk/genturfahi.meta

    r25671 r25672  
    33 (doc-from-wiki)
    44 (license "ISC")
    5  (depends matchable sandbox srfi-37)
     5 (depends matchable sandbox srfi-37 utf8)
    66 (test-depends test utils)
    77 (synopsis "lo ke pe'a jajgau ratcu ke'e genturfa'i"))
  • release/4/genturfahi/trunk/tests/run.scm

    r22817 r25672  
    1818;;;;
    1919
    20 (use genturfahi genturfahi-peg test utils)
     20(use utf8 utf8-srfi-14 genturfahi genturfahi-peg test utils)
    2121
    2222(include "empty-string.scm")
     
    4343(include "lerfu-klesi.scm")
    4444(include "mex.scm")
     45(include "utf8.scm")
    4546(include "rrecursion.scm")
    4647(include "lrecursion.scm")
  • release/4/genturfahi/trunk/tests/utf8.peg

    r25671 r25672  
    33;;;;            `-> A Scheme packrat parser.
    44;;;;
    5 ;;;; Copyright (c) 2010 ".alyn.post." <alyn.post@lodockikumazvati.org>
     5;;;; Copyright (c) 2011 ".alyn.post." <alyn.post@lodockikumazvati.org>
    66;;;;
    77;;;; Permission to use, copy, modify, and/or distribute this software for any
     
    1818;;;;
    1919
    20 (include "chicken-declare.scm")
    21 
    22 ;(use utf8)
    23 (use srfi-28)    ; Basic Format Strings
    24 (use srfi-37)    ; args-fold
    25 (use extras)     ; pretty-print
    26 (use genturfahi)
    27 (use genturfahi-peg)
    28 
    29 (include "license.scm")
    30 (include "main-srfi-37.scm")
    31 
    32 (main)
    33 (exit (secuxna-exit-status))
     20gerna <- #\«
     21         "¿?"
     22         #:valsi ( !#\∞ !#\» . )*
     23         #:inf [∞]*
     24         #\»
     25      -> test-utf8
Note: See TracChangeset for help on using the changeset viewer.