Compare commits

..

No commits in common. '0b20cd490312de9154d023bc8627e3c90bb5845a' and '2bfe9b055193e70a7e8e9aea81790c42c41c45a9' have entirely different histories.

55
.gitignore vendored

@ -1,5 +1,58 @@
.#* config.h.in
obj/*
*.so
*.o
.deps
.libs
autom4te.cache
config.h
*.doc
*.x
*.lo
*.la
aclocal.m4
depcomp
mdate-sh
texinfo.tex
*~ *~
,* ,*
aclocal.m4
confdefs.h
config.build-subdirs
config.cache
config.h
config.status
conftest
conftest.c
depcomp
ltconfig
mdate-sh
mkinstalldirs
stamp-h1
*.go *.go
cscope.out
cscope.files
*.log
*.aux
*.cp
*.cps
*.dvi
*.fn
*.fns
*.ky
*.pg
*.toc
*.tp
*.vr
*.tps
*.vrs
*.pgs
*.rn
*.rns
*.scan
*.d
version.scm version.scm
*.m4
ltmain.sh
libtool
env

@ -1,3 +1,3 @@
This csv reader is originally wrote by Andy Wingo <wingo at pobox dot com> This csv reader is originally wrote by Andy Wingo <wingo at pobox dot com>
Modified and maintained by Nala Ginrut <nalaginrut@gmail.com> Modified and maintained by Nala Ginrut <nalaginrut@gmail.com>
Further modified for use by Brady McDonough <echo bWVAYnJhZHltY2QuY2EK | base64 -d> Further modified for use by Brady McDonough <me at bradymcd dot ca>

@ -1,6 +0,0 @@
This is an index of all major changes from the original at (https://gitlab.com/NalaGinrut/guile-csv)/
- Added a csv->sxml procedure
- Added an optional argument #:record-sym to both (csv->sxml) and (csv->xml)
- Rewrote the Makefile to install to the site directory
- Added a pre-compile step to `make install` to be friendly-er to multi-user setups and REPL users

@ -6,20 +6,12 @@ OBJ := csv.go
all: $(OBJ) all: $(OBJ)
%.go: csv/%.scm %.go: csv/%.scm
@GUILE_AUTO_COMPILE=0 guild compile $< -o $@ GUILE_AUTO_COMPILE=0 guild compile $< -o $@
install: $(TARGET)/csv $(CCACHE)/csv install:
$(TARGET)/csv:
@echo "Installing source..."
cp -fr csv/ $(TARGET) cp -fr csv/ $(TARGET)
@echo "Install complete."
$(CCACHE)/csv:
@echo "Installing objects to cache..."
mkdir -p $(CCACHE)/csv/ mkdir -p $(CCACHE)/csv/
cp -fr *.go $(CCACHE)/csv/ cp -fr *.go $(CCACHE)/csv/
@echo "Cache complete."
uninstall: uninstall:
rm -fr $(TARGET)/csv rm -fr $(TARGET)/csv

@ -72,4 +72,4 @@ breath). If anyone reading this does want such functionality and has a
description of how they think the function ought to act please do raise an description of how they think the function ought to act please do raise an
issue. issue.
[og-repo]:https://gitlab.com/NalaGinrut/guile-csv [og-repo]:(https://gitlab.com/NalaGinrut/guile-csv)

@ -1,8 +1,7 @@
;; guile-csv ;; guile-csv
;; Copyright (C) 2008, 2012, 2013, 2021 ;; Copyright (C) 2008, 2012, 2013
;; Andy Wingo <wingo at pobox dot com> ;; Andy Wingo <wingo at pobox dot com>
;; Nala Ginrut <nalaginrut@gmail.com> ;; Nala Ginrut <nalaginrut@gmail.com>
;; Brady McDonough
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU Lesser General Public License as ;; it under the terms of the GNU Lesser General Public License as
@ -37,17 +36,13 @@
(define (finish-cell b seed) (define (finish-cell b seed)
(have-cell (list->string (reverse b)) seed)) (have-cell (list->string (reverse b)) seed))
(define (next-cell b seed) (define (next-cell b seed)
(state-finish-cell (!) (finish-cell b seed))) (state-init (!) (finish-cell b seed)))
(define (state-init c seed) (define (state-init c seed)
(cond ((eqv? c delimiter) (state-init (!) (have-cell "" seed))) (cond ((eqv? c delimiter) (state-init (!) (have-cell "" seed)))
((eqv? c #\") (state-string (!) '() seed)) ((eqv? c #\") (state-string (!) '() seed))
((eqv? c #\newline) (have-cell "" seed)) ((eqv? c #\newline) seed)
((eof-object? c) seed) ((eof-object? c) seed)
(else (state-any c '() seed)))) (else (state-any c '() seed))))
(define (state-finish-cell c seed)
(cond ((eqv? c #\newline) seed)
((eof-object? c) seed)
(else (state-init c seed))))
(define (state-string c b seed) (define (state-string c b seed)
(cond ((eqv? c #\") (state-string-quote (!) b seed)) (cond ((eqv? c #\") (state-string-quote (!) b seed))
((eof-object? c) (error "Open double-quoted string" (list->string (reverse b)))) ((eof-object? c) (error "Open double-quoted string" (list->string (reverse b))))

Loading…
Cancel
Save