aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/openaxiom-c-macros.h.in289
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--src/ChangeLog10
-rw-r--r--src/boot/scanner.boot3
-rw-r--r--src/boot/strap/scanner.clisp7
-rw-r--r--src/boot/strap/utility.clisp23
-rw-r--r--src/boot/utility.boot13
-rw-r--r--src/interp/io.boot3
-rw-r--r--src/interp/match.boot9
10 files changed, 341 insertions, 38 deletions
diff --git a/config/openaxiom-c-macros.h.in b/config/openaxiom-c-macros.h.in
index 91a98cbb..41805ba4 100644
--- a/config/openaxiom-c-macros.h.in
+++ b/config/openaxiom-c-macros.h.in
@@ -1,5 +1,189 @@
/* config/openaxiom-c-macros.h.in. Generated from configure.ac by autoheader. */
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Host has AF_LOCAL */
+#undef HAVE_AF_LOCAL
+
+/* Host has AF_UNIX */
+#undef HAVE_AF_UNIX
+
+/* Define to 1 if you have the declaration of `fork', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FORK
+
+/* Define to 1 if you have the declaration of `getegid', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETEGID
+
+/* Define to 1 if you have the declaration of `geteuid', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETEUID
+
+/* Define to 1 if you have the declaration of `getgid', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GETGID
+
+/* Define to 1 if you have the declaration of `getuid', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GETUID
+
+/* Define to 1 if you have the declaration of `kill', and to 0 if you don't.
+ */
+#undef HAVE_DECL_KILL
+
+/* Define to 1 if you have the declaration of `openpty', and to 0 if you
+ don't. */
+#undef HAVE_DECL_OPENPTY
+
+/* Define to 1 if you have the declaration of `sigaction', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SIGACTION
+
+/* Define to 1 if you have the declaration of `wait', and to 0 if you don't.
+ */
+#undef HAVE_DECL_WAIT
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if the system has the type `int16_t'. */
+#undef HAVE_INT16_T
+
+/* Define to 1 if the system has the type `int32_t'. */
+#undef HAVE_INT32_T
+
+/* Define to 1 if the system has the type `int64_t'. */
+#undef HAVE_INT64_T
+
+/* Define to 1 if the system has the type `int8_t'. */
+#undef HAVE_INT8_T
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#undef HAVE_INTMAX_T
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <libutil.h> header file. */
+#undef HAVE_LIBUTIL_H
+
+/* Define to 1 if you support file names longer than 14 characters. */
+#undef HAVE_LONG_FILE_NAMES
+
+/* Define to 1 if the system has the type `long long int'. */
+#undef HAVE_LONG_LONG_INT
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <pty.h> header file. */
+#undef HAVE_PTY_H
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#undef HAVE_UINT16_T
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#undef HAVE_UINT32_T
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#undef HAVE_UINT64_T
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#undef HAVE_UINT8_T
+
+/* Define to 1 if the system has the type `uintmax_t'. */
+#undef HAVE_UINTMAX_T
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
+
+/* Define to 1 if you have the <util.h> header file. */
+#undef HAVE_UTIL_H
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
+
+/* Define to 1 if you have the <X11/xpm.h> header file. */
+#undef HAVE_X11_XPM_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* The kind of base runtime system for this build. */
+#undef OPENAXIOM_BASE_RTS
+
+/* Extension of executable file. */
+#undef OPENAXIOM_EXEEXT
+
+/* The width of the host Lisp and CPU registers. */
+#undef OPENAXIOM_HOST_LISP_PRECISION
+
+/* mmap anonymous flag */
+#undef OPENAXIOM_MM_ANONYMOUS_MAP_FLAG
+
+/* Whether to use the QT-based GUI interface as driver. */
+#undef OPENAXIOM_USE_GUI
+
+/* Whether to use the session manager as driver. */
+#undef OPENAXIOM_USE_SMAN
+
+/* Name of package */
+#undef PACKAGE
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -17,3 +201,108 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+
+/* The size of `void*', as computed by sizeof. */
+#undef SIZEOF_VOIDP
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int16_t
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+ a type exists and the standard includes do not define it. */
+#undef int8_t
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
+#undef intmax_t
+
+/* Define to the type of a signed integer type wide enough to hold a pointer,
+ if such a type exists, and if the system does not define it. */
+#undef intptr_t
+
+/* Alignment specifier operator */
+#undef openaxiom_alignas
+
+/* Alignment query operator */
+#undef openaxiom_alignment
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint64_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint8_t
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
+#undef uintmax_t
+
+/* Define to the type of an unsigned integer type wide enough to hold a
+ pointer, if such a type exists, and if the system does not define it. */
+#undef uintptr_t
diff --git a/configure b/configure
index 95118806..0b1206ab 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for OpenAxiom 1.5.0-2012-05-26.
+# Generated by GNU Autoconf 2.68 for OpenAxiom 1.5.0-2012-05-28.
#
# Report bugs to <open-axiom-bugs@lists.sf.net>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.5.0-2012-05-26'
-PACKAGE_STRING='OpenAxiom 1.5.0-2012-05-26'
+PACKAGE_VERSION='1.5.0-2012-05-28'
+PACKAGE_STRING='OpenAxiom 1.5.0-2012-05-28'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
PACKAGE_URL=''
@@ -1365,7 +1365,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenAxiom 1.5.0-2012-05-26 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.5.0-2012-05-28 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1440,7 +1440,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.5.0-2012-05-26:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.5.0-2012-05-28:";;
esac
cat <<\_ACEOF
@@ -1553,7 +1553,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.5.0-2012-05-26
+OpenAxiom configure 1.5.0-2012-05-28
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2546,7 +2546,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenAxiom $as_me 1.5.0-2012-05-26, which was
+It was created by OpenAxiom $as_me 1.5.0-2012-05-28, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3479,7 +3479,7 @@ fi
# Define the identity of the package.
PACKAGE='openaxiom'
- VERSION='1.5.0-2012-05-26'
+ VERSION='1.5.0-2012-05-28'
cat >>confdefs.h <<_ACEOF
@@ -20276,7 +20276,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenAxiom $as_me 1.5.0-2012-05-26, which was
+This file was extended by OpenAxiom $as_me 1.5.0-2012-05-28, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20342,7 +20342,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-OpenAxiom config.status 1.5.0-2012-05-26
+OpenAxiom config.status 1.5.0-2012-05-28
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index f4161817..0c11c545 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,7 @@ dnl Makefiles for building OpenAxiom interpreter, compiler, libraries, and
dnl auxiliary tools where appropriate.
dnl
-AC_INIT([OpenAxiom], [1.5.0-2012-05-26],
+AC_INIT([OpenAxiom], [1.5.0-2012-05-28],
[open-axiom-bugs@lists.sf.net])
dnl Most of the macros used in this configure.ac are defined in files
diff --git a/src/ChangeLog b/src/ChangeLog
index 43a06c68..7a530006 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
+2012-05-28 Gabriel Dos Reis <gdr@cse.tamu.edu>
+
+ * interp/io.boot (findChar): Do not define here.
+ * interp/match.boot (charPosition): Likewise.
+ * boot/utility.boot (charPosition): Now return argument string
+ length if no match.
+ (findChar): New.
+ * boot/scanner.boot (lexerCharPosition): Adjust.
+ (shoeAccumulateLines): Use findChar.
+
2012-05-26 Gabriel Dos Reis <gdr@cs.tamu.edu>
* boot/ast.boot (bfMDef): Simplify.
diff --git a/src/boot/scanner.boot b/src/boot/scanner.boot
index b9272757..8b9a5e5e 100644
--- a/src/boot/scanner.boot
+++ b/src/boot/scanner.boot
@@ -115,7 +115,6 @@ macro lexerCharacterAt(lex,k) ==
++ Return the position of next character `c', or end of line.
lexerCharPosition(lex,c) ==
charPosition(c,lexerLineString lex,lexerCurrentPosition lex)
- or lexerLineLength lex
++ Return true if the current position is at end of line.
lexerEol? lex ==
@@ -179,7 +178,7 @@ shoeAccumulateLines(lex,s,string)==
command and #command > 0 =>
stringChar(command,0) = char ";" =>
shoeAccumulateLines(lex,$r,string)
- a := charPosition(char ";",command,0) =>
+ a := findChar(char ";",command) =>
shoeAccumulateLines(lex,$r,
strconc(string,subString(command,0,a-1)))
shoeAccumulateLines(lex,$r,strconc(string,command))
diff --git a/src/boot/strap/scanner.clisp b/src/boot/strap/scanner.clisp
index e1b8418a..744d4e28 100644
--- a/src/boot/strap/scanner.clisp
+++ b/src/boot/strap/scanner.clisp
@@ -69,10 +69,7 @@
(LIST 'SCHAR (LIST '|lexerLineString| |lex|) |k|))
(DEFUN |lexerCharPosition| (|lex| |c|)
- (OR
- (|charPosition| |c| (|lexerLineString| |lex|)
- (|lexerCurrentPosition| |lex|))
- (|lexerLineLength| |lex|)))
+ (|charPosition| |c| (|lexerLineString| |lex|) (|lexerCurrentPosition| |lex|)))
(DEFUN |lexerEol?| (|lex|)
(NOT (< (|lexerCurrentPosition| |lex|) (|lexerLineLength| |lex|))))
@@ -164,7 +161,7 @@
(COND
((CHAR= (SCHAR |command| 0) (|char| '|;|))
(|shoeAccumulateLines| |lex| |$r| |string|))
- ((SETQ |a| (|charPosition| (|char| '|;|) |command| 0))
+ ((SETQ |a| (|findChar| (|char| '|;|) |command|))
(|shoeAccumulateLines| |lex| |$r|
(CONCAT |string|
(|subString| |command| 0
diff --git a/src/boot/strap/utility.clisp b/src/boot/strap/utility.clisp
index 4de1d345..daec2a91 100644
--- a/src/boot/strap/utility.clisp
+++ b/src/boot/strap/utility.clisp
@@ -22,7 +22,7 @@
|symbolAssoc| |applySubst| |applySubst!| |applySubstNQ|
|objectAssoc| |remove| |removeSymbol| |atomic?| |every?|
|any?| |take| |takeWhile| |drop| |copyTree| |finishLine|
- |stringSuffix?|)))
+ |stringSuffix?| |findChar| |charPosition|)))
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Thing| |%Thing|) |%Thing|) |substitute|))
@@ -429,14 +429,27 @@
((OR (CHARACTERP |x|) (INTEGERP |x|)) (|removeScalar| |l| |x|))
(T (|removeValue| |l| |x|))))
+(DEFUN |findChar| (|c| |s| &OPTIONAL (|k| 0))
+ (LET ((|bfVar#2| NIL) (|bfVar#1| (|maxIndex| |s|)) (|i| |k|))
+ (LOOP
+ (COND ((> |i| |bfVar#1|) (RETURN |bfVar#2|))
+ (T
+ (AND (CHAR= (SCHAR |s| |i|) |c|)
+ (PROGN
+ (SETQ |bfVar#2| |i|)
+ (COND (|bfVar#2| (RETURN |bfVar#2|)))))))
+ (SETQ |i| (+ |i| 1)))))
+
(DEFUN |charPosition| (|c| |s| |k|)
(LET* (|n|)
(PROGN
(SETQ |n| (LENGTH |s|))
- (LOOP
- (COND ((NOT (< |k| |n|)) (RETURN NIL))
- ((CHAR= (SCHAR |s| |k|) |c|) (RETURN |k|))
- (T (SETQ |k| (+ |k| 1))))))))
+ (COND ((MINUSP |k|) |n|)
+ (T
+ (LOOP
+ (COND ((NOT (< |k| |n|)) (RETURN |k|))
+ ((CHAR= (SCHAR |s| |k|) |c|) (RETURN |k|))
+ (T (SETQ |k| (+ |k| 1))))))))))
(DEFUN |firstNonblankPosition| (|s| |k|)
(LET ((|bfVar#2| NIL) (|bfVar#1| (- (LENGTH |s|) 1)) (|i| |k|))
diff --git a/src/boot/utility.boot b/src/boot/utility.boot
index 42bbbf00..6dfdb668 100644
--- a/src/boot/utility.boot
+++ b/src/boot/utility.boot
@@ -49,7 +49,7 @@ module utility (objectMember?, symbolMember?, stringMember?,
setDifference, setUnion, setIntersection,
symbolAssoc, applySubst, applySubst!, applySubstNQ, objectAssoc,
remove, removeSymbol, atomic?, every?, any?, take, takeWhile, drop,
- copyTree, finishLine, stringSuffix?) where
+ copyTree, finishLine, stringSuffix?, findChar, charPosition) where
substitute: (%Thing,%Thing,%Thing) -> %Thing
substitute!: (%Thing,%Thing,%Thing) -> %Thing
append: (%List %Thing,%List %Thing) -> %List %Thing
@@ -339,12 +339,19 @@ remove(l,x) ==
--% search
+++ Return the index of the first match of character `c' in string `s'
+++ starting from `k', if any. Otherwise return nil.
+findChar(c,s,k == 0) ==
+ or/[i for i in k..maxIndex s | stringChar(s,i) = c]
+
++ Return the index of the character `c' in the string `s', if present.
-++ Otherwise, return nil.
+++ Otherwise return the one-past-the-end index of `s' or k, whichever
+++ is greater.
charPosition(c,s,k) ==
n := # s
+ k < 0 => n
repeat
- k >= n => return nil
+ k >= n => return k
stringChar(s,k) = c => return k
k := k + 1
diff --git a/src/interp/io.boot b/src/interp/io.boot
index 2191c3d8..f7a35617 100644
--- a/src/interp/io.boot
+++ b/src/interp/io.boot
@@ -93,9 +93,6 @@ expandLeadingTabs line ==
nbLoc = indLoc => line
strconc(makeString(indLoc,char " "), subString(line,nbLoc))
-findChar(c,s,k == 0) ==
- or/[i for i in k..maxIndex s | stringChar(s,i) = c]
-
++ Find the position at which `s1' matches a substring of `s2',
++ starting from `k'. Return nil on failure.
findString(s1,s2,k == 0) ==
diff --git a/src/interp/match.boot b/src/interp/match.boot
index 7e8144f9..b8c92e10 100644
--- a/src/interp/match.boot
+++ b/src/interp/match.boot
@@ -56,15 +56,6 @@ anySubstring?(part,whole,startpos) ==
or/[((k := i) and "and"/[CHAR_-EQUAL(part.ip,whole.iw)
for ip in 0..np - 1 for iw in i..]) for i in startpos..nw - np] => k
-charPosition(c,t,startpos) ==
- n := # t
- startpos < 0 or startpos > n => n
- k:= startpos
- for i in startpos .. n-1 repeat
- c = t.i => return nil
- k := k+1
- k
-
rightCharPosition(c,t,startpos) == --startpos often equals maxIndex t (rightmost)
k := startpos
for i in startpos..0 by -1 while c ~= stringChar(t,i) repeat (k := k - 1)