Fossil SCM

Sync with trunk.

florian 2025-07-21 12:20 UTC diff-word-wrap merge
Commit 931e7065bbc2731d778478e3cde45c8bfcbf2087dd2a36284e6814f1a81a72e9
202 files changed +2 +1 +6 -6 +1 -1 +1 -1 +689 -553 +30 +379 +44 -18 +7 -6 +1147 -1059 +770 -596 +1018 -707 +7092 -4380 +408 -210 +1 -1 +1 -1 +2 -1 +1 -1 +1 -1 +1 -1 +1 -1 +1 -1 +1 -1 +101 +1 -1 +10 -3 +1 -1 +172 -67 +2 -1 +2 -2 +13 -6 +30 -27 +1 -1 +15 -14 +2 -2 +16 +55 -29 +317 -173 +2 -1 +236 -72 +14 -9 +26 -3 +5 -2 +353 +165 -103 +7 -1 +1 +316 -118 +2 +2 +67 -42 +60 -5 +60 -5 +81 -20 +73 -29 +73 -29 +372 -55 +11 -3 +93 -3 +11 -3 +15 -8 +42 +5 -3 +36 -9 +12 -2 +12 -2 +3 -3 +95 -22 +1 -4 +376 -57 +11 +13 -5 +9 -8 +1 -1 +12 -1 +59 -25 -1 +7 -7 +13 -3 +40 -26 +304 -129 +3 -3 -1 +21 -8 +18 -2 +33 -21 +136 -42 +38 -12 +302 -3 +59 -2 +386 +162 -82 +53 -15 +321 -43 +106 -19 +157 -97 +89 -182 +147 -27 +59 -17 +1 -1 +39 +98 -25 +2 -4 +1 -1 +244 -115 +190 -151 +106 -61 +188 -38 +4 -3 +3 -2 +98 -48 +5 -1 +1 +9 -3 +6 -4 +12 -7 +44 -7 +17 -7 +1 -1 +1 -1 +64 -3 +95 -56 +53 -14 +92 -53 +231 -89 +34 -88 +753 -602 +28 -17 +140 -15 +1 -1 +9 -5 +8 -8 +81 -44 +1 -1 +79 -22 +58 -14 +367 -181 +36 -21 +13 -15 +79 -12 +113 -22 -346 +82 +224 +68 +1 -1 +25 +28 -25 +6 -4 +9 +84 +36 -36 +1 -1 +24 -18 +84 +141 +1 -1 +21 -11 +19 -15 +36 +16 -5 +12 -6 +18 -2 +16 -2 +3 +3 +1 -1 +9 -8 +30 -42 +10 -1 +184 -18 +18 +14 -11 +1 -1 +37 -1 +24 -3 +12 -5 +1 -1 +2 -2 +1 -1 +1 -1 +4 -4 +9 -8 +2 -2 +19 +1 +107 -75 +16 -18 +5 -4 +3 -3 +1 -1 +34 -6 +3 -3 +124 +197 -88 +23 -11 +160 -30 +12 +14
~ .fossil-settings/crlf-glob ~ .fossil-settings/ignore-glob ~ Dockerfile ~ Makefile.classic ~ Makefile.in ~ VERSION ~ auto.def ~ autosetup/local.tcl ~ extsrc/linenoise-win32.c ~ extsrc/linenoise.c ~ extsrc/pikchr-worker.js ~ extsrc/pikchr.c ~ extsrc/pikchr.js ~ extsrc/pikchr.wasm ~ extsrc/shell.c ~ extsrc/sqlite3.c ~ extsrc/sqlite3.h ~ skins/blitz/footer.txt ~ skins/darkmode/footer.txt ~ skins/default/css.txt ~ skins/default/header.txt ~ skins/eagle/css.txt ~ skins/eagle/footer.txt ~ skins/eagle/header.txt ~ skins/original/footer.txt ~ skins/original/header.txt ~ skins/xekri/css.txt ~ skins/xekri/header.txt ~ src/add.c ~ src/ajax.c ~ src/alerts.c ~ src/allrepo.c ~ src/backlink.c ~ src/backoffice.c ~ src/bisect.c ~ src/blob.c ~ src/branch.c ~ src/browse.c ~ src/builtin.c ~ src/cache.c ~ src/cgi.c ~ src/chat.c ~ src/checkin.c ~ src/checkout.c ~ src/clearsign.c ~ src/clone.c ~ src/color.c ~ src/comformat.c ~ src/configure.c ~ src/content.c ~ src/db.c ~ src/default.css ~ src/default.css ~ src/descendants.c ~ src/diff.c ~ src/diff.c ~ src/diff.tcl ~ src/diffcmd.c ~ src/diffcmd.c ~ src/dispatch.c ~ src/doc.c ~ src/encode.c ~ src/etag.c ~ src/export.c ~ src/file.c ~ src/finfo.c ~ src/forum.c ~ src/fossil.diff.js ~ src/fossil.diff.js ~ src/fossil.dom.js ~ src/fossil.fetch.js ~ src/fossil.numbered-lines.js ~ src/fossil.page.chat.js ~ src/fossil.page.forumpost.js ~ src/fossil.page.pikchrshowasm.js ~ src/fossil.page.wikiedit.js ~ src/fossil.popupwidget.js ~ src/fuzz.c ~ src/graph.c ~ src/graph.js ~ src/hook.c ~ src/http.c ~ src/http_ssl.c ~ src/info.c ~ src/interwiki.c ~ src/json_config.c ~ src/loadctrl.c ~ src/login.c ~ src/lookslike.c ~ src/main.c ~ src/main.mk ~ src/manifest.c ~ src/markdown_html.c ~ src/match.c ~ src/merge.c ~ src/merge.tcl ~ src/name.c ~ src/patch.c ~ src/path.c ~ src/pikchrshow.c ~ src/pqueue.c ~ src/printf.c ~ src/rebuild.c ~ src/regexp.c ~ src/repolist.c ~ src/report.c ~ src/schema.c ~ src/search.c ~ src/security_audit.c ~ src/setup.c ~ src/setupuser.c ~ src/shun.c ~ src/sitemap.c ~ src/smtp.c ~ src/sorttable.js ~ src/sqlcmd.c ~ src/stash.c ~ src/stat.c ~ src/statrep.c ~ src/style.c ~ src/style.chat.css ~ src/tag.c ~ src/tar.c ~ src/terminal.c ~ src/th.c ~ src/th.h ~ src/th_lang.c ~ src/th_main.c ~ src/th_tcl.c ~ src/timeline.c ~ src/tkt.c ~ src/tktsetup.c ~ src/undo.c ~ src/unversioned.c ~ src/update.c ~ src/user.c ~ src/utf8.c ~ src/util.c ~ src/wiki.c ~ src/wikiformat.c ~ src/winfile.c ~ src/winhttp.c ~ src/xfer.c ~ src/zip.c - test/comment.test ~ test/link-tester.html ~ test/link-tester.js ~ test/link-tester.json ~ test/many-www.tcl ~ test/merge1.test ~ test/merge3.test ~ test/merge4.test ~ test/tester.tcl ~ test/th1-taint.test ~ test/th1.test ~ test/update.test ~ tools/emcc.sh.in ~ tools/fake-smtpd.tcl ~ tools/find-fossil-cgis.tcl ~ tools/fossil-stress.tcl ~ tools/makemake.tcl ~ tools/mkindex.c ~ tools/randomize-js-names.tcl ~ tools/translate.c ~ win/Makefile.dmc ~ win/Makefile.mingw ~ win/Makefile.msc ~ win/build32.bat ~ win/build64.bat ~ www/aboutcgi.wiki ~ www/alerts.md ~ www/build.wiki ~ www/cgi.wiki ~ www/changes.wiki ~ www/chat.md ~ www/chroot.md ~ www/containers.md ~ www/customskin.md ~ www/env-opts.md ~ www/fileformat.wiki ~ www/fossil-is-not-relational.md ~ www/fossil-v-git.wiki ~ www/gsoc-ideas.md ~ www/hooks.md ~ www/index.wiki ~ www/inout.wiki ~ www/loadmgmt.md ~ www/mirrorlimitations.md ~ www/permutedindex.html ~ www/quickstart.wiki ~ www/reviews.wiki ~ www/selfhost.wiki ~ www/server/debian/service.md ~ www/server/windows/service.md ~ www/serverext.wiki ~ www/settings.wiki ~ www/signing.md ~ www/ssl-server.md ~ www/sync.wiki ~ www/th1.md ~ www/title-test.md ~ www/title-test.wiki
--- .fossil-settings/crlf-glob
+++ .fossil-settings/crlf-glob
@@ -1,5 +1,7 @@
11
compat/zlib/*
22
setup/fossil.iss
33
test/th1-docs-input.txt
44
test/th1-hooks-input.txt
5
+win/build32.bat
6
+win/build64.bat
57
win/buildmsvc.bat
68
--- .fossil-settings/crlf-glob
+++ .fossil-settings/crlf-glob
@@ -1,5 +1,7 @@
1 compat/zlib/*
2 setup/fossil.iss
3 test/th1-docs-input.txt
4 test/th1-hooks-input.txt
 
 
5 win/buildmsvc.bat
6
--- .fossil-settings/crlf-glob
+++ .fossil-settings/crlf-glob
@@ -1,5 +1,7 @@
1 compat/zlib/*
2 setup/fossil.iss
3 test/th1-docs-input.txt
4 test/th1-hooks-input.txt
5 win/build32.bat
6 win/build64.bat
7 win/buildmsvc.bat
8
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -5,5 +5,6 @@
55
fossil
66
fossil.exe
77
win/fossil.exe
88
*shell-see.*
99
*sqlite3-see.*
10
+bld
1011
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -5,5 +5,6 @@
5 fossil
6 fossil.exe
7 win/fossil.exe
8 *shell-see.*
9 *sqlite3-see.*
 
10
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -5,5 +5,6 @@
5 fossil
6 fossil.exe
7 win/fossil.exe
8 *shell-see.*
9 *sqlite3-see.*
10 bld
11
+6 -6
--- Dockerfile
+++ Dockerfile
@@ -3,19 +3,19 @@
33
44
## ---------------------------------------------------------------------
55
## STAGE 1: Build static Fossil binary
66
## ---------------------------------------------------------------------
77
8
-### We aren't pinning to a more stable version of Alpine because we want
8
+### We don't pin a more stable version of our base layer because we want
99
### to build with the latest tools and libraries available in case they
1010
### fixed something that matters to us since the last build. Everything
1111
### below depends on this layer, and so, alas, we toss this container's
1212
### cache on Alpine's release schedule, roughly once a month.
1313
FROM alpine:latest AS bld
1414
WORKDIR /fsl
1515
16
-### Bake the basic Alpine Linux into a base layer so it only changes
16
+### Bake the build-time userland into a base layer so it only changes
1717
### when the upstream image is updated or we change the package set.
1818
RUN set -x \
1919
&& apk update \
2020
&& apk upgrade --no-cache \
2121
&& apk add --no-cache \
@@ -23,19 +23,19 @@
2323
linux-headers musl-dev \
2424
openssl-dev openssl-libs-static \
2525
zlib-dev zlib-static
2626
2727
### Build Fossil as a separate layer so we don't have to rebuild the
28
-### Alpine environment for each iteration of Fossil's dev cycle.
28
+### userland for each iteration of Fossil's dev cycle.
2929
###
3030
### We must cope with a bizarre ADD misfeature here: it unpacks tarballs
3131
### automatically when you give it a local file name but not if you give
3232
### it a /tarball URL! It matters because we default to a URL in case
3333
### you're building outside a Fossil checkout, but when building via the
34
-### container-image target, we avoid a costly hit on fossil-scm.org
35
-### by leveraging its DVCS nature via the "tarball" command and passing
36
-### the resulting file's name in.
34
+### container-image target, we avoid a costly hit on fossil-scm.org by
35
+### leveraging its DVCS nature via the "tarball" command and passing the
36
+### resulting file's name in.
3737
ARG FSLCFG=""
3838
ARG FSLVER="trunk"
3939
ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
4040
ENV FSLSTB=/fsl/src.tar.gz
4141
ADD $FSLURL $FSLSTB
4242
--- Dockerfile
+++ Dockerfile
@@ -3,19 +3,19 @@
3
4 ## ---------------------------------------------------------------------
5 ## STAGE 1: Build static Fossil binary
6 ## ---------------------------------------------------------------------
7
8 ### We aren't pinning to a more stable version of Alpine because we want
9 ### to build with the latest tools and libraries available in case they
10 ### fixed something that matters to us since the last build. Everything
11 ### below depends on this layer, and so, alas, we toss this container's
12 ### cache on Alpine's release schedule, roughly once a month.
13 FROM alpine:latest AS bld
14 WORKDIR /fsl
15
16 ### Bake the basic Alpine Linux into a base layer so it only changes
17 ### when the upstream image is updated or we change the package set.
18 RUN set -x \
19 && apk update \
20 && apk upgrade --no-cache \
21 && apk add --no-cache \
@@ -23,19 +23,19 @@
23 linux-headers musl-dev \
24 openssl-dev openssl-libs-static \
25 zlib-dev zlib-static
26
27 ### Build Fossil as a separate layer so we don't have to rebuild the
28 ### Alpine environment for each iteration of Fossil's dev cycle.
29 ###
30 ### We must cope with a bizarre ADD misfeature here: it unpacks tarballs
31 ### automatically when you give it a local file name but not if you give
32 ### it a /tarball URL! It matters because we default to a URL in case
33 ### you're building outside a Fossil checkout, but when building via the
34 ### container-image target, we avoid a costly hit on fossil-scm.org
35 ### by leveraging its DVCS nature via the "tarball" command and passing
36 ### the resulting file's name in.
37 ARG FSLCFG=""
38 ARG FSLVER="trunk"
39 ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
40 ENV FSLSTB=/fsl/src.tar.gz
41 ADD $FSLURL $FSLSTB
42
--- Dockerfile
+++ Dockerfile
@@ -3,19 +3,19 @@
3
4 ## ---------------------------------------------------------------------
5 ## STAGE 1: Build static Fossil binary
6 ## ---------------------------------------------------------------------
7
8 ### We don't pin a more stable version of our base layer because we want
9 ### to build with the latest tools and libraries available in case they
10 ### fixed something that matters to us since the last build. Everything
11 ### below depends on this layer, and so, alas, we toss this container's
12 ### cache on Alpine's release schedule, roughly once a month.
13 FROM alpine:latest AS bld
14 WORKDIR /fsl
15
16 ### Bake the build-time userland into a base layer so it only changes
17 ### when the upstream image is updated or we change the package set.
18 RUN set -x \
19 && apk update \
20 && apk upgrade --no-cache \
21 && apk add --no-cache \
@@ -23,19 +23,19 @@
23 linux-headers musl-dev \
24 openssl-dev openssl-libs-static \
25 zlib-dev zlib-static
26
27 ### Build Fossil as a separate layer so we don't have to rebuild the
28 ### userland for each iteration of Fossil's dev cycle.
29 ###
30 ### We must cope with a bizarre ADD misfeature here: it unpacks tarballs
31 ### automatically when you give it a local file name but not if you give
32 ### it a /tarball URL! It matters because we default to a URL in case
33 ### you're building outside a Fossil checkout, but when building via the
34 ### container-image target, we avoid a costly hit on fossil-scm.org by
35 ### leveraging its DVCS nature via the "tarball" command and passing the
36 ### resulting file's name in.
37 ARG FSLCFG=""
38 ARG FSLVER="trunk"
39 ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
40 ENV FSLSTB=/fsl/src.tar.gz
41 ADD $FSLURL $FSLSTB
42
--- Makefile.classic
+++ Makefile.classic
@@ -95,11 +95,11 @@
9595
#
9696
# Automatic platform-specific options.
9797
HOST_OS_CMD = uname -s
9898
HOST_OS = $(HOST_OS_CMD:sh)
9999
100
-LIB.SunOS= -lsocket -lnsl
100
+LIB.SunOS= -lsocket -lnsl -lrt
101101
LIB += $(LIB.$(HOST_OS))
102102
103103
TCC.DragonFly += -DUSE_PREAD
104104
TCC.FreeBSD += -DUSE_PREAD
105105
TCC.NetBSD += -DUSE_PREAD
106106
--- Makefile.classic
+++ Makefile.classic
@@ -95,11 +95,11 @@
95 #
96 # Automatic platform-specific options.
97 HOST_OS_CMD = uname -s
98 HOST_OS = $(HOST_OS_CMD:sh)
99
100 LIB.SunOS= -lsocket -lnsl
101 LIB += $(LIB.$(HOST_OS))
102
103 TCC.DragonFly += -DUSE_PREAD
104 TCC.FreeBSD += -DUSE_PREAD
105 TCC.NetBSD += -DUSE_PREAD
106
--- Makefile.classic
+++ Makefile.classic
@@ -95,11 +95,11 @@
95 #
96 # Automatic platform-specific options.
97 HOST_OS_CMD = uname -s
98 HOST_OS = $(HOST_OS_CMD:sh)
99
100 LIB.SunOS= -lsocket -lnsl -lrt
101 LIB += $(LIB.$(HOST_OS))
102
103 TCC.DragonFly += -DUSE_PREAD
104 TCC.FreeBSD += -DUSE_PREAD
105 TCC.NetBSD += -DUSE_PREAD
106

No diff available

+1 -1
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1
-2.26
1
+2.27
22
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.26
2
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.27
2
+689 -553
--- auto.def
+++ auto.def
@@ -36,17 +36,31 @@
3636
}
3737
3838
# Update the minimum required SQLite version number here, and also
3939
# in src/main.c near the sqlite3_libversion_number() call. Take care
4040
# that both places agree!
41
-define MINIMUM_SQLITE_VERSION "3.46.0"
41
+define MINIMUM_SQLITE_VERSION "3.49.0"
4242
4343
# This is useful for people wanting Fossil to use an external SQLite library
4444
# to compare the one they have against the minimum required
4545
if {[opt-bool print-minimum-sqlite-version]} {
46
- puts [get-define MINIMUM_SQLITE_VERSION]
47
- exit 0
46
+ puts [get-define MINIMUM_SQLITE_VERSION]
47
+ exit 0
48
+}
49
+
50
+# Space characters have never been allowed in either the source
51
+# tree nor the build directory. But the resulting error messages
52
+# could be confusing. The following checks make the reason for the
53
+# failure clear.
54
+#
55
+if {[string first " " $autosetup(srcdir)] != -1} {
56
+ user-error "The pathname of the source tree\
57
+ may not contain space characters"
58
+}
59
+if {[string first " " $autosetup(builddir)] != -1} {
60
+ user-error "The pathname of the build directory\
61
+ may not contain space characters"
4862
}
4963
5064
set outOfTreeBuild 0
5165
if {![file exists fossil.1]} {
5266
puts "This appears to be an out-of-tree build."
@@ -53,21 +67,21 @@
5367
set outOfTreeBuild 1
5468
}
5569
5670
# sqlite wants these types if possible
5771
cc-with {-includes {stdint.h inttypes.h}} {
58
- cc-check-types uint32_t uint16_t int16_t uint8_t
72
+ cc-check-types uint32_t uint16_t int16_t uint8_t
5973
}
6074
6175
# Use pread/pwrite system calls in place of seek + read/write if possible
6276
define USE_PREAD [cc-check-functions pread]
6377
6478
# If we have cscope here, we'll use it in the "tags" target
6579
if {[cc-check-progs cscope]} {
66
- define COLLECT_CSCOPE_DATA "cscope -bR $::autosetup(srcdir)/src/*.\[ch\]"
80
+ define COLLECT_CSCOPE_DATA "cscope -bR $::autosetup(srcdir)/src/*.\[ch\]"
6781
} else {
68
- define COLLECT_CSCOPE_DATA ""
82
+ define COLLECT_CSCOPE_DATA ""
6983
}
7084
7185
# Find tclsh for the test suite.
7286
#
7387
# We can't use jimsh for this: the test suite uses features of Tcl that
@@ -80,35 +94,35 @@
8094
# Ironically, this means we may right now be running under either jimsh0
8195
# or a version of tclsh that we find unsuitable below!
8296
cc-check-progs tclsh
8397
set hbtd /usr/local/Cellar/tcl-tk
8498
if {[string equal false [get-define TCLSH]]} {
85
- msg-result "WARNING: 'make test' will not run here."
86
-} else {
87
- set v [exec /bin/sh -c "echo 'puts \$tcl_version' | tclsh"]
88
- if {[expr {$v >= 8.6}]} {
89
- msg-result "Found Tclsh version $v in the PATH."
90
- define TCLSH tclsh
91
- } elseif {[file isdirectory $hbtd]} {
92
- # This is a macOS system with the Homebrew version of Tcl/Tk
93
- # installed. Select the newest version. It won't normally be
94
- # in the PATH to avoid shadowing /usr/bin/tclsh, and even if it
95
- # were in the PATH, it's bad practice to put /usr/local/bin (the
96
- # Homebrew default) ahead of /usr/bin, especially given that
97
- # it's user-writeable by default with Homebrew. Thus, we can be
98
- # pretty sure the only way to call it is with an absolute path.
99
- set v [exec ls -tr $hbtd | tail -1]
100
- set path "$hbtd/$v/bin/tclsh"
101
- define TCLSH $path
102
- msg-result "Using Homebrew Tcl/Tk version $path."
103
- } else {
104
- msg-result "WARNING: tclsh $v found; need >= 8.6 for 'make test'."
105
- define TCLSH false ;# force "make test" failure via /usr/bin/false
106
- }
107
-}
108
-
109
-define CFLAGS [get-env CFLAGS "-g -O2"]
99
+ msg-result "WARNING: 'make test' will not run here."
100
+} else {
101
+ set v [exec sh -c "echo 'puts \$tcl_version' | tclsh"]
102
+ if {[expr {$v >= 8.6}]} {
103
+ msg-result "Found Tclsh version $v in the PATH."
104
+ define TCLSH tclsh
105
+ } elseif {[file isdirectory $hbtd]} {
106
+ # This is a macOS system with the Homebrew version of Tcl/Tk
107
+ # installed. Select the newest version. It won't normally be
108
+ # in the PATH to avoid shadowing /usr/bin/tclsh, and even if it
109
+ # were in the PATH, it's bad practice to put /usr/local/bin (the
110
+ # Homebrew default) ahead of /usr/bin, especially given that
111
+ # it's user-writeable by default with Homebrew. Thus, we can be
112
+ # pretty sure the only way to call it is with an absolute path.
113
+ set v [exec ls -tr $hbtd | tail -1]
114
+ set path "$hbtd/$v/bin/tclsh"
115
+ define TCLSH $path
116
+ msg-result "Using Homebrew Tcl/Tk version $path."
117
+ } else {
118
+ msg-result "WARNING: tclsh $v found; need >= 8.6 for 'make test'."
119
+ define TCLSH false ;# force "make test" failure via /usr/bin/false
120
+ }
121
+}
122
+
123
+define CFLAGS [get-env CFLAGS "-g -Os"]
110124
define EXTRA_CFLAGS "-Wall"
111125
define EXTRA_LDFLAGS ""
112126
define USE_SYSTEM_SQLITE 0
113127
define USE_LINENOISE 0
114128
define USE_MMAN_H 0
@@ -119,48 +133,48 @@
119133
# SQLITE_OPTIONS_EXT => build-dependent CFLAGS for sqlite3.c and shell.c
120134
121135
# Maintain the C89/C90-style order of variable declarations before statements.
122136
# Check if the compiler supports the respective warning flag.
123137
if {[cctest -cflags -Wdeclaration-after-statement]} {
124
- define-append EXTRA_CFLAGS -Wdeclaration-after-statement
138
+ define-append EXTRA_CFLAGS -Wdeclaration-after-statement
125139
}
126140
127141
128142
# This procedure is a customized version of "cc-check-function-in-lib",
129143
# that does not modify the LIBS variable. Its use prevents prematurely
130144
# pulling in libraries that will be added later anyhow (e.g. "-ldl").
131145
proc check-function-in-lib {function libs {otherlibs {}}} {
132
- if {[string length $otherlibs]} {
133
- msg-checking "Checking for $function in $libs with $otherlibs..."
134
- } else {
135
- msg-checking "Checking for $function in $libs..."
136
- }
137
- set found 0
138
- cc-with [list -libs $otherlibs] {
139
- if {[cctest_function $function]} {
140
- msg-result "none needed"
141
- define lib_$function ""
142
- incr found
143
- } else {
144
- foreach lib $libs {
145
- cc-with [list -libs -l$lib] {
146
- if {[cctest_function $function]} {
147
- msg-result -l$lib
148
- define lib_$function -l$lib
149
- incr found
150
- break
151
- }
152
- }
153
- }
154
- }
155
- }
156
- if {$found} {
157
- define [feature-define-name $function]
158
- } else {
159
- msg-result "no"
160
- }
161
- return $found
146
+ if {[string length $otherlibs]} {
147
+ msg-checking "Checking for $function in $libs with $otherlibs..."
148
+ } else {
149
+ msg-checking "Checking for $function in $libs..."
150
+ }
151
+ set found 0
152
+ cc-with [list -libs $otherlibs] {
153
+ if {[cctest_function $function]} {
154
+ msg-result "none needed"
155
+ define lib_$function ""
156
+ incr found
157
+ } else {
158
+ foreach lib $libs {
159
+ cc-with [list -libs -l$lib] {
160
+ if {[cctest_function $function]} {
161
+ msg-result -l$lib
162
+ define lib_$function -l$lib
163
+ incr found
164
+ break
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ if {$found} {
171
+ define [feature-define-name $function]
172
+ } else {
173
+ msg-result "no"
174
+ }
175
+ return $found
162176
}
163177
164178
if {![opt-bool internal-sqlite]} {
165179
proc find_system_sqlite {} {
166180
@@ -205,17 +219,17 @@
205219
set sqlite-version [string cat "-D MINIMUM_SQLITE_VERSION=" [get-define MINIMUM_SQLITE_VERSION]]
206220
lappend cmdline {*}[set sqlite-version]
207221
set ok 1
208222
set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
209223
if {$err} {
210
- configlog "Failed: [join $cmdline]"
211
- if {[string length $result]>0} {configlog $result}
212
- configlog "============"
213
- set ok 0
224
+ configlog "Failed: [join $cmdline]"
225
+ if {[string length $result]>0} {configlog $result}
226
+ configlog "============"
227
+ set ok 0
214228
} elseif {$::autosetup(debug)} {
215
- configlog "Compiled OK: [join $cmdline]"
216
- configlog "============"
229
+ configlog "Compiled OK: [join $cmdline]"
230
+ configlog "============"
217231
}
218232
if {!$ok} {
219233
user-error "unable to compile SQLite compatibility test program"
220234
}
221235
set err [catch {exec-with-stderr ./conftest__} result errinfo]
@@ -230,498 +244,527 @@
230244
test_system_sqlite
231245
232246
}
233247
234248
proc is_mingw {} {
235
- return [string match *mingw* [get-define host]]
236
-}
237
-
238
-if {[is_mingw]} {
239
- define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE
240
- define-append LIBS -lkernel32 -lws2_32
241
-} else {
242
- #
243
- # NOTE: All platforms except MinGW should use the linenoise
244
- # package. It is currently unsupported on Win32.
245
- #
246
- define USE_LINENOISE 1
247
-}
248
-
249
-if {[string match *-solaris* [get-define host]]} {
250
- define-append EXTRA_CFLAGS {-D__EXTENSIONS__}
251
-}
252
-
253
-if {[opt-bool fossil-debug]} {
254
- define CFLAGS {-g -O0 -Wall}
255
- define-append CFLAGS -DFOSSIL_DEBUG
256
- msg-result "Debugging support enabled"
257
-}
258
-
259
-if {[opt-bool no-opt]} {
260
- define CFLAGS {-g -O0 -Wall}
261
- msg-result "Builting without compiler optimization"
262
- if {[opt-bool fossil-debug]} {
263
- define-append CFLAGS -DFOSSIL_DEBUG
264
- }
265
-}
266
-
267
-if {[opt-bool with-mman]} {
268
- define-append EXTRA_CFLAGS -DUSE_MMAN_H
269
- define USE_MMAN_H 1
270
- msg-result "Enabling \"sys/mman.h\" support"
249
+ return [expr {
250
+ [string match *mingw* [get-define host]] &&
251
+ ![file exists "/dev/null"]
252
+ }]
253
+}
254
+
255
+if {[is_mingw]} {
256
+ define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE
257
+ define-append LIBS -lkernel32 -lws2_32
258
+} else {
259
+ #
260
+ # NOTE: All platforms except MinGW should use the linenoise
261
+ # package. It is currently unsupported on Win32.
262
+ #
263
+ define USE_LINENOISE 1
264
+}
265
+
266
+if {[string match *-solaris* [get-define host]]} {
267
+ define-append EXTRA_CFLAGS {-D__EXTENSIONS__}
268
+}
269
+
270
+if {[opt-bool fossil-debug]} {
271
+ define CFLAGS {-g -O0 -Wall}
272
+ define-append CFLAGS -DFOSSIL_DEBUG
273
+ msg-result "Debugging support enabled"
274
+}
275
+
276
+if {[opt-bool no-opt]} {
277
+ define CFLAGS {-g -O0 -Wall}
278
+ msg-result "Builting without compiler optimization"
279
+ if {[opt-bool fossil-debug]} {
280
+ define-append CFLAGS -DFOSSIL_DEBUG
281
+ }
282
+}
283
+
284
+if {[opt-bool with-mman]} {
285
+ define-append EXTRA_CFLAGS -DUSE_MMAN_H
286
+ define USE_MMAN_H 1
287
+ msg-result "Enabling \"sys/mman.h\" support"
271288
}
272289
273290
if {[opt-bool with-see]} {
274
- define-append EXTRA_CFLAGS -DUSE_SEE
275
- define USE_SEE 1
276
- define SQLITE3_ORIGIN 1
277
- msg-result "Enabling encryption support"
291
+ define-append EXTRA_CFLAGS -DUSE_SEE
292
+ define USE_SEE 1
293
+ define SQLITE3_ORIGIN 1
294
+ msg-result "Enabling encryption support"
278295
}
279296
280297
if {[opt-bool json]} {
281
- # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
282
- # is required in the CFLAGS because json*.c
283
- # have #ifdef guards around the whole file without
284
- # reading config.h first.
285
- define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
286
- define FOSSIL_ENABLE_JSON
287
- msg-result "JSON support enabled"
298
+ # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
299
+ # is required in the CFLAGS because json*.c
300
+ # have #ifdef guards around the whole file without
301
+ # reading config.h first.
302
+ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
303
+ define FOSSIL_ENABLE_JSON
304
+ msg-result "JSON support enabled"
288305
}
289306
290307
if {[opt-bool with-exec-rel-paths]} {
291
- define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_EXEC_REL_PATHS
292
- define FOSSIL_ENABLE_EXEC_REL_PATHS
293
- msg-result "Relative paths in external diff/gdiff enabled"
308
+ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_EXEC_REL_PATHS
309
+ define FOSSIL_ENABLE_EXEC_REL_PATHS
310
+ msg-result "Relative paths in external diff/gdiff enabled"
294311
}
295312
296313
if {[opt-bool with-th1-docs]} {
297
- define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_DOCS
298
- define FOSSIL_ENABLE_TH1_DOCS
299
- msg-result "TH1 embedded documentation support enabled"
314
+ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_DOCS
315
+ define FOSSIL_ENABLE_TH1_DOCS
316
+ msg-result "TH1 embedded documentation support enabled"
300317
}
301318
302319
if {[opt-bool with-th1-hooks]} {
303
- define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
304
- define FOSSIL_ENABLE_TH1_HOOKS
305
- msg-result "TH1 hooks support enabled"
320
+ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
321
+ define FOSSIL_ENABLE_TH1_HOOKS
322
+ msg-result "TH1 hooks support enabled"
306323
}
307324
308325
#if {[opt-bool markdown]} {
309326
# # no-op. Markdown is now enabled by default.
310327
# msg-result "Markdown support enabled"
311328
#}
312329
313330
if {[opt-bool static]} {
314
- # XXX: This will not work on all systems.
315
- define-append EXTRA_LDFLAGS -static
316
- msg-result "Trying to link statically"
331
+ # XXX: This will not work on all systems.
332
+ define-append EXTRA_LDFLAGS -static
333
+ msg-result "Trying to link statically"
317334
} else {
318
- define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1
319
- define FOSSIL_DYNAMIC_BUILD
335
+ define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1
336
+ define FOSSIL_DYNAMIC_BUILD
320337
}
321338
322339
# Check for libraries that need to be sorted out early
323340
cc-check-function-in-lib iconv iconv
324341
342
+cc-check-function-in-lib sin m
343
+cc-check-function-in-lib dlopen dl
344
+
325345
# Helper for OpenSSL checking
326346
proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto -lpthread}}} {
327
- msg-checking "Checking for $msg..."
328
- set rc 0
329
- if {[is_mingw]} {
330
- lappend libs -lgdi32 -lwsock32 -lcrypt32
331
- }
332
- if {[info exists ::zlib_lib]} {
333
- lappend libs $::zlib_lib
334
- }
335
- msg-quiet cc-with [list -cflags $cflags -libs $libs] {
336
- if {[cc-check-includes openssl/ssl.h] && \
337
- [cc-check-functions SSL_new]} {
338
- incr rc
339
- }
340
- }
341
- if {!$rc && ![is_mingw]} {
342
- # On some systems, OpenSSL appears to require -ldl to link.
343
- lappend libs -ldl
344
- msg-quiet cc-with [list -cflags $cflags -libs $libs] {
345
- if {[cc-check-includes openssl/ssl.h] && \
346
- [cc-check-functions SSL_new]} {
347
- incr rc
348
- }
349
- }
350
- }
351
- if {$rc} {
352
- msg-result "ok"
353
- return 1
354
- } else {
355
- msg-result "no"
356
- return 0
357
- }
358
-}
359
-
347
+ msg-checking "Checking for $msg..."
348
+ set rc 0
349
+ if {[is_mingw]} {
350
+ lappend libs -lgdi32 -lwsock32 -lcrypt32
351
+ }
352
+ if {[info exists ::zlib_lib]} {
353
+ lappend libs $::zlib_lib
354
+ }
355
+ msg-quiet cc-with [list -cflags $cflags -libs $libs] {
356
+ if {[cc-check-includes openssl/ssl.h] && \
357
+ [cc-check-functions SSL_new]} {
358
+ incr rc
359
+ }
360
+ }
361
+ if {!$rc && ![is_mingw]} {
362
+ # On some systems, OpenSSL appears to require -ldl to link.
363
+ lappend libs -ldl
364
+ msg-quiet cc-with [list -cflags $cflags -libs $libs] {
365
+ if {[cc-check-includes openssl/ssl.h] && \
366
+ [cc-check-functions SSL_new]} {
367
+ incr rc
368
+ }
369
+ }
370
+ }
371
+ if {$rc} {
372
+ msg-result "ok"
373
+ return 1
374
+ } else {
375
+ msg-result "no"
376
+ return 0
377
+ }
378
+}
379
+
380
+#
360381
# Check for zlib, using the given location if specified
361
-set zlibpath [opt-val with-zlib]
362
-if {$zlibpath eq "tree"} {
363
- set zlibdir [file dirname $autosetup(dir)]/compat/zlib
364
- if {![file isdirectory $zlibdir]} {
365
- user-error "The zlib in source tree directory does not exist"
366
- } elseif { ([llength [glob -nocomplain -directory $zlibdir libz*]] == 0) } {
367
- user-error "With --with-zlib=tree, $zlibdir must be configured and built first."
368
- }
369
- cc-with [list -cflags "-I$zlibdir -L$zlibdir"]
370
- define-append EXTRA_CFLAGS -I$zlibdir
371
- define-append LIBS $zlibdir/libz.a
372
- set ::zlib_lib $zlibdir/libz.a
373
- msg-result "Using zlib in source tree"
374
-} else {
375
- set cftry {""}
376
- set ldtry {""}
377
- if {$zlibpath ni {auto ""}} {
378
- lappend cftry "-I$zlibpath"
379
- lappend cftry "-I$zlibpath/include"
380
- lappend ldtry "-L$zlibpath"
381
- lappend ldtry "-L$zlibpath/lib"
382
- }
383
-
384
- # Reverse the list of tests so we check most-specific to least, else
385
- # platform devel files will shadow local --with-zlib overrides.
386
- foreach c [lreverse $cftry] {
387
- if {[cc-with [list -cflags $c] {cc-check-includes zlib.h}]} {
388
- if {$c eq ""} {
389
- msg-result "Found zlib.h in default include path"
390
- } else {
391
- define-append EXTRA_CFLAGS "$c"
392
- msg-result "Found zlib.h via $c"
393
- }
394
- set cfound $c
395
- break
396
- }
397
- }
398
- if {![info exists cfound]} {
399
- user-error "zlib.h not found; either install it or specify its location via --with-zlib"
400
- }
401
- foreach lcheck [lreverse $ldtry] {
402
- if {[cc-with [list -cflags "$cfound $lcheck"] {check-function-in-lib inflateEnd z}]} {
403
- if {$lcheck eq ""} {
404
- msg-result "Linked to zlib via default library path"
405
- } else {
406
- define-append EXTRA_LDFLAGS "$lcheck"
407
- msg-result "Linked to zlib via $lcheck"
408
- }
409
- if {![check-function-in-lib compressBound z]} {
410
- puts "Notice: disabling zlib compression in the SQL shell"
411
- define-append SQLITE_OPTIONS_EXT {-USQLITE_HAVE_ZLIB}
412
- }
413
- break
414
- }
415
- }
416
- set ::zlib_lib -lz
417
-}
418
-
419
-set ssldirs [opt-val with-openssl]
420
-if {$ssldirs ne "none"} {
382
+#
383
+proc handle-zlib {} {
384
+ set ::zlibpath [opt-val with-zlib]; # used by downstream tcl tests
385
+ if {$::zlibpath eq "tree"} {
386
+ set ::zlibdir [file dirname $::autosetup(dir)]/compat/zlib
387
+ if {![file isdirectory $::zlibdir]} {
388
+ user-error "The zlib in source tree directory does not exist"
389
+ } elseif { ([llength [glob -nocomplain -directory $::zlibdir libz*]] == 0) } {
390
+ user-error "With --with-zlib=tree, $::zlibdir must be configured and built first."
391
+ }
392
+ cc-with [list -cflags "-I$::zlibdir -L$::zlibdir"]
393
+ define-append EXTRA_CFLAGS -I$::zlibdir
394
+ define-append LIBS $::zlibdir/libz.a
395
+ set ::zlib_lib $::zlibdir/libz.a
396
+ msg-result "Using zlib in source tree"
397
+ } else {
398
+ set cftry {""}
399
+ set ldtry {""}
400
+ if {$::zlibpath ni {auto ""}} {
401
+ lappend cftry "-I$::zlibpath"
402
+ lappend cftry "-I$::zlibpath/include"
403
+ lappend ldtry "-L$::zlibpath"
404
+ lappend ldtry "-L$::zlibpath/lib"
405
+ }
406
+
407
+ # Reverse the list of tests so we check most-specific to least, else
408
+ # platform devel files will shadow local --with-zlib overrides.
409
+ foreach c [lreverse $cftry] {
410
+ if {[cc-with [list -cflags $c] {cc-check-includes zlib.h}]} {
411
+ if {$c eq ""} {
412
+ msg-result "Found zlib.h in default include path"
413
+ } else {
414
+ define-append EXTRA_CFLAGS "$c"
415
+ msg-result "Found zlib.h via $c"
416
+ }
417
+ set cfound $c
418
+ break
419
+ }
420
+ }
421
+ if {![info exists cfound]} {
422
+ user-error "zlib.h not found; either install it or specify its location via --with-zlib"
423
+ }
424
+ foreach lcheck [lreverse $ldtry] {
425
+ if {[cc-with [list -cflags "$cfound $lcheck"] {check-function-in-lib inflateEnd z}]} {
426
+ if {$lcheck eq ""} {
427
+ msg-result "Linked to zlib via default library path"
428
+ } else {
429
+ define-append EXTRA_LDFLAGS "$lcheck"
430
+ msg-result "Linked to zlib via $lcheck"
431
+ }
432
+ if {![check-function-in-lib compressBound z]} {
433
+ puts "Notice: disabling zlib compression in the SQL shell"
434
+ define-append SQLITE_OPTIONS_EXT {-USQLITE_HAVE_ZLIB}
435
+ }
436
+ break
437
+ }
438
+ }
439
+ set ::zlib_lib -lz
440
+ }
441
+}; # handle-zlib
442
+handle-zlib
443
+
444
+#
445
+# Handle the --with-openssl flag and, incidentally, update @LIBS@ for
446
+# zlib if openssl is _not_ used (if it is, we get zlib via libssl).
447
+#
448
+# This function should be called as late as possible in the configure
449
+# script to avoid that its updates to @LIBS@ break tests which follow
450
+# it when a custom local build of openssl is used, as discussed in
451
+# <https://fossil-scm.org/forum/forumpost/15e3d9cdc137030c>.
452
+#
453
+proc handle-with-openssl {} {
454
+ set ssldirs [opt-val with-openssl]
455
+ if {$ssldirs ne "none"} {
421456
set found 0
422457
if {$ssldirs eq "tree"} {
423
- set ssldir [file dirname $autosetup(dir)]/compat/openssl
424
- if {![file isdirectory $ssldir]} {
425
- user-error "The OpenSSL in source tree directory does not exist"
426
- }
427
- set msg "ssl in $ssldir"
428
- set cflags "-I$ssldir/include"
429
- set ldflags "-L$ssldir"
430
- set ssllibs "$ssldir/libssl.a $ssldir/libcrypto.a -lpthread"
431
- set found [check-for-openssl "ssl in source tree" "$cflags $ldflags" $ssllibs]
458
+ set ssldir [file dirname $::autosetup(dir)]/compat/openssl
459
+ if {![file isdirectory $ssldir]} {
460
+ user-error "The OpenSSL in source tree directory does not exist"
461
+ }
462
+ set msg "openssl in $ssldir"
463
+ set cflags "-I$ssldir/include"
464
+ set ldflags "-L$ssldir"
465
+ set ssllibs "$ssldir/libssl.a $ssldir/libcrypto.a -lpthread"
466
+ set found [check-for-openssl "openssl in source tree" "$cflags $ldflags" $ssllibs]
432467
} else {
433
- if {$ssldirs in {auto ""}} {
434
- catch {
435
- set cflags [exec pkg-config openssl --cflags-only-I]
436
- set ldflags [exec pkg-config openssl --libs-only-L]
437
- set found [check-for-openssl "ssl via pkg-config" "$cflags $ldflags"]
438
- } msg
439
- if {!$found} {
440
- set ssldirs "{} /usr/sfw /usr/local/ssl /usr/lib/ssl /usr/ssl \
468
+ if {$ssldirs in {auto ""}} {
469
+ catch {
470
+ # TODO?: use autosetup's pkg-config support
471
+ set cflags [exec pkg-config openssl --cflags-only-I]
472
+ set ldflags [exec pkg-config openssl --libs-only-L]
473
+ set found [check-for-openssl "ssl via pkg-config" "$cflags $ldflags"]
474
+ } msg
475
+ if {!$found} {
476
+ set ssldirs "{} /usr/sfw /usr/local/ssl /usr/lib/ssl /usr/ssl \
441477
/usr/pkg /usr/local /usr /usr/local/opt/openssl \
442478
/opt/homebrew/opt/openssl"
443
- }
444
- }
445
- if {!$found} {
446
- foreach dir $ssldirs {
447
- if {$dir eq ""} {
448
- set msg "system ssl"
449
- set cflags ""
450
- set ldflags ""
451
- } else {
452
- set msg "ssl in $dir"
453
- set cflags "-I$dir/include"
454
- set ldflags "-L$dir/lib"
455
- }
456
- if {[check-for-openssl $msg "$cflags $ldflags"]} {
457
- incr found
458
- break
459
- }
460
- }
461
- }
479
+ }
480
+ }
481
+ if {!$found} {
482
+ foreach dir $ssldirs {
483
+ if {$dir eq ""} {
484
+ set msg "system openssl"
485
+ set cflags ""
486
+ set ldflags ""
487
+ } else {
488
+ set msg "openssl in $dir"
489
+ set cflags "-I$dir/include"
490
+ if {[file readable $dir/libssl.a]} {
491
+ set ldflags -L$dir
492
+ } elseif {[file readable $dir/lib/libssl.a]} {
493
+ set ldflags -L$dir/lib
494
+ } elseif {[file isdir $dir/lib]} {
495
+ set ldflags "-L$dir -L$dir/lib"
496
+ } else {
497
+ set ldflags -L$dir
498
+ }
499
+ }
500
+ if {[check-for-openssl $msg "$cflags $ldflags"]} {
501
+ incr found
502
+ break
503
+ }
504
+ if {$dir ne ""} {
505
+ set ldflags ""
506
+ set msg "static build of openssl in $dir"
507
+ set ssllibs "$dir/libssl.a $dir/libcrypto.a -lpthread"
508
+ if {[check-for-openssl $msg "$cflags $ldflags" $ssllibs]} {
509
+ incr found
510
+ break
511
+ }
512
+ # This test should arguably fail here if --with-openssl=X
513
+ # points to an invalid X.
514
+ }
515
+ }
516
+ }
462517
}
463518
if {$found} {
464
- define FOSSIL_ENABLE_SSL
465
- define-append EXTRA_CFLAGS $cflags
466
- define-append EXTRA_LDFLAGS $ldflags
467
- define-append CFLAGS $cflags
468
- define-append LDFLAGS $ldflags
469
- if {[info exists ssllibs]} {
470
- define-append LIBS $ssllibs
471
- } else {
472
- define-append LIBS -lssl -lcrypto
473
- }
474
- if {[info exists ::zlib_lib]} {
475
- define-append LIBS $::zlib_lib
476
- }
477
- if {[is_mingw]} {
478
- define-append LIBS -lgdi32 -lwsock32 -lcrypt32
479
- }
480
- msg-result "HTTPS support enabled"
481
-
482
- # Silence OpenSSL deprecation warnings on Mac OS X 10.7.
483
- if {[string match *-darwin* [get-define host]]} {
484
- if {[cctest -cflags {-Wdeprecated-declarations}]} {
485
- define-append EXTRA_CFLAGS -Wdeprecated-declarations
486
- }
487
- }
488
- } else {
489
- user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
490
- }
491
-} else {
492
- if {[info exists ::zlib_lib]} {
493
- define-append LIBS $::zlib_lib
494
- }
495
-}
496
-
497
-
519
+ define FOSSIL_ENABLE_SSL
520
+ define-append EXTRA_CFLAGS $cflags
521
+ define-append EXTRA_LDFLAGS $ldflags
522
+ if {[info exists ssllibs]} {
523
+ define-append LIBS $ssllibs
524
+ } else {
525
+ define-append LIBS -lssl -lcrypto
526
+ }
527
+ if {[info exists ::zlib_lib]} {
528
+ define-append LIBS $::zlib_lib
529
+ }
530
+ if {[is_mingw]} {
531
+ define-append LIBS -lgdi32 -lwsock32 -lcrypt32
532
+ }
533
+ msg-result "HTTPS support enabled"
534
+
535
+ # Silence OpenSSL deprecation warnings on Mac OS X 10.7.
536
+ if {[string match *-darwin* [get-define host]]} {
537
+ if {[cctest -cflags {-Wdeprecated-declarations}]} {
538
+ define-append EXTRA_CFLAGS -Wdeprecated-declarations
539
+ }
540
+ }
541
+ } else {
542
+ user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
543
+ }
544
+ } else {
545
+ if {[info exists ::zlib_lib]} {
546
+ define-append LIBS $::zlib_lib
547
+ }
548
+ }
549
+}; # handle-with-openssl
550
+
551
+#
552
+# CFLAGS_INCLUDE is ONLY for -I... flags and their order is
553
+# significant so that --with-sqlite=PATH's header can shadow our
554
+# own. <s>One caveat with this is that we cannot point
555
+# --with-sqlite=PATH to the root of sqlite3's own build tree because
556
+# that dir has a config.h which ends up shadowing src/config.h,
557
+# breaking our build.</s> (That is no longer true: that that config.h
558
+# was renamed to sqlite_cfg.h at some point.)
559
+#
560
+define CFLAGS_INCLUDE {}
498561
499562
########################################################################
500563
# --with-sqlite=PATH checks for the first it finds of the following...
501564
# - PATH/sqlite3.c and PATH/sqlite3.h
502565
# - PATH/sqlite3.o (and assumes sqlite3.h is with it)
503566
# - PATH/lib/libsqlite3* and PATH/include/sqlite3.h
504
-define CFLAGS_INCLUDE {}
505
-# ^^^ CFLAGS_INCLUDE is ONLY for -I... flags and their order is
506
-# significant so that --with-sqlite=PATH's header can shadow our
507
-# own. One caveat with this is that we cannot point --with-sqlite=PATH
508
-# to the root of sqlite3's own build tree because that dir has a
509
-# config.h which ends up shadowing src/config.h, breaking our build.
510
-set sq3path [opt-val with-sqlite]
511
-define SQLITE3_SRC.2 {}
512
-define SQLITE3_OBJ.2 {}
513
-define SQLITE3_SHELL_SRC.2 {$(SQLITE3_SHELL_SRC.0)}
514
-if {$sq3path in {tree ""}} {
515
- msg-result "Using sqlite3.c from this source tree."
516
-} else {
517
- # SQLITE3_ORIGIN:
518
- # 0 = local source tree
519
- # 1 = use external lib or sqlite3.o
520
- # 2 = use external sqlite3.c and (if found) shell.c
521
- define USE_SYSTEM_SQLITE 1
522
- define SQLITE3_ORIGIN 2
523
- if {$sq3path != "auto"} {
524
- if {([file exists $sq3path/sqlite3.c]) && \
525
- ([file exists $sq3path/sqlite3.h]) } {
526
- # Prefer sqlite3.[ch] if found.
527
- define SQLITE3_SRC.2 $sq3path/sqlite3.c
528
- define SQLITE3_OBJ.2 {$(SQLITE3_OBJ.0)}
529
- define USE_SYSTEM_SQLITE 2
530
- define SQLITE3_ORIGIN 2
531
- if {[file exists $sq3path/shell.c]} {
532
- define SQLITE3_SHELL_SRC.2 $sq3path/shell.c
533
- }
534
- define-append CFLAGS_INCLUDE -I$sq3path
535
- define-append EXTRA_LDFLAGS -lpthread
536
- # ^^^ additional -lXXX flags are conservative estimates
537
- msg-result "Using sqlite3.c and sqlite3.h from $sq3path"
538
- } elseif {[file exists $sq3path/sqlite3.o]} {
539
- # Use sqlite3.o if found.
540
- define SQLITE3_OBJ.2 $sq3path/sqlite3.o
541
- define-append CFLAGS_INCLUDE -I$sq3path
542
- define-append EXTRA_LDFLAGS $sq3path/sqlite3.o -lpthread
543
- # ^^^ additional -lXXX flags are conservative estimates
544
- msg-result "Using sqlite3.o from $sq3path"
545
- } elseif { ([llength [glob -nocomplain -directory $sq3path/lib libsqlite3*]] != 0) \
546
- && ([file exists $sq3path/include/sqlite3.h]) } {
547
- # e.g. --with-sqlite=/usr/local. Try $sq3path/lib/libsqlite3*
548
- # and $sq3path/include/sqlite3.h
549
- define-append CFLAGS_INCLUDE -I$sq3path/include
550
- define-append EXTRA_LDFLAGS -L$sq3path/lib -lsqlite3 -lpthread
551
- # ^^^ additional -lXXX flags are conservative estimates
552
- msg-result "Using -lsqlite3 from $sq3path"
553
- } else {
554
- # Assume $sq3path holds both the lib and header
555
- cc-with [list -cflags "-I$sq3path -L$sq3path"]
556
- define-append CFLAGS_INCLUDE -I$sq3path
557
- define-append EXTRA_LDFLAGS -L$sq3path -lsqlite3 -lpthread
558
- # ^^^ additional -lXXX flags are conservative estimates
559
- msg-result "Using -lsqlite3 from $sq3path"
560
- }
561
- } elseif {![cc-check-includes sqlite3.h] || ![check-function-in-lib sqlite3_open_v2 sqlite3]} {
562
- user-error "libsqlite3 not found please install it or specify the location with --with-sqlite"
563
- }
564
-}
565
-define-append CFLAGS_INCLUDE {-I. -I$(SRCDIR) -I$(SRCDIR_extsrc)}
566
-
567
-set tclpath [opt-val with-tcl]
568
-if {$tclpath ne ""} {
569
- set tclprivatestubs [opt-bool with-tcl-private-stubs]
570
- # Note parse-tclconfig-sh is in autosetup/local.tcl
571
- if {$tclpath eq "1"} {
572
- set tcldir [file dirname $autosetup(dir)]/compat/tcl-8.6
573
- if {$tclprivatestubs} {
574
- set tclconfig(TCL_INCLUDE_SPEC) -I$tcldir/generic
575
- set tclconfig(TCL_VERSION) {Private Stubs}
576
- set tclconfig(TCL_PATCH_LEVEL) {}
577
- set tclconfig(TCL_PREFIX) $tcldir
578
- set tclconfig(TCL_LD_FLAGS) { }
579
- } else {
580
- # Use the system Tcl. Look in some likely places.
581
- array set tclconfig [parse-tclconfig-sh \
582
- $tcldir/unix $tcldir/win \
583
- /usr /usr/local /usr/share /opt/local]
584
- set msg "on your system"
585
- }
586
- } else {
587
- array set tclconfig [parse-tclconfig-sh $tclpath]
588
- set msg "at $tclpath"
589
- }
590
- if {[opt-bool static]} {
591
- set tclconfig(TCL_LD_FLAGS) { }
592
- }
593
- if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
594
- user-error "Cannot find Tcl $msg"
595
- }
596
- set tclstubs [opt-bool with-tcl-stubs]
597
- if {$tclprivatestubs} {
598
- define FOSSIL_ENABLE_TCL_PRIVATE_STUBS
599
- define USE_TCL_STUBS
600
- } elseif {$tclstubs && $tclconfig(TCL_SUPPORTS_STUBS)} {
601
- set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
602
- define FOSSIL_ENABLE_TCL_STUBS
603
- define USE_TCL_STUBS
604
- } else {
605
- set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
606
- }
607
- set cflags $tclconfig(TCL_INCLUDE_SPEC)
608
- if {!$tclprivatestubs} {
609
- set foundtcl 0; # Did we find a working Tcl library?
610
- cc-with [list -cflags $cflags -libs $libs] {
611
- if {$tclstubs} {
612
- if {[cc-check-functions Tcl_InitStubs]} {
613
- set foundtcl 1
614
- }
615
- } else {
616
- if {[cc-check-functions Tcl_CreateInterp]} {
617
- set foundtcl 1
618
- }
619
- }
620
- }
621
- if {!$foundtcl && [string match *-lieee* $libs]} {
622
- # On some systems, using "-lieee" from TCL_LIB_SPEC appears
623
- # to cause issues.
624
- msg-result "Removing \"-lieee\" and retrying for Tcl..."
625
- set libs [string map [list -lieee ""] $libs]
626
- cc-with [list -cflags $cflags -libs $libs] {
627
- if {$tclstubs} {
628
- if {[cc-check-functions Tcl_InitStubs]} {
629
- set foundtcl 1
630
- }
631
- } else {
632
- if {[cc-check-functions Tcl_CreateInterp]} {
633
- set foundtcl 1
634
- }
635
- }
636
- }
637
- }
638
- if {!$foundtcl && ![string match *-lpthread* $libs]} {
639
- # On some systems, TCL_LIB_SPEC appears to be missing
640
- # "-lpthread". Try adding it.
641
- msg-result "Adding \"-lpthread\" and retrying for Tcl..."
642
- set libs "$libs -lpthread"
643
- cc-with [list -cflags $cflags -libs $libs] {
644
- if {$tclstubs} {
645
- if {[cc-check-functions Tcl_InitStubs]} {
646
- set foundtcl 1
647
- }
648
- } else {
649
- if {[cc-check-functions Tcl_CreateInterp]} {
650
- set foundtcl 1
651
- }
652
- }
653
- }
654
- }
655
- if {!$foundtcl} {
656
- if {$tclstubs} {
657
- user-error "Cannot find a usable Tcl stubs library $msg"
658
- } else {
659
- user-error "Cannot find a usable Tcl library $msg"
660
- }
661
- }
662
- }
663
- set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
664
- msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
665
- if {!$tclprivatestubs} {
666
- define-append LIBS $libs
667
- }
668
- define-append EXTRA_CFLAGS $cflags
669
- define-append CFLAGS $cflags
670
- if {[info exists zlibpath] && $zlibpath eq "tree"} {
671
- #
672
- # NOTE: When using zlib in the source tree, prevent Tcl from
673
- # pulling in the system one.
674
- #
675
- set tclconfig(TCL_LD_FLAGS) [string map [list -lz ""] \
676
- $tclconfig(TCL_LD_FLAGS)]
677
- }
678
- #
679
- # NOTE: Remove "-ldl" from the TCL_LD_FLAGS because it will be
680
- # be checked for near the bottom of this file.
681
- #
682
- set tclconfig(TCL_LD_FLAGS) [string map [list -ldl ""] \
683
- $tclconfig(TCL_LD_FLAGS)]
684
- define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
685
- define FOSSIL_ENABLE_TCL
686
-}
687
-
688
-# Emscripten is a purely optional component used only for doing
689
-# in-tree builds of WASM stuff, as opposed to WASM binaries we import
690
-# from other places. This is only set up for Unix-style OSes and is
691
-# untested anywhere but Linux.
692
-set emsdkHome [opt-val with-emsdk]
693
-define EMSDK_HOME ""
694
-define EMSDK_ENV ""
695
-define EMCC_OPT "-Oz"
696
-if {$emsdkHome eq "" && [info exists ::env(EMSDK)]} {
697
- # Fall back to checking the environment. $EMSDK gets set
698
- # by sourcing emsdk_env.sh.
699
- set emsdkHome $::env(EMSDK)
700
-}
701
-if {$emsdkHome ne ""} {
702
- define EMSDK_HOME $emsdkHome
703
- set emsdkEnv "$emsdkHome/emsdk_env.sh"
704
- if {[file exists $emsdkEnv]} {
705
- puts "Using Emscripten SDK environment from $emsdkEnv."
706
- define EMSDK_ENV $emsdkEnv
707
- if {[info exists ::env(EMCC_OPT)]} {
708
- define EMCC_OPT $::env(EMCC_OPT)
709
- }
710
- } else {
711
- puts "emsdk_env.sh not found. Assuming emcc is in the PATH."
712
- }
713
-}
567
+proc handle-with-sqlite {} {
568
+ set sq3path [opt-val with-sqlite]
569
+ define SQLITE3_SRC.2 {}
570
+ define SQLITE3_OBJ.2 {}
571
+ define SQLITE3_SHELL_SRC.2 {$(SQLITE3_SHELL_SRC.0)}
572
+ if {$sq3path in {tree ""}} {
573
+ msg-result "Using sqlite3.c from this source tree."
574
+ } else {
575
+ # SQLITE3_ORIGIN:
576
+ # 0 = local source tree
577
+ # 1 = use external lib or sqlite3.o
578
+ # 2 = use external sqlite3.c and (if found) shell.c
579
+ define USE_SYSTEM_SQLITE 1
580
+ define SQLITE3_ORIGIN 2
581
+ if {$sq3path != "auto"} {
582
+ if {([file exists $sq3path/sqlite3.c]) &&
583
+ ([file exists $sq3path/sqlite3.h]) } {
584
+ # Prefer sqlite3.[ch] if found.
585
+ define SQLITE3_SRC.2 $sq3path/sqlite3.c
586
+ define SQLITE3_OBJ.2 {$(SQLITE3_OBJ.0)}
587
+ define USE_SYSTEM_SQLITE 2
588
+ define SQLITE3_ORIGIN 2
589
+ if {[file exists $sq3path/shell.c]} {
590
+ define SQLITE3_SHELL_SRC.2 $sq3path/shell.c
591
+ }
592
+ define-append CFLAGS_INCLUDE -I$sq3path
593
+ define-append EXTRA_LDFLAGS -lpthread
594
+ # ^^^ additional -lXXX flags are conservative estimates
595
+ msg-result "Using sqlite3.c and sqlite3.h from $sq3path"
596
+ } elseif {[file exists $sq3path/sqlite3.o]} {
597
+ # Use sqlite3.o if found.
598
+ define SQLITE3_OBJ.2 $sq3path/sqlite3.o
599
+ define-append CFLAGS_INCLUDE -I$sq3path
600
+ define-append EXTRA_LDFLAGS $sq3path/sqlite3.o -lpthread
601
+ # ^^^ additional -lXXX flags are conservative estimates
602
+ msg-result "Using sqlite3.o from $sq3path"
603
+ } elseif { ([llength [glob -nocomplain -directory $sq3path/lib libsqlite3*]] != 0) \
604
+ && ([file exists $sq3path/include/sqlite3.h]) } {
605
+ # e.g. --with-sqlite=/usr/local. Try $sq3path/lib/libsqlite3*
606
+ # and $sq3path/include/sqlite3.h
607
+ define-append CFLAGS_INCLUDE -I$sq3path/include
608
+ define-append EXTRA_LDFLAGS -L$sq3path/lib -lsqlite3 -lpthread
609
+ # ^^^ additional -lXXX flags are conservative estimates
610
+ msg-result "Using -lsqlite3 from $sq3path"
611
+ } else {
612
+ # Assume $sq3path holds both the lib and header
613
+ cc-with [list -cflags "-I$sq3path -L$sq3path"]
614
+ define-append CFLAGS_INCLUDE -I$sq3path
615
+ define-append EXTRA_LDFLAGS -L$sq3path -lsqlite3 -lpthread
616
+ # ^^^ additional -lXXX flags are conservative estimates
617
+ msg-result "Using -lsqlite3 from $sq3path"
618
+ }
619
+ } elseif {![cc-check-includes sqlite3.h] || ![check-function-in-lib sqlite3_open_v2 sqlite3]} {
620
+ user-error "libsqlite3 not found please install it or specify the location with --with-sqlite"
621
+ }
622
+ }
623
+}; # handle-with-sqlite
624
+handle-with-sqlite
625
+define-append CFLAGS_INCLUDE {-I. -I$(SRCDIR) -I$(SRCDIR_extsrc)}; # must be after handle-with-sqlite
626
+
627
+#
628
+# Handle the --with-tcl flag.
629
+#
630
+proc handle-with-tcl {} {
631
+ set tclpath [opt-val with-tcl]
632
+ if {$tclpath eq ""} {
633
+ return
634
+ }
635
+ set tclprivatestubs [opt-bool with-tcl-private-stubs]
636
+ # Note parse-tclconfig-sh is in autosetup/local.tcl
637
+ if {$tclpath eq "1"} {
638
+ set tcldir [file dirname $::autosetup(dir)]/compat/tcl-8.6
639
+ if {$tclprivatestubs} {
640
+ set tclconfig(TCL_INCLUDE_SPEC) -I$tcldir/generic
641
+ set tclconfig(TCL_VERSION) {Private Stubs}
642
+ set tclconfig(TCL_PATCH_LEVEL) {}
643
+ set tclconfig(TCL_PREFIX) $tcldir
644
+ set tclconfig(TCL_LD_FLAGS) { }
645
+ } else {
646
+ # Use the system Tcl. Look in some likely places.
647
+ array set tclconfig [parse-tclconfig-sh \
648
+ $tcldir/unix $tcldir/win \
649
+ /usr /usr/local /usr/share /opt/local]
650
+ set msg "on your system"
651
+ }
652
+ } else {
653
+ array set tclconfig [parse-tclconfig-sh $tclpath]
654
+ set msg "at $tclpath"
655
+ }
656
+ if {[opt-bool static]} {
657
+ set tclconfig(TCL_LD_FLAGS) { }
658
+ }
659
+ if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
660
+ user-error "Cannot find Tcl $msg"
661
+ }
662
+ set tclstubs [opt-bool with-tcl-stubs]
663
+ if {$tclprivatestubs} {
664
+ define FOSSIL_ENABLE_TCL_PRIVATE_STUBS
665
+ define USE_TCL_STUBS
666
+ } elseif {$tclstubs && $tclconfig(TCL_SUPPORTS_STUBS)} {
667
+ set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
668
+ define FOSSIL_ENABLE_TCL_STUBS
669
+ define USE_TCL_STUBS
670
+ } else {
671
+ set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
672
+ }
673
+ set cflags $tclconfig(TCL_INCLUDE_SPEC)
674
+ if {!$tclprivatestubs} {
675
+ set foundtcl 0; # Did we find a working Tcl library?
676
+ cc-with [list -cflags $cflags -libs $libs] {
677
+ if {$tclstubs} {
678
+ if {[cc-check-functions Tcl_InitStubs]} {
679
+ set foundtcl 1
680
+ }
681
+ } else {
682
+ if {[cc-check-functions Tcl_CreateInterp]} {
683
+ set foundtcl 1
684
+ }
685
+ }
686
+ }
687
+ if {!$foundtcl && [string match *-lieee* $libs]} {
688
+ # On some systems, using "-lieee" from TCL_LIB_SPEC appears
689
+ # to cause issues.
690
+ msg-result "Removing \"-lieee\" and retrying for Tcl..."
691
+ set libs [string map [list -lieee ""] $libs]
692
+ cc-with [list -cflags $cflags -libs $libs] {
693
+ if {$tclstubs} {
694
+ if {[cc-check-functions Tcl_InitStubs]} {
695
+ set foundtcl 1
696
+ }
697
+ } else {
698
+ if {[cc-check-functions Tcl_CreateInterp]} {
699
+ set foundtcl 1
700
+ }
701
+ }
702
+ }
703
+ }
704
+ if {!$foundtcl && ![string match *-lpthread* $libs]} {
705
+ # On some systems, TCL_LIB_SPEC appears to be missing
706
+ # "-lpthread". Try adding it.
707
+ msg-result "Adding \"-lpthread\" and retrying for Tcl..."
708
+ set libs "$libs -lpthread"
709
+ cc-with [list -cflags $cflags -libs $libs] {
710
+ if {$tclstubs} {
711
+ if {[cc-check-functions Tcl_InitStubs]} {
712
+ set foundtcl 1
713
+ }
714
+ } else {
715
+ if {[cc-check-functions Tcl_CreateInterp]} {
716
+ set foundtcl 1
717
+ }
718
+ }
719
+ }
720
+ }
721
+ if {!$foundtcl} {
722
+ if {$tclstubs} {
723
+ user-error "Cannot find a usable Tcl stubs library $msg"
724
+ } else {
725
+ user-error "Cannot find a usable Tcl library $msg"
726
+ }
727
+ }
728
+ }
729
+ set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
730
+ msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
731
+ if {!$tclprivatestubs} {
732
+ define-append LIBS $libs
733
+ }
734
+ define-append EXTRA_CFLAGS $cflags
735
+ define-append CFLAGS $cflags
736
+ if {[info exists ::zlibpath] && $::zlibpath eq "tree"} {
737
+ #
738
+ # NOTE: When using zlib in the source tree, prevent Tcl from
739
+ # pulling in the system one.
740
+ #
741
+ set tclconfig(TCL_LD_FLAGS) [string map [list -lz ""] \
742
+ $tclconfig(TCL_LD_FLAGS)]
743
+ }
744
+ #
745
+ # NOTE: Remove "-ldl" from the TCL_LD_FLAGS because it will be
746
+ # be checked for near the bottom of this file.
747
+ #
748
+ set tclconfig(TCL_LD_FLAGS) [string map [list -ldl ""] \
749
+ $tclconfig(TCL_LD_FLAGS)]
750
+ define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
751
+ define FOSSIL_ENABLE_TCL
752
+}; # handle-with-tcl
753
+handle-with-tcl
714754
715755
# Network functions require libraries on some systems
716756
cc-check-function-in-lib gethostbyname nsl
717757
if {![cc-check-function-in-lib socket {socket network}]} {
718
- # Last resort, may be Windows
719
- if {[is_mingw]} {
720
- define-append LIBS -lwsock32
721
- }
758
+ # Last resort, may be Windows
759
+ if {[is_mingw]} {
760
+ define-append LIBS -lwsock32
761
+ }
722762
}
763
+
764
+# Some systems (ex: SunOS) require -lrt in order to use nanosleep
765
+cc-check-function-in-lib nanosleep rt
723766
724767
# The SMTP module requires special libraries and headers for MX DNS
725768
# record lookups and such.
726769
cc-check-includes arpa/nameser.h
727770
cc-include-needs bind/resolv.h netinet/in.h
@@ -732,11 +775,11 @@
732775
[cc-check-function-in-lib __ns_name_uncompress {bind resolv}]) &&
733776
([cc-check-function-in-lib ns_parserr {bind resolv}] ||
734777
[cc-check-function-in-lib __ns_parserr {bind resolv}]) &&
735778
([cc-check-function-in-lib res_query {bind resolv}] ||
736779
[cc-check-function-in-lib __res_query {bind resolv}]))} {
737
- msg-result "WARNING: SMTP feature will not be able to look up local MX."
780
+ msg-result "WARNING: SMTP feature will not be able to look up local MX."
738781
}
739782
cc-check-function-in-lib res_9_ns_initparse resolv
740783
741784
# Other nonstandard function checks
742785
cc-check-functions utime
@@ -744,15 +787,15 @@
744787
cc-check-functions strchrnul
745788
cc-check-functions pledge
746789
cc-check-functions backtrace
747790
748791
# Termux on Android adds "getpass(char *)" to unistd.h, so check this so we
749
-# guard against including it again; use cctest as cc-check-functions and
792
+# guard against including it again; use cctest as cc-check-functions and
750793
# cctest_function check for "getpass()" with no args and fail
751794
if {[cctest -link 1 -includes {unistd.h} -code "getpass(0);"]} {
752
- define FOSSIL_HAVE_GETPASS 1
753
- msg-result "Found getpass() with unistd.h"
795
+ define FOSSIL_HAVE_GETPASS 1
796
+ msg-result "Found getpass() with unistd.h"
754797
}
755798
756799
# Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
757800
if {![cc-check-functions getloadavg] ||
758801
![cctest -link 1 -includes {unistd.h} -code "double a\[3\]; getloadavg(a,3);"]} {
@@ -760,44 +803,43 @@
760803
msg-result "Load average support unavailable"
761804
}
762805
763806
# Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
764807
if {![cc-check-functions getpassphrase]} {
765
- # Haiku needs this
766
- cc-check-function-in-lib getpass bsd
808
+ # Haiku needs this
809
+ cc-check-function-in-lib getpass bsd
767810
}
768
-cc-check-function-in-lib sin m
769811
770812
# Check for the FuseFS library
771813
if {[opt-bool fusefs]} {
772814
if {[opt-bool static]} {
773
- msg-result "FuseFS support disabled due to -static"
815
+ msg-result "FuseFS support disabled due to -static"
774816
} elseif {[cc-check-function-in-lib fuse_mount fuse]} {
775
- define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
776
- define FOSSIL_HAVE_FUSEFS 1
777
- msg-result "FuseFS support enabled"
817
+ define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
818
+ define FOSSIL_HAVE_FUSEFS 1
819
+ msg-result "FuseFS support enabled"
778820
}
779821
}
780822
781823
########################################################################
782824
# Checks the compiler for compile_commands.json support.
783825
#
784826
# Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
785827
# if supported, "no" if not.
786828
proc check-compile-commands {} {
787
- msg-checking "compile_commands.json support... "
788
- if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
789
- # This test reportedly incorrectly succeeds on one of
790
- # Martin G.'s older systems.
791
- msg-result "compiler supports compile_commands.json"
792
- define MAKE_COMPILATION_DB yes
793
- return 1
794
- } else {
795
- msg-result "compiler does not support compile_commands.json"
796
- define MAKE_COMPILATION_DB no
797
- return 0
798
- }
829
+ msg-checking "compile_commands.json support... "
830
+ if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
831
+ # This test reportedly incorrectly succeeds on one of
832
+ # Martin G.'s older systems.
833
+ msg-result "compiler supports compile_commands.json"
834
+ define MAKE_COMPILATION_DB yes
835
+ return 1
836
+ } else {
837
+ msg-result "compiler does not support compile_commands.json"
838
+ define MAKE_COMPILATION_DB no
839
+ return 0
840
+ }
799841
}
800842
801843
define MAKE_COMPILATION_DB no
802844
if {!$outOfTreeBuild} {
803845
if {[opt-bool compile-commands]} {
@@ -814,40 +856,134 @@
814856
# Add -fsanitize compile and link options late: we don't want the C
815857
# checks above to run with those sanitizers enabled. It can not only
816858
# be pointless, it can actually break correct tests.
817859
set fsan [opt-val with-sanitizer]
818860
if {[string length $fsan]} {
819
- define-append EXTRA_CFLAGS -fsanitize=$fsan
820
- define-append EXTRA_LDFLAGS -fsanitize=$fsan
821
- if {[string first "undefined" $fsan] != -1} {
822
- # We need to link with libubsan if we're compiling under
823
- # GCC with -fsanitize=undefined.
824
- cc-check-function-in-lib __ubsan_handle_add_overflow ubsan
825
- }
826
-}
827
-
828
-# Finally, append libraries that must be last. This matters more on some
829
-# OSes than others, but is most broadly required for static linking.
830
-if {[check-function-in-lib dlopen dl]} {
831
- # Some platforms (*BSD) have the dl functions already in libc and no libdl.
832
- # In such case we can link directly without -ldl.
833
- define-append LIBS [get-define lib_dlopen]
834
-}
835
-if {[opt-bool static]} {
836
- # Linux can only infer the dependency on pthread from OpenSSL when
837
- # doing dynamic linkage.
838
- define-append LIBS -lpthread
839
-}
840
-
841
-if {[get-define EMSDK_HOME] ne ""} {
842
- define EMCC_WRAPPER $::autosetup(dir)/../tools/emcc.sh
861
+ define-append EXTRA_CFLAGS -fsanitize=$fsan
862
+ define-append EXTRA_LDFLAGS -fsanitize=$fsan
863
+ if {[string first "undefined" $fsan] != -1} {
864
+ # We need to link with libubsan if we're compiling under
865
+ # GCC with -fsanitize=undefined.
866
+ cc-check-function-in-lib __ubsan_handle_add_overflow ubsan
867
+ }
868
+}
869
+
870
+########################################################################
871
+# @proj-check-emsdk
872
+#
873
+# Emscripten is used for doing in-tree builds of web-based WASM stuff,
874
+# as opposed to WASI-based WASM or WASM binaries we import from other
875
+# places. This is only set up for Unix-style OSes and is untested
876
+# anywhere but Linux. Requires that the --with-emsdk flag be
877
+# registered with autosetup.
878
+#
879
+# It looks for the SDK in the location specified by --with-emsdk.
880
+# Values of "" or "auto" mean to check for the environment var EMSDK
881
+# (which gets set by the emsdk_env.sh script from the SDK) or that
882
+# same var passed to configure.
883
+#
884
+# If the given directory is found, it expects to find emsdk_env.sh in
885
+# that directory, as well as the emcc compiler somewhere under there.
886
+#
887
+# If the --with-emsdk flag is explicitly provided and the SDK is not
888
+# found then a fatal error is generated, otherwise failure to find the
889
+# SDK is not fatal.
890
+#
891
+# Defines the following:
892
+#
893
+# - EMSDK_HOME = top dir of the emsdk or "".
894
+# - EMSDK_ENV_SH = path to EMSDK_HOME/emsdk_env.sh or ""
895
+# - BIN_EMCC = $EMSDK_HOME/upstream/emscripten/emcc or ""
896
+# - HAVE_EMSDK = 0 or 1 (this function's return value)
897
+#
898
+# Returns 1 if EMSDK_ENV_SH is found, else 0. If EMSDK_HOME is not empty
899
+# but BIN_EMCC is then emcc was not found in the EMSDK_HOME, in which
900
+# case we have to rely on the fact that sourcing $EMSDK_ENV_SH from a
901
+# shell will add emcc to the $PATH.
902
+proc proj-check-emsdk {} {
903
+ set emsdkHome [opt-val with-emsdk]
904
+ define EMSDK_HOME ""
905
+ define EMSDK_ENV_SH ""
906
+ define BIN_EMCC ""
907
+ set hadValue [llength $emsdkHome]
908
+ msg-checking "Emscripten SDK? "
909
+ if {$emsdkHome in {"" "auto"}} {
910
+ # Check the environment. $EMSDK gets set by sourcing emsdk_env.sh.
911
+ set emsdkHome [get-env EMSDK ""]
912
+ }
913
+ set rc 0
914
+ if {$emsdkHome ne ""} {
915
+ define EMSDK_HOME $emsdkHome
916
+ set emsdkEnv "$emsdkHome/emsdk_env.sh"
917
+ if {[file exists $emsdkEnv]} {
918
+ msg-result "$emsdkHome"
919
+ define EMSDK_ENV_SH $emsdkEnv
920
+ set rc 1
921
+ set emcc "$emsdkHome/upstream/emscripten/emcc"
922
+ if {[file exists $emcc]} {
923
+ define BIN_EMCC $emcc
924
+ }
925
+ } else {
926
+ msg-result "emsdk_env.sh not found in $emsdkHome"
927
+ }
928
+ } else {
929
+ msg-result "not found"
930
+ }
931
+ if {$hadValue && 0 == $rc} {
932
+ # Fail if it was explicitly requested but not found
933
+ proj-fatal "Cannot find the Emscripten SDK"
934
+ }
935
+ define HAVE_EMSDK $rc
936
+ return $rc
937
+}
938
+
939
+if {[proj-check-emsdk]} {
940
+ define EMCC_WRAPPER $::autosetup(dir)/../tools/emcc.sh
941
+ define EMCC_OPT [get-env EMCC_OPT "-Oz"]; # optional flags to pass to emcc
843942
make-template tools/emcc.sh.in
844943
catch {exec chmod u+x tools/emcc.sh}
845944
} else {
846945
define EMCC_WRAPPER ""
946
+ define EMCC_OPT ""
847947
catch {exec rm -f tools/emcc.sh}
848948
}
949
+
950
+handle-with-openssl
951
+
952
+# Finally, append libraries that must be last. This matters more on some
953
+# OSes than others, but is most broadly required for static linking.
954
+if {[opt-bool static]} {
955
+ # Linux can only infer the dependency on pthread from OpenSSL when
956
+ # doing dynamic linkage.
957
+ define-append LIBS -lpthread
958
+}
959
+
960
+apply {{} {
961
+ # This started out as a workaround for getting the ordering of -ldl
962
+ # correct in conjunction with openssl in some environments. Then it
963
+ # evolved into a more generic preemptive portability workaround to
964
+ # ensure that certain libraries are always appended to the global
965
+ # LIBS list if they exist on the system. Based on a /chat discussion
966
+ # on 2025-02-27 in the context of check-in [8d3b9bf4d4].
967
+ #
968
+ # Note that [move-lib-to-end] and [lib-actually-exists] are in
969
+ # autosetup/local.tcl.
970
+ set libs [get-define LIBS]
971
+ #puts "**** 1 LIBS: $libs"
972
+ foreach ll {-ldl -lpthread -lm} {
973
+ if {![move-lib-to-end $ll $libs libs]} {
974
+ # $ll was not in the list
975
+ if {[lib-actually-exists $ll]} {
976
+ # Add it to the list "just in case." This will be a no-op on
977
+ # systems where the lib is not actually used.
978
+ lappend libs $ll
979
+ }
980
+ }
981
+ }
982
+ #puts "**** 2 LIBS: $libs"
983
+ define LIBS [join $libs " "]
984
+}}
849985
850986
# Tag container builds with a prefix of the checkin ID of the version
851987
# of Fossil each one contains. This not only allows multiple images
852988
# to coexist and multiple containers to be created unamgiguosly from
853989
# them, it also changes the URL we fetch the source tarball from, so
854990
--- auto.def
+++ auto.def
@@ -36,17 +36,31 @@
36 }
37
38 # Update the minimum required SQLite version number here, and also
39 # in src/main.c near the sqlite3_libversion_number() call. Take care
40 # that both places agree!
41 define MINIMUM_SQLITE_VERSION "3.46.0"
42
43 # This is useful for people wanting Fossil to use an external SQLite library
44 # to compare the one they have against the minimum required
45 if {[opt-bool print-minimum-sqlite-version]} {
46 puts [get-define MINIMUM_SQLITE_VERSION]
47 exit 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48 }
49
50 set outOfTreeBuild 0
51 if {![file exists fossil.1]} {
52 puts "This appears to be an out-of-tree build."
@@ -53,21 +67,21 @@
53 set outOfTreeBuild 1
54 }
55
56 # sqlite wants these types if possible
57 cc-with {-includes {stdint.h inttypes.h}} {
58 cc-check-types uint32_t uint16_t int16_t uint8_t
59 }
60
61 # Use pread/pwrite system calls in place of seek + read/write if possible
62 define USE_PREAD [cc-check-functions pread]
63
64 # If we have cscope here, we'll use it in the "tags" target
65 if {[cc-check-progs cscope]} {
66 define COLLECT_CSCOPE_DATA "cscope -bR $::autosetup(srcdir)/src/*.\[ch\]"
67 } else {
68 define COLLECT_CSCOPE_DATA ""
69 }
70
71 # Find tclsh for the test suite.
72 #
73 # We can't use jimsh for this: the test suite uses features of Tcl that
@@ -80,35 +94,35 @@
80 # Ironically, this means we may right now be running under either jimsh0
81 # or a version of tclsh that we find unsuitable below!
82 cc-check-progs tclsh
83 set hbtd /usr/local/Cellar/tcl-tk
84 if {[string equal false [get-define TCLSH]]} {
85 msg-result "WARNING: 'make test' will not run here."
86 } else {
87 set v [exec /bin/sh -c "echo 'puts \$tcl_version' | tclsh"]
88 if {[expr {$v >= 8.6}]} {
89 msg-result "Found Tclsh version $v in the PATH."
90 define TCLSH tclsh
91 } elseif {[file isdirectory $hbtd]} {
92 # This is a macOS system with the Homebrew version of Tcl/Tk
93 # installed. Select the newest version. It won't normally be
94 # in the PATH to avoid shadowing /usr/bin/tclsh, and even if it
95 # were in the PATH, it's bad practice to put /usr/local/bin (the
96 # Homebrew default) ahead of /usr/bin, especially given that
97 # it's user-writeable by default with Homebrew. Thus, we can be
98 # pretty sure the only way to call it is with an absolute path.
99 set v [exec ls -tr $hbtd | tail -1]
100 set path "$hbtd/$v/bin/tclsh"
101 define TCLSH $path
102 msg-result "Using Homebrew Tcl/Tk version $path."
103 } else {
104 msg-result "WARNING: tclsh $v found; need >= 8.6 for 'make test'."
105 define TCLSH false ;# force "make test" failure via /usr/bin/false
106 }
107 }
108
109 define CFLAGS [get-env CFLAGS "-g -O2"]
110 define EXTRA_CFLAGS "-Wall"
111 define EXTRA_LDFLAGS ""
112 define USE_SYSTEM_SQLITE 0
113 define USE_LINENOISE 0
114 define USE_MMAN_H 0
@@ -119,48 +133,48 @@
119 # SQLITE_OPTIONS_EXT => build-dependent CFLAGS for sqlite3.c and shell.c
120
121 # Maintain the C89/C90-style order of variable declarations before statements.
122 # Check if the compiler supports the respective warning flag.
123 if {[cctest -cflags -Wdeclaration-after-statement]} {
124 define-append EXTRA_CFLAGS -Wdeclaration-after-statement
125 }
126
127
128 # This procedure is a customized version of "cc-check-function-in-lib",
129 # that does not modify the LIBS variable. Its use prevents prematurely
130 # pulling in libraries that will be added later anyhow (e.g. "-ldl").
131 proc check-function-in-lib {function libs {otherlibs {}}} {
132 if {[string length $otherlibs]} {
133 msg-checking "Checking for $function in $libs with $otherlibs..."
134 } else {
135 msg-checking "Checking for $function in $libs..."
136 }
137 set found 0
138 cc-with [list -libs $otherlibs] {
139 if {[cctest_function $function]} {
140 msg-result "none needed"
141 define lib_$function ""
142 incr found
143 } else {
144 foreach lib $libs {
145 cc-with [list -libs -l$lib] {
146 if {[cctest_function $function]} {
147 msg-result -l$lib
148 define lib_$function -l$lib
149 incr found
150 break
151 }
152 }
153 }
154 }
155 }
156 if {$found} {
157 define [feature-define-name $function]
158 } else {
159 msg-result "no"
160 }
161 return $found
162 }
163
164 if {![opt-bool internal-sqlite]} {
165 proc find_system_sqlite {} {
166
@@ -205,17 +219,17 @@
205 set sqlite-version [string cat "-D MINIMUM_SQLITE_VERSION=" [get-define MINIMUM_SQLITE_VERSION]]
206 lappend cmdline {*}[set sqlite-version]
207 set ok 1
208 set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
209 if {$err} {
210 configlog "Failed: [join $cmdline]"
211 if {[string length $result]>0} {configlog $result}
212 configlog "============"
213 set ok 0
214 } elseif {$::autosetup(debug)} {
215 configlog "Compiled OK: [join $cmdline]"
216 configlog "============"
217 }
218 if {!$ok} {
219 user-error "unable to compile SQLite compatibility test program"
220 }
221 set err [catch {exec-with-stderr ./conftest__} result errinfo]
@@ -230,498 +244,527 @@
230 test_system_sqlite
231
232 }
233
234 proc is_mingw {} {
235 return [string match *mingw* [get-define host]]
236 }
237
238 if {[is_mingw]} {
239 define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE
240 define-append LIBS -lkernel32 -lws2_32
241 } else {
242 #
243 # NOTE: All platforms except MinGW should use the linenoise
244 # package. It is currently unsupported on Win32.
245 #
246 define USE_LINENOISE 1
247 }
248
249 if {[string match *-solaris* [get-define host]]} {
250 define-append EXTRA_CFLAGS {-D__EXTENSIONS__}
251 }
252
253 if {[opt-bool fossil-debug]} {
254 define CFLAGS {-g -O0 -Wall}
255 define-append CFLAGS -DFOSSIL_DEBUG
256 msg-result "Debugging support enabled"
257 }
258
259 if {[opt-bool no-opt]} {
260 define CFLAGS {-g -O0 -Wall}
261 msg-result "Builting without compiler optimization"
262 if {[opt-bool fossil-debug]} {
263 define-append CFLAGS -DFOSSIL_DEBUG
264 }
265 }
266
267 if {[opt-bool with-mman]} {
268 define-append EXTRA_CFLAGS -DUSE_MMAN_H
269 define USE_MMAN_H 1
270 msg-result "Enabling \"sys/mman.h\" support"
 
 
 
271 }
272
273 if {[opt-bool with-see]} {
274 define-append EXTRA_CFLAGS -DUSE_SEE
275 define USE_SEE 1
276 define SQLITE3_ORIGIN 1
277 msg-result "Enabling encryption support"
278 }
279
280 if {[opt-bool json]} {
281 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
282 # is required in the CFLAGS because json*.c
283 # have #ifdef guards around the whole file without
284 # reading config.h first.
285 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
286 define FOSSIL_ENABLE_JSON
287 msg-result "JSON support enabled"
288 }
289
290 if {[opt-bool with-exec-rel-paths]} {
291 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_EXEC_REL_PATHS
292 define FOSSIL_ENABLE_EXEC_REL_PATHS
293 msg-result "Relative paths in external diff/gdiff enabled"
294 }
295
296 if {[opt-bool with-th1-docs]} {
297 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_DOCS
298 define FOSSIL_ENABLE_TH1_DOCS
299 msg-result "TH1 embedded documentation support enabled"
300 }
301
302 if {[opt-bool with-th1-hooks]} {
303 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
304 define FOSSIL_ENABLE_TH1_HOOKS
305 msg-result "TH1 hooks support enabled"
306 }
307
308 #if {[opt-bool markdown]} {
309 # # no-op. Markdown is now enabled by default.
310 # msg-result "Markdown support enabled"
311 #}
312
313 if {[opt-bool static]} {
314 # XXX: This will not work on all systems.
315 define-append EXTRA_LDFLAGS -static
316 msg-result "Trying to link statically"
317 } else {
318 define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1
319 define FOSSIL_DYNAMIC_BUILD
320 }
321
322 # Check for libraries that need to be sorted out early
323 cc-check-function-in-lib iconv iconv
324
 
 
 
325 # Helper for OpenSSL checking
326 proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto -lpthread}}} {
327 msg-checking "Checking for $msg..."
328 set rc 0
329 if {[is_mingw]} {
330 lappend libs -lgdi32 -lwsock32 -lcrypt32
331 }
332 if {[info exists ::zlib_lib]} {
333 lappend libs $::zlib_lib
334 }
335 msg-quiet cc-with [list -cflags $cflags -libs $libs] {
336 if {[cc-check-includes openssl/ssl.h] && \
337 [cc-check-functions SSL_new]} {
338 incr rc
339 }
340 }
341 if {!$rc && ![is_mingw]} {
342 # On some systems, OpenSSL appears to require -ldl to link.
343 lappend libs -ldl
344 msg-quiet cc-with [list -cflags $cflags -libs $libs] {
345 if {[cc-check-includes openssl/ssl.h] && \
346 [cc-check-functions SSL_new]} {
347 incr rc
348 }
349 }
350 }
351 if {$rc} {
352 msg-result "ok"
353 return 1
354 } else {
355 msg-result "no"
356 return 0
357 }
358 }
359
 
360 # Check for zlib, using the given location if specified
361 set zlibpath [opt-val with-zlib]
362 if {$zlibpath eq "tree"} {
363 set zlibdir [file dirname $autosetup(dir)]/compat/zlib
364 if {![file isdirectory $zlibdir]} {
365 user-error "The zlib in source tree directory does not exist"
366 } elseif { ([llength [glob -nocomplain -directory $zlibdir libz*]] == 0) } {
367 user-error "With --with-zlib=tree, $zlibdir must be configured and built first."
368 }
369 cc-with [list -cflags "-I$zlibdir -L$zlibdir"]
370 define-append EXTRA_CFLAGS -I$zlibdir
371 define-append LIBS $zlibdir/libz.a
372 set ::zlib_lib $zlibdir/libz.a
373 msg-result "Using zlib in source tree"
374 } else {
375 set cftry {""}
376 set ldtry {""}
377 if {$zlibpath ni {auto ""}} {
378 lappend cftry "-I$zlibpath"
379 lappend cftry "-I$zlibpath/include"
380 lappend ldtry "-L$zlibpath"
381 lappend ldtry "-L$zlibpath/lib"
382 }
383
384 # Reverse the list of tests so we check most-specific to least, else
385 # platform devel files will shadow local --with-zlib overrides.
386 foreach c [lreverse $cftry] {
387 if {[cc-with [list -cflags $c] {cc-check-includes zlib.h}]} {
388 if {$c eq ""} {
389 msg-result "Found zlib.h in default include path"
390 } else {
391 define-append EXTRA_CFLAGS "$c"
392 msg-result "Found zlib.h via $c"
393 }
394 set cfound $c
395 break
396 }
397 }
398 if {![info exists cfound]} {
399 user-error "zlib.h not found; either install it or specify its location via --with-zlib"
400 }
401 foreach lcheck [lreverse $ldtry] {
402 if {[cc-with [list -cflags "$cfound $lcheck"] {check-function-in-lib inflateEnd z}]} {
403 if {$lcheck eq ""} {
404 msg-result "Linked to zlib via default library path"
405 } else {
406 define-append EXTRA_LDFLAGS "$lcheck"
407 msg-result "Linked to zlib via $lcheck"
408 }
409 if {![check-function-in-lib compressBound z]} {
410 puts "Notice: disabling zlib compression in the SQL shell"
411 define-append SQLITE_OPTIONS_EXT {-USQLITE_HAVE_ZLIB}
412 }
413 break
414 }
415 }
416 set ::zlib_lib -lz
417 }
418
419 set ssldirs [opt-val with-openssl]
420 if {$ssldirs ne "none"} {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421 set found 0
422 if {$ssldirs eq "tree"} {
423 set ssldir [file dirname $autosetup(dir)]/compat/openssl
424 if {![file isdirectory $ssldir]} {
425 user-error "The OpenSSL in source tree directory does not exist"
426 }
427 set msg "ssl in $ssldir"
428 set cflags "-I$ssldir/include"
429 set ldflags "-L$ssldir"
430 set ssllibs "$ssldir/libssl.a $ssldir/libcrypto.a -lpthread"
431 set found [check-for-openssl "ssl in source tree" "$cflags $ldflags" $ssllibs]
432 } else {
433 if {$ssldirs in {auto ""}} {
434 catch {
435 set cflags [exec pkg-config openssl --cflags-only-I]
436 set ldflags [exec pkg-config openssl --libs-only-L]
437 set found [check-for-openssl "ssl via pkg-config" "$cflags $ldflags"]
438 } msg
439 if {!$found} {
440 set ssldirs "{} /usr/sfw /usr/local/ssl /usr/lib/ssl /usr/ssl \
 
441 /usr/pkg /usr/local /usr /usr/local/opt/openssl \
442 /opt/homebrew/opt/openssl"
443 }
444 }
445 if {!$found} {
446 foreach dir $ssldirs {
447 if {$dir eq ""} {
448 set msg "system ssl"
449 set cflags ""
450 set ldflags ""
451 } else {
452 set msg "ssl in $dir"
453 set cflags "-I$dir/include"
454 set ldflags "-L$dir/lib"
455 }
456 if {[check-for-openssl $msg "$cflags $ldflags"]} {
457 incr found
458 break
459 }
460 }
461 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462 }
463 if {$found} {
464 define FOSSIL_ENABLE_SSL
465 define-append EXTRA_CFLAGS $cflags
466 define-append EXTRA_LDFLAGS $ldflags
467 define-append CFLAGS $cflags
468 define-append LDFLAGS $ldflags
469 if {[info exists ssllibs]} {
470 define-append LIBS $ssllibs
471 } else {
472 define-append LIBS -lssl -lcrypto
473 }
474 if {[info exists ::zlib_lib]} {
475 define-append LIBS $::zlib_lib
476 }
477 if {[is_mingw]} {
478 define-append LIBS -lgdi32 -lwsock32 -lcrypt32
479 }
480 msg-result "HTTPS support enabled"
481
482 # Silence OpenSSL deprecation warnings on Mac OS X 10.7.
483 if {[string match *-darwin* [get-define host]]} {
484 if {[cctest -cflags {-Wdeprecated-declarations}]} {
485 define-append EXTRA_CFLAGS -Wdeprecated-declarations
486 }
487 }
488 } else {
489 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
490 }
491 } else {
492 if {[info exists ::zlib_lib]} {
493 define-append LIBS $::zlib_lib
494 }
495 }
496
497
 
 
 
 
 
 
 
 
498
499 ########################################################################
500 # --with-sqlite=PATH checks for the first it finds of the following...
501 # - PATH/sqlite3.c and PATH/sqlite3.h
502 # - PATH/sqlite3.o (and assumes sqlite3.h is with it)
503 # - PATH/lib/libsqlite3* and PATH/include/sqlite3.h
504 define CFLAGS_INCLUDE {}
505 # ^^^ CFLAGS_INCLUDE is ONLY for -I... flags and their order is
506 # significant so that --with-sqlite=PATH's header can shadow our
507 # own. One caveat with this is that we cannot point --with-sqlite=PATH
508 # to the root of sqlite3's own build tree because that dir has a
509 # config.h which ends up shadowing src/config.h, breaking our build.
510 set sq3path [opt-val with-sqlite]
511 define SQLITE3_SRC.2 {}
512 define SQLITE3_OBJ.2 {}
513 define SQLITE3_SHELL_SRC.2 {$(SQLITE3_SHELL_SRC.0)}
514 if {$sq3path in {tree ""}} {
515 msg-result "Using sqlite3.c from this source tree."
516 } else {
517 # SQLITE3_ORIGIN:
518 # 0 = local source tree
519 # 1 = use external lib or sqlite3.o
520 # 2 = use external sqlite3.c and (if found) shell.c
521 define USE_SYSTEM_SQLITE 1
522 define SQLITE3_ORIGIN 2
523 if {$sq3path != "auto"} {
524 if {([file exists $sq3path/sqlite3.c]) && \
525 ([file exists $sq3path/sqlite3.h]) } {
526 # Prefer sqlite3.[ch] if found.
527 define SQLITE3_SRC.2 $sq3path/sqlite3.c
528 define SQLITE3_OBJ.2 {$(SQLITE3_OBJ.0)}
529 define USE_SYSTEM_SQLITE 2
530 define SQLITE3_ORIGIN 2
531 if {[file exists $sq3path/shell.c]} {
532 define SQLITE3_SHELL_SRC.2 $sq3path/shell.c
533 }
534 define-append CFLAGS_INCLUDE -I$sq3path
535 define-append EXTRA_LDFLAGS -lpthread
536 # ^^^ additional -lXXX flags are conservative estimates
537 msg-result "Using sqlite3.c and sqlite3.h from $sq3path"
538 } elseif {[file exists $sq3path/sqlite3.o]} {
539 # Use sqlite3.o if found.
540 define SQLITE3_OBJ.2 $sq3path/sqlite3.o
541 define-append CFLAGS_INCLUDE -I$sq3path
542 define-append EXTRA_LDFLAGS $sq3path/sqlite3.o -lpthread
543 # ^^^ additional -lXXX flags are conservative estimates
544 msg-result "Using sqlite3.o from $sq3path"
545 } elseif { ([llength [glob -nocomplain -directory $sq3path/lib libsqlite3*]] != 0) \
546 && ([file exists $sq3path/include/sqlite3.h]) } {
547 # e.g. --with-sqlite=/usr/local. Try $sq3path/lib/libsqlite3*
548 # and $sq3path/include/sqlite3.h
549 define-append CFLAGS_INCLUDE -I$sq3path/include
550 define-append EXTRA_LDFLAGS -L$sq3path/lib -lsqlite3 -lpthread
551 # ^^^ additional -lXXX flags are conservative estimates
552 msg-result "Using -lsqlite3 from $sq3path"
553 } else {
554 # Assume $sq3path holds both the lib and header
555 cc-with [list -cflags "-I$sq3path -L$sq3path"]
556 define-append CFLAGS_INCLUDE -I$sq3path
557 define-append EXTRA_LDFLAGS -L$sq3path -lsqlite3 -lpthread
558 # ^^^ additional -lXXX flags are conservative estimates
559 msg-result "Using -lsqlite3 from $sq3path"
560 }
561 } elseif {![cc-check-includes sqlite3.h] || ![check-function-in-lib sqlite3_open_v2 sqlite3]} {
562 user-error "libsqlite3 not found please install it or specify the location with --with-sqlite"
563 }
564 }
565 define-append CFLAGS_INCLUDE {-I. -I$(SRCDIR) -I$(SRCDIR_extsrc)}
566
567 set tclpath [opt-val with-tcl]
568 if {$tclpath ne ""} {
569 set tclprivatestubs [opt-bool with-tcl-private-stubs]
570 # Note parse-tclconfig-sh is in autosetup/local.tcl
571 if {$tclpath eq "1"} {
572 set tcldir [file dirname $autosetup(dir)]/compat/tcl-8.6
573 if {$tclprivatestubs} {
574 set tclconfig(TCL_INCLUDE_SPEC) -I$tcldir/generic
575 set tclconfig(TCL_VERSION) {Private Stubs}
576 set tclconfig(TCL_PATCH_LEVEL) {}
577 set tclconfig(TCL_PREFIX) $tcldir
578 set tclconfig(TCL_LD_FLAGS) { }
579 } else {
580 # Use the system Tcl. Look in some likely places.
581 array set tclconfig [parse-tclconfig-sh \
582 $tcldir/unix $tcldir/win \
583 /usr /usr/local /usr/share /opt/local]
584 set msg "on your system"
585 }
586 } else {
587 array set tclconfig [parse-tclconfig-sh $tclpath]
588 set msg "at $tclpath"
589 }
590 if {[opt-bool static]} {
591 set tclconfig(TCL_LD_FLAGS) { }
592 }
593 if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
594 user-error "Cannot find Tcl $msg"
595 }
596 set tclstubs [opt-bool with-tcl-stubs]
597 if {$tclprivatestubs} {
598 define FOSSIL_ENABLE_TCL_PRIVATE_STUBS
599 define USE_TCL_STUBS
600 } elseif {$tclstubs && $tclconfig(TCL_SUPPORTS_STUBS)} {
601 set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
602 define FOSSIL_ENABLE_TCL_STUBS
603 define USE_TCL_STUBS
604 } else {
605 set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
606 }
607 set cflags $tclconfig(TCL_INCLUDE_SPEC)
608 if {!$tclprivatestubs} {
609 set foundtcl 0; # Did we find a working Tcl library?
610 cc-with [list -cflags $cflags -libs $libs] {
611 if {$tclstubs} {
612 if {[cc-check-functions Tcl_InitStubs]} {
613 set foundtcl 1
614 }
615 } else {
616 if {[cc-check-functions Tcl_CreateInterp]} {
617 set foundtcl 1
618 }
619 }
620 }
621 if {!$foundtcl && [string match *-lieee* $libs]} {
622 # On some systems, using "-lieee" from TCL_LIB_SPEC appears
623 # to cause issues.
624 msg-result "Removing \"-lieee\" and retrying for Tcl..."
625 set libs [string map [list -lieee ""] $libs]
626 cc-with [list -cflags $cflags -libs $libs] {
627 if {$tclstubs} {
628 if {[cc-check-functions Tcl_InitStubs]} {
629 set foundtcl 1
630 }
631 } else {
632 if {[cc-check-functions Tcl_CreateInterp]} {
633 set foundtcl 1
634 }
635 }
636 }
637 }
638 if {!$foundtcl && ![string match *-lpthread* $libs]} {
639 # On some systems, TCL_LIB_SPEC appears to be missing
640 # "-lpthread". Try adding it.
641 msg-result "Adding \"-lpthread\" and retrying for Tcl..."
642 set libs "$libs -lpthread"
643 cc-with [list -cflags $cflags -libs $libs] {
644 if {$tclstubs} {
645 if {[cc-check-functions Tcl_InitStubs]} {
646 set foundtcl 1
647 }
648 } else {
649 if {[cc-check-functions Tcl_CreateInterp]} {
650 set foundtcl 1
651 }
652 }
653 }
654 }
655 if {!$foundtcl} {
656 if {$tclstubs} {
657 user-error "Cannot find a usable Tcl stubs library $msg"
658 } else {
659 user-error "Cannot find a usable Tcl library $msg"
660 }
661 }
662 }
663 set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
664 msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
665 if {!$tclprivatestubs} {
666 define-append LIBS $libs
667 }
668 define-append EXTRA_CFLAGS $cflags
669 define-append CFLAGS $cflags
670 if {[info exists zlibpath] && $zlibpath eq "tree"} {
671 #
672 # NOTE: When using zlib in the source tree, prevent Tcl from
673 # pulling in the system one.
674 #
675 set tclconfig(TCL_LD_FLAGS) [string map [list -lz ""] \
676 $tclconfig(TCL_LD_FLAGS)]
677 }
678 #
679 # NOTE: Remove "-ldl" from the TCL_LD_FLAGS because it will be
680 # be checked for near the bottom of this file.
681 #
682 set tclconfig(TCL_LD_FLAGS) [string map [list -ldl ""] \
683 $tclconfig(TCL_LD_FLAGS)]
684 define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
685 define FOSSIL_ENABLE_TCL
686 }
687
688 # Emscripten is a purely optional component used only for doing
689 # in-tree builds of WASM stuff, as opposed to WASM binaries we import
690 # from other places. This is only set up for Unix-style OSes and is
691 # untested anywhere but Linux.
692 set emsdkHome [opt-val with-emsdk]
693 define EMSDK_HOME ""
694 define EMSDK_ENV ""
695 define EMCC_OPT "-Oz"
696 if {$emsdkHome eq "" && [info exists ::env(EMSDK)]} {
697 # Fall back to checking the environment. $EMSDK gets set
698 # by sourcing emsdk_env.sh.
699 set emsdkHome $::env(EMSDK)
700 }
701 if {$emsdkHome ne ""} {
702 define EMSDK_HOME $emsdkHome
703 set emsdkEnv "$emsdkHome/emsdk_env.sh"
704 if {[file exists $emsdkEnv]} {
705 puts "Using Emscripten SDK environment from $emsdkEnv."
706 define EMSDK_ENV $emsdkEnv
707 if {[info exists ::env(EMCC_OPT)]} {
708 define EMCC_OPT $::env(EMCC_OPT)
709 }
710 } else {
711 puts "emsdk_env.sh not found. Assuming emcc is in the PATH."
712 }
713 }
714
715 # Network functions require libraries on some systems
716 cc-check-function-in-lib gethostbyname nsl
717 if {![cc-check-function-in-lib socket {socket network}]} {
718 # Last resort, may be Windows
719 if {[is_mingw]} {
720 define-append LIBS -lwsock32
721 }
722 }
 
 
 
723
724 # The SMTP module requires special libraries and headers for MX DNS
725 # record lookups and such.
726 cc-check-includes arpa/nameser.h
727 cc-include-needs bind/resolv.h netinet/in.h
@@ -732,11 +775,11 @@
732 [cc-check-function-in-lib __ns_name_uncompress {bind resolv}]) &&
733 ([cc-check-function-in-lib ns_parserr {bind resolv}] ||
734 [cc-check-function-in-lib __ns_parserr {bind resolv}]) &&
735 ([cc-check-function-in-lib res_query {bind resolv}] ||
736 [cc-check-function-in-lib __res_query {bind resolv}]))} {
737 msg-result "WARNING: SMTP feature will not be able to look up local MX."
738 }
739 cc-check-function-in-lib res_9_ns_initparse resolv
740
741 # Other nonstandard function checks
742 cc-check-functions utime
@@ -744,15 +787,15 @@
744 cc-check-functions strchrnul
745 cc-check-functions pledge
746 cc-check-functions backtrace
747
748 # Termux on Android adds "getpass(char *)" to unistd.h, so check this so we
749 # guard against including it again; use cctest as cc-check-functions and
750 # cctest_function check for "getpass()" with no args and fail
751 if {[cctest -link 1 -includes {unistd.h} -code "getpass(0);"]} {
752 define FOSSIL_HAVE_GETPASS 1
753 msg-result "Found getpass() with unistd.h"
754 }
755
756 # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
757 if {![cc-check-functions getloadavg] ||
758 ![cctest -link 1 -includes {unistd.h} -code "double a\[3\]; getloadavg(a,3);"]} {
@@ -760,44 +803,43 @@
760 msg-result "Load average support unavailable"
761 }
762
763 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
764 if {![cc-check-functions getpassphrase]} {
765 # Haiku needs this
766 cc-check-function-in-lib getpass bsd
767 }
768 cc-check-function-in-lib sin m
769
770 # Check for the FuseFS library
771 if {[opt-bool fusefs]} {
772 if {[opt-bool static]} {
773 msg-result "FuseFS support disabled due to -static"
774 } elseif {[cc-check-function-in-lib fuse_mount fuse]} {
775 define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
776 define FOSSIL_HAVE_FUSEFS 1
777 msg-result "FuseFS support enabled"
778 }
779 }
780
781 ########################################################################
782 # Checks the compiler for compile_commands.json support.
783 #
784 # Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
785 # if supported, "no" if not.
786 proc check-compile-commands {} {
787 msg-checking "compile_commands.json support... "
788 if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
789 # This test reportedly incorrectly succeeds on one of
790 # Martin G.'s older systems.
791 msg-result "compiler supports compile_commands.json"
792 define MAKE_COMPILATION_DB yes
793 return 1
794 } else {
795 msg-result "compiler does not support compile_commands.json"
796 define MAKE_COMPILATION_DB no
797 return 0
798 }
799 }
800
801 define MAKE_COMPILATION_DB no
802 if {!$outOfTreeBuild} {
803 if {[opt-bool compile-commands]} {
@@ -814,40 +856,134 @@
814 # Add -fsanitize compile and link options late: we don't want the C
815 # checks above to run with those sanitizers enabled. It can not only
816 # be pointless, it can actually break correct tests.
817 set fsan [opt-val with-sanitizer]
818 if {[string length $fsan]} {
819 define-append EXTRA_CFLAGS -fsanitize=$fsan
820 define-append EXTRA_LDFLAGS -fsanitize=$fsan
821 if {[string first "undefined" $fsan] != -1} {
822 # We need to link with libubsan if we're compiling under
823 # GCC with -fsanitize=undefined.
824 cc-check-function-in-lib __ubsan_handle_add_overflow ubsan
825 }
826 }
827
828 # Finally, append libraries that must be last. This matters more on some
829 # OSes than others, but is most broadly required for static linking.
830 if {[check-function-in-lib dlopen dl]} {
831 # Some platforms (*BSD) have the dl functions already in libc and no libdl.
832 # In such case we can link directly without -ldl.
833 define-append LIBS [get-define lib_dlopen]
834 }
835 if {[opt-bool static]} {
836 # Linux can only infer the dependency on pthread from OpenSSL when
837 # doing dynamic linkage.
838 define-append LIBS -lpthread
839 }
840
841 if {[get-define EMSDK_HOME] ne ""} {
842 define EMCC_WRAPPER $::autosetup(dir)/../tools/emcc.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
843 make-template tools/emcc.sh.in
844 catch {exec chmod u+x tools/emcc.sh}
845 } else {
846 define EMCC_WRAPPER ""
 
847 catch {exec rm -f tools/emcc.sh}
848 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
849
850 # Tag container builds with a prefix of the checkin ID of the version
851 # of Fossil each one contains. This not only allows multiple images
852 # to coexist and multiple containers to be created unamgiguosly from
853 # them, it also changes the URL we fetch the source tarball from, so
854
--- auto.def
+++ auto.def
@@ -36,17 +36,31 @@
36 }
37
38 # Update the minimum required SQLite version number here, and also
39 # in src/main.c near the sqlite3_libversion_number() call. Take care
40 # that both places agree!
41 define MINIMUM_SQLITE_VERSION "3.49.0"
42
43 # This is useful for people wanting Fossil to use an external SQLite library
44 # to compare the one they have against the minimum required
45 if {[opt-bool print-minimum-sqlite-version]} {
46 puts [get-define MINIMUM_SQLITE_VERSION]
47 exit 0
48 }
49
50 # Space characters have never been allowed in either the source
51 # tree nor the build directory. But the resulting error messages
52 # could be confusing. The following checks make the reason for the
53 # failure clear.
54 #
55 if {[string first " " $autosetup(srcdir)] != -1} {
56 user-error "The pathname of the source tree\
57 may not contain space characters"
58 }
59 if {[string first " " $autosetup(builddir)] != -1} {
60 user-error "The pathname of the build directory\
61 may not contain space characters"
62 }
63
64 set outOfTreeBuild 0
65 if {![file exists fossil.1]} {
66 puts "This appears to be an out-of-tree build."
@@ -53,21 +67,21 @@
67 set outOfTreeBuild 1
68 }
69
70 # sqlite wants these types if possible
71 cc-with {-includes {stdint.h inttypes.h}} {
72 cc-check-types uint32_t uint16_t int16_t uint8_t
73 }
74
75 # Use pread/pwrite system calls in place of seek + read/write if possible
76 define USE_PREAD [cc-check-functions pread]
77
78 # If we have cscope here, we'll use it in the "tags" target
79 if {[cc-check-progs cscope]} {
80 define COLLECT_CSCOPE_DATA "cscope -bR $::autosetup(srcdir)/src/*.\[ch\]"
81 } else {
82 define COLLECT_CSCOPE_DATA ""
83 }
84
85 # Find tclsh for the test suite.
86 #
87 # We can't use jimsh for this: the test suite uses features of Tcl that
@@ -80,35 +94,35 @@
94 # Ironically, this means we may right now be running under either jimsh0
95 # or a version of tclsh that we find unsuitable below!
96 cc-check-progs tclsh
97 set hbtd /usr/local/Cellar/tcl-tk
98 if {[string equal false [get-define TCLSH]]} {
99 msg-result "WARNING: 'make test' will not run here."
100 } else {
101 set v [exec sh -c "echo 'puts \$tcl_version' | tclsh"]
102 if {[expr {$v >= 8.6}]} {
103 msg-result "Found Tclsh version $v in the PATH."
104 define TCLSH tclsh
105 } elseif {[file isdirectory $hbtd]} {
106 # This is a macOS system with the Homebrew version of Tcl/Tk
107 # installed. Select the newest version. It won't normally be
108 # in the PATH to avoid shadowing /usr/bin/tclsh, and even if it
109 # were in the PATH, it's bad practice to put /usr/local/bin (the
110 # Homebrew default) ahead of /usr/bin, especially given that
111 # it's user-writeable by default with Homebrew. Thus, we can be
112 # pretty sure the only way to call it is with an absolute path.
113 set v [exec ls -tr $hbtd | tail -1]
114 set path "$hbtd/$v/bin/tclsh"
115 define TCLSH $path
116 msg-result "Using Homebrew Tcl/Tk version $path."
117 } else {
118 msg-result "WARNING: tclsh $v found; need >= 8.6 for 'make test'."
119 define TCLSH false ;# force "make test" failure via /usr/bin/false
120 }
121 }
122
123 define CFLAGS [get-env CFLAGS "-g -Os"]
124 define EXTRA_CFLAGS "-Wall"
125 define EXTRA_LDFLAGS ""
126 define USE_SYSTEM_SQLITE 0
127 define USE_LINENOISE 0
128 define USE_MMAN_H 0
@@ -119,48 +133,48 @@
133 # SQLITE_OPTIONS_EXT => build-dependent CFLAGS for sqlite3.c and shell.c
134
135 # Maintain the C89/C90-style order of variable declarations before statements.
136 # Check if the compiler supports the respective warning flag.
137 if {[cctest -cflags -Wdeclaration-after-statement]} {
138 define-append EXTRA_CFLAGS -Wdeclaration-after-statement
139 }
140
141
142 # This procedure is a customized version of "cc-check-function-in-lib",
143 # that does not modify the LIBS variable. Its use prevents prematurely
144 # pulling in libraries that will be added later anyhow (e.g. "-ldl").
145 proc check-function-in-lib {function libs {otherlibs {}}} {
146 if {[string length $otherlibs]} {
147 msg-checking "Checking for $function in $libs with $otherlibs..."
148 } else {
149 msg-checking "Checking for $function in $libs..."
150 }
151 set found 0
152 cc-with [list -libs $otherlibs] {
153 if {[cctest_function $function]} {
154 msg-result "none needed"
155 define lib_$function ""
156 incr found
157 } else {
158 foreach lib $libs {
159 cc-with [list -libs -l$lib] {
160 if {[cctest_function $function]} {
161 msg-result -l$lib
162 define lib_$function -l$lib
163 incr found
164 break
165 }
166 }
167 }
168 }
169 }
170 if {$found} {
171 define [feature-define-name $function]
172 } else {
173 msg-result "no"
174 }
175 return $found
176 }
177
178 if {![opt-bool internal-sqlite]} {
179 proc find_system_sqlite {} {
180
@@ -205,17 +219,17 @@
219 set sqlite-version [string cat "-D MINIMUM_SQLITE_VERSION=" [get-define MINIMUM_SQLITE_VERSION]]
220 lappend cmdline {*}[set sqlite-version]
221 set ok 1
222 set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
223 if {$err} {
224 configlog "Failed: [join $cmdline]"
225 if {[string length $result]>0} {configlog $result}
226 configlog "============"
227 set ok 0
228 } elseif {$::autosetup(debug)} {
229 configlog "Compiled OK: [join $cmdline]"
230 configlog "============"
231 }
232 if {!$ok} {
233 user-error "unable to compile SQLite compatibility test program"
234 }
235 set err [catch {exec-with-stderr ./conftest__} result errinfo]
@@ -230,498 +244,527 @@
244 test_system_sqlite
245
246 }
247
248 proc is_mingw {} {
249 return [expr {
250 [string match *mingw* [get-define host]] &&
251 ![file exists "/dev/null"]
252 }]
253 }
254
255 if {[is_mingw]} {
256 define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE
257 define-append LIBS -lkernel32 -lws2_32
258 } else {
259 #
260 # NOTE: All platforms except MinGW should use the linenoise
261 # package. It is currently unsupported on Win32.
262 #
263 define USE_LINENOISE 1
264 }
265
266 if {[string match *-solaris* [get-define host]]} {
267 define-append EXTRA_CFLAGS {-D__EXTENSIONS__}
268 }
269
270 if {[opt-bool fossil-debug]} {
271 define CFLAGS {-g -O0 -Wall}
272 define-append CFLAGS -DFOSSIL_DEBUG
273 msg-result "Debugging support enabled"
274 }
275
276 if {[opt-bool no-opt]} {
277 define CFLAGS {-g -O0 -Wall}
278 msg-result "Builting without compiler optimization"
279 if {[opt-bool fossil-debug]} {
280 define-append CFLAGS -DFOSSIL_DEBUG
281 }
282 }
283
284 if {[opt-bool with-mman]} {
285 define-append EXTRA_CFLAGS -DUSE_MMAN_H
286 define USE_MMAN_H 1
287 msg-result "Enabling \"sys/mman.h\" support"
288 }
289
290 if {[opt-bool with-see]} {
291 define-append EXTRA_CFLAGS -DUSE_SEE
292 define USE_SEE 1
293 define SQLITE3_ORIGIN 1
294 msg-result "Enabling encryption support"
295 }
296
297 if {[opt-bool json]} {
298 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
299 # is required in the CFLAGS because json*.c
300 # have #ifdef guards around the whole file without
301 # reading config.h first.
302 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
303 define FOSSIL_ENABLE_JSON
304 msg-result "JSON support enabled"
305 }
306
307 if {[opt-bool with-exec-rel-paths]} {
308 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_EXEC_REL_PATHS
309 define FOSSIL_ENABLE_EXEC_REL_PATHS
310 msg-result "Relative paths in external diff/gdiff enabled"
311 }
312
313 if {[opt-bool with-th1-docs]} {
314 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_DOCS
315 define FOSSIL_ENABLE_TH1_DOCS
316 msg-result "TH1 embedded documentation support enabled"
317 }
318
319 if {[opt-bool with-th1-hooks]} {
320 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
321 define FOSSIL_ENABLE_TH1_HOOKS
322 msg-result "TH1 hooks support enabled"
323 }
324
325 #if {[opt-bool markdown]} {
326 # # no-op. Markdown is now enabled by default.
327 # msg-result "Markdown support enabled"
328 #}
329
330 if {[opt-bool static]} {
331 # XXX: This will not work on all systems.
332 define-append EXTRA_LDFLAGS -static
333 msg-result "Trying to link statically"
334 } else {
335 define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1
336 define FOSSIL_DYNAMIC_BUILD
337 }
338
339 # Check for libraries that need to be sorted out early
340 cc-check-function-in-lib iconv iconv
341
342 cc-check-function-in-lib sin m
343 cc-check-function-in-lib dlopen dl
344
345 # Helper for OpenSSL checking
346 proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto -lpthread}}} {
347 msg-checking "Checking for $msg..."
348 set rc 0
349 if {[is_mingw]} {
350 lappend libs -lgdi32 -lwsock32 -lcrypt32
351 }
352 if {[info exists ::zlib_lib]} {
353 lappend libs $::zlib_lib
354 }
355 msg-quiet cc-with [list -cflags $cflags -libs $libs] {
356 if {[cc-check-includes openssl/ssl.h] && \
357 [cc-check-functions SSL_new]} {
358 incr rc
359 }
360 }
361 if {!$rc && ![is_mingw]} {
362 # On some systems, OpenSSL appears to require -ldl to link.
363 lappend libs -ldl
364 msg-quiet cc-with [list -cflags $cflags -libs $libs] {
365 if {[cc-check-includes openssl/ssl.h] && \
366 [cc-check-functions SSL_new]} {
367 incr rc
368 }
369 }
370 }
371 if {$rc} {
372 msg-result "ok"
373 return 1
374 } else {
375 msg-result "no"
376 return 0
377 }
378 }
379
380 #
381 # Check for zlib, using the given location if specified
382 #
383 proc handle-zlib {} {
384 set ::zlibpath [opt-val with-zlib]; # used by downstream tcl tests
385 if {$::zlibpath eq "tree"} {
386 set ::zlibdir [file dirname $::autosetup(dir)]/compat/zlib
387 if {![file isdirectory $::zlibdir]} {
388 user-error "The zlib in source tree directory does not exist"
389 } elseif { ([llength [glob -nocomplain -directory $::zlibdir libz*]] == 0) } {
390 user-error "With --with-zlib=tree, $::zlibdir must be configured and built first."
391 }
392 cc-with [list -cflags "-I$::zlibdir -L$::zlibdir"]
393 define-append EXTRA_CFLAGS -I$::zlibdir
394 define-append LIBS $::zlibdir/libz.a
395 set ::zlib_lib $::zlibdir/libz.a
396 msg-result "Using zlib in source tree"
397 } else {
398 set cftry {""}
399 set ldtry {""}
400 if {$::zlibpath ni {auto ""}} {
401 lappend cftry "-I$::zlibpath"
402 lappend cftry "-I$::zlibpath/include"
403 lappend ldtry "-L$::zlibpath"
404 lappend ldtry "-L$::zlibpath/lib"
405 }
406
407 # Reverse the list of tests so we check most-specific to least, else
408 # platform devel files will shadow local --with-zlib overrides.
409 foreach c [lreverse $cftry] {
410 if {[cc-with [list -cflags $c] {cc-check-includes zlib.h}]} {
411 if {$c eq ""} {
412 msg-result "Found zlib.h in default include path"
413 } else {
414 define-append EXTRA_CFLAGS "$c"
415 msg-result "Found zlib.h via $c"
416 }
417 set cfound $c
418 break
419 }
420 }
421 if {![info exists cfound]} {
422 user-error "zlib.h not found; either install it or specify its location via --with-zlib"
423 }
424 foreach lcheck [lreverse $ldtry] {
425 if {[cc-with [list -cflags "$cfound $lcheck"] {check-function-in-lib inflateEnd z}]} {
426 if {$lcheck eq ""} {
427 msg-result "Linked to zlib via default library path"
428 } else {
429 define-append EXTRA_LDFLAGS "$lcheck"
430 msg-result "Linked to zlib via $lcheck"
431 }
432 if {![check-function-in-lib compressBound z]} {
433 puts "Notice: disabling zlib compression in the SQL shell"
434 define-append SQLITE_OPTIONS_EXT {-USQLITE_HAVE_ZLIB}
435 }
436 break
437 }
438 }
439 set ::zlib_lib -lz
440 }
441 }; # handle-zlib
442 handle-zlib
443
444 #
445 # Handle the --with-openssl flag and, incidentally, update @LIBS@ for
446 # zlib if openssl is _not_ used (if it is, we get zlib via libssl).
447 #
448 # This function should be called as late as possible in the configure
449 # script to avoid that its updates to @LIBS@ break tests which follow
450 # it when a custom local build of openssl is used, as discussed in
451 # <https://fossil-scm.org/forum/forumpost/15e3d9cdc137030c>.
452 #
453 proc handle-with-openssl {} {
454 set ssldirs [opt-val with-openssl]
455 if {$ssldirs ne "none"} {
456 set found 0
457 if {$ssldirs eq "tree"} {
458 set ssldir [file dirname $::autosetup(dir)]/compat/openssl
459 if {![file isdirectory $ssldir]} {
460 user-error "The OpenSSL in source tree directory does not exist"
461 }
462 set msg "openssl in $ssldir"
463 set cflags "-I$ssldir/include"
464 set ldflags "-L$ssldir"
465 set ssllibs "$ssldir/libssl.a $ssldir/libcrypto.a -lpthread"
466 set found [check-for-openssl "openssl in source tree" "$cflags $ldflags" $ssllibs]
467 } else {
468 if {$ssldirs in {auto ""}} {
469 catch {
470 # TODO?: use autosetup's pkg-config support
471 set cflags [exec pkg-config openssl --cflags-only-I]
472 set ldflags [exec pkg-config openssl --libs-only-L]
473 set found [check-for-openssl "ssl via pkg-config" "$cflags $ldflags"]
474 } msg
475 if {!$found} {
476 set ssldirs "{} /usr/sfw /usr/local/ssl /usr/lib/ssl /usr/ssl \
477 /usr/pkg /usr/local /usr /usr/local/opt/openssl \
478 /opt/homebrew/opt/openssl"
479 }
480 }
481 if {!$found} {
482 foreach dir $ssldirs {
483 if {$dir eq ""} {
484 set msg "system openssl"
485 set cflags ""
486 set ldflags ""
487 } else {
488 set msg "openssl in $dir"
489 set cflags "-I$dir/include"
490 if {[file readable $dir/libssl.a]} {
491 set ldflags -L$dir
492 } elseif {[file readable $dir/lib/libssl.a]} {
493 set ldflags -L$dir/lib
494 } elseif {[file isdir $dir/lib]} {
495 set ldflags "-L$dir -L$dir/lib"
496 } else {
497 set ldflags -L$dir
498 }
499 }
500 if {[check-for-openssl $msg "$cflags $ldflags"]} {
501 incr found
502 break
503 }
504 if {$dir ne ""} {
505 set ldflags ""
506 set msg "static build of openssl in $dir"
507 set ssllibs "$dir/libssl.a $dir/libcrypto.a -lpthread"
508 if {[check-for-openssl $msg "$cflags $ldflags" $ssllibs]} {
509 incr found
510 break
511 }
512 # This test should arguably fail here if --with-openssl=X
513 # points to an invalid X.
514 }
515 }
516 }
517 }
518 if {$found} {
519 define FOSSIL_ENABLE_SSL
520 define-append EXTRA_CFLAGS $cflags
521 define-append EXTRA_LDFLAGS $ldflags
522 if {[info exists ssllibs]} {
523 define-append LIBS $ssllibs
524 } else {
525 define-append LIBS -lssl -lcrypto
526 }
527 if {[info exists ::zlib_lib]} {
528 define-append LIBS $::zlib_lib
529 }
530 if {[is_mingw]} {
531 define-append LIBS -lgdi32 -lwsock32 -lcrypt32
532 }
533 msg-result "HTTPS support enabled"
534
535 # Silence OpenSSL deprecation warnings on Mac OS X 10.7.
536 if {[string match *-darwin* [get-define host]]} {
537 if {[cctest -cflags {-Wdeprecated-declarations}]} {
538 define-append EXTRA_CFLAGS -Wdeprecated-declarations
539 }
540 }
541 } else {
542 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
543 }
544 } else {
545 if {[info exists ::zlib_lib]} {
546 define-append LIBS $::zlib_lib
547 }
548 }
549 }; # handle-with-openssl
550
551 #
552 # CFLAGS_INCLUDE is ONLY for -I... flags and their order is
553 # significant so that --with-sqlite=PATH's header can shadow our
554 # own. <s>One caveat with this is that we cannot point
555 # --with-sqlite=PATH to the root of sqlite3's own build tree because
556 # that dir has a config.h which ends up shadowing src/config.h,
557 # breaking our build.</s> (That is no longer true: that that config.h
558 # was renamed to sqlite_cfg.h at some point.)
559 #
560 define CFLAGS_INCLUDE {}
561
562 ########################################################################
563 # --with-sqlite=PATH checks for the first it finds of the following...
564 # - PATH/sqlite3.c and PATH/sqlite3.h
565 # - PATH/sqlite3.o (and assumes sqlite3.h is with it)
566 # - PATH/lib/libsqlite3* and PATH/include/sqlite3.h
567 proc handle-with-sqlite {} {
568 set sq3path [opt-val with-sqlite]
569 define SQLITE3_SRC.2 {}
570 define SQLITE3_OBJ.2 {}
571 define SQLITE3_SHELL_SRC.2 {$(SQLITE3_SHELL_SRC.0)}
572 if {$sq3path in {tree ""}} {
573 msg-result "Using sqlite3.c from this source tree."
574 } else {
575 # SQLITE3_ORIGIN:
576 # 0 = local source tree
577 # 1 = use external lib or sqlite3.o
578 # 2 = use external sqlite3.c and (if found) shell.c
579 define USE_SYSTEM_SQLITE 1
580 define SQLITE3_ORIGIN 2
581 if {$sq3path != "auto"} {
582 if {([file exists $sq3path/sqlite3.c]) &&
583 ([file exists $sq3path/sqlite3.h]) } {
584 # Prefer sqlite3.[ch] if found.
585 define SQLITE3_SRC.2 $sq3path/sqlite3.c
586 define SQLITE3_OBJ.2 {$(SQLITE3_OBJ.0)}
587 define USE_SYSTEM_SQLITE 2
588 define SQLITE3_ORIGIN 2
589 if {[file exists $sq3path/shell.c]} {
590 define SQLITE3_SHELL_SRC.2 $sq3path/shell.c
591 }
592 define-append CFLAGS_INCLUDE -I$sq3path
593 define-append EXTRA_LDFLAGS -lpthread
594 # ^^^ additional -lXXX flags are conservative estimates
595 msg-result "Using sqlite3.c and sqlite3.h from $sq3path"
596 } elseif {[file exists $sq3path/sqlite3.o]} {
597 # Use sqlite3.o if found.
598 define SQLITE3_OBJ.2 $sq3path/sqlite3.o
599 define-append CFLAGS_INCLUDE -I$sq3path
600 define-append EXTRA_LDFLAGS $sq3path/sqlite3.o -lpthread
601 # ^^^ additional -lXXX flags are conservative estimates
602 msg-result "Using sqlite3.o from $sq3path"
603 } elseif { ([llength [glob -nocomplain -directory $sq3path/lib libsqlite3*]] != 0) \
604 && ([file exists $sq3path/include/sqlite3.h]) } {
605 # e.g. --with-sqlite=/usr/local. Try $sq3path/lib/libsqlite3*
606 # and $sq3path/include/sqlite3.h
607 define-append CFLAGS_INCLUDE -I$sq3path/include
608 define-append EXTRA_LDFLAGS -L$sq3path/lib -lsqlite3 -lpthread
609 # ^^^ additional -lXXX flags are conservative estimates
610 msg-result "Using -lsqlite3 from $sq3path"
611 } else {
612 # Assume $sq3path holds both the lib and header
613 cc-with [list -cflags "-I$sq3path -L$sq3path"]
614 define-append CFLAGS_INCLUDE -I$sq3path
615 define-append EXTRA_LDFLAGS -L$sq3path -lsqlite3 -lpthread
616 # ^^^ additional -lXXX flags are conservative estimates
617 msg-result "Using -lsqlite3 from $sq3path"
618 }
619 } elseif {![cc-check-includes sqlite3.h] || ![check-function-in-lib sqlite3_open_v2 sqlite3]} {
620 user-error "libsqlite3 not found please install it or specify the location with --with-sqlite"
621 }
622 }
623 }; # handle-with-sqlite
624 handle-with-sqlite
625 define-append CFLAGS_INCLUDE {-I. -I$(SRCDIR) -I$(SRCDIR_extsrc)}; # must be after handle-with-sqlite
626
627 #
628 # Handle the --with-tcl flag.
629 #
630 proc handle-with-tcl {} {
631 set tclpath [opt-val with-tcl]
632 if {$tclpath eq ""} {
633 return
634 }
635 set tclprivatestubs [opt-bool with-tcl-private-stubs]
636 # Note parse-tclconfig-sh is in autosetup/local.tcl
637 if {$tclpath eq "1"} {
638 set tcldir [file dirname $::autosetup(dir)]/compat/tcl-8.6
639 if {$tclprivatestubs} {
640 set tclconfig(TCL_INCLUDE_SPEC) -I$tcldir/generic
641 set tclconfig(TCL_VERSION) {Private Stubs}
642 set tclconfig(TCL_PATCH_LEVEL) {}
643 set tclconfig(TCL_PREFIX) $tcldir
644 set tclconfig(TCL_LD_FLAGS) { }
645 } else {
646 # Use the system Tcl. Look in some likely places.
647 array set tclconfig [parse-tclconfig-sh \
648 $tcldir/unix $tcldir/win \
649 /usr /usr/local /usr/share /opt/local]
650 set msg "on your system"
651 }
652 } else {
653 array set tclconfig [parse-tclconfig-sh $tclpath]
654 set msg "at $tclpath"
655 }
656 if {[opt-bool static]} {
657 set tclconfig(TCL_LD_FLAGS) { }
658 }
659 if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
660 user-error "Cannot find Tcl $msg"
661 }
662 set tclstubs [opt-bool with-tcl-stubs]
663 if {$tclprivatestubs} {
664 define FOSSIL_ENABLE_TCL_PRIVATE_STUBS
665 define USE_TCL_STUBS
666 } elseif {$tclstubs && $tclconfig(TCL_SUPPORTS_STUBS)} {
667 set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
668 define FOSSIL_ENABLE_TCL_STUBS
669 define USE_TCL_STUBS
670 } else {
671 set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
672 }
673 set cflags $tclconfig(TCL_INCLUDE_SPEC)
674 if {!$tclprivatestubs} {
675 set foundtcl 0; # Did we find a working Tcl library?
676 cc-with [list -cflags $cflags -libs $libs] {
677 if {$tclstubs} {
678 if {[cc-check-functions Tcl_InitStubs]} {
679 set foundtcl 1
680 }
681 } else {
682 if {[cc-check-functions Tcl_CreateInterp]} {
683 set foundtcl 1
684 }
685 }
686 }
687 if {!$foundtcl && [string match *-lieee* $libs]} {
688 # On some systems, using "-lieee" from TCL_LIB_SPEC appears
689 # to cause issues.
690 msg-result "Removing \"-lieee\" and retrying for Tcl..."
691 set libs [string map [list -lieee ""] $libs]
692 cc-with [list -cflags $cflags -libs $libs] {
693 if {$tclstubs} {
694 if {[cc-check-functions Tcl_InitStubs]} {
695 set foundtcl 1
696 }
697 } else {
698 if {[cc-check-functions Tcl_CreateInterp]} {
699 set foundtcl 1
700 }
701 }
702 }
703 }
704 if {!$foundtcl && ![string match *-lpthread* $libs]} {
705 # On some systems, TCL_LIB_SPEC appears to be missing
706 # "-lpthread". Try adding it.
707 msg-result "Adding \"-lpthread\" and retrying for Tcl..."
708 set libs "$libs -lpthread"
709 cc-with [list -cflags $cflags -libs $libs] {
710 if {$tclstubs} {
711 if {[cc-check-functions Tcl_InitStubs]} {
712 set foundtcl 1
713 }
714 } else {
715 if {[cc-check-functions Tcl_CreateInterp]} {
716 set foundtcl 1
717 }
718 }
719 }
720 }
721 if {!$foundtcl} {
722 if {$tclstubs} {
723 user-error "Cannot find a usable Tcl stubs library $msg"
724 } else {
725 user-error "Cannot find a usable Tcl library $msg"
726 }
727 }
728 }
729 set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
730 msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
731 if {!$tclprivatestubs} {
732 define-append LIBS $libs
733 }
734 define-append EXTRA_CFLAGS $cflags
735 define-append CFLAGS $cflags
736 if {[info exists ::zlibpath] && $::zlibpath eq "tree"} {
737 #
738 # NOTE: When using zlib in the source tree, prevent Tcl from
739 # pulling in the system one.
740 #
741 set tclconfig(TCL_LD_FLAGS) [string map [list -lz ""] \
742 $tclconfig(TCL_LD_FLAGS)]
743 }
744 #
745 # NOTE: Remove "-ldl" from the TCL_LD_FLAGS because it will be
746 # be checked for near the bottom of this file.
747 #
748 set tclconfig(TCL_LD_FLAGS) [string map [list -ldl ""] \
749 $tclconfig(TCL_LD_FLAGS)]
750 define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
751 define FOSSIL_ENABLE_TCL
752 }; # handle-with-tcl
753 handle-with-tcl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
755 # Network functions require libraries on some systems
756 cc-check-function-in-lib gethostbyname nsl
757 if {![cc-check-function-in-lib socket {socket network}]} {
758 # Last resort, may be Windows
759 if {[is_mingw]} {
760 define-append LIBS -lwsock32
761 }
762 }
763
764 # Some systems (ex: SunOS) require -lrt in order to use nanosleep
765 cc-check-function-in-lib nanosleep rt
766
767 # The SMTP module requires special libraries and headers for MX DNS
768 # record lookups and such.
769 cc-check-includes arpa/nameser.h
770 cc-include-needs bind/resolv.h netinet/in.h
@@ -732,11 +775,11 @@
775 [cc-check-function-in-lib __ns_name_uncompress {bind resolv}]) &&
776 ([cc-check-function-in-lib ns_parserr {bind resolv}] ||
777 [cc-check-function-in-lib __ns_parserr {bind resolv}]) &&
778 ([cc-check-function-in-lib res_query {bind resolv}] ||
779 [cc-check-function-in-lib __res_query {bind resolv}]))} {
780 msg-result "WARNING: SMTP feature will not be able to look up local MX."
781 }
782 cc-check-function-in-lib res_9_ns_initparse resolv
783
784 # Other nonstandard function checks
785 cc-check-functions utime
@@ -744,15 +787,15 @@
787 cc-check-functions strchrnul
788 cc-check-functions pledge
789 cc-check-functions backtrace
790
791 # Termux on Android adds "getpass(char *)" to unistd.h, so check this so we
792 # guard against including it again; use cctest as cc-check-functions and
793 # cctest_function check for "getpass()" with no args and fail
794 if {[cctest -link 1 -includes {unistd.h} -code "getpass(0);"]} {
795 define FOSSIL_HAVE_GETPASS 1
796 msg-result "Found getpass() with unistd.h"
797 }
798
799 # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
800 if {![cc-check-functions getloadavg] ||
801 ![cctest -link 1 -includes {unistd.h} -code "double a\[3\]; getloadavg(a,3);"]} {
@@ -760,44 +803,43 @@
803 msg-result "Load average support unavailable"
804 }
805
806 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
807 if {![cc-check-functions getpassphrase]} {
808 # Haiku needs this
809 cc-check-function-in-lib getpass bsd
810 }
 
811
812 # Check for the FuseFS library
813 if {[opt-bool fusefs]} {
814 if {[opt-bool static]} {
815 msg-result "FuseFS support disabled due to -static"
816 } elseif {[cc-check-function-in-lib fuse_mount fuse]} {
817 define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
818 define FOSSIL_HAVE_FUSEFS 1
819 msg-result "FuseFS support enabled"
820 }
821 }
822
823 ########################################################################
824 # Checks the compiler for compile_commands.json support.
825 #
826 # Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
827 # if supported, "no" if not.
828 proc check-compile-commands {} {
829 msg-checking "compile_commands.json support... "
830 if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
831 # This test reportedly incorrectly succeeds on one of
832 # Martin G.'s older systems.
833 msg-result "compiler supports compile_commands.json"
834 define MAKE_COMPILATION_DB yes
835 return 1
836 } else {
837 msg-result "compiler does not support compile_commands.json"
838 define MAKE_COMPILATION_DB no
839 return 0
840 }
841 }
842
843 define MAKE_COMPILATION_DB no
844 if {!$outOfTreeBuild} {
845 if {[opt-bool compile-commands]} {
@@ -814,40 +856,134 @@
856 # Add -fsanitize compile and link options late: we don't want the C
857 # checks above to run with those sanitizers enabled. It can not only
858 # be pointless, it can actually break correct tests.
859 set fsan [opt-val with-sanitizer]
860 if {[string length $fsan]} {
861 define-append EXTRA_CFLAGS -fsanitize=$fsan
862 define-append EXTRA_LDFLAGS -fsanitize=$fsan
863 if {[string first "undefined" $fsan] != -1} {
864 # We need to link with libubsan if we're compiling under
865 # GCC with -fsanitize=undefined.
866 cc-check-function-in-lib __ubsan_handle_add_overflow ubsan
867 }
868 }
869
870 ########################################################################
871 # @proj-check-emsdk
872 #
873 # Emscripten is used for doing in-tree builds of web-based WASM stuff,
874 # as opposed to WASI-based WASM or WASM binaries we import from other
875 # places. This is only set up for Unix-style OSes and is untested
876 # anywhere but Linux. Requires that the --with-emsdk flag be
877 # registered with autosetup.
878 #
879 # It looks for the SDK in the location specified by --with-emsdk.
880 # Values of "" or "auto" mean to check for the environment var EMSDK
881 # (which gets set by the emsdk_env.sh script from the SDK) or that
882 # same var passed to configure.
883 #
884 # If the given directory is found, it expects to find emsdk_env.sh in
885 # that directory, as well as the emcc compiler somewhere under there.
886 #
887 # If the --with-emsdk flag is explicitly provided and the SDK is not
888 # found then a fatal error is generated, otherwise failure to find the
889 # SDK is not fatal.
890 #
891 # Defines the following:
892 #
893 # - EMSDK_HOME = top dir of the emsdk or "".
894 # - EMSDK_ENV_SH = path to EMSDK_HOME/emsdk_env.sh or ""
895 # - BIN_EMCC = $EMSDK_HOME/upstream/emscripten/emcc or ""
896 # - HAVE_EMSDK = 0 or 1 (this function's return value)
897 #
898 # Returns 1 if EMSDK_ENV_SH is found, else 0. If EMSDK_HOME is not empty
899 # but BIN_EMCC is then emcc was not found in the EMSDK_HOME, in which
900 # case we have to rely on the fact that sourcing $EMSDK_ENV_SH from a
901 # shell will add emcc to the $PATH.
902 proc proj-check-emsdk {} {
903 set emsdkHome [opt-val with-emsdk]
904 define EMSDK_HOME ""
905 define EMSDK_ENV_SH ""
906 define BIN_EMCC ""
907 set hadValue [llength $emsdkHome]
908 msg-checking "Emscripten SDK? "
909 if {$emsdkHome in {"" "auto"}} {
910 # Check the environment. $EMSDK gets set by sourcing emsdk_env.sh.
911 set emsdkHome [get-env EMSDK ""]
912 }
913 set rc 0
914 if {$emsdkHome ne ""} {
915 define EMSDK_HOME $emsdkHome
916 set emsdkEnv "$emsdkHome/emsdk_env.sh"
917 if {[file exists $emsdkEnv]} {
918 msg-result "$emsdkHome"
919 define EMSDK_ENV_SH $emsdkEnv
920 set rc 1
921 set emcc "$emsdkHome/upstream/emscripten/emcc"
922 if {[file exists $emcc]} {
923 define BIN_EMCC $emcc
924 }
925 } else {
926 msg-result "emsdk_env.sh not found in $emsdkHome"
927 }
928 } else {
929 msg-result "not found"
930 }
931 if {$hadValue && 0 == $rc} {
932 # Fail if it was explicitly requested but not found
933 proj-fatal "Cannot find the Emscripten SDK"
934 }
935 define HAVE_EMSDK $rc
936 return $rc
937 }
938
939 if {[proj-check-emsdk]} {
940 define EMCC_WRAPPER $::autosetup(dir)/../tools/emcc.sh
941 define EMCC_OPT [get-env EMCC_OPT "-Oz"]; # optional flags to pass to emcc
942 make-template tools/emcc.sh.in
943 catch {exec chmod u+x tools/emcc.sh}
944 } else {
945 define EMCC_WRAPPER ""
946 define EMCC_OPT ""
947 catch {exec rm -f tools/emcc.sh}
948 }
949
950 handle-with-openssl
951
952 # Finally, append libraries that must be last. This matters more on some
953 # OSes than others, but is most broadly required for static linking.
954 if {[opt-bool static]} {
955 # Linux can only infer the dependency on pthread from OpenSSL when
956 # doing dynamic linkage.
957 define-append LIBS -lpthread
958 }
959
960 apply {{} {
961 # This started out as a workaround for getting the ordering of -ldl
962 # correct in conjunction with openssl in some environments. Then it
963 # evolved into a more generic preemptive portability workaround to
964 # ensure that certain libraries are always appended to the global
965 # LIBS list if they exist on the system. Based on a /chat discussion
966 # on 2025-02-27 in the context of check-in [8d3b9bf4d4].
967 #
968 # Note that [move-lib-to-end] and [lib-actually-exists] are in
969 # autosetup/local.tcl.
970 set libs [get-define LIBS]
971 #puts "**** 1 LIBS: $libs"
972 foreach ll {-ldl -lpthread -lm} {
973 if {![move-lib-to-end $ll $libs libs]} {
974 # $ll was not in the list
975 if {[lib-actually-exists $ll]} {
976 # Add it to the list "just in case." This will be a no-op on
977 # systems where the lib is not actually used.
978 lappend libs $ll
979 }
980 }
981 }
982 #puts "**** 2 LIBS: $libs"
983 define LIBS [join $libs " "]
984 }}
985
986 # Tag container builds with a prefix of the checkin ID of the version
987 # of Fossil each one contains. This not only allows multiple images
988 # to coexist and multiple containers to be created unamgiguosly from
989 # them, it also changes the URL we fetch the source tarball from, so
990
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -27,5 +27,35 @@
2727
set tclconfig($name) [string trim $value ']
2828
}
2929
}
3030
return [array get tclconfig]
3131
}
32
+
33
+#
34
+# Given a library link flag, e.g. -lfoo, returns 1 if that library can
35
+# actually be linked to, else returns 0.
36
+proc lib-actually-exists {linkFlag} {
37
+ cctest -link 1 -code "void libActuallyExists(void){}" -libs $linkFlag
38
+}
39
+
40
+#
41
+# Given a library flag, e.g. -lfoo, a list of libs, e.g. {-lfoo -lbar
42
+# -lbaz}, and a target variable name, this function appends all
43
+# entries of $libList which do not match $flag to $tgtVar, then
44
+# appends $flag to the end of $tgtVar. Returns the number of matches
45
+# found.
46
+proc move-lib-to-end {flag libList tgtVar} {
47
+ upvar $tgtVar tgt
48
+ set tgt {}
49
+ set found 0
50
+ foreach e $libList {
51
+ if {$flag eq $e} {
52
+ incr found
53
+ } else {
54
+ lappend tgt $e
55
+ }
56
+ }
57
+ if {$found} {
58
+ lappend tgt $flag
59
+ }
60
+ return $found
61
+}
3262
3363
ADDED extsrc/linenoise-win32.c
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -27,5 +27,35 @@
27 set tclconfig($name) [string trim $value ']
28 }
29 }
30 return [array get tclconfig]
31 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33 DDED extsrc/linenoise-win32.c
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -27,5 +27,35 @@
27 set tclconfig($name) [string trim $value ']
28 }
29 }
30 return [array get tclconfig]
31 }
32
33 #
34 # Given a library link flag, e.g. -lfoo, returns 1 if that library can
35 # actually be linked to, else returns 0.
36 proc lib-actually-exists {linkFlag} {
37 cctest -link 1 -code "void libActuallyExists(void){}" -libs $linkFlag
38 }
39
40 #
41 # Given a library flag, e.g. -lfoo, a list of libs, e.g. {-lfoo -lbar
42 # -lbaz}, and a target variable name, this function appends all
43 # entries of $libList which do not match $flag to $tgtVar, then
44 # appends $flag to the end of $tgtVar. Returns the number of matches
45 # found.
46 proc move-lib-to-end {flag libList tgtVar} {
47 upvar $tgtVar tgt
48 set tgt {}
49 set found 0
50 foreach e $libList {
51 if {$flag eq $e} {
52 incr found
53 } else {
54 lappend tgt $e
55 }
56 }
57 if {$found} {
58 lappend tgt $flag
59 }
60 return $found
61 }
62
63 DDED extsrc/linenoise-win32.c
--- a/extsrc/linenoise-win32.c
+++ b/extsrc/linenoise-win32.c
@@ -0,0 +1,379 @@
1
+
2
+/* this code is not standalone
3
+ * it is included into linenoise.c
4
+ * for windows.
5
+ * It is deliberately kept separate so that
6
+ * applications that have no need for windows
7
+ * support can omit this
8
+ */
9
+static DWORD orig_consolemode = 0;
10
+
11
+static int flushOutput(struct current *current);
12
+static void outputNewline(struct current *current);
13
+
14
+static void refreshStart(struct current *current)
15
+{
16
+ (void)current;
17
+}
18
+
19
+static void refreshEnd(struct current *current)
20
+{
21
+ (void)current;
22
+}
23
+
24
+static void refreshStartChars(struct current *current)
25
+{
26
+ assert(current->output == NULL);
27
+ /* We accumulate all output here */
28
+ current->output = sb_alloc();
29
+#ifdef USE_UTF8
30
+ current->ubuflen = 0;
31
+#endif
32
+}
33
+
34
+static void refreshNewline(struct current *current)
35
+{
36
+ DRL("<nl>");
37
+ outputNewline(current);
38
+}
39
+
40
+static void refreshEndChars(struct current *current)
41
+{
42
+ assert(current->output);
43
+ flushOutput(current);
44
+ sb_free(current->output);
45
+ current->output = NULL;
46
+}
47
+
48
+static int enableRawMode(struct current *current) {
49
+ DWORD n;
50
+ INPUT_RECORD irec;
51
+
52
+ current->outh = GetStdHandle(STD_OUTPUT_HANDLE);
53
+ current->inh = GetStdHandle(STD_INPUT_HANDLE);
54
+
55
+ if (!PeekConsoleInput(current->inh, &irec, 1, &n)) {
56
+ return -1;
57
+ }
58
+ if (getWindowSize(current) != 0) {
59
+ return -1;
60
+ }
61
+ if (GetConsoleMode(current->inh, &orig_consolemode)) {
62
+ SetConsoleMode(current->inh, ENABLE_PROCESSED_INPUT);
63
+ }
64
+#ifdef USE_UTF8
65
+ /* XXX is this the right thing to do? */
66
+ SetConsoleCP(65001);
67
+#endif
68
+ return 0;
69
+}
70
+
71
+static void disableRawMode(struct current *current)
72
+{
73
+ SetConsoleMode(current->inh, orig_consolemode);
74
+}
75
+
76
+void linenoiseClearScreen(void)
77
+{
78
+ /* XXX: This is ugly. Should just have the caller pass a handle */
79
+ struct current current;
80
+
81
+ current.outh = GetStdHandle(STD_OUTPUT_HANDLE);
82
+
83
+ if (getWindowSize(&current) == 0) {
84
+ COORD topleft = { 0, 0 };
85
+ DWORD n;
86
+
87
+ FillConsoleOutputCharacter(current.outh, ' ',
88
+ current.cols * current.rows, topleft, &n);
89
+ FillConsoleOutputAttribute(current.outh,
90
+ FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN,
91
+ current.cols * current.rows, topleft, &n);
92
+ SetConsoleCursorPosition(current.outh, topleft);
93
+ }
94
+}
95
+
96
+static void cursorToLeft(struct current *current)
97
+{
98
+ COORD pos;
99
+ DWORD n;
100
+
101
+ pos.X = 0;
102
+ pos.Y = (SHORT)current->y;
103
+
104
+ FillConsoleOutputAttribute(current->outh,
105
+ FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN, current->cols, pos, &n);
106
+ current->x = 0;
107
+}
108
+
109
+#ifdef USE_UTF8
110
+static void flush_ubuf(struct current *current)
111
+{
112
+ COORD pos;
113
+ DWORD nwritten;
114
+ pos.Y = (SHORT)current->y;
115
+ pos.X = (SHORT)current->x;
116
+ SetConsoleCursorPosition(current->outh, pos);
117
+ WriteConsoleW(current->outh, current->ubuf, current->ubuflen, &nwritten, 0);
118
+ current->x += current->ubufcols;
119
+ current->ubuflen = 0;
120
+ current->ubufcols = 0;
121
+}
122
+
123
+static void add_ubuf(struct current *current, int ch)
124
+{
125
+ /* This code originally by: Author: Mark E. Davis, 1994. */
126
+ static const int halfShift = 10; /* used for shifting by 10 bits */
127
+
128
+ static const DWORD halfBase = 0x0010000UL;
129
+ static const DWORD halfMask = 0x3FFUL;
130
+
131
+ #define UNI_SUR_HIGH_START 0xD800
132
+ #define UNI_SUR_HIGH_END 0xDBFF
133
+ #define UNI_SUR_LOW_START 0xDC00
134
+ #define UNI_SUR_LOW_END 0xDFFF
135
+
136
+ #define UNI_MAX_BMP 0x0000FFFF
137
+
138
+ if (ch > UNI_MAX_BMP) {
139
+ /* convert from unicode to utf16 surrogate pairs
140
+ * There is always space for one extra word in ubuf
141
+ */
142
+ ch -= halfBase;
143
+ current->ubuf[current->ubuflen++] = (WORD)((ch >> halfShift) + UNI_SUR_HIGH_START);
144
+ current->ubuf[current->ubuflen++] = (WORD)((ch & halfMask) + UNI_SUR_LOW_START);
145
+ }
146
+ else {
147
+ current->ubuf[current->ubuflen++] = ch;
148
+ }
149
+ current->ubufcols += utf8_width(ch);
150
+ if (current->ubuflen >= UBUF_MAX_CHARS) {
151
+ flush_ubuf(current);
152
+ }
153
+}
154
+#endif
155
+
156
+static int flushOutput(struct current *current)
157
+{
158
+ const char *pt = sb_str(current->output);
159
+ int len = sb_len(current->output);
160
+
161
+#ifdef USE_UTF8
162
+ /* convert utf8 in current->output into utf16 in current->ubuf
163
+ */
164
+ while (len) {
165
+ int ch;
166
+ int n = utf8_tounicode(pt, &ch);
167
+
168
+ pt += n;
169
+ len -= n;
170
+
171
+ add_ubuf(current, ch);
172
+ }
173
+ flush_ubuf(current);
174
+#else
175
+ DWORD nwritten;
176
+ COORD pos;
177
+
178
+ pos.Y = (SHORT)current->y;
179
+ pos.X = (SHORT)current->x;
180
+
181
+ SetConsoleCursorPosition(current->outh, pos);
182
+ WriteConsoleA(current->outh, pt, len, &nwritten, 0);
183
+
184
+ current->x += len;
185
+#endif
186
+
187
+ sb_clear(current->output);
188
+
189
+ return 0;
190
+}
191
+
192
+static int outputChars(struct current *current, const char *buf, int len)
193
+{
194
+ if (len < 0) {
195
+ len = strlen(buf);
196
+ }
197
+ assert(current->output);
198
+
199
+ sb_append_len(current->output, buf, len);
200
+
201
+ return 0;
202
+}
203
+
204
+static void outputNewline(struct current *current)
205
+{
206
+ /* On the last row output a newline to force a scroll */
207
+ if (current->y + 1 == current->rows) {
208
+ outputChars(current, "\n", 1);
209
+ }
210
+ flushOutput(current);
211
+ current->x = 0;
212
+ current->y++;
213
+}
214
+
215
+static void setOutputHighlight(struct current *current, const int *props, int nprops)
216
+{
217
+ int colour = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;
218
+ int bold = 0;
219
+ int reverse = 0;
220
+ int i;
221
+
222
+ for (i = 0; i < nprops; i++) {
223
+ switch (props[i]) {
224
+ case 0:
225
+ colour = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;
226
+ bold = 0;
227
+ reverse = 0;
228
+ break;
229
+ case 1:
230
+ bold = FOREGROUND_INTENSITY;
231
+ break;
232
+ case 7:
233
+ reverse = 1;
234
+ break;
235
+ case 30:
236
+ colour = 0;
237
+ break;
238
+ case 31:
239
+ colour = FOREGROUND_RED;
240
+ break;
241
+ case 32:
242
+ colour = FOREGROUND_GREEN;
243
+ break;
244
+ case 33:
245
+ colour = FOREGROUND_RED | FOREGROUND_GREEN;
246
+ break;
247
+ case 34:
248
+ colour = FOREGROUND_BLUE;
249
+ break;
250
+ case 35:
251
+ colour = FOREGROUND_RED | FOREGROUND_BLUE;
252
+ break;
253
+ case 36:
254
+ colour = FOREGROUND_BLUE | FOREGROUND_GREEN;
255
+ break;
256
+ case 37:
257
+ colour = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;
258
+ break;
259
+ }
260
+ }
261
+
262
+ flushOutput(current);
263
+
264
+ if (reverse) {
265
+ SetConsoleTextAttribute(current->outh, BACKGROUND_INTENSITY);
266
+ }
267
+ else {
268
+ SetConsoleTextAttribute(current->outh, colour | bold);
269
+ }
270
+}
271
+
272
+static void eraseEol(struct current *current)
273
+{
274
+ COORD pos;
275
+ DWORD n;
276
+
277
+ pos.X = (SHORT) current->x;
278
+ pos.Y = (SHORT) current->y;
279
+
280
+ FillConsoleOutputCharacter(current->outh, ' ', current->cols - current->x, pos, &n);
281
+}
282
+
283
+static void setCursorXY(struct current *current)
284
+{
285
+ COORD pos;
286
+
287
+ pos.X = (SHORT) current->x;
288
+ pos.Y = (SHORT) current->y;
289
+
290
+ SetConsoleCursorPosition(current->outh, pos);
291
+}
292
+
293
+
294
+static void setCursorPos(struct current *current, int x)
295
+{
296
+ current->x = x;
297
+ setCursorXY(current);
298
+}
299
+
300
+static void cursorUp(struct current *current, int n)
301
+{
302
+ current->y -= n;
303
+ setCursorXY(current);
304
+}
305
+
306
+static void cursorDown(struct current *current, int n)
307
+{
308
+ current->y += n;
309
+ setCursorXY(current);
310
+}
311
+
312
+static int fd_read(struct current *current)
313
+{
314
+ while (1) {
315
+ INPUT_RECORD irec;
316
+ DWORD n;
317
+ if (WaitForSingleObject(current->inh, INFINITE) != WAIT_OBJECT_0) {
318
+ break;
319
+ }
320
+ if (!ReadConsoleInputW(current->inh, &irec, 1, &n)) {
321
+ break;
322
+ }
323
+ if (irec.EventType == KEY_EVENT) {
324
+ KEY_EVENT_RECORD *k = &irec.Event.KeyEvent;
325
+ if (k->bKeyDown || k->wVirtualKeyCode == VK_MENU) {
326
+ if (k->dwControlKeyState & ENHANCED_KEY) {
327
+ switch (k->wVirtualKeyCode) {
328
+ case VK_LEFT:
329
+ return SPECIAL_LEFT;
330
+ case VK_RIGHT:
331
+ return SPECIAL_RIGHT;
332
+ case VK_UP:
333
+ return SPECIAL_UP;
334
+ case VK_DOWN:
335
+ return SPECIAL_DOWN;
336
+ case VK_INSERT:
337
+ return SPECIAL_INSERT;
338
+ case VK_DELETE:
339
+ return SPECIAL_DELETE;
340
+ case VK_HOME:
341
+ return SPECIAL_HOME;
342
+ case VK_END:
343
+ return SPECIAL_END;
344
+ case VK_PRIOR:
345
+ return SPECIAL_PAGE_UP;
346
+ case VK_NEXT:
347
+ return SPECIAL_PAGE_DOWN;
348
+ case VK_RETURN:
349
+ return k->uChar.UnicodeChar;
350
+ }
351
+ }
352
+ /* Note that control characters are already translated in AsciiChar */
353
+ else if (k->wVirtualKeyCode == VK_CONTROL)
354
+ continue;
355
+ else {
356
+ return k->uChar.UnicodeChar;
357
+ }
358
+ }
359
+ }
360
+ }
361
+ return -1;
362
+}
363
+
364
+static int getWindowSize(struct current *current)
365
+{
366
+ CONSOLE_SCREEN_BUFFER_INFO info;
367
+ if (!GetConsoleScreenBufferInfo(current->outh, &info)) {
368
+ return -1;
369
+ }
370
+ current->cols = info.dwSize.X;
371
+ current->rows = info.dwSize.Y;
372
+ if (current->cols <= 0 || current->rows <= 0) {
373
+ current->cols = 80;
374
+ return -1;
375
+ }
376
+ current->y = info.dwCursorPosition.Y;
377
+ current->x = info.dwCursorPosition.X;
378
+ return 0;
379
+}
--- a/extsrc/linenoise-win32.c
+++ b/extsrc/linenoise-win32.c
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/extsrc/linenoise-win32.c
+++ b/extsrc/linenoise-win32.c
@@ -0,0 +1,379 @@
1
2 /* this code is not standalone
3 * it is included into linenoise.c
4 * for windows.
5 * It is deliberately kept separate so that
6 * applications that have no need for windows
7 * support can omit this
8 */
9 static DWORD orig_consolemode = 0;
10
11 static int flushOutput(struct current *current);
12 static void outputNewline(struct current *current);
13
14 static void refreshStart(struct current *current)
15 {
16 (void)current;
17 }
18
19 static void refreshEnd(struct current *current)
20 {
21 (void)current;
22 }
23
24 static void refreshStartChars(struct current *current)
25 {
26 assert(current->output == NULL);
27 /* We accumulate all output here */
28 current->output = sb_alloc();
29 #ifdef USE_UTF8
30 current->ubuflen = 0;
31 #endif
32 }
33
34 static void refreshNewline(struct current *current)
35 {
36 DRL("<nl>");
37 outputNewline(current);
38 }
39
40 static void refreshEndChars(struct current *current)
41 {
42 assert(current->output);
43 flushOutput(current);
44 sb_free(current->output);
45 current->output = NULL;
46 }
47
48 static int enableRawMode(struct current *current) {
49 DWORD n;
50 INPUT_RECORD irec;
51
52 current->outh = GetStdHandle(STD_OUTPUT_HANDLE);
53 current->inh = GetStdHandle(STD_INPUT_HANDLE);
54
55 if (!PeekConsoleInput(current->inh, &irec, 1, &n)) {
56 return -1;
57 }
58 if (getWindowSize(current) != 0) {
59 return -1;
60 }
61 if (GetConsoleMode(current->inh, &orig_consolemode)) {
62 SetConsoleMode(current->inh, ENABLE_PROCESSED_INPUT);
63 }
64 #ifdef USE_UTF8
65 /* XXX is this the right thing to do? */
66 SetConsoleCP(65001);
67 #endif
68 return 0;
69 }
70
71 static void disableRawMode(struct current *current)
72 {
73 SetConsoleMode(current->inh, orig_consolemode);
74 }
75
76 void linenoiseClearScreen(void)
77 {
78 /* XXX: This is ugly. Should just have the caller pass a handle */
79 struct current current;
80
81 current.outh = GetStdHandle(STD_OUTPUT_HANDLE);
82
83 if (getWindowSize(&current) == 0) {
84 COORD topleft = { 0, 0 };
85 DWORD n;
86
87 FillConsoleOutputCharacter(current.outh, ' ',
88 current.cols * current.rows, topleft, &n);
89 FillConsoleOutputAttribute(current.outh,
90 FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN,
91 current.cols * current.rows, topleft, &n);
92 SetConsoleCursorPosition(current.outh, topleft);
93 }
94 }
95
96 static void cursorToLeft(struct current *current)
97 {
98 COORD pos;
99 DWORD n;
100
101 pos.X = 0;
102 pos.Y = (SHORT)current->y;
103
104 FillConsoleOutputAttribute(current->outh,
105 FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN, current->cols, pos, &n);
106 current->x = 0;
107 }
108
109 #ifdef USE_UTF8
110 static void flush_ubuf(struct current *current)
111 {
112 COORD pos;
113 DWORD nwritten;
114 pos.Y = (SHORT)current->y;
115 pos.X = (SHORT)current->x;
116 SetConsoleCursorPosition(current->outh, pos);
117 WriteConsoleW(current->outh, current->ubuf, current->ubuflen, &nwritten, 0);
118 current->x += current->ubufcols;
119 current->ubuflen = 0;
120 current->ubufcols = 0;
121 }
122
123 static void add_ubuf(struct current *current, int ch)
124 {
125 /* This code originally by: Author: Mark E. Davis, 1994. */
126 static const int halfShift = 10; /* used for shifting by 10 bits */
127
128 static const DWORD halfBase = 0x0010000UL;
129 static const DWORD halfMask = 0x3FFUL;
130
131 #define UNI_SUR_HIGH_START 0xD800
132 #define UNI_SUR_HIGH_END 0xDBFF
133 #define UNI_SUR_LOW_START 0xDC00
134 #define UNI_SUR_LOW_END 0xDFFF
135
136 #define UNI_MAX_BMP 0x0000FFFF
137
138 if (ch > UNI_MAX_BMP) {
139 /* convert from unicode to utf16 surrogate pairs
140 * There is always space for one extra word in ubuf
141 */
142 ch -= halfBase;
143 current->ubuf[current->ubuflen++] = (WORD)((ch >> halfShift) + UNI_SUR_HIGH_START);
144 current->ubuf[current->ubuflen++] = (WORD)((ch & halfMask) + UNI_SUR_LOW_START);
145 }
146 else {
147 current->ubuf[current->ubuflen++] = ch;
148 }
149 current->ubufcols += utf8_width(ch);
150 if (current->ubuflen >= UBUF_MAX_CHARS) {
151 flush_ubuf(current);
152 }
153 }
154 #endif
155
156 static int flushOutput(struct current *current)
157 {
158 const char *pt = sb_str(current->output);
159 int len = sb_len(current->output);
160
161 #ifdef USE_UTF8
162 /* convert utf8 in current->output into utf16 in current->ubuf
163 */
164 while (len) {
165 int ch;
166 int n = utf8_tounicode(pt, &ch);
167
168 pt += n;
169 len -= n;
170
171 add_ubuf(current, ch);
172 }
173 flush_ubuf(current);
174 #else
175 DWORD nwritten;
176 COORD pos;
177
178 pos.Y = (SHORT)current->y;
179 pos.X = (SHORT)current->x;
180
181 SetConsoleCursorPosition(current->outh, pos);
182 WriteConsoleA(current->outh, pt, len, &nwritten, 0);
183
184 current->x += len;
185 #endif
186
187 sb_clear(current->output);
188
189 return 0;
190 }
191
192 static int outputChars(struct current *current, const char *buf, int len)
193 {
194 if (len < 0) {
195 len = strlen(buf);
196 }
197 assert(current->output);
198
199 sb_append_len(current->output, buf, len);
200
201 return 0;
202 }
203
204 static void outputNewline(struct current *current)
205 {
206 /* On the last row output a newline to force a scroll */
207 if (current->y + 1 == current->rows) {
208 outputChars(current, "\n", 1);
209 }
210 flushOutput(current);
211 current->x = 0;
212 current->y++;
213 }
214
215 static void setOutputHighlight(struct current *current, const int *props, int nprops)
216 {
217 int colour = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;
218 int bold = 0;
219 int reverse = 0;
220 int i;
221
222 for (i = 0; i < nprops; i++) {
223 switch (props[i]) {
224 case 0:
225 colour = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;
226 bold = 0;
227 reverse = 0;
228 break;
229 case 1:
230 bold = FOREGROUND_INTENSITY;
231 break;
232 case 7:
233 reverse = 1;
234 break;
235 case 30:
236 colour = 0;
237 break;
238 case 31:
239 colour = FOREGROUND_RED;
240 break;
241 case 32:
242 colour = FOREGROUND_GREEN;
243 break;
244 case 33:
245 colour = FOREGROUND_RED | FOREGROUND_GREEN;
246 break;
247 case 34:
248 colour = FOREGROUND_BLUE;
249 break;
250 case 35:
251 colour = FOREGROUND_RED | FOREGROUND_BLUE;
252 break;
253 case 36:
254 colour = FOREGROUND_BLUE | FOREGROUND_GREEN;
255 break;
256 case 37:
257 colour = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;
258 break;
259 }
260 }
261
262 flushOutput(current);
263
264 if (reverse) {
265 SetConsoleTextAttribute(current->outh, BACKGROUND_INTENSITY);
266 }
267 else {
268 SetConsoleTextAttribute(current->outh, colour | bold);
269 }
270 }
271
272 static void eraseEol(struct current *current)
273 {
274 COORD pos;
275 DWORD n;
276
277 pos.X = (SHORT) current->x;
278 pos.Y = (SHORT) current->y;
279
280 FillConsoleOutputCharacter(current->outh, ' ', current->cols - current->x, pos, &n);
281 }
282
283 static void setCursorXY(struct current *current)
284 {
285 COORD pos;
286
287 pos.X = (SHORT) current->x;
288 pos.Y = (SHORT) current->y;
289
290 SetConsoleCursorPosition(current->outh, pos);
291 }
292
293
294 static void setCursorPos(struct current *current, int x)
295 {
296 current->x = x;
297 setCursorXY(current);
298 }
299
300 static void cursorUp(struct current *current, int n)
301 {
302 current->y -= n;
303 setCursorXY(current);
304 }
305
306 static void cursorDown(struct current *current, int n)
307 {
308 current->y += n;
309 setCursorXY(current);
310 }
311
312 static int fd_read(struct current *current)
313 {
314 while (1) {
315 INPUT_RECORD irec;
316 DWORD n;
317 if (WaitForSingleObject(current->inh, INFINITE) != WAIT_OBJECT_0) {
318 break;
319 }
320 if (!ReadConsoleInputW(current->inh, &irec, 1, &n)) {
321 break;
322 }
323 if (irec.EventType == KEY_EVENT) {
324 KEY_EVENT_RECORD *k = &irec.Event.KeyEvent;
325 if (k->bKeyDown || k->wVirtualKeyCode == VK_MENU) {
326 if (k->dwControlKeyState & ENHANCED_KEY) {
327 switch (k->wVirtualKeyCode) {
328 case VK_LEFT:
329 return SPECIAL_LEFT;
330 case VK_RIGHT:
331 return SPECIAL_RIGHT;
332 case VK_UP:
333 return SPECIAL_UP;
334 case VK_DOWN:
335 return SPECIAL_DOWN;
336 case VK_INSERT:
337 return SPECIAL_INSERT;
338 case VK_DELETE:
339 return SPECIAL_DELETE;
340 case VK_HOME:
341 return SPECIAL_HOME;
342 case VK_END:
343 return SPECIAL_END;
344 case VK_PRIOR:
345 return SPECIAL_PAGE_UP;
346 case VK_NEXT:
347 return SPECIAL_PAGE_DOWN;
348 case VK_RETURN:
349 return k->uChar.UnicodeChar;
350 }
351 }
352 /* Note that control characters are already translated in AsciiChar */
353 else if (k->wVirtualKeyCode == VK_CONTROL)
354 continue;
355 else {
356 return k->uChar.UnicodeChar;
357 }
358 }
359 }
360 }
361 return -1;
362 }
363
364 static int getWindowSize(struct current *current)
365 {
366 CONSOLE_SCREEN_BUFFER_INFO info;
367 if (!GetConsoleScreenBufferInfo(current->outh, &info)) {
368 return -1;
369 }
370 current->cols = info.dwSize.X;
371 current->rows = info.dwSize.Y;
372 if (current->cols <= 0 || current->rows <= 0) {
373 current->cols = 80;
374 return -1;
375 }
376 current->y = info.dwCursorPosition.Y;
377 current->x = info.dwCursorPosition.X;
378 return 0;
379 }
+44 -18
--- extsrc/linenoise.c
+++ extsrc/linenoise.c
@@ -892,10 +892,11 @@
892892
const char *prompt;
893893
stringbuf *capture; /* capture buffer, or NULL for none. Always null terminated */
894894
stringbuf *output; /* used only during refreshLine() - output accumulator */
895895
#if defined(USE_TERMIOS)
896896
int fd; /* Terminal fd */
897
+ int pending; /* pending char fd_read_char() */
897898
#elif defined(USE_WINCONSOLE)
898899
HANDLE outh; /* Console output handle */
899900
HANDLE inh; /* Console input handle */
900901
int rows; /* Screen rows */
901902
int x; /* Current column during output */
@@ -1121,28 +1122,31 @@
11211122
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
11221123
/* control chars - set return condition: min number of bytes and timer.
11231124
* We want read to return every single byte, without timeout. */
11241125
raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; /* 1 byte, no timer */
11251126
1126
- /* put terminal in raw mode after flushing */
1127
- if (tcsetattr(current->fd,TCSADRAIN,&raw) < 0) {
1127
+ /* put terminal in raw mode. Because we aren't changing any output
1128
+ * settings we don't need to use TCSADRAIN and I have seen that hang on
1129
+ * OpenBSD when running under a pty
1130
+ */
1131
+ if (tcsetattr(current->fd,TCSANOW,&raw) < 0) {
11281132
goto fatal;
11291133
}
11301134
rawmode = 1;
11311135
return 0;
11321136
}
11331137
11341138
static void disableRawMode(struct current *current) {
11351139
/* Don't even check the return value as it's too late. */
1136
- if (rawmode && tcsetattr(current->fd,TCSADRAIN,&orig_termios) != -1)
1140
+ if (rawmode && tcsetattr(current->fd,TCSANOW,&orig_termios) != -1)
11371141
rawmode = 0;
11381142
}
11391143
11401144
/* At exit we'll try to fix the terminal to the initial conditions. */
11411145
static void linenoiseAtExit(void) {
11421146
if (rawmode) {
1143
- tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_termios);
1147
+ tcsetattr(STDIN_FILENO, TCSANOW, &orig_termios);
11441148
}
11451149
linenoiseHistoryFree();
11461150
}
11471151
11481152
/* gcc/glibc insists that we care about the return code of write!
@@ -1230,29 +1234,35 @@
12301234
{
12311235
IGNORE_RC(write(STDOUT_FILENO, "\x1b[H\x1b[2J", 7));
12321236
}
12331237
12341238
/**
1235
- * Reads a char from 'fd', waiting at most 'timeout' milliseconds.
1239
+ * Reads a char from 'current->fd', waiting at most 'timeout' milliseconds.
12361240
*
12371241
* A timeout of -1 means to wait forever.
12381242
*
12391243
* Returns -1 if no char is received within the time or an error occurs.
12401244
*/
1241
-static int fd_read_char(int fd, int timeout)
1245
+static int fd_read_char(struct current *current, int timeout)
12421246
{
12431247
struct pollfd p;
12441248
unsigned char c;
12451249
1246
- p.fd = fd;
1250
+ if (current->pending) {
1251
+ c = current->pending;
1252
+ current->pending = 0;
1253
+ return c;
1254
+ }
1255
+
1256
+ p.fd = current->fd;
12471257
p.events = POLLIN;
12481258
12491259
if (poll(&p, 1, timeout) == 0) {
12501260
/* timeout */
12511261
return -1;
12521262
}
1253
- if (read(fd, &c, 1) != 1) {
1263
+ if (read(current->fd, &c, 1) != 1) {
12541264
return -1;
12551265
}
12561266
return c;
12571267
}
12581268
@@ -1266,11 +1276,15 @@
12661276
char buf[MAX_UTF8_LEN];
12671277
int n;
12681278
int i;
12691279
int c;
12701280
1271
- if (read(current->fd, &buf[0], 1) != 1) {
1281
+ if (current->pending) {
1282
+ buf[0] = current->pending;
1283
+ current->pending = 0;
1284
+ }
1285
+ else if (read(current->fd, &buf[0], 1) != 1) {
12721286
return -1;
12731287
}
12741288
n = utf8_charlen(buf[0]);
12751289
if (n < 1) {
12761290
return -1;
@@ -1282,11 +1296,11 @@
12821296
}
12831297
/* decode and return the character */
12841298
utf8_tounicode(buf, &c);
12851299
return c;
12861300
#else
1287
- return fd_read_char(current->fd, -1);
1301
+ return fd_read_char(current, -1);
12881302
#endif
12891303
}
12901304
12911305
12921306
/**
@@ -1295,20 +1309,29 @@
12951309
*/
12961310
static int queryCursor(struct current *current, int* cols)
12971311
{
12981312
struct esc_parser parser;
12991313
int ch;
1314
+ /* Unfortunately we don't have any persistent state, so assume
1315
+ * a process will only ever interact with one terminal at a time.
1316
+ */
1317
+ static int query_cursor_failed;
1318
+
1319
+ if (query_cursor_failed) {
1320
+ /* If it ever fails, don't try again */
1321
+ return 0;
1322
+ }
13001323
13011324
/* Should not be buffering this output, it needs to go immediately */
13021325
assert(current->output == NULL);
13031326
13041327
/* control sequence - report cursor location */
13051328
outputChars(current, "\x1b[6n", -1);
13061329
13071330
/* Parse the response: ESC [ rows ; cols R */
13081331
initParseEscapeSeq(&parser, 'R');
1309
- while ((ch = fd_read_char(current->fd, 100)) > 0) {
1332
+ while ((ch = fd_read_char(current, 100)) > 0) {
13101333
switch (parseEscapeSequence(&parser, ch)) {
13111334
default:
13121335
continue;
13131336
case EP_END:
13141337
if (parser.numprops == 2 && parser.props[1] < 1000) {
@@ -1315,15 +1338,18 @@
13151338
*cols = parser.props[1];
13161339
return 1;
13171340
}
13181341
break;
13191342
case EP_ERROR:
1343
+ /* Push back the character that caused the error */
1344
+ current->pending = ch;
13201345
break;
13211346
}
13221347
/* failed */
13231348
break;
13241349
}
1350
+ query_cursor_failed = 1;
13251351
return 0;
13261352
}
13271353
13281354
/**
13291355
* Updates current->cols with the current window size (width)
@@ -1386,13 +1412,13 @@
13861412
* Returns SPECIAL_NONE if unrecognised, or -1 if EOF.
13871413
*
13881414
* If no additional char is received within a short time,
13891415
* CHAR_ESCAPE is returned.
13901416
*/
1391
-static int check_special(int fd)
1417
+static int check_special(struct current *current)
13921418
{
1393
- int c = fd_read_char(fd, 50);
1419
+ int c = fd_read_char(current, 50);
13941420
int c2;
13951421
13961422
if (c < 0) {
13971423
return CHAR_ESCAPE;
13981424
}
@@ -1399,11 +1425,11 @@
13991425
else if (c >= 'a' && c <= 'z') {
14001426
/* esc-a => meta-a */
14011427
return meta(c);
14021428
}
14031429
1404
- c2 = fd_read_char(fd, 50);
1430
+ c2 = fd_read_char(current, 50);
14051431
if (c2 < 0) {
14061432
return c2;
14071433
}
14081434
if (c == '[' || c == 'O') {
14091435
/* Potential arrow key */
@@ -1422,11 +1448,11 @@
14221448
return SPECIAL_HOME;
14231449
}
14241450
}
14251451
if (c == '[' && c2 >= '1' && c2 <= '8') {
14261452
/* extended escape */
1427
- c = fd_read_char(fd, 50);
1453
+ c = fd_read_char(current, 50);
14281454
if (c == '~') {
14291455
switch (c2) {
14301456
case '2':
14311457
return SPECIAL_INSERT;
14321458
case '3':
@@ -1441,11 +1467,11 @@
14411467
return SPECIAL_END;
14421468
}
14431469
}
14441470
while (c != -1 && c != '~') {
14451471
/* .e.g \e[12~ or '\e[11;2~ discard the complete sequence */
1446
- c = fd_read_char(fd, 50);
1472
+ c = fd_read_char(current, 50);
14471473
}
14481474
}
14491475
14501476
return SPECIAL_NONE;
14511477
}
@@ -2234,11 +2260,11 @@
22342260
}
22352261
continue;
22362262
}
22372263
#ifdef USE_TERMIOS
22382264
if (c == CHAR_ESCAPE) {
2239
- c = check_special(current->fd);
2265
+ c = check_special(current);
22402266
}
22412267
#endif
22422268
if (c == ctrl('R')) {
22432269
/* Search for the previous (earlier) match */
22442270
if (searchpos > 0) {
@@ -2346,11 +2372,11 @@
23462372
/* go on to process the returned char normally */
23472373
}
23482374
23492375
#ifdef USE_TERMIOS
23502376
if (c == CHAR_ESCAPE) { /* escape sequence */
2351
- c = check_special(current->fd);
2377
+ c = check_special(current);
23522378
}
23532379
#endif
23542380
if (c == -1) {
23552381
/* Return on errors */
23562382
return sb_len(current->buf);
23572383
--- extsrc/linenoise.c
+++ extsrc/linenoise.c
@@ -892,10 +892,11 @@
892 const char *prompt;
893 stringbuf *capture; /* capture buffer, or NULL for none. Always null terminated */
894 stringbuf *output; /* used only during refreshLine() - output accumulator */
895 #if defined(USE_TERMIOS)
896 int fd; /* Terminal fd */
 
897 #elif defined(USE_WINCONSOLE)
898 HANDLE outh; /* Console output handle */
899 HANDLE inh; /* Console input handle */
900 int rows; /* Screen rows */
901 int x; /* Current column during output */
@@ -1121,28 +1122,31 @@
1121 raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
1122 /* control chars - set return condition: min number of bytes and timer.
1123 * We want read to return every single byte, without timeout. */
1124 raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; /* 1 byte, no timer */
1125
1126 /* put terminal in raw mode after flushing */
1127 if (tcsetattr(current->fd,TCSADRAIN,&raw) < 0) {
 
 
 
1128 goto fatal;
1129 }
1130 rawmode = 1;
1131 return 0;
1132 }
1133
1134 static void disableRawMode(struct current *current) {
1135 /* Don't even check the return value as it's too late. */
1136 if (rawmode && tcsetattr(current->fd,TCSADRAIN,&orig_termios) != -1)
1137 rawmode = 0;
1138 }
1139
1140 /* At exit we'll try to fix the terminal to the initial conditions. */
1141 static void linenoiseAtExit(void) {
1142 if (rawmode) {
1143 tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_termios);
1144 }
1145 linenoiseHistoryFree();
1146 }
1147
1148 /* gcc/glibc insists that we care about the return code of write!
@@ -1230,29 +1234,35 @@
1230 {
1231 IGNORE_RC(write(STDOUT_FILENO, "\x1b[H\x1b[2J", 7));
1232 }
1233
1234 /**
1235 * Reads a char from 'fd', waiting at most 'timeout' milliseconds.
1236 *
1237 * A timeout of -1 means to wait forever.
1238 *
1239 * Returns -1 if no char is received within the time or an error occurs.
1240 */
1241 static int fd_read_char(int fd, int timeout)
1242 {
1243 struct pollfd p;
1244 unsigned char c;
1245
1246 p.fd = fd;
 
 
 
 
 
 
1247 p.events = POLLIN;
1248
1249 if (poll(&p, 1, timeout) == 0) {
1250 /* timeout */
1251 return -1;
1252 }
1253 if (read(fd, &c, 1) != 1) {
1254 return -1;
1255 }
1256 return c;
1257 }
1258
@@ -1266,11 +1276,15 @@
1266 char buf[MAX_UTF8_LEN];
1267 int n;
1268 int i;
1269 int c;
1270
1271 if (read(current->fd, &buf[0], 1) != 1) {
 
 
 
 
1272 return -1;
1273 }
1274 n = utf8_charlen(buf[0]);
1275 if (n < 1) {
1276 return -1;
@@ -1282,11 +1296,11 @@
1282 }
1283 /* decode and return the character */
1284 utf8_tounicode(buf, &c);
1285 return c;
1286 #else
1287 return fd_read_char(current->fd, -1);
1288 #endif
1289 }
1290
1291
1292 /**
@@ -1295,20 +1309,29 @@
1295 */
1296 static int queryCursor(struct current *current, int* cols)
1297 {
1298 struct esc_parser parser;
1299 int ch;
 
 
 
 
 
 
 
 
 
1300
1301 /* Should not be buffering this output, it needs to go immediately */
1302 assert(current->output == NULL);
1303
1304 /* control sequence - report cursor location */
1305 outputChars(current, "\x1b[6n", -1);
1306
1307 /* Parse the response: ESC [ rows ; cols R */
1308 initParseEscapeSeq(&parser, 'R');
1309 while ((ch = fd_read_char(current->fd, 100)) > 0) {
1310 switch (parseEscapeSequence(&parser, ch)) {
1311 default:
1312 continue;
1313 case EP_END:
1314 if (parser.numprops == 2 && parser.props[1] < 1000) {
@@ -1315,15 +1338,18 @@
1315 *cols = parser.props[1];
1316 return 1;
1317 }
1318 break;
1319 case EP_ERROR:
 
 
1320 break;
1321 }
1322 /* failed */
1323 break;
1324 }
 
1325 return 0;
1326 }
1327
1328 /**
1329 * Updates current->cols with the current window size (width)
@@ -1386,13 +1412,13 @@
1386 * Returns SPECIAL_NONE if unrecognised, or -1 if EOF.
1387 *
1388 * If no additional char is received within a short time,
1389 * CHAR_ESCAPE is returned.
1390 */
1391 static int check_special(int fd)
1392 {
1393 int c = fd_read_char(fd, 50);
1394 int c2;
1395
1396 if (c < 0) {
1397 return CHAR_ESCAPE;
1398 }
@@ -1399,11 +1425,11 @@
1399 else if (c >= 'a' && c <= 'z') {
1400 /* esc-a => meta-a */
1401 return meta(c);
1402 }
1403
1404 c2 = fd_read_char(fd, 50);
1405 if (c2 < 0) {
1406 return c2;
1407 }
1408 if (c == '[' || c == 'O') {
1409 /* Potential arrow key */
@@ -1422,11 +1448,11 @@
1422 return SPECIAL_HOME;
1423 }
1424 }
1425 if (c == '[' && c2 >= '1' && c2 <= '8') {
1426 /* extended escape */
1427 c = fd_read_char(fd, 50);
1428 if (c == '~') {
1429 switch (c2) {
1430 case '2':
1431 return SPECIAL_INSERT;
1432 case '3':
@@ -1441,11 +1467,11 @@
1441 return SPECIAL_END;
1442 }
1443 }
1444 while (c != -1 && c != '~') {
1445 /* .e.g \e[12~ or '\e[11;2~ discard the complete sequence */
1446 c = fd_read_char(fd, 50);
1447 }
1448 }
1449
1450 return SPECIAL_NONE;
1451 }
@@ -2234,11 +2260,11 @@
2234 }
2235 continue;
2236 }
2237 #ifdef USE_TERMIOS
2238 if (c == CHAR_ESCAPE) {
2239 c = check_special(current->fd);
2240 }
2241 #endif
2242 if (c == ctrl('R')) {
2243 /* Search for the previous (earlier) match */
2244 if (searchpos > 0) {
@@ -2346,11 +2372,11 @@
2346 /* go on to process the returned char normally */
2347 }
2348
2349 #ifdef USE_TERMIOS
2350 if (c == CHAR_ESCAPE) { /* escape sequence */
2351 c = check_special(current->fd);
2352 }
2353 #endif
2354 if (c == -1) {
2355 /* Return on errors */
2356 return sb_len(current->buf);
2357
--- extsrc/linenoise.c
+++ extsrc/linenoise.c
@@ -892,10 +892,11 @@
892 const char *prompt;
893 stringbuf *capture; /* capture buffer, or NULL for none. Always null terminated */
894 stringbuf *output; /* used only during refreshLine() - output accumulator */
895 #if defined(USE_TERMIOS)
896 int fd; /* Terminal fd */
897 int pending; /* pending char fd_read_char() */
898 #elif defined(USE_WINCONSOLE)
899 HANDLE outh; /* Console output handle */
900 HANDLE inh; /* Console input handle */
901 int rows; /* Screen rows */
902 int x; /* Current column during output */
@@ -1121,28 +1122,31 @@
1122 raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
1123 /* control chars - set return condition: min number of bytes and timer.
1124 * We want read to return every single byte, without timeout. */
1125 raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; /* 1 byte, no timer */
1126
1127 /* put terminal in raw mode. Because we aren't changing any output
1128 * settings we don't need to use TCSADRAIN and I have seen that hang on
1129 * OpenBSD when running under a pty
1130 */
1131 if (tcsetattr(current->fd,TCSANOW,&raw) < 0) {
1132 goto fatal;
1133 }
1134 rawmode = 1;
1135 return 0;
1136 }
1137
1138 static void disableRawMode(struct current *current) {
1139 /* Don't even check the return value as it's too late. */
1140 if (rawmode && tcsetattr(current->fd,TCSANOW,&orig_termios) != -1)
1141 rawmode = 0;
1142 }
1143
1144 /* At exit we'll try to fix the terminal to the initial conditions. */
1145 static void linenoiseAtExit(void) {
1146 if (rawmode) {
1147 tcsetattr(STDIN_FILENO, TCSANOW, &orig_termios);
1148 }
1149 linenoiseHistoryFree();
1150 }
1151
1152 /* gcc/glibc insists that we care about the return code of write!
@@ -1230,29 +1234,35 @@
1234 {
1235 IGNORE_RC(write(STDOUT_FILENO, "\x1b[H\x1b[2J", 7));
1236 }
1237
1238 /**
1239 * Reads a char from 'current->fd', waiting at most 'timeout' milliseconds.
1240 *
1241 * A timeout of -1 means to wait forever.
1242 *
1243 * Returns -1 if no char is received within the time or an error occurs.
1244 */
1245 static int fd_read_char(struct current *current, int timeout)
1246 {
1247 struct pollfd p;
1248 unsigned char c;
1249
1250 if (current->pending) {
1251 c = current->pending;
1252 current->pending = 0;
1253 return c;
1254 }
1255
1256 p.fd = current->fd;
1257 p.events = POLLIN;
1258
1259 if (poll(&p, 1, timeout) == 0) {
1260 /* timeout */
1261 return -1;
1262 }
1263 if (read(current->fd, &c, 1) != 1) {
1264 return -1;
1265 }
1266 return c;
1267 }
1268
@@ -1266,11 +1276,15 @@
1276 char buf[MAX_UTF8_LEN];
1277 int n;
1278 int i;
1279 int c;
1280
1281 if (current->pending) {
1282 buf[0] = current->pending;
1283 current->pending = 0;
1284 }
1285 else if (read(current->fd, &buf[0], 1) != 1) {
1286 return -1;
1287 }
1288 n = utf8_charlen(buf[0]);
1289 if (n < 1) {
1290 return -1;
@@ -1282,11 +1296,11 @@
1296 }
1297 /* decode and return the character */
1298 utf8_tounicode(buf, &c);
1299 return c;
1300 #else
1301 return fd_read_char(current, -1);
1302 #endif
1303 }
1304
1305
1306 /**
@@ -1295,20 +1309,29 @@
1309 */
1310 static int queryCursor(struct current *current, int* cols)
1311 {
1312 struct esc_parser parser;
1313 int ch;
1314 /* Unfortunately we don't have any persistent state, so assume
1315 * a process will only ever interact with one terminal at a time.
1316 */
1317 static int query_cursor_failed;
1318
1319 if (query_cursor_failed) {
1320 /* If it ever fails, don't try again */
1321 return 0;
1322 }
1323
1324 /* Should not be buffering this output, it needs to go immediately */
1325 assert(current->output == NULL);
1326
1327 /* control sequence - report cursor location */
1328 outputChars(current, "\x1b[6n", -1);
1329
1330 /* Parse the response: ESC [ rows ; cols R */
1331 initParseEscapeSeq(&parser, 'R');
1332 while ((ch = fd_read_char(current, 100)) > 0) {
1333 switch (parseEscapeSequence(&parser, ch)) {
1334 default:
1335 continue;
1336 case EP_END:
1337 if (parser.numprops == 2 && parser.props[1] < 1000) {
@@ -1315,15 +1338,18 @@
1338 *cols = parser.props[1];
1339 return 1;
1340 }
1341 break;
1342 case EP_ERROR:
1343 /* Push back the character that caused the error */
1344 current->pending = ch;
1345 break;
1346 }
1347 /* failed */
1348 break;
1349 }
1350 query_cursor_failed = 1;
1351 return 0;
1352 }
1353
1354 /**
1355 * Updates current->cols with the current window size (width)
@@ -1386,13 +1412,13 @@
1412 * Returns SPECIAL_NONE if unrecognised, or -1 if EOF.
1413 *
1414 * If no additional char is received within a short time,
1415 * CHAR_ESCAPE is returned.
1416 */
1417 static int check_special(struct current *current)
1418 {
1419 int c = fd_read_char(current, 50);
1420 int c2;
1421
1422 if (c < 0) {
1423 return CHAR_ESCAPE;
1424 }
@@ -1399,11 +1425,11 @@
1425 else if (c >= 'a' && c <= 'z') {
1426 /* esc-a => meta-a */
1427 return meta(c);
1428 }
1429
1430 c2 = fd_read_char(current, 50);
1431 if (c2 < 0) {
1432 return c2;
1433 }
1434 if (c == '[' || c == 'O') {
1435 /* Potential arrow key */
@@ -1422,11 +1448,11 @@
1448 return SPECIAL_HOME;
1449 }
1450 }
1451 if (c == '[' && c2 >= '1' && c2 <= '8') {
1452 /* extended escape */
1453 c = fd_read_char(current, 50);
1454 if (c == '~') {
1455 switch (c2) {
1456 case '2':
1457 return SPECIAL_INSERT;
1458 case '3':
@@ -1441,11 +1467,11 @@
1467 return SPECIAL_END;
1468 }
1469 }
1470 while (c != -1 && c != '~') {
1471 /* .e.g \e[12~ or '\e[11;2~ discard the complete sequence */
1472 c = fd_read_char(current, 50);
1473 }
1474 }
1475
1476 return SPECIAL_NONE;
1477 }
@@ -2234,11 +2260,11 @@
2260 }
2261 continue;
2262 }
2263 #ifdef USE_TERMIOS
2264 if (c == CHAR_ESCAPE) {
2265 c = check_special(current);
2266 }
2267 #endif
2268 if (c == ctrl('R')) {
2269 /* Search for the previous (earlier) match */
2270 if (searchpos > 0) {
@@ -2346,11 +2372,11 @@
2372 /* go on to process the returned char normally */
2373 }
2374
2375 #ifdef USE_TERMIOS
2376 if (c == CHAR_ESCAPE) { /* escape sequence */
2377 c = check_special(current);
2378 }
2379 #endif
2380 if (c == -1) {
2381 /* Return on errors */
2382 return sb_len(current->buf);
2383
--- extsrc/pikchr-worker.js
+++ extsrc/pikchr-worker.js
@@ -36,11 +36,11 @@
3636
pikchr: source code for the pikchr,
3737
darkMode: boolean true to adjust colors for a dark color scheme,
3838
cssClass: CSS class name to add to the SVG
3939
}
4040
41
- Workers-to-Main types
41
+ Workers-to-Main message types:
4242
4343
- stdout, stderr: indicate stdout/stderr output from the wasm
4444
layer. The data property is the string of the output, noting
4545
that the emscripten binding emits these one line at a time. Thus,
4646
if a C-side puts() emits multiple lines in a single call, the JS
@@ -50,21 +50,21 @@
5050
5151
- module: Status text. This is intended to alert the main thread
5252
about module loading status so that, e.g., the main thread can
5353
update a progress widget and DTRT when the module is finished
5454
loading and available for work. Status messages come in the form
55
-
55
+
5656
{type:'module', data:{
5757
type:'status',
5858
data: {text:string|null, step:1-based-integer}
5959
}
6060
6161
with an incrementing step value for each subsequent message. When
6262
the module loading is complete, a message with a text value of
6363
null is posted.
6464
65
- - pikchr:
65
+ - pikchr:
6666
6767
{type: 'pikchr',
6868
data:{
6969
pikchr: input text,
7070
result: rendered result (SVG on success, HTML on error),
@@ -162,11 +162,11 @@
162162
}
163163
return;
164164
};
165165
console.warn("Unknown pikchr-worker message type:",ev);
166166
};
167
-
167
+
168168
/**
169169
emscripten module for use with build mode -sMODULARIZE.
170170
*/
171171
const pikchrModule = {
172172
print: function(){wMsg('stdout', Array.prototype.slice.call(arguments));},
@@ -206,16 +206,17 @@
206206
data:{step: ++f.last.step, text: text||null}
207207
});
208208
}
209209
};
210210
211
- importScripts('pikchr.js');
211
+ importScripts('pikchr-v2813665466.js');
212212
/**
213213
initPikchrModule() is installed via pikchr.js due to
214214
building with:
215215
216216
emcc ... -sMODULARIZE=1 -sEXPORT_NAME=initPikchrModule
217217
*/
218218
initPikchrModule(pikchrModule).then(function(thisModule){
219
- wMsg('pikchr-ready');
219
+ //globalThis.M = pikchrModule; console.warn("pikchrModule=globalThis.M=",globalThis.M);
220
+ wMsg('pikchr-ready', pikchrModule.ccall('pikchr_version','string'));
220221
});
221222
})();
222223
--- extsrc/pikchr-worker.js
+++ extsrc/pikchr-worker.js
@@ -36,11 +36,11 @@
36 pikchr: source code for the pikchr,
37 darkMode: boolean true to adjust colors for a dark color scheme,
38 cssClass: CSS class name to add to the SVG
39 }
40
41 Workers-to-Main types
42
43 - stdout, stderr: indicate stdout/stderr output from the wasm
44 layer. The data property is the string of the output, noting
45 that the emscripten binding emits these one line at a time. Thus,
46 if a C-side puts() emits multiple lines in a single call, the JS
@@ -50,21 +50,21 @@
50
51 - module: Status text. This is intended to alert the main thread
52 about module loading status so that, e.g., the main thread can
53 update a progress widget and DTRT when the module is finished
54 loading and available for work. Status messages come in the form
55
56 {type:'module', data:{
57 type:'status',
58 data: {text:string|null, step:1-based-integer}
59 }
60
61 with an incrementing step value for each subsequent message. When
62 the module loading is complete, a message with a text value of
63 null is posted.
64
65 - pikchr:
66
67 {type: 'pikchr',
68 data:{
69 pikchr: input text,
70 result: rendered result (SVG on success, HTML on error),
@@ -162,11 +162,11 @@
162 }
163 return;
164 };
165 console.warn("Unknown pikchr-worker message type:",ev);
166 };
167
168 /**
169 emscripten module for use with build mode -sMODULARIZE.
170 */
171 const pikchrModule = {
172 print: function(){wMsg('stdout', Array.prototype.slice.call(arguments));},
@@ -206,16 +206,17 @@
206 data:{step: ++f.last.step, text: text||null}
207 });
208 }
209 };
210
211 importScripts('pikchr.js');
212 /**
213 initPikchrModule() is installed via pikchr.js due to
214 building with:
215
216 emcc ... -sMODULARIZE=1 -sEXPORT_NAME=initPikchrModule
217 */
218 initPikchrModule(pikchrModule).then(function(thisModule){
219 wMsg('pikchr-ready');
 
220 });
221 })();
222
--- extsrc/pikchr-worker.js
+++ extsrc/pikchr-worker.js
@@ -36,11 +36,11 @@
36 pikchr: source code for the pikchr,
37 darkMode: boolean true to adjust colors for a dark color scheme,
38 cssClass: CSS class name to add to the SVG
39 }
40
41 Workers-to-Main message types:
42
43 - stdout, stderr: indicate stdout/stderr output from the wasm
44 layer. The data property is the string of the output, noting
45 that the emscripten binding emits these one line at a time. Thus,
46 if a C-side puts() emits multiple lines in a single call, the JS
@@ -50,21 +50,21 @@
50
51 - module: Status text. This is intended to alert the main thread
52 about module loading status so that, e.g., the main thread can
53 update a progress widget and DTRT when the module is finished
54 loading and available for work. Status messages come in the form
55
56 {type:'module', data:{
57 type:'status',
58 data: {text:string|null, step:1-based-integer}
59 }
60
61 with an incrementing step value for each subsequent message. When
62 the module loading is complete, a message with a text value of
63 null is posted.
64
65 - pikchr:
66
67 {type: 'pikchr',
68 data:{
69 pikchr: input text,
70 result: rendered result (SVG on success, HTML on error),
@@ -162,11 +162,11 @@
162 }
163 return;
164 };
165 console.warn("Unknown pikchr-worker message type:",ev);
166 };
167
168 /**
169 emscripten module for use with build mode -sMODULARIZE.
170 */
171 const pikchrModule = {
172 print: function(){wMsg('stdout', Array.prototype.slice.call(arguments));},
@@ -206,16 +206,17 @@
206 data:{step: ++f.last.step, text: text||null}
207 });
208 }
209 };
210
211 importScripts('pikchr-v2813665466.js');
212 /**
213 initPikchrModule() is installed via pikchr.js due to
214 building with:
215
216 emcc ... -sMODULARIZE=1 -sEXPORT_NAME=initPikchrModule
217 */
218 initPikchrModule(pikchrModule).then(function(thisModule){
219 //globalThis.M = pikchrModule; console.warn("pikchrModule=globalThis.M=",globalThis.M);
220 wMsg('pikchr-ready', pikchrModule.ccall('pikchr_version','string'));
221 });
222 })();
223
+1147 -1059
--- extsrc/pikchr.c
+++ extsrc/pikchr.c
@@ -1,8 +1,47 @@
11
/* This file is automatically generated by Lemon from input grammar
22
** source file "pikchr.y".
33
*/
4
+/*
5
+** 2000-05-29
6
+**
7
+** The author disclaims copyright to this source code. In place of
8
+** a legal notice, here is a blessing:
9
+**
10
+** May you do good and not evil.
11
+** May you find forgiveness for yourself and forgive others.
12
+** May you share freely, never taking more than you give.
13
+**
14
+*************************************************************************
15
+** Driver template for the LEMON parser generator.
16
+**
17
+** The "lemon" program processes an LALR(1) input grammar file, then uses
18
+** this template to construct a parser. The "lemon" program inserts text
19
+** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
20
+** interstitial "-" characters) contained in this template is changed into
21
+** the value of the %name directive from the grammar. Otherwise, the content
22
+** of this template is copied straight through into the generate parser
23
+** source file.
24
+**
25
+** The following is the concatenation of all %include directives from the
26
+** input grammar file:
27
+*/
28
+/************ Begin %include sections from the grammar ************************/
29
+#line 1 "VERSION.h"
30
+#define MANIFEST_UUID "8a43b020141f772a0ac45291a7fd73041d2efba5e3665c6bd2f334ad9b2e9845"
31
+#define MANIFEST_VERSION "[8a43b02014]"
32
+#define MANIFEST_DATE "2025-03-19 16:19:43"
33
+#define MANIFEST_YEAR "2025"
34
+#define MANIFEST_ISODATE "20250319161943"
35
+#define MANIFEST_NUMERIC_DATE 20250319
36
+#define MANIFEST_NUMERIC_TIME 161943
37
+#define RELEASE_VERSION "1.0"
38
+#define RELEASE_VERSION_NUMBER 10000
39
+#define RELEASE_RESOURCE_VERSION 1,0,0,0
40
+#define COMPILER "gcc-13.3.0"
41
+#line 2 "pikchr.y"
42
+
443
/*
544
** Zero-Clause BSD license:
645
**
746
** Copyright (C) 2020-09-01 by D. Richard Hipp <[email protected]>
847
**
@@ -125,10 +164,22 @@
125164
#include <assert.h>
126165
#define count(X) (sizeof(X)/sizeof(X[0]))
127166
#ifndef M_PI
128167
# define M_PI 3.1415926535897932385
129168
#endif
169
+
170
+/*
171
+** Typesafe version of ctype.h macros. Cygwin requires this, I'm told.
172
+*/
173
+#define IsUpper(X) isupper((unsigned char)(X))
174
+#define IsLower(X) islower((unsigned char)(X))
175
+#define ToLower(X) tolower((unsigned char)(X))
176
+#define IsDigit(X) isdigit((unsigned char)(X))
177
+#define IsXDigit(X) isxdigit((unsigned char)(X))
178
+#define IsSpace(X) isspace((unsigned char)(X))
179
+#define IsAlnum(X) isalnum((unsigned char)(X))
180
+
130181
131182
/* Limit the number of tokens in a single script to avoid run-away
132183
** macro expansion attacks. See forum post
133184
** https://pikchr.org/home/forumpost/ef8684c6955a411a
134185
*/
@@ -474,11 +525,11 @@
474525
static void pik_bbox_addbox(PBox*,PBox*);
475526
static void pik_bbox_add_xy(PBox*,PNum,PNum);
476527
static void pik_bbox_addellipse(PBox*,PNum x,PNum y,PNum rx,PNum ry);
477528
static void pik_add_txt(Pik*,PToken*,int);
478529
static int pik_text_length(const PToken *pToken, const int isMonospace);
479
-static void pik_size_to_fit(Pik*,PToken*,int);
530
+static void pik_size_to_fit(Pik*,PObj*,PToken*,int);
480531
static int pik_text_position(int,PToken*);
481532
static PNum pik_property_of(PObj*,PToken*);
482533
static PNum pik_func(Pik*,PToken*,PNum,PNum);
483534
static PPoint pik_position_between(PNum x, PPoint p1, PPoint p2);
484535
static PPoint pik_position_at_angle(PNum dist, PNum r, PPoint pt);
@@ -492,11 +543,11 @@
492543
static PObj *pik_position_assert(Pik*,PPoint*,PToken*,PPoint*);
493544
static PNum pik_dist(PPoint*,PPoint*);
494545
static void pik_add_macro(Pik*,PToken *pId,PToken *pCode);
495546
496547
497
-#line 523 "pikchr.c"
548
+#line 549 "pikchr.c"
498549
/**************** End of %include directives **********************************/
499550
/* These constants specify the various numeric values for terminal symbols.
500551
***************** Begin token definitions *************************************/
501552
#ifndef T_ID
502553
#define T_ID 1
@@ -522,84 +573,85 @@
522573
#define T_COLOR 21
523574
#define T_THICKNESS 22
524575
#define T_PRINT 23
525576
#define T_STRING 24
526577
#define T_COMMA 25
527
-#define T_CLASSNAME 26
528
-#define T_LB 27
529
-#define T_RB 28
530
-#define T_UP 29
531
-#define T_DOWN 30
532
-#define T_LEFT 31
533
-#define T_RIGHT 32
534
-#define T_CLOSE 33
535
-#define T_CHOP 34
536
-#define T_FROM 35
537
-#define T_TO 36
538
-#define T_THEN 37
539
-#define T_HEADING 38
540
-#define T_GO 39
541
-#define T_AT 40
542
-#define T_WITH 41
543
-#define T_SAME 42
544
-#define T_AS 43
545
-#define T_FIT 44
546
-#define T_BEHIND 45
547
-#define T_UNTIL 46
548
-#define T_EVEN 47
549
-#define T_DOT_E 48
550
-#define T_HEIGHT 49
551
-#define T_WIDTH 50
552
-#define T_RADIUS 51
553
-#define T_DIAMETER 52
554
-#define T_DOTTED 53
555
-#define T_DASHED 54
556
-#define T_CW 55
557
-#define T_CCW 56
558
-#define T_LARROW 57
559
-#define T_RARROW 58
560
-#define T_LRARROW 59
561
-#define T_INVIS 60
562
-#define T_THICK 61
563
-#define T_THIN 62
564
-#define T_SOLID 63
565
-#define T_CENTER 64
566
-#define T_LJUST 65
567
-#define T_RJUST 66
568
-#define T_ABOVE 67
569
-#define T_BELOW 68
570
-#define T_ITALIC 69
571
-#define T_BOLD 70
572
-#define T_MONO 71
573
-#define T_ALIGNED 72
574
-#define T_BIG 73
575
-#define T_SMALL 74
576
-#define T_AND 75
577
-#define T_LT 76
578
-#define T_GT 77
579
-#define T_ON 78
580
-#define T_WAY 79
581
-#define T_BETWEEN 80
582
-#define T_THE 81
583
-#define T_NTH 82
584
-#define T_VERTEX 83
585
-#define T_TOP 84
586
-#define T_BOTTOM 85
587
-#define T_START 86
588
-#define T_END 87
589
-#define T_IN 88
590
-#define T_THIS 89
591
-#define T_DOT_U 90
592
-#define T_LAST 91
593
-#define T_NUMBER 92
594
-#define T_FUNC1 93
595
-#define T_FUNC2 94
596
-#define T_DIST 95
597
-#define T_DOT_XY 96
598
-#define T_X 97
599
-#define T_Y 98
600
-#define T_DOT_L 99
578
+#define T_ISODATE 26
579
+#define T_CLASSNAME 27
580
+#define T_LB 28
581
+#define T_RB 29
582
+#define T_UP 30
583
+#define T_DOWN 31
584
+#define T_LEFT 32
585
+#define T_RIGHT 33
586
+#define T_CLOSE 34
587
+#define T_CHOP 35
588
+#define T_FROM 36
589
+#define T_TO 37
590
+#define T_THEN 38
591
+#define T_HEADING 39
592
+#define T_GO 40
593
+#define T_AT 41
594
+#define T_WITH 42
595
+#define T_SAME 43
596
+#define T_AS 44
597
+#define T_FIT 45
598
+#define T_BEHIND 46
599
+#define T_UNTIL 47
600
+#define T_EVEN 48
601
+#define T_DOT_E 49
602
+#define T_HEIGHT 50
603
+#define T_WIDTH 51
604
+#define T_RADIUS 52
605
+#define T_DIAMETER 53
606
+#define T_DOTTED 54
607
+#define T_DASHED 55
608
+#define T_CW 56
609
+#define T_CCW 57
610
+#define T_LARROW 58
611
+#define T_RARROW 59
612
+#define T_LRARROW 60
613
+#define T_INVIS 61
614
+#define T_THICK 62
615
+#define T_THIN 63
616
+#define T_SOLID 64
617
+#define T_CENTER 65
618
+#define T_LJUST 66
619
+#define T_RJUST 67
620
+#define T_ABOVE 68
621
+#define T_BELOW 69
622
+#define T_ITALIC 70
623
+#define T_BOLD 71
624
+#define T_MONO 72
625
+#define T_ALIGNED 73
626
+#define T_BIG 74
627
+#define T_SMALL 75
628
+#define T_AND 76
629
+#define T_LT 77
630
+#define T_GT 78
631
+#define T_ON 79
632
+#define T_WAY 80
633
+#define T_BETWEEN 81
634
+#define T_THE 82
635
+#define T_NTH 83
636
+#define T_VERTEX 84
637
+#define T_TOP 85
638
+#define T_BOTTOM 86
639
+#define T_START 87
640
+#define T_END 88
641
+#define T_IN 89
642
+#define T_THIS 90
643
+#define T_DOT_U 91
644
+#define T_LAST 92
645
+#define T_NUMBER 93
646
+#define T_FUNC1 94
647
+#define T_FUNC2 95
648
+#define T_DIST 96
649
+#define T_DOT_XY 97
650
+#define T_X 98
651
+#define T_Y 99
652
+#define T_DOT_L 100
601653
#endif
602654
/**************** End token definitions ***************************************/
603655
604656
/* The next sections is a series of control #defines.
605657
** various aspects of the generated parser.
@@ -660,22 +712,22 @@
660712
#ifndef INTERFACE
661713
# define INTERFACE 1
662714
#endif
663715
/************* Begin control #defines *****************************************/
664716
#define YYCODETYPE unsigned char
665
-#define YYNOCODE 136
717
+#define YYNOCODE 138
666718
#define YYACTIONTYPE unsigned short int
667719
#define pik_parserTOKENTYPE PToken
668720
typedef union {
669721
int yyinit;
670722
pik_parserTOKENTYPE yy0;
671
- PNum yy21;
672
- PPoint yy63;
673
- PRel yy72;
674
- PObj* yy162;
675
- short int yy188;
676
- PList* yy235;
723
+ PList* yy23;
724
+ PRel yy28;
725
+ PObj* yy54;
726
+ PNum yy129;
727
+ PPoint yy187;
728
+ short int yy272;
677729
} YYMINORTYPE;
678730
#ifndef YYSTACKDEPTH
679731
#define YYSTACKDEPTH 100
680732
#endif
681733
#define pik_parserARG_SDECL
@@ -693,21 +745,21 @@
693745
#define pik_parserCTX_STORE yypParser->p=p;
694746
#define YYFALLBACK 1
695747
#define YYNSTATE 164
696748
#define YYNRULE 156
697749
#define YYNRULE_WITH_ACTION 116
698
-#define YYNTOKEN 100
750
+#define YYNTOKEN 101
699751
#define YY_MAX_SHIFT 163
700752
#define YY_MIN_SHIFTREDUCE 287
701753
#define YY_MAX_SHIFTREDUCE 442
702754
#define YY_ERROR_ACTION 443
703755
#define YY_ACCEPT_ACTION 444
704756
#define YY_NO_ACTION 445
705757
#define YY_MIN_REDUCE 446
706758
#define YY_MAX_REDUCE 601
707
-#define YY_MIN_DSTRCTR 100
708
-#define YY_MAX_DSTRCTR 103
759
+#define YY_MIN_DSTRCTR 101
760
+#define YY_MAX_DSTRCTR 104
709761
/************* End control #defines *******************************************/
710762
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
711763
712764
/* Define the yytestcase() macro to be a no-op if is not already defined
713765
** otherwise.
@@ -786,324 +838,322 @@
786838
** yy_reduce_ofst[] For each state, the offset into yy_action for
787839
** shifting non-terminals after a reduce.
788840
** yy_default[] Default action for each state.
789841
**
790842
*********** Begin parsing tables **********************************************/
791
-#define YY_ACTTAB_COUNT (1313)
843
+#define YY_ACTTAB_COUNT (1305)
792844
static const YYACTIONTYPE yy_action[] = {
793845
/* 0 */ 575, 495, 161, 119, 25, 452, 29, 74, 129, 148,
794
- /* 10 */ 575, 492, 161, 119, 453, 113, 120, 161, 119, 530,
795
- /* 20 */ 427, 428, 339, 559, 81, 30, 560, 561, 575, 64,
796
- /* 30 */ 63, 62, 61, 322, 323, 9, 8, 33, 149, 32,
797
- /* 40 */ 7, 71, 127, 38, 335, 66, 48, 37, 28, 339,
798
- /* 50 */ 339, 339, 339, 425, 426, 340, 341, 342, 343, 344,
799
- /* 60 */ 345, 346, 347, 348, 474, 528, 161, 119, 577, 77,
800
- /* 70 */ 577, 73, 306, 148, 474, 533, 161, 119, 112, 113,
801
- /* 80 */ 120, 161, 119, 128, 427, 428, 339, 31, 81, 531,
802
- /* 90 */ 161, 119, 474, 35, 330, 378, 158, 322, 323, 9,
803
- /* 100 */ 8, 33, 149, 32, 7, 71, 127, 328, 335, 66,
804
- /* 110 */ 579, 378, 158, 339, 339, 339, 339, 425, 426, 340,
805
- /* 120 */ 341, 342, 343, 344, 345, 346, 347, 348, 394, 435,
806
- /* 130 */ 46, 59, 60, 64, 63, 62, 61, 357, 36, 376,
807
- /* 140 */ 54, 51, 2, 47, 403, 13, 297, 411, 412, 413,
808
- /* 150 */ 414, 80, 162, 308, 79, 133, 310, 126, 441, 440,
809
- /* 160 */ 118, 123, 83, 404, 405, 406, 408, 80, 84, 308,
810
- /* 170 */ 79, 299, 411, 412, 413, 414, 118, 69, 350, 350,
811
- /* 180 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 62,
812
- /* 190 */ 61, 434, 64, 63, 62, 61, 313, 398, 399, 427,
813
- /* 200 */ 428, 339, 380, 157, 64, 63, 62, 61, 122, 106,
814
- /* 210 */ 535, 436, 437, 438, 439, 298, 375, 391, 117, 393,
815
- /* 220 */ 155, 154, 153, 394, 435, 49, 59, 60, 339, 339,
816
- /* 230 */ 339, 339, 425, 426, 376, 3, 4, 2, 64, 63,
817
- /* 240 */ 62, 61, 156, 156, 156, 394, 379, 159, 59, 60,
818
- /* 250 */ 76, 67, 535, 441, 440, 5, 102, 6, 535, 42,
819
- /* 260 */ 131, 535, 69, 107, 301, 302, 303, 394, 305, 15,
820
- /* 270 */ 59, 60, 120, 161, 119, 446, 463, 424, 376, 423,
821
- /* 280 */ 1, 42, 397, 78, 78, 36, 434, 11, 394, 435,
822
- /* 290 */ 356, 59, 60, 12, 152, 139, 432, 14, 16, 376,
823
- /* 300 */ 18, 65, 2, 138, 106, 430, 436, 437, 438, 439,
824
- /* 310 */ 44, 375, 19, 117, 393, 155, 154, 153, 441, 440,
825
- /* 320 */ 142, 140, 64, 63, 62, 61, 106, 20, 68, 376,
826
- /* 330 */ 359, 107, 23, 375, 45, 117, 393, 155, 154, 153,
827
- /* 340 */ 120, 161, 119, 55, 463, 114, 26, 57, 106, 147,
828
- /* 350 */ 146, 434, 569, 58, 392, 375, 43, 117, 393, 155,
829
- /* 360 */ 154, 153, 152, 384, 64, 63, 62, 61, 382, 106,
830
- /* 370 */ 383, 436, 437, 438, 439, 377, 375, 70, 117, 393,
831
- /* 380 */ 155, 154, 153, 160, 39, 22, 21, 445, 142, 140,
832
- /* 390 */ 64, 63, 62, 61, 24, 17, 145, 141, 431, 108,
833
- /* 400 */ 445, 445, 445, 391, 445, 445, 375, 445, 117, 445,
834
- /* 410 */ 445, 55, 74, 445, 148, 445, 445, 147, 146, 124,
835
- /* 420 */ 113, 120, 161, 119, 43, 445, 445, 142, 140, 64,
836
- /* 430 */ 63, 62, 61, 445, 394, 445, 445, 59, 60, 64,
837
- /* 440 */ 63, 62, 61, 149, 445, 376, 445, 445, 42, 445,
838
- /* 450 */ 55, 445, 391, 22, 21, 445, 147, 146, 445, 445,
839
- /* 460 */ 52, 445, 24, 43, 145, 141, 431, 394, 445, 445,
840
- /* 470 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 132,
841
- /* 480 */ 130, 42, 445, 445, 445, 355, 156, 156, 156, 445,
842
- /* 490 */ 445, 445, 22, 21, 445, 394, 473, 445, 59, 60,
843
- /* 500 */ 445, 24, 445, 145, 141, 431, 376, 445, 107, 42,
844
- /* 510 */ 64, 63, 62, 61, 445, 106, 445, 120, 161, 119,
845
- /* 520 */ 445, 478, 375, 354, 117, 393, 155, 154, 153, 445,
846
- /* 530 */ 394, 143, 473, 59, 60, 64, 63, 62, 61, 152,
847
- /* 540 */ 445, 376, 445, 445, 42, 445, 445, 445, 106, 64,
848
- /* 550 */ 63, 62, 61, 445, 445, 375, 50, 117, 393, 155,
849
- /* 560 */ 154, 153, 445, 394, 144, 445, 59, 60, 445, 445,
850
- /* 570 */ 53, 72, 445, 148, 376, 445, 106, 42, 125, 113,
851
- /* 580 */ 120, 161, 119, 375, 445, 117, 393, 155, 154, 153,
852
- /* 590 */ 394, 445, 445, 59, 60, 445, 445, 445, 445, 445,
853
- /* 600 */ 445, 102, 149, 445, 42, 445, 74, 445, 148, 445,
854
- /* 610 */ 445, 106, 445, 497, 113, 120, 161, 119, 375, 445,
855
- /* 620 */ 117, 393, 155, 154, 153, 394, 445, 445, 59, 60,
856
- /* 630 */ 445, 445, 88, 445, 445, 445, 376, 149, 445, 40,
857
- /* 640 */ 445, 120, 161, 119, 106, 445, 445, 435, 110, 110,
858
- /* 650 */ 445, 375, 445, 117, 393, 155, 154, 153, 394, 445,
859
- /* 660 */ 445, 59, 60, 152, 85, 445, 445, 445, 445, 376,
860
- /* 670 */ 445, 106, 41, 120, 161, 119, 441, 440, 375, 445,
861
- /* 680 */ 117, 393, 155, 154, 153, 448, 454, 29, 445, 445,
862
- /* 690 */ 74, 450, 148, 75, 88, 152, 445, 496, 113, 120,
863
- /* 700 */ 161, 119, 163, 120, 161, 119, 106, 27, 445, 434,
864
- /* 710 */ 111, 111, 445, 375, 445, 117, 393, 155, 154, 153,
865
- /* 720 */ 445, 149, 445, 445, 445, 152, 74, 445, 148, 436,
866
- /* 730 */ 437, 438, 439, 490, 113, 120, 161, 119, 445, 106,
867
- /* 740 */ 121, 447, 454, 29, 445, 445, 375, 450, 117, 393,
868
- /* 750 */ 155, 154, 153, 445, 445, 445, 445, 149, 163, 74,
869
- /* 760 */ 445, 148, 444, 27, 445, 445, 484, 113, 120, 161,
870
- /* 770 */ 119, 445, 445, 445, 74, 445, 148, 445, 445, 445,
871
- /* 780 */ 445, 483, 113, 120, 161, 119, 74, 445, 148, 86,
872
- /* 790 */ 149, 445, 445, 480, 113, 120, 161, 119, 120, 161,
873
- /* 800 */ 119, 445, 74, 445, 148, 149, 445, 445, 445, 134,
874
- /* 810 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
875
- /* 820 */ 152, 517, 113, 120, 161, 119, 88, 64, 63, 62,
876
- /* 830 */ 61, 445, 445, 149, 445, 120, 161, 119, 445, 74,
877
- /* 840 */ 396, 148, 475, 445, 445, 149, 137, 113, 120, 161,
878
- /* 850 */ 119, 74, 445, 148, 445, 445, 445, 152, 525, 113,
879
- /* 860 */ 120, 161, 119, 445, 74, 445, 148, 445, 445, 445,
880
- /* 870 */ 149, 527, 113, 120, 161, 119, 445, 445, 445, 74,
881
- /* 880 */ 445, 148, 149, 445, 445, 445, 524, 113, 120, 161,
882
- /* 890 */ 119, 74, 445, 148, 98, 149, 445, 445, 526, 113,
883
- /* 900 */ 120, 161, 119, 120, 161, 119, 445, 74, 445, 148,
884
- /* 910 */ 149, 445, 445, 445, 523, 113, 120, 161, 119, 74,
885
- /* 920 */ 445, 148, 149, 445, 445, 152, 522, 113, 120, 161,
886
- /* 930 */ 119, 89, 64, 63, 62, 61, 445, 445, 149, 445,
887
- /* 940 */ 120, 161, 119, 445, 74, 395, 148, 445, 445, 445,
888
- /* 950 */ 149, 521, 113, 120, 161, 119, 74, 445, 148, 445,
889
- /* 960 */ 445, 445, 152, 520, 113, 120, 161, 119, 445, 74,
890
- /* 970 */ 445, 148, 445, 445, 445, 149, 519, 113, 120, 161,
891
- /* 980 */ 119, 445, 445, 445, 74, 445, 148, 149, 445, 445,
892
- /* 990 */ 445, 150, 113, 120, 161, 119, 74, 445, 148, 90,
893
- /* 1000 */ 149, 445, 445, 151, 113, 120, 161, 119, 120, 161,
894
- /* 1010 */ 119, 445, 74, 445, 148, 149, 445, 435, 445, 136,
895
- /* 1020 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
896
- /* 1030 */ 152, 135, 113, 120, 161, 119, 64, 63, 62, 61,
897
- /* 1040 */ 445, 445, 445, 149, 445, 445, 441, 440, 445, 88,
898
- /* 1050 */ 445, 445, 445, 445, 445, 149, 445, 56, 120, 161,
899
- /* 1060 */ 119, 88, 445, 445, 10, 479, 479, 445, 445, 445,
900
- /* 1070 */ 120, 161, 119, 445, 445, 445, 445, 82, 445, 434,
901
- /* 1080 */ 152, 445, 445, 445, 466, 445, 34, 109, 447, 454,
902
- /* 1090 */ 29, 445, 152, 445, 450, 445, 445, 445, 107, 436,
903
- /* 1100 */ 437, 438, 439, 87, 445, 163, 445, 120, 161, 119,
904
- /* 1110 */ 27, 451, 120, 161, 119, 99, 445, 64, 63, 62,
905
- /* 1120 */ 61, 445, 100, 445, 120, 161, 119, 101, 445, 152,
906
- /* 1130 */ 391, 120, 161, 119, 152, 445, 120, 161, 119, 91,
907
- /* 1140 */ 445, 445, 445, 445, 445, 445, 152, 445, 120, 161,
908
- /* 1150 */ 119, 103, 445, 152, 92, 445, 445, 445, 152, 445,
909
- /* 1160 */ 120, 161, 119, 120, 161, 119, 93, 445, 445, 104,
910
- /* 1170 */ 152, 445, 445, 445, 445, 120, 161, 119, 120, 161,
911
- /* 1180 */ 119, 445, 152, 445, 94, 152, 445, 445, 445, 445,
912
- /* 1190 */ 445, 445, 105, 120, 161, 119, 445, 152, 445, 95,
913
- /* 1200 */ 152, 120, 161, 119, 445, 445, 445, 96, 120, 161,
914
- /* 1210 */ 119, 445, 445, 445, 445, 152, 120, 161, 119, 445,
915
- /* 1220 */ 445, 445, 445, 152, 445, 445, 445, 445, 445, 445,
916
- /* 1230 */ 152, 97, 445, 445, 549, 445, 445, 548, 152, 445,
917
- /* 1240 */ 120, 161, 119, 120, 161, 119, 120, 161, 119, 445,
918
- /* 1250 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
919
- /* 1260 */ 445, 445, 152, 547, 445, 152, 546, 445, 152, 115,
920
- /* 1270 */ 445, 445, 120, 161, 119, 120, 161, 119, 120, 161,
921
- /* 1280 */ 119, 116, 445, 445, 445, 445, 445, 445, 445, 445,
922
- /* 1290 */ 120, 161, 119, 445, 152, 445, 445, 152, 445, 445,
923
- /* 1300 */ 152, 445, 445, 445, 445, 445, 445, 445, 445, 445,
924
- /* 1310 */ 445, 445, 152,
846
+ /* 10 */ 575, 64, 63, 62, 61, 453, 113, 120, 161, 119,
847
+ /* 20 */ 427, 428, 339, 357, 81, 121, 447, 454, 29, 575,
848
+ /* 30 */ 530, 13, 50, 450, 322, 323, 9, 8, 33, 149,
849
+ /* 40 */ 32, 7, 71, 127, 163, 335, 66, 28, 444, 27,
850
+ /* 50 */ 339, 339, 339, 339, 425, 426, 340, 341, 342, 343,
851
+ /* 60 */ 344, 345, 346, 347, 348, 474, 64, 63, 62, 61,
852
+ /* 70 */ 54, 51, 73, 306, 148, 474, 492, 161, 119, 297,
853
+ /* 80 */ 112, 113, 120, 161, 119, 427, 428, 339, 30, 81,
854
+ /* 90 */ 109, 447, 454, 29, 474, 528, 161, 119, 450, 322,
855
+ /* 100 */ 323, 9, 8, 33, 149, 32, 7, 71, 127, 163,
856
+ /* 110 */ 335, 66, 535, 36, 27, 339, 339, 339, 339, 425,
857
+ /* 120 */ 426, 340, 341, 342, 343, 344, 345, 346, 347, 348,
858
+ /* 130 */ 394, 435, 310, 59, 60, 64, 63, 62, 61, 313,
859
+ /* 140 */ 74, 376, 148, 69, 2, 533, 161, 119, 124, 113,
860
+ /* 150 */ 120, 161, 119, 80, 535, 31, 308, 79, 83, 107,
861
+ /* 160 */ 535, 441, 440, 535, 394, 435, 299, 59, 60, 120,
862
+ /* 170 */ 161, 119, 149, 463, 376, 376, 330, 84, 2, 122,
863
+ /* 180 */ 78, 78, 38, 156, 156, 156, 48, 37, 559, 328,
864
+ /* 190 */ 128, 152, 560, 561, 434, 441, 440, 350, 350, 350,
865
+ /* 200 */ 350, 350, 350, 350, 350, 350, 350, 350, 577, 77,
866
+ /* 210 */ 577, 35, 106, 46, 436, 437, 438, 439, 579, 375,
867
+ /* 220 */ 298, 117, 393, 155, 154, 153, 47, 4, 434, 69,
868
+ /* 230 */ 394, 435, 3, 59, 60, 411, 412, 413, 414, 398,
869
+ /* 240 */ 399, 376, 62, 61, 2, 108, 106, 5, 436, 437,
870
+ /* 250 */ 438, 439, 375, 375, 117, 117, 393, 155, 154, 153,
871
+ /* 260 */ 76, 441, 440, 67, 6, 142, 140, 64, 63, 62,
872
+ /* 270 */ 61, 380, 157, 424, 427, 428, 339, 379, 159, 45,
873
+ /* 280 */ 423, 72, 131, 148, 531, 161, 119, 1, 55, 125,
874
+ /* 290 */ 113, 120, 161, 119, 434, 147, 146, 64, 63, 62,
875
+ /* 300 */ 61, 397, 43, 11, 339, 339, 339, 339, 425, 426,
876
+ /* 310 */ 355, 65, 106, 149, 436, 437, 438, 439, 74, 375,
877
+ /* 320 */ 148, 117, 393, 155, 154, 153, 497, 113, 120, 161,
878
+ /* 330 */ 119, 22, 21, 12, 142, 140, 64, 63, 62, 61,
879
+ /* 340 */ 24, 356, 145, 141, 431, 64, 63, 62, 61, 391,
880
+ /* 350 */ 149, 448, 454, 29, 378, 158, 85, 55, 450, 394,
881
+ /* 360 */ 432, 138, 59, 60, 147, 146, 120, 161, 119, 163,
882
+ /* 370 */ 102, 43, 139, 42, 27, 430, 14, 15, 301, 302,
883
+ /* 380 */ 303, 446, 305, 16, 44, 74, 18, 148, 152, 19,
884
+ /* 390 */ 20, 36, 68, 496, 113, 120, 161, 119, 114, 359,
885
+ /* 400 */ 22, 21, 23, 142, 140, 64, 63, 62, 61, 24,
886
+ /* 410 */ 107, 145, 141, 431, 26, 57, 377, 149, 58, 118,
887
+ /* 420 */ 120, 161, 119, 392, 463, 384, 55, 64, 63, 62,
888
+ /* 430 */ 61, 382, 569, 147, 146, 160, 383, 435, 39, 70,
889
+ /* 440 */ 43, 106, 152, 445, 445, 88, 445, 445, 375, 445,
890
+ /* 450 */ 117, 393, 155, 154, 153, 120, 161, 119, 445, 17,
891
+ /* 460 */ 445, 10, 479, 479, 445, 445, 435, 441, 440, 22,
892
+ /* 470 */ 21, 445, 403, 64, 63, 62, 61, 152, 24, 445,
893
+ /* 480 */ 145, 141, 431, 133, 75, 126, 354, 445, 445, 123,
894
+ /* 490 */ 445, 404, 405, 406, 408, 80, 441, 440, 308, 79,
895
+ /* 500 */ 434, 411, 412, 413, 414, 394, 445, 445, 59, 60,
896
+ /* 510 */ 64, 63, 62, 61, 445, 445, 376, 445, 445, 42,
897
+ /* 520 */ 436, 437, 438, 439, 156, 156, 156, 394, 445, 434,
898
+ /* 530 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 445,
899
+ /* 540 */ 445, 42, 445, 394, 473, 391, 59, 60, 445, 436,
900
+ /* 550 */ 437, 438, 439, 49, 376, 445, 74, 42, 148, 445,
901
+ /* 560 */ 88, 445, 445, 445, 490, 113, 120, 161, 119, 445,
902
+ /* 570 */ 120, 161, 119, 132, 130, 394, 143, 475, 59, 60,
903
+ /* 580 */ 445, 473, 64, 63, 62, 61, 376, 106, 149, 42,
904
+ /* 590 */ 445, 445, 152, 445, 375, 391, 117, 393, 155, 154,
905
+ /* 600 */ 153, 394, 144, 52, 59, 60, 445, 445, 445, 106,
906
+ /* 610 */ 445, 445, 376, 445, 445, 42, 375, 445, 117, 393,
907
+ /* 620 */ 155, 154, 153, 445, 445, 106, 64, 63, 62, 61,
908
+ /* 630 */ 445, 445, 375, 445, 117, 393, 155, 154, 153, 394,
909
+ /* 640 */ 445, 445, 59, 60, 88, 445, 445, 53, 445, 445,
910
+ /* 650 */ 376, 445, 445, 42, 120, 161, 119, 106, 445, 445,
911
+ /* 660 */ 445, 110, 110, 445, 375, 445, 117, 393, 155, 154,
912
+ /* 670 */ 153, 394, 445, 445, 59, 60, 152, 107, 445, 445,
913
+ /* 680 */ 445, 445, 102, 106, 445, 42, 445, 120, 161, 119,
914
+ /* 690 */ 375, 451, 117, 393, 155, 154, 153, 394, 445, 445,
915
+ /* 700 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 152,
916
+ /* 710 */ 445, 40, 445, 394, 445, 396, 59, 60, 445, 445,
917
+ /* 720 */ 445, 106, 445, 445, 376, 88, 445, 41, 375, 445,
918
+ /* 730 */ 117, 393, 155, 154, 153, 120, 161, 119, 74, 445,
919
+ /* 740 */ 148, 445, 111, 111, 107, 445, 484, 113, 120, 161,
920
+ /* 750 */ 119, 445, 445, 106, 120, 161, 119, 152, 478, 445,
921
+ /* 760 */ 375, 86, 117, 393, 155, 154, 153, 445, 445, 445,
922
+ /* 770 */ 149, 120, 161, 119, 445, 445, 152, 445, 445, 106,
923
+ /* 780 */ 445, 64, 63, 62, 61, 445, 375, 445, 117, 393,
924
+ /* 790 */ 155, 154, 153, 152, 395, 106, 64, 63, 62, 61,
925
+ /* 800 */ 98, 445, 375, 445, 117, 393, 155, 154, 153, 445,
926
+ /* 810 */ 120, 161, 119, 445, 74, 445, 148, 56, 445, 74,
927
+ /* 820 */ 445, 148, 483, 113, 120, 161, 119, 480, 113, 120,
928
+ /* 830 */ 161, 119, 152, 74, 445, 148, 445, 89, 445, 445,
929
+ /* 840 */ 445, 134, 113, 120, 161, 119, 149, 120, 161, 119,
930
+ /* 850 */ 445, 149, 74, 445, 148, 445, 445, 445, 378, 158,
931
+ /* 860 */ 517, 113, 120, 161, 119, 149, 74, 445, 148, 152,
932
+ /* 870 */ 445, 74, 445, 148, 137, 113, 120, 161, 119, 525,
933
+ /* 880 */ 113, 120, 161, 119, 149, 74, 445, 148, 64, 63,
934
+ /* 890 */ 62, 61, 445, 527, 113, 120, 161, 119, 149, 445,
935
+ /* 900 */ 445, 391, 445, 149, 445, 445, 445, 445, 445, 445,
936
+ /* 910 */ 74, 445, 148, 445, 445, 162, 445, 149, 524, 113,
937
+ /* 920 */ 120, 161, 119, 118, 445, 74, 445, 148, 445, 445,
938
+ /* 930 */ 445, 445, 445, 526, 113, 120, 161, 119, 445, 74,
939
+ /* 940 */ 445, 148, 149, 445, 445, 445, 445, 523, 113, 120,
940
+ /* 950 */ 161, 119, 74, 445, 148, 445, 445, 149, 445, 445,
941
+ /* 960 */ 522, 113, 120, 161, 119, 445, 74, 445, 148, 445,
942
+ /* 970 */ 445, 149, 445, 445, 521, 113, 120, 161, 119, 74,
943
+ /* 980 */ 445, 148, 445, 445, 149, 445, 445, 520, 113, 120,
944
+ /* 990 */ 161, 119, 445, 74, 445, 148, 445, 445, 149, 445,
945
+ /* 1000 */ 445, 519, 113, 120, 161, 119, 445, 445, 445, 445,
946
+ /* 1010 */ 445, 149, 445, 445, 445, 445, 445, 445, 74, 445,
947
+ /* 1020 */ 148, 445, 445, 445, 445, 149, 150, 113, 120, 161,
948
+ /* 1030 */ 119, 74, 445, 148, 445, 445, 445, 445, 445, 151,
949
+ /* 1040 */ 113, 120, 161, 119, 445, 74, 445, 148, 445, 445,
950
+ /* 1050 */ 149, 445, 445, 136, 113, 120, 161, 119, 74, 445,
951
+ /* 1060 */ 148, 445, 445, 149, 445, 445, 135, 113, 120, 161,
952
+ /* 1070 */ 119, 445, 88, 445, 445, 445, 445, 149, 445, 445,
953
+ /* 1080 */ 445, 90, 120, 161, 119, 445, 445, 445, 445, 82,
954
+ /* 1090 */ 149, 120, 161, 119, 445, 87, 466, 445, 34, 99,
955
+ /* 1100 */ 445, 445, 445, 445, 152, 120, 161, 119, 100, 120,
956
+ /* 1110 */ 161, 119, 445, 152, 445, 445, 445, 445, 120, 161,
957
+ /* 1120 */ 119, 445, 445, 445, 101, 445, 445, 152, 445, 445,
958
+ /* 1130 */ 445, 152, 91, 445, 120, 161, 119, 103, 445, 445,
959
+ /* 1140 */ 152, 445, 120, 161, 119, 445, 445, 120, 161, 119,
960
+ /* 1150 */ 445, 92, 445, 445, 445, 445, 152, 445, 445, 445,
961
+ /* 1160 */ 93, 120, 161, 119, 152, 445, 104, 445, 445, 152,
962
+ /* 1170 */ 120, 161, 119, 445, 94, 445, 120, 161, 119, 445,
963
+ /* 1180 */ 445, 445, 445, 152, 120, 161, 119, 445, 445, 105,
964
+ /* 1190 */ 445, 445, 152, 445, 445, 445, 445, 95, 152, 120,
965
+ /* 1200 */ 161, 119, 96, 445, 445, 97, 152, 120, 161, 119,
966
+ /* 1210 */ 445, 445, 120, 161, 119, 120, 161, 119, 445, 445,
967
+ /* 1220 */ 445, 152, 445, 445, 445, 445, 445, 445, 445, 152,
968
+ /* 1230 */ 549, 445, 445, 548, 152, 445, 445, 152, 547, 445,
969
+ /* 1240 */ 120, 161, 119, 120, 161, 119, 546, 445, 120, 161,
970
+ /* 1250 */ 119, 445, 445, 445, 445, 445, 120, 161, 119, 445,
971
+ /* 1260 */ 445, 445, 152, 445, 445, 152, 445, 445, 445, 115,
972
+ /* 1270 */ 152, 445, 116, 445, 445, 445, 445, 445, 152, 120,
973
+ /* 1280 */ 161, 119, 120, 161, 119, 445, 445, 445, 445, 445,
974
+ /* 1290 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
975
+ /* 1300 */ 445, 152, 445, 445, 152,
925976
};
926977
static const YYCODETYPE yy_lookahead[] = {
927
- /* 0 */ 0, 113, 114, 115, 134, 102, 103, 104, 106, 106,
928
- /* 10 */ 10, 113, 114, 115, 111, 112, 113, 114, 115, 106,
929
- /* 20 */ 20, 21, 22, 105, 24, 126, 108, 109, 28, 4,
930
- /* 30 */ 5, 6, 7, 33, 34, 35, 36, 37, 135, 39,
931
- /* 40 */ 40, 41, 42, 105, 44, 45, 108, 109, 107, 49,
978
+ /* 0 */ 0, 115, 116, 117, 136, 103, 104, 105, 107, 107,
979
+ /* 10 */ 10, 4, 5, 6, 7, 113, 114, 115, 116, 117,
980
+ /* 20 */ 20, 21, 22, 17, 24, 101, 102, 103, 104, 29,
981
+ /* 30 */ 107, 25, 25, 109, 34, 35, 36, 37, 38, 137,
982
+ /* 40 */ 40, 41, 42, 43, 120, 45, 46, 109, 124, 125,
932983
/* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
933
- /* 60 */ 60, 61, 62, 63, 0, 113, 114, 115, 130, 131,
934
- /* 70 */ 132, 104, 25, 106, 10, 113, 114, 115, 111, 112,
935
- /* 80 */ 113, 114, 115, 106, 20, 21, 22, 128, 24, 113,
936
- /* 90 */ 114, 115, 28, 129, 2, 26, 27, 33, 34, 35,
937
- /* 100 */ 36, 37, 135, 39, 40, 41, 42, 2, 44, 45,
938
- /* 110 */ 133, 26, 27, 49, 50, 51, 52, 53, 54, 55,
939
- /* 120 */ 56, 57, 58, 59, 60, 61, 62, 63, 1, 2,
940
- /* 130 */ 38, 4, 5, 4, 5, 6, 7, 17, 10, 12,
941
- /* 140 */ 4, 5, 15, 38, 1, 25, 17, 29, 30, 31,
942
- /* 150 */ 32, 24, 83, 26, 27, 12, 28, 14, 31, 32,
943
- /* 160 */ 91, 18, 116, 20, 21, 22, 23, 24, 116, 26,
944
- /* 170 */ 27, 19, 29, 30, 31, 32, 91, 3, 64, 65,
945
- /* 180 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 6,
946
- /* 190 */ 7, 64, 4, 5, 6, 7, 8, 97, 98, 20,
947
- /* 200 */ 21, 22, 26, 27, 4, 5, 6, 7, 1, 82,
948
- /* 210 */ 48, 84, 85, 86, 87, 17, 89, 17, 91, 92,
949
- /* 220 */ 93, 94, 95, 1, 2, 25, 4, 5, 49, 50,
950
- /* 230 */ 51, 52, 53, 54, 12, 16, 15, 15, 4, 5,
951
- /* 240 */ 6, 7, 20, 21, 22, 1, 26, 27, 4, 5,
952
- /* 250 */ 48, 43, 90, 31, 32, 40, 12, 40, 96, 15,
953
- /* 260 */ 47, 99, 88, 104, 20, 21, 22, 1, 24, 35,
954
- /* 270 */ 4, 5, 113, 114, 115, 0, 117, 41, 12, 41,
955
- /* 280 */ 13, 15, 17, 124, 125, 10, 64, 25, 1, 2,
956
- /* 290 */ 17, 4, 5, 75, 135, 81, 80, 3, 3, 12,
957
- /* 300 */ 3, 99, 15, 79, 82, 80, 84, 85, 86, 87,
958
- /* 310 */ 38, 89, 3, 91, 92, 93, 94, 95, 31, 32,
959
- /* 320 */ 2, 3, 4, 5, 6, 7, 82, 3, 3, 12,
960
- /* 330 */ 77, 104, 25, 89, 16, 91, 92, 93, 94, 95,
961
- /* 340 */ 113, 114, 115, 25, 117, 96, 15, 15, 82, 31,
962
- /* 350 */ 32, 64, 125, 15, 17, 89, 38, 91, 92, 93,
963
- /* 360 */ 94, 95, 135, 28, 4, 5, 6, 7, 28, 82,
964
- /* 370 */ 28, 84, 85, 86, 87, 12, 89, 3, 91, 92,
965
- /* 380 */ 93, 94, 95, 90, 11, 67, 68, 136, 2, 3,
966
- /* 390 */ 4, 5, 6, 7, 76, 35, 78, 79, 80, 82,
967
- /* 400 */ 136, 136, 136, 17, 136, 136, 89, 136, 91, 136,
968
- /* 410 */ 136, 25, 104, 136, 106, 136, 136, 31, 32, 111,
969
- /* 420 */ 112, 113, 114, 115, 38, 136, 136, 2, 3, 4,
970
- /* 430 */ 5, 6, 7, 136, 1, 136, 136, 4, 5, 4,
971
- /* 440 */ 5, 6, 7, 135, 136, 12, 136, 136, 15, 136,
972
- /* 450 */ 25, 136, 17, 67, 68, 136, 31, 32, 136, 136,
973
- /* 460 */ 25, 136, 76, 38, 78, 79, 80, 1, 136, 136,
974
- /* 470 */ 4, 5, 4, 5, 6, 7, 136, 136, 12, 46,
975
- /* 480 */ 47, 15, 136, 136, 136, 17, 20, 21, 22, 136,
976
- /* 490 */ 136, 136, 67, 68, 136, 1, 2, 136, 4, 5,
977
- /* 500 */ 136, 76, 136, 78, 79, 80, 12, 136, 104, 15,
978
- /* 510 */ 4, 5, 6, 7, 136, 82, 136, 113, 114, 115,
979
- /* 520 */ 136, 117, 89, 17, 91, 92, 93, 94, 95, 136,
980
- /* 530 */ 1, 2, 38, 4, 5, 4, 5, 6, 7, 135,
981
- /* 540 */ 136, 12, 136, 136, 15, 136, 136, 136, 82, 4,
982
- /* 550 */ 5, 6, 7, 136, 136, 89, 25, 91, 92, 93,
983
- /* 560 */ 94, 95, 136, 1, 2, 136, 4, 5, 136, 136,
984
- /* 570 */ 25, 104, 136, 106, 12, 136, 82, 15, 111, 112,
985
- /* 580 */ 113, 114, 115, 89, 136, 91, 92, 93, 94, 95,
986
- /* 590 */ 1, 136, 136, 4, 5, 136, 136, 136, 136, 136,
987
- /* 600 */ 136, 12, 135, 136, 15, 136, 104, 136, 106, 136,
988
- /* 610 */ 136, 82, 136, 111, 112, 113, 114, 115, 89, 136,
989
- /* 620 */ 91, 92, 93, 94, 95, 1, 136, 136, 4, 5,
990
- /* 630 */ 136, 136, 104, 136, 136, 136, 12, 135, 136, 15,
991
- /* 640 */ 136, 113, 114, 115, 82, 136, 136, 2, 120, 121,
992
- /* 650 */ 136, 89, 136, 91, 92, 93, 94, 95, 1, 136,
993
- /* 660 */ 136, 4, 5, 135, 104, 136, 136, 136, 136, 12,
994
- /* 670 */ 136, 82, 15, 113, 114, 115, 31, 32, 89, 136,
995
- /* 680 */ 91, 92, 93, 94, 95, 101, 102, 103, 136, 136,
996
- /* 690 */ 104, 107, 106, 48, 104, 135, 136, 111, 112, 113,
997
- /* 700 */ 114, 115, 118, 113, 114, 115, 82, 123, 136, 64,
998
- /* 710 */ 120, 121, 136, 89, 136, 91, 92, 93, 94, 95,
999
- /* 720 */ 136, 135, 136, 136, 136, 135, 104, 136, 106, 84,
1000
- /* 730 */ 85, 86, 87, 111, 112, 113, 114, 115, 136, 82,
1001
- /* 740 */ 100, 101, 102, 103, 136, 136, 89, 107, 91, 92,
1002
- /* 750 */ 93, 94, 95, 136, 136, 136, 136, 135, 118, 104,
1003
- /* 760 */ 136, 106, 122, 123, 136, 136, 111, 112, 113, 114,
1004
- /* 770 */ 115, 136, 136, 136, 104, 136, 106, 136, 136, 136,
1005
- /* 780 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1006
- /* 790 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1007
- /* 800 */ 115, 136, 104, 136, 106, 135, 136, 136, 136, 111,
1008
- /* 810 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1009
- /* 820 */ 135, 111, 112, 113, 114, 115, 104, 4, 5, 6,
1010
- /* 830 */ 7, 136, 136, 135, 136, 113, 114, 115, 136, 104,
1011
- /* 840 */ 17, 106, 120, 136, 136, 135, 111, 112, 113, 114,
1012
- /* 850 */ 115, 104, 136, 106, 136, 136, 136, 135, 111, 112,
1013
- /* 860 */ 113, 114, 115, 136, 104, 136, 106, 136, 136, 136,
1014
- /* 870 */ 135, 111, 112, 113, 114, 115, 136, 136, 136, 104,
1015
- /* 880 */ 136, 106, 135, 136, 136, 136, 111, 112, 113, 114,
1016
- /* 890 */ 115, 104, 136, 106, 104, 135, 136, 136, 111, 112,
1017
- /* 900 */ 113, 114, 115, 113, 114, 115, 136, 104, 136, 106,
1018
- /* 910 */ 135, 136, 136, 136, 111, 112, 113, 114, 115, 104,
1019
- /* 920 */ 136, 106, 135, 136, 136, 135, 111, 112, 113, 114,
1020
- /* 930 */ 115, 104, 4, 5, 6, 7, 136, 136, 135, 136,
1021
- /* 940 */ 113, 114, 115, 136, 104, 17, 106, 136, 136, 136,
1022
- /* 950 */ 135, 111, 112, 113, 114, 115, 104, 136, 106, 136,
1023
- /* 960 */ 136, 136, 135, 111, 112, 113, 114, 115, 136, 104,
1024
- /* 970 */ 136, 106, 136, 136, 136, 135, 111, 112, 113, 114,
1025
- /* 980 */ 115, 136, 136, 136, 104, 136, 106, 135, 136, 136,
1026
- /* 990 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1027
- /* 1000 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1028
- /* 1010 */ 115, 136, 104, 136, 106, 135, 136, 2, 136, 111,
1029
- /* 1020 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1030
- /* 1030 */ 135, 111, 112, 113, 114, 115, 4, 5, 6, 7,
1031
- /* 1040 */ 136, 136, 136, 135, 136, 136, 31, 32, 136, 104,
1032
- /* 1050 */ 136, 136, 136, 136, 136, 135, 136, 25, 113, 114,
1033
- /* 1060 */ 115, 104, 136, 136, 119, 120, 121, 136, 136, 136,
1034
- /* 1070 */ 113, 114, 115, 136, 136, 136, 136, 120, 136, 64,
1035
- /* 1080 */ 135, 136, 136, 136, 127, 136, 129, 100, 101, 102,
1036
- /* 1090 */ 103, 136, 135, 136, 107, 136, 136, 136, 104, 84,
1037
- /* 1100 */ 85, 86, 87, 104, 136, 118, 136, 113, 114, 115,
1038
- /* 1110 */ 123, 117, 113, 114, 115, 104, 136, 4, 5, 6,
1039
- /* 1120 */ 7, 136, 104, 136, 113, 114, 115, 104, 136, 135,
1040
- /* 1130 */ 17, 113, 114, 115, 135, 136, 113, 114, 115, 104,
1041
- /* 1140 */ 136, 136, 136, 136, 136, 136, 135, 136, 113, 114,
1042
- /* 1150 */ 115, 104, 136, 135, 104, 136, 136, 136, 135, 136,
1043
- /* 1160 */ 113, 114, 115, 113, 114, 115, 104, 136, 136, 104,
1044
- /* 1170 */ 135, 136, 136, 136, 136, 113, 114, 115, 113, 114,
1045
- /* 1180 */ 115, 136, 135, 136, 104, 135, 136, 136, 136, 136,
1046
- /* 1190 */ 136, 136, 104, 113, 114, 115, 136, 135, 136, 104,
1047
- /* 1200 */ 135, 113, 114, 115, 136, 136, 136, 104, 113, 114,
1048
- /* 1210 */ 115, 136, 136, 136, 136, 135, 113, 114, 115, 136,
1049
- /* 1220 */ 136, 136, 136, 135, 136, 136, 136, 136, 136, 136,
1050
- /* 1230 */ 135, 104, 136, 136, 104, 136, 136, 104, 135, 136,
1051
- /* 1240 */ 113, 114, 115, 113, 114, 115, 113, 114, 115, 136,
1052
- /* 1250 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1053
- /* 1260 */ 136, 136, 135, 104, 136, 135, 104, 136, 135, 104,
1054
- /* 1270 */ 136, 136, 113, 114, 115, 113, 114, 115, 113, 114,
1055
- /* 1280 */ 115, 104, 136, 136, 136, 136, 136, 136, 136, 136,
1056
- /* 1290 */ 113, 114, 115, 136, 135, 136, 136, 135, 136, 136,
1057
- /* 1300 */ 135, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1058
- /* 1310 */ 136, 136, 135, 100, 100, 100, 100, 100, 100, 100,
1059
- /* 1320 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1060
- /* 1330 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1061
- /* 1340 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1062
- /* 1350 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1063
- /* 1360 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1064
- /* 1370 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1065
- /* 1380 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1066
- /* 1390 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1067
- /* 1400 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1068
- /* 1410 */ 100, 100, 100,
984
+ /* 60 */ 60, 61, 62, 63, 64, 0, 4, 5, 6, 7,
985
+ /* 70 */ 4, 5, 105, 25, 107, 10, 115, 116, 117, 17,
986
+ /* 80 */ 113, 114, 115, 116, 117, 20, 21, 22, 128, 24,
987
+ /* 90 */ 101, 102, 103, 104, 29, 115, 116, 117, 109, 34,
988
+ /* 100 */ 35, 36, 37, 38, 137, 40, 41, 42, 43, 120,
989
+ /* 110 */ 45, 46, 49, 10, 125, 50, 51, 52, 53, 54,
990
+ /* 120 */ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
991
+ /* 130 */ 1, 2, 29, 4, 5, 4, 5, 6, 7, 8,
992
+ /* 140 */ 105, 12, 107, 3, 15, 115, 116, 117, 113, 114,
993
+ /* 150 */ 115, 116, 117, 24, 91, 130, 27, 28, 118, 105,
994
+ /* 160 */ 97, 32, 33, 100, 1, 2, 19, 4, 5, 115,
995
+ /* 170 */ 116, 117, 137, 119, 12, 12, 2, 118, 15, 1,
996
+ /* 180 */ 126, 127, 106, 20, 21, 22, 110, 111, 106, 2,
997
+ /* 190 */ 107, 137, 110, 111, 65, 32, 33, 65, 66, 67,
998
+ /* 200 */ 68, 69, 70, 71, 72, 73, 74, 75, 132, 133,
999
+ /* 210 */ 134, 131, 83, 39, 85, 86, 87, 88, 135, 90,
1000
+ /* 220 */ 17, 92, 93, 94, 95, 96, 39, 15, 65, 89,
1001
+ /* 230 */ 1, 2, 16, 4, 5, 30, 31, 32, 33, 98,
1002
+ /* 240 */ 99, 12, 6, 7, 15, 83, 83, 41, 85, 86,
1003
+ /* 250 */ 87, 88, 90, 90, 92, 92, 93, 94, 95, 96,
1004
+ /* 260 */ 49, 32, 33, 44, 41, 2, 3, 4, 5, 6,
1005
+ /* 270 */ 7, 27, 28, 42, 20, 21, 22, 27, 28, 16,
1006
+ /* 280 */ 42, 105, 48, 107, 115, 116, 117, 13, 25, 113,
1007
+ /* 290 */ 114, 115, 116, 117, 65, 32, 33, 4, 5, 6,
1008
+ /* 300 */ 7, 17, 39, 25, 50, 51, 52, 53, 54, 55,
1009
+ /* 310 */ 17, 100, 83, 137, 85, 86, 87, 88, 105, 90,
1010
+ /* 320 */ 107, 92, 93, 94, 95, 96, 113, 114, 115, 116,
1011
+ /* 330 */ 117, 68, 69, 76, 2, 3, 4, 5, 6, 7,
1012
+ /* 340 */ 77, 17, 79, 80, 81, 4, 5, 6, 7, 17,
1013
+ /* 350 */ 137, 102, 103, 104, 27, 28, 105, 25, 109, 1,
1014
+ /* 360 */ 81, 80, 4, 5, 32, 33, 115, 116, 117, 120,
1015
+ /* 370 */ 12, 39, 82, 15, 125, 81, 3, 36, 20, 21,
1016
+ /* 380 */ 22, 0, 24, 3, 39, 105, 3, 107, 137, 3,
1017
+ /* 390 */ 3, 10, 3, 113, 114, 115, 116, 117, 97, 78,
1018
+ /* 400 */ 68, 69, 25, 2, 3, 4, 5, 6, 7, 77,
1019
+ /* 410 */ 105, 79, 80, 81, 15, 15, 12, 137, 15, 92,
1020
+ /* 420 */ 115, 116, 117, 17, 119, 29, 25, 4, 5, 6,
1021
+ /* 430 */ 7, 29, 127, 32, 33, 91, 29, 2, 11, 3,
1022
+ /* 440 */ 39, 83, 137, 138, 138, 105, 138, 138, 90, 138,
1023
+ /* 450 */ 92, 93, 94, 95, 96, 115, 116, 117, 138, 36,
1024
+ /* 460 */ 138, 121, 122, 123, 138, 138, 2, 32, 33, 68,
1025
+ /* 470 */ 69, 138, 1, 4, 5, 6, 7, 137, 77, 138,
1026
+ /* 480 */ 79, 80, 81, 12, 49, 14, 17, 138, 138, 18,
1027
+ /* 490 */ 138, 20, 21, 22, 23, 24, 32, 33, 27, 28,
1028
+ /* 500 */ 65, 30, 31, 32, 33, 1, 138, 138, 4, 5,
1029
+ /* 510 */ 4, 5, 6, 7, 138, 138, 12, 138, 138, 15,
1030
+ /* 520 */ 85, 86, 87, 88, 20, 21, 22, 1, 138, 65,
1031
+ /* 530 */ 4, 5, 4, 5, 6, 7, 138, 138, 12, 138,
1032
+ /* 540 */ 138, 15, 138, 1, 2, 17, 4, 5, 138, 85,
1033
+ /* 550 */ 86, 87, 88, 25, 12, 138, 105, 15, 107, 138,
1034
+ /* 560 */ 105, 138, 138, 138, 113, 114, 115, 116, 117, 138,
1035
+ /* 570 */ 115, 116, 117, 47, 48, 1, 2, 122, 4, 5,
1036
+ /* 580 */ 138, 39, 4, 5, 6, 7, 12, 83, 137, 15,
1037
+ /* 590 */ 138, 138, 137, 138, 90, 17, 92, 93, 94, 95,
1038
+ /* 600 */ 96, 1, 2, 25, 4, 5, 138, 138, 138, 83,
1039
+ /* 610 */ 138, 138, 12, 138, 138, 15, 90, 138, 92, 93,
1040
+ /* 620 */ 94, 95, 96, 138, 138, 83, 4, 5, 6, 7,
1041
+ /* 630 */ 138, 138, 90, 138, 92, 93, 94, 95, 96, 1,
1042
+ /* 640 */ 138, 138, 4, 5, 105, 138, 138, 25, 138, 138,
1043
+ /* 650 */ 12, 138, 138, 15, 115, 116, 117, 83, 138, 138,
1044
+ /* 660 */ 138, 122, 123, 138, 90, 138, 92, 93, 94, 95,
1045
+ /* 670 */ 96, 1, 138, 138, 4, 5, 137, 105, 138, 138,
1046
+ /* 680 */ 138, 138, 12, 83, 138, 15, 138, 115, 116, 117,
1047
+ /* 690 */ 90, 119, 92, 93, 94, 95, 96, 1, 138, 138,
1048
+ /* 700 */ 4, 5, 4, 5, 6, 7, 138, 138, 12, 137,
1049
+ /* 710 */ 138, 15, 138, 1, 138, 17, 4, 5, 138, 138,
1050
+ /* 720 */ 138, 83, 138, 138, 12, 105, 138, 15, 90, 138,
1051
+ /* 730 */ 92, 93, 94, 95, 96, 115, 116, 117, 105, 138,
1052
+ /* 740 */ 107, 138, 122, 123, 105, 138, 113, 114, 115, 116,
1053
+ /* 750 */ 117, 138, 138, 83, 115, 116, 117, 137, 119, 138,
1054
+ /* 760 */ 90, 105, 92, 93, 94, 95, 96, 138, 138, 138,
1055
+ /* 770 */ 137, 115, 116, 117, 138, 138, 137, 138, 138, 83,
1056
+ /* 780 */ 138, 4, 5, 6, 7, 138, 90, 138, 92, 93,
1057
+ /* 790 */ 94, 95, 96, 137, 17, 83, 4, 5, 6, 7,
1058
+ /* 800 */ 105, 138, 90, 138, 92, 93, 94, 95, 96, 138,
1059
+ /* 810 */ 115, 116, 117, 138, 105, 138, 107, 25, 138, 105,
1060
+ /* 820 */ 138, 107, 113, 114, 115, 116, 117, 113, 114, 115,
1061
+ /* 830 */ 116, 117, 137, 105, 138, 107, 138, 105, 138, 138,
1062
+ /* 840 */ 138, 113, 114, 115, 116, 117, 137, 115, 116, 117,
1063
+ /* 850 */ 138, 137, 105, 138, 107, 138, 138, 138, 27, 28,
1064
+ /* 860 */ 113, 114, 115, 116, 117, 137, 105, 138, 107, 137,
1065
+ /* 870 */ 138, 105, 138, 107, 113, 114, 115, 116, 117, 113,
1066
+ /* 880 */ 114, 115, 116, 117, 137, 105, 138, 107, 4, 5,
1067
+ /* 890 */ 6, 7, 138, 113, 114, 115, 116, 117, 137, 138,
1068
+ /* 900 */ 138, 17, 138, 137, 138, 138, 138, 138, 138, 138,
1069
+ /* 910 */ 105, 138, 107, 138, 138, 84, 138, 137, 113, 114,
1070
+ /* 920 */ 115, 116, 117, 92, 138, 105, 138, 107, 138, 138,
1071
+ /* 930 */ 138, 138, 138, 113, 114, 115, 116, 117, 138, 105,
1072
+ /* 940 */ 138, 107, 137, 138, 138, 138, 138, 113, 114, 115,
1073
+ /* 950 */ 116, 117, 105, 138, 107, 138, 138, 137, 138, 138,
1074
+ /* 960 */ 113, 114, 115, 116, 117, 138, 105, 138, 107, 138,
1075
+ /* 970 */ 138, 137, 138, 138, 113, 114, 115, 116, 117, 105,
1076
+ /* 980 */ 138, 107, 138, 138, 137, 138, 138, 113, 114, 115,
1077
+ /* 990 */ 116, 117, 138, 105, 138, 107, 138, 138, 137, 138,
1078
+ /* 1000 */ 138, 113, 114, 115, 116, 117, 138, 138, 138, 138,
1079
+ /* 1010 */ 138, 137, 138, 138, 138, 138, 138, 138, 105, 138,
1080
+ /* 1020 */ 107, 138, 138, 138, 138, 137, 113, 114, 115, 116,
1081
+ /* 1030 */ 117, 105, 138, 107, 138, 138, 138, 138, 138, 113,
1082
+ /* 1040 */ 114, 115, 116, 117, 138, 105, 138, 107, 138, 138,
1083
+ /* 1050 */ 137, 138, 138, 113, 114, 115, 116, 117, 105, 138,
1084
+ /* 1060 */ 107, 138, 138, 137, 138, 138, 113, 114, 115, 116,
1085
+ /* 1070 */ 117, 138, 105, 138, 138, 138, 138, 137, 138, 138,
1086
+ /* 1080 */ 138, 105, 115, 116, 117, 138, 138, 138, 138, 122,
1087
+ /* 1090 */ 137, 115, 116, 117, 138, 105, 129, 138, 131, 105,
1088
+ /* 1100 */ 138, 138, 138, 138, 137, 115, 116, 117, 105, 115,
1089
+ /* 1110 */ 116, 117, 138, 137, 138, 138, 138, 138, 115, 116,
1090
+ /* 1120 */ 117, 138, 138, 138, 105, 138, 138, 137, 138, 138,
1091
+ /* 1130 */ 138, 137, 105, 138, 115, 116, 117, 105, 138, 138,
1092
+ /* 1140 */ 137, 138, 115, 116, 117, 138, 138, 115, 116, 117,
1093
+ /* 1150 */ 138, 105, 138, 138, 138, 138, 137, 138, 138, 138,
1094
+ /* 1160 */ 105, 115, 116, 117, 137, 138, 105, 138, 138, 137,
1095
+ /* 1170 */ 115, 116, 117, 138, 105, 138, 115, 116, 117, 138,
1096
+ /* 1180 */ 138, 138, 138, 137, 115, 116, 117, 138, 138, 105,
1097
+ /* 1190 */ 138, 138, 137, 138, 138, 138, 138, 105, 137, 115,
1098
+ /* 1200 */ 116, 117, 105, 138, 138, 105, 137, 115, 116, 117,
1099
+ /* 1210 */ 138, 138, 115, 116, 117, 115, 116, 117, 138, 138,
1100
+ /* 1220 */ 138, 137, 138, 138, 138, 138, 138, 138, 138, 137,
1101
+ /* 1230 */ 105, 138, 138, 105, 137, 138, 138, 137, 105, 138,
1102
+ /* 1240 */ 115, 116, 117, 115, 116, 117, 105, 138, 115, 116,
1103
+ /* 1250 */ 117, 138, 138, 138, 138, 138, 115, 116, 117, 138,
1104
+ /* 1260 */ 138, 138, 137, 138, 138, 137, 138, 138, 138, 105,
1105
+ /* 1270 */ 137, 138, 105, 138, 138, 138, 138, 138, 137, 115,
1106
+ /* 1280 */ 116, 117, 115, 116, 117, 138, 138, 138, 138, 138,
1107
+ /* 1290 */ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
1108
+ /* 1300 */ 138, 137, 138, 138, 137, 101, 101, 101, 101, 101,
1109
+ /* 1310 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1110
+ /* 1320 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1111
+ /* 1330 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1112
+ /* 1340 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1113
+ /* 1350 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1114
+ /* 1360 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1115
+ /* 1370 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1116
+ /* 1380 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1117
+ /* 1390 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1118
+ /* 1400 */ 101, 101, 101, 101, 101, 101,
10691119
};
10701120
#define YY_SHIFT_COUNT (163)
10711121
#define YY_SHIFT_MIN (0)
1072
-#define YY_SHIFT_MAX (1113)
1122
+#define YY_SHIFT_MAX (884)
10731123
static const unsigned short int yy_shift_ofst[] = {
1074
- /* 0 */ 143, 127, 222, 287, 287, 287, 287, 287, 287, 287,
1075
- /* 10 */ 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
1076
- /* 20 */ 287, 287, 287, 287, 287, 287, 287, 244, 433, 266,
1077
- /* 30 */ 244, 143, 494, 494, 0, 64, 143, 589, 266, 589,
1078
- /* 40 */ 466, 466, 466, 529, 562, 266, 266, 266, 266, 266,
1079
- /* 50 */ 266, 624, 266, 266, 657, 266, 266, 266, 266, 266,
1080
- /* 60 */ 266, 266, 266, 266, 266, 179, 317, 317, 317, 317,
1081
- /* 70 */ 317, 645, 318, 386, 425, 1015, 1015, 118, 47, 1313,
1082
- /* 80 */ 1313, 1313, 1313, 114, 114, 200, 435, 129, 188, 234,
1083
- /* 90 */ 360, 468, 531, 506, 545, 823, 1032, 928, 1113, 25,
1084
- /* 100 */ 25, 25, 162, 25, 25, 25, 69, 25, 85, 128,
1085
- /* 110 */ 92, 105, 120, 136, 100, 183, 183, 176, 220, 174,
1086
- /* 120 */ 202, 275, 152, 207, 198, 219, 221, 208, 215, 217,
1087
- /* 130 */ 236, 238, 213, 267, 265, 262, 218, 273, 216, 224,
1088
- /* 140 */ 214, 225, 294, 295, 297, 272, 309, 324, 325, 249,
1089
- /* 150 */ 253, 307, 249, 331, 332, 338, 337, 335, 340, 342,
1090
- /* 160 */ 363, 293, 374, 373,
1124
+ /* 0 */ 471, 129, 163, 229, 229, 229, 229, 229, 229, 229,
1125
+ /* 10 */ 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
1126
+ /* 20 */ 229, 229, 229, 229, 229, 229, 229, 358, 526, 638,
1127
+ /* 30 */ 358, 471, 542, 542, 0, 65, 471, 670, 638, 670,
1128
+ /* 40 */ 504, 504, 504, 574, 600, 638, 638, 638, 638, 638,
1129
+ /* 50 */ 638, 696, 638, 638, 712, 638, 638, 638, 638, 638,
1130
+ /* 60 */ 638, 638, 638, 638, 638, 254, 162, 162, 162, 162,
1131
+ /* 70 */ 162, 435, 263, 332, 401, 464, 464, 205, 48, 1305,
1132
+ /* 80 */ 1305, 1305, 1305, 132, 132, 528, 578, 62, 131, 341,
1133
+ /* 90 */ 423, 293, 7, 469, 622, 698, 792, 777, 884, 506,
1134
+ /* 100 */ 506, 506, 63, 506, 506, 506, 831, 506, 327, 103,
1135
+ /* 110 */ 174, 187, 6, 66, 141, 236, 236, 244, 250, 140,
1136
+ /* 120 */ 211, 381, 147, 178, 203, 216, 212, 219, 206, 223,
1137
+ /* 130 */ 231, 238, 234, 274, 284, 278, 257, 324, 279, 281,
1138
+ /* 140 */ 290, 294, 373, 380, 383, 345, 386, 387, 389, 301,
1139
+ /* 150 */ 321, 377, 301, 399, 400, 403, 406, 396, 402, 407,
1140
+ /* 160 */ 404, 344, 436, 427,
10911141
};
10921142
#define YY_REDUCE_COUNT (82)
1093
-#define YY_REDUCE_MIN (-130)
1094
-#define YY_REDUCE_MAX (1177)
1143
+#define YY_REDUCE_MIN (-132)
1144
+#define YY_REDUCE_MAX (1167)
10951145
static const short yy_reduce_ofst[] = {
1096
- /* 0 */ 640, -97, -33, 308, 467, 502, 586, 622, 655, 670,
1097
- /* 10 */ 682, 698, 710, 735, 747, 760, 775, 787, 803, 815,
1098
- /* 20 */ 840, 852, 865, 880, 892, 908, 920, 159, 945, 957,
1099
- /* 30 */ 227, 987, 528, 590, -62, -62, 584, 404, 722, 994,
1100
- /* 40 */ 560, 685, 790, 827, 895, 999, 1011, 1018, 1023, 1035,
1101
- /* 50 */ 1047, 1050, 1062, 1065, 1080, 1088, 1095, 1103, 1127, 1130,
1102
- /* 60 */ 1133, 1159, 1162, 1165, 1177, -82, -112, -102, -48, -38,
1103
- /* 70 */ -24, -23, -130, -130, -130, -98, -87, -59, -101, -41,
1104
- /* 80 */ 46, 52, -36,
1146
+ /* 0 */ -76, -98, -33, 35, 176, 213, 280, 451, 633, 709,
1147
+ /* 10 */ 714, 728, 747, 761, 766, 780, 805, 820, 834, 847,
1148
+ /* 20 */ 861, 874, 888, 913, 926, 940, 953, 54, 340, 967,
1149
+ /* 30 */ 305, -11, 539, 620, 76, 76, 249, 639, 455, 572,
1150
+ /* 40 */ 251, 656, 695, 732, 976, 990, 994, 1003, 1019, 1027,
1151
+ /* 50 */ 1032, 1046, 1055, 1061, 1069, 1084, 1092, 1097, 1100, 1125,
1152
+ /* 60 */ 1128, 1133, 1141, 1164, 1167, 82, -114, -39, -20, 30,
1153
+ /* 70 */ 169, 83, -132, -132, -132, -99, -77, -62, -40, 25,
1154
+ /* 80 */ 40, 59, 80,
11051155
};
11061156
static const YYACTIONTYPE yy_default[] = {
11071157
/* 0 */ 449, 443, 443, 443, 443, 443, 443, 443, 443, 443,
11081158
/* 10 */ 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
11091159
/* 20 */ 443, 443, 443, 443, 443, 443, 443, 443, 473, 576,
@@ -1164,10 +1214,11 @@
11641214
0, /* COLOR => nothing */
11651215
0, /* THICKNESS => nothing */
11661216
0, /* PRINT => nothing */
11671217
0, /* STRING => nothing */
11681218
0, /* COMMA => nothing */
1219
+ 0, /* ISODATE => nothing */
11691220
0, /* CLASSNAME => nothing */
11701221
0, /* LB => nothing */
11711222
0, /* RB => nothing */
11721223
0, /* UP => nothing */
11731224
0, /* DOWN => nothing */
@@ -1347,120 +1398,122 @@
13471398
/* 21 */ "COLOR",
13481399
/* 22 */ "THICKNESS",
13491400
/* 23 */ "PRINT",
13501401
/* 24 */ "STRING",
13511402
/* 25 */ "COMMA",
1352
- /* 26 */ "CLASSNAME",
1353
- /* 27 */ "LB",
1354
- /* 28 */ "RB",
1355
- /* 29 */ "UP",
1356
- /* 30 */ "DOWN",
1357
- /* 31 */ "LEFT",
1358
- /* 32 */ "RIGHT",
1359
- /* 33 */ "CLOSE",
1360
- /* 34 */ "CHOP",
1361
- /* 35 */ "FROM",
1362
- /* 36 */ "TO",
1363
- /* 37 */ "THEN",
1364
- /* 38 */ "HEADING",
1365
- /* 39 */ "GO",
1366
- /* 40 */ "AT",
1367
- /* 41 */ "WITH",
1368
- /* 42 */ "SAME",
1369
- /* 43 */ "AS",
1370
- /* 44 */ "FIT",
1371
- /* 45 */ "BEHIND",
1372
- /* 46 */ "UNTIL",
1373
- /* 47 */ "EVEN",
1374
- /* 48 */ "DOT_E",
1375
- /* 49 */ "HEIGHT",
1376
- /* 50 */ "WIDTH",
1377
- /* 51 */ "RADIUS",
1378
- /* 52 */ "DIAMETER",
1379
- /* 53 */ "DOTTED",
1380
- /* 54 */ "DASHED",
1381
- /* 55 */ "CW",
1382
- /* 56 */ "CCW",
1383
- /* 57 */ "LARROW",
1384
- /* 58 */ "RARROW",
1385
- /* 59 */ "LRARROW",
1386
- /* 60 */ "INVIS",
1387
- /* 61 */ "THICK",
1388
- /* 62 */ "THIN",
1389
- /* 63 */ "SOLID",
1390
- /* 64 */ "CENTER",
1391
- /* 65 */ "LJUST",
1392
- /* 66 */ "RJUST",
1393
- /* 67 */ "ABOVE",
1394
- /* 68 */ "BELOW",
1395
- /* 69 */ "ITALIC",
1396
- /* 70 */ "BOLD",
1397
- /* 71 */ "MONO",
1398
- /* 72 */ "ALIGNED",
1399
- /* 73 */ "BIG",
1400
- /* 74 */ "SMALL",
1401
- /* 75 */ "AND",
1402
- /* 76 */ "LT",
1403
- /* 77 */ "GT",
1404
- /* 78 */ "ON",
1405
- /* 79 */ "WAY",
1406
- /* 80 */ "BETWEEN",
1407
- /* 81 */ "THE",
1408
- /* 82 */ "NTH",
1409
- /* 83 */ "VERTEX",
1410
- /* 84 */ "TOP",
1411
- /* 85 */ "BOTTOM",
1412
- /* 86 */ "START",
1413
- /* 87 */ "END",
1414
- /* 88 */ "IN",
1415
- /* 89 */ "THIS",
1416
- /* 90 */ "DOT_U",
1417
- /* 91 */ "LAST",
1418
- /* 92 */ "NUMBER",
1419
- /* 93 */ "FUNC1",
1420
- /* 94 */ "FUNC2",
1421
- /* 95 */ "DIST",
1422
- /* 96 */ "DOT_XY",
1423
- /* 97 */ "X",
1424
- /* 98 */ "Y",
1425
- /* 99 */ "DOT_L",
1426
- /* 100 */ "statement_list",
1427
- /* 101 */ "statement",
1428
- /* 102 */ "unnamed_statement",
1429
- /* 103 */ "basetype",
1430
- /* 104 */ "expr",
1431
- /* 105 */ "numproperty",
1432
- /* 106 */ "edge",
1433
- /* 107 */ "direction",
1434
- /* 108 */ "dashproperty",
1435
- /* 109 */ "colorproperty",
1436
- /* 110 */ "locproperty",
1437
- /* 111 */ "position",
1438
- /* 112 */ "place",
1439
- /* 113 */ "object",
1440
- /* 114 */ "objectname",
1441
- /* 115 */ "nth",
1442
- /* 116 */ "textposition",
1443
- /* 117 */ "rvalue",
1444
- /* 118 */ "lvalue",
1445
- /* 119 */ "even",
1446
- /* 120 */ "relexpr",
1447
- /* 121 */ "optrelexpr",
1448
- /* 122 */ "document",
1449
- /* 123 */ "print",
1450
- /* 124 */ "prlist",
1451
- /* 125 */ "pritem",
1452
- /* 126 */ "prsep",
1453
- /* 127 */ "attribute_list",
1454
- /* 128 */ "savelist",
1455
- /* 129 */ "alist",
1456
- /* 130 */ "attribute",
1457
- /* 131 */ "go",
1458
- /* 132 */ "boolproperty",
1459
- /* 133 */ "withclause",
1460
- /* 134 */ "between",
1461
- /* 135 */ "place2",
1403
+ /* 26 */ "ISODATE",
1404
+ /* 27 */ "CLASSNAME",
1405
+ /* 28 */ "LB",
1406
+ /* 29 */ "RB",
1407
+ /* 30 */ "UP",
1408
+ /* 31 */ "DOWN",
1409
+ /* 32 */ "LEFT",
1410
+ /* 33 */ "RIGHT",
1411
+ /* 34 */ "CLOSE",
1412
+ /* 35 */ "CHOP",
1413
+ /* 36 */ "FROM",
1414
+ /* 37 */ "TO",
1415
+ /* 38 */ "THEN",
1416
+ /* 39 */ "HEADING",
1417
+ /* 40 */ "GO",
1418
+ /* 41 */ "AT",
1419
+ /* 42 */ "WITH",
1420
+ /* 43 */ "SAME",
1421
+ /* 44 */ "AS",
1422
+ /* 45 */ "FIT",
1423
+ /* 46 */ "BEHIND",
1424
+ /* 47 */ "UNTIL",
1425
+ /* 48 */ "EVEN",
1426
+ /* 49 */ "DOT_E",
1427
+ /* 50 */ "HEIGHT",
1428
+ /* 51 */ "WIDTH",
1429
+ /* 52 */ "RADIUS",
1430
+ /* 53 */ "DIAMETER",
1431
+ /* 54 */ "DOTTED",
1432
+ /* 55 */ "DASHED",
1433
+ /* 56 */ "CW",
1434
+ /* 57 */ "CCW",
1435
+ /* 58 */ "LARROW",
1436
+ /* 59 */ "RARROW",
1437
+ /* 60 */ "LRARROW",
1438
+ /* 61 */ "INVIS",
1439
+ /* 62 */ "THICK",
1440
+ /* 63 */ "THIN",
1441
+ /* 64 */ "SOLID",
1442
+ /* 65 */ "CENTER",
1443
+ /* 66 */ "LJUST",
1444
+ /* 67 */ "RJUST",
1445
+ /* 68 */ "ABOVE",
1446
+ /* 69 */ "BELOW",
1447
+ /* 70 */ "ITALIC",
1448
+ /* 71 */ "BOLD",
1449
+ /* 72 */ "MONO",
1450
+ /* 73 */ "ALIGNED",
1451
+ /* 74 */ "BIG",
1452
+ /* 75 */ "SMALL",
1453
+ /* 76 */ "AND",
1454
+ /* 77 */ "LT",
1455
+ /* 78 */ "GT",
1456
+ /* 79 */ "ON",
1457
+ /* 80 */ "WAY",
1458
+ /* 81 */ "BETWEEN",
1459
+ /* 82 */ "THE",
1460
+ /* 83 */ "NTH",
1461
+ /* 84 */ "VERTEX",
1462
+ /* 85 */ "TOP",
1463
+ /* 86 */ "BOTTOM",
1464
+ /* 87 */ "START",
1465
+ /* 88 */ "END",
1466
+ /* 89 */ "IN",
1467
+ /* 90 */ "THIS",
1468
+ /* 91 */ "DOT_U",
1469
+ /* 92 */ "LAST",
1470
+ /* 93 */ "NUMBER",
1471
+ /* 94 */ "FUNC1",
1472
+ /* 95 */ "FUNC2",
1473
+ /* 96 */ "DIST",
1474
+ /* 97 */ "DOT_XY",
1475
+ /* 98 */ "X",
1476
+ /* 99 */ "Y",
1477
+ /* 100 */ "DOT_L",
1478
+ /* 101 */ "statement_list",
1479
+ /* 102 */ "statement",
1480
+ /* 103 */ "unnamed_statement",
1481
+ /* 104 */ "basetype",
1482
+ /* 105 */ "expr",
1483
+ /* 106 */ "numproperty",
1484
+ /* 107 */ "edge",
1485
+ /* 108 */ "isodate",
1486
+ /* 109 */ "direction",
1487
+ /* 110 */ "dashproperty",
1488
+ /* 111 */ "colorproperty",
1489
+ /* 112 */ "locproperty",
1490
+ /* 113 */ "position",
1491
+ /* 114 */ "place",
1492
+ /* 115 */ "object",
1493
+ /* 116 */ "objectname",
1494
+ /* 117 */ "nth",
1495
+ /* 118 */ "textposition",
1496
+ /* 119 */ "rvalue",
1497
+ /* 120 */ "lvalue",
1498
+ /* 121 */ "even",
1499
+ /* 122 */ "relexpr",
1500
+ /* 123 */ "optrelexpr",
1501
+ /* 124 */ "document",
1502
+ /* 125 */ "print",
1503
+ /* 126 */ "prlist",
1504
+ /* 127 */ "pritem",
1505
+ /* 128 */ "prsep",
1506
+ /* 129 */ "attribute_list",
1507
+ /* 130 */ "savelist",
1508
+ /* 131 */ "alist",
1509
+ /* 132 */ "attribute",
1510
+ /* 133 */ "go",
1511
+ /* 134 */ "boolproperty",
1512
+ /* 135 */ "withclause",
1513
+ /* 136 */ "between",
1514
+ /* 137 */ "place2",
14621515
};
14631516
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
14641517
14651518
#ifndef NDEBUG
14661519
/* For tracing reduce actions, the names of all rules are required.
@@ -1743,24 +1796,24 @@
17431796
** Note: during a reduce, the only symbols destroyed are those
17441797
** which appear on the RHS of the rule, but which are *not* used
17451798
** inside the C code.
17461799
*/
17471800
/********* Begin destructor definitions ***************************************/
1748
- case 100: /* statement_list */
1749
-{
1750
-#line 511 "pikchr.y"
1751
-pik_elist_free(p,(yypminor->yy235));
1752
-#line 1777 "pikchr.c"
1753
-}
1754
- break;
1755
- case 101: /* statement */
1756
- case 102: /* unnamed_statement */
1757
- case 103: /* basetype */
1758
-{
1759
-#line 513 "pikchr.y"
1760
-pik_elem_free(p,(yypminor->yy162));
1761
-#line 1786 "pikchr.c"
1801
+ case 101: /* statement_list */
1802
+{
1803
+#line 524 "pikchr.y"
1804
+pik_elist_free(p,(yypminor->yy23));
1805
+#line 1805 "pikchr.c"
1806
+}
1807
+ break;
1808
+ case 102: /* statement */
1809
+ case 103: /* unnamed_statement */
1810
+ case 104: /* basetype */
1811
+{
1812
+#line 526 "pikchr.y"
1813
+pik_elem_free(p,(yypminor->yy54));
1814
+#line 1814 "pikchr.c"
17621815
}
17631816
break;
17641817
/********* End destructor definitions *****************************************/
17651818
default: break; /* If no destructor action specified: do nothing */
17661819
}
@@ -1991,14 +2044,14 @@
19912044
#endif
19922045
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
19932046
/* Here code is inserted which will execute if the parser
19942047
** stack every overflows */
19952048
/******** Begin %stack_overflow code ******************************************/
1996
-#line 545 "pikchr.y"
2049
+#line 559 "pikchr.y"
19972050
19982051
pik_error(p, 0, "parser stack overflow");
1999
-#line 2024 "pikchr.c"
2052
+#line 2052 "pikchr.c"
20002053
/******** End %stack_overflow code ********************************************/
20012054
pik_parserARG_STORE /* Suppress warning about unused %extra_argument var */
20022055
pik_parserCTX_STORE
20032056
}
20042057
@@ -2060,166 +2113,166 @@
20602113
}
20612114
20622115
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
20632116
** of that rule */
20642117
static const YYCODETYPE yyRuleInfoLhs[] = {
2065
- 122, /* (0) document ::= statement_list */
2066
- 100, /* (1) statement_list ::= statement */
2067
- 100, /* (2) statement_list ::= statement_list EOL statement */
2068
- 101, /* (3) statement ::= */
2069
- 101, /* (4) statement ::= direction */
2070
- 101, /* (5) statement ::= lvalue ASSIGN rvalue */
2071
- 101, /* (6) statement ::= PLACENAME COLON unnamed_statement */
2072
- 101, /* (7) statement ::= PLACENAME COLON position */
2073
- 101, /* (8) statement ::= unnamed_statement */
2074
- 101, /* (9) statement ::= print prlist */
2075
- 101, /* (10) statement ::= ASSERT LP expr EQ expr RP */
2076
- 101, /* (11) statement ::= ASSERT LP position EQ position RP */
2077
- 101, /* (12) statement ::= DEFINE ID CODEBLOCK */
2078
- 117, /* (13) rvalue ::= PLACENAME */
2079
- 125, /* (14) pritem ::= FILL */
2080
- 125, /* (15) pritem ::= COLOR */
2081
- 125, /* (16) pritem ::= THICKNESS */
2082
- 125, /* (17) pritem ::= rvalue */
2083
- 125, /* (18) pritem ::= STRING */
2084
- 126, /* (19) prsep ::= COMMA */
2085
- 102, /* (20) unnamed_statement ::= basetype attribute_list */
2086
- 103, /* (21) basetype ::= CLASSNAME */
2087
- 103, /* (22) basetype ::= STRING textposition */
2088
- 103, /* (23) basetype ::= LB savelist statement_list RB */
2089
- 128, /* (24) savelist ::= */
2090
- 120, /* (25) relexpr ::= expr */
2091
- 120, /* (26) relexpr ::= expr PERCENT */
2092
- 121, /* (27) optrelexpr ::= */
2093
- 127, /* (28) attribute_list ::= relexpr alist */
2094
- 130, /* (29) attribute ::= numproperty relexpr */
2095
- 130, /* (30) attribute ::= dashproperty expr */
2096
- 130, /* (31) attribute ::= dashproperty */
2097
- 130, /* (32) attribute ::= colorproperty rvalue */
2098
- 130, /* (33) attribute ::= go direction optrelexpr */
2099
- 130, /* (34) attribute ::= go direction even position */
2100
- 130, /* (35) attribute ::= CLOSE */
2101
- 130, /* (36) attribute ::= CHOP */
2102
- 130, /* (37) attribute ::= FROM position */
2103
- 130, /* (38) attribute ::= TO position */
2104
- 130, /* (39) attribute ::= THEN */
2105
- 130, /* (40) attribute ::= THEN optrelexpr HEADING expr */
2106
- 130, /* (41) attribute ::= THEN optrelexpr EDGEPT */
2107
- 130, /* (42) attribute ::= GO optrelexpr HEADING expr */
2108
- 130, /* (43) attribute ::= GO optrelexpr EDGEPT */
2109
- 130, /* (44) attribute ::= AT position */
2110
- 130, /* (45) attribute ::= SAME */
2111
- 130, /* (46) attribute ::= SAME AS object */
2112
- 130, /* (47) attribute ::= STRING textposition */
2113
- 130, /* (48) attribute ::= FIT */
2114
- 130, /* (49) attribute ::= BEHIND object */
2115
- 133, /* (50) withclause ::= DOT_E edge AT position */
2116
- 133, /* (51) withclause ::= edge AT position */
2117
- 105, /* (52) numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2118
- 132, /* (53) boolproperty ::= CW */
2119
- 132, /* (54) boolproperty ::= CCW */
2120
- 132, /* (55) boolproperty ::= LARROW */
2121
- 132, /* (56) boolproperty ::= RARROW */
2122
- 132, /* (57) boolproperty ::= LRARROW */
2123
- 132, /* (58) boolproperty ::= INVIS */
2124
- 132, /* (59) boolproperty ::= THICK */
2125
- 132, /* (60) boolproperty ::= THIN */
2126
- 132, /* (61) boolproperty ::= SOLID */
2127
- 116, /* (62) textposition ::= */
2128
- 116, /* (63) textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2129
- 111, /* (64) position ::= expr COMMA expr */
2130
- 111, /* (65) position ::= place PLUS expr COMMA expr */
2131
- 111, /* (66) position ::= place MINUS expr COMMA expr */
2132
- 111, /* (67) position ::= place PLUS LP expr COMMA expr RP */
2133
- 111, /* (68) position ::= place MINUS LP expr COMMA expr RP */
2134
- 111, /* (69) position ::= LP position COMMA position RP */
2135
- 111, /* (70) position ::= LP position RP */
2136
- 111, /* (71) position ::= expr between position AND position */
2137
- 111, /* (72) position ::= expr LT position COMMA position GT */
2138
- 111, /* (73) position ::= expr ABOVE position */
2139
- 111, /* (74) position ::= expr BELOW position */
2140
- 111, /* (75) position ::= expr LEFT OF position */
2141
- 111, /* (76) position ::= expr RIGHT OF position */
2142
- 111, /* (77) position ::= expr ON HEADING EDGEPT OF position */
2143
- 111, /* (78) position ::= expr HEADING EDGEPT OF position */
2144
- 111, /* (79) position ::= expr EDGEPT OF position */
2145
- 111, /* (80) position ::= expr ON HEADING expr FROM position */
2146
- 111, /* (81) position ::= expr HEADING expr FROM position */
2147
- 112, /* (82) place ::= edge OF object */
2148
- 135, /* (83) place2 ::= object */
2149
- 135, /* (84) place2 ::= object DOT_E edge */
2150
- 135, /* (85) place2 ::= NTH VERTEX OF object */
2151
- 113, /* (86) object ::= nth */
2152
- 113, /* (87) object ::= nth OF|IN object */
2153
- 114, /* (88) objectname ::= THIS */
2154
- 114, /* (89) objectname ::= PLACENAME */
2155
- 114, /* (90) objectname ::= objectname DOT_U PLACENAME */
2156
- 115, /* (91) nth ::= NTH CLASSNAME */
2157
- 115, /* (92) nth ::= NTH LAST CLASSNAME */
2158
- 115, /* (93) nth ::= LAST CLASSNAME */
2159
- 115, /* (94) nth ::= LAST */
2160
- 115, /* (95) nth ::= NTH LB RB */
2161
- 115, /* (96) nth ::= NTH LAST LB RB */
2162
- 115, /* (97) nth ::= LAST LB RB */
2163
- 104, /* (98) expr ::= expr PLUS expr */
2164
- 104, /* (99) expr ::= expr MINUS expr */
2165
- 104, /* (100) expr ::= expr STAR expr */
2166
- 104, /* (101) expr ::= expr SLASH expr */
2167
- 104, /* (102) expr ::= MINUS expr */
2168
- 104, /* (103) expr ::= PLUS expr */
2169
- 104, /* (104) expr ::= LP expr RP */
2170
- 104, /* (105) expr ::= LP FILL|COLOR|THICKNESS RP */
2171
- 104, /* (106) expr ::= NUMBER */
2172
- 104, /* (107) expr ::= ID */
2173
- 104, /* (108) expr ::= FUNC1 LP expr RP */
2174
- 104, /* (109) expr ::= FUNC2 LP expr COMMA expr RP */
2175
- 104, /* (110) expr ::= DIST LP position COMMA position RP */
2176
- 104, /* (111) expr ::= place2 DOT_XY X */
2177
- 104, /* (112) expr ::= place2 DOT_XY Y */
2178
- 104, /* (113) expr ::= object DOT_L numproperty */
2179
- 104, /* (114) expr ::= object DOT_L dashproperty */
2180
- 104, /* (115) expr ::= object DOT_L colorproperty */
2181
- 118, /* (116) lvalue ::= ID */
2182
- 118, /* (117) lvalue ::= FILL */
2183
- 118, /* (118) lvalue ::= COLOR */
2184
- 118, /* (119) lvalue ::= THICKNESS */
2185
- 117, /* (120) rvalue ::= expr */
2186
- 123, /* (121) print ::= PRINT */
2187
- 124, /* (122) prlist ::= pritem */
2188
- 124, /* (123) prlist ::= prlist prsep pritem */
2189
- 107, /* (124) direction ::= UP */
2190
- 107, /* (125) direction ::= DOWN */
2191
- 107, /* (126) direction ::= LEFT */
2192
- 107, /* (127) direction ::= RIGHT */
2193
- 121, /* (128) optrelexpr ::= relexpr */
2194
- 127, /* (129) attribute_list ::= alist */
2195
- 129, /* (130) alist ::= */
2196
- 129, /* (131) alist ::= alist attribute */
2197
- 130, /* (132) attribute ::= boolproperty */
2198
- 130, /* (133) attribute ::= WITH withclause */
2199
- 131, /* (134) go ::= GO */
2200
- 131, /* (135) go ::= */
2201
- 119, /* (136) even ::= UNTIL EVEN WITH */
2202
- 119, /* (137) even ::= EVEN WITH */
2203
- 108, /* (138) dashproperty ::= DOTTED */
2204
- 108, /* (139) dashproperty ::= DASHED */
2205
- 109, /* (140) colorproperty ::= FILL */
2206
- 109, /* (141) colorproperty ::= COLOR */
2207
- 111, /* (142) position ::= place */
2208
- 134, /* (143) between ::= WAY BETWEEN */
2209
- 134, /* (144) between ::= BETWEEN */
2210
- 134, /* (145) between ::= OF THE WAY BETWEEN */
2211
- 112, /* (146) place ::= place2 */
2212
- 106, /* (147) edge ::= CENTER */
2213
- 106, /* (148) edge ::= EDGEPT */
2214
- 106, /* (149) edge ::= TOP */
2215
- 106, /* (150) edge ::= BOTTOM */
2216
- 106, /* (151) edge ::= START */
2217
- 106, /* (152) edge ::= END */
2218
- 106, /* (153) edge ::= RIGHT */
2219
- 106, /* (154) edge ::= LEFT */
2220
- 113, /* (155) object ::= objectname */
2118
+ 124, /* (0) document ::= statement_list */
2119
+ 101, /* (1) statement_list ::= statement */
2120
+ 101, /* (2) statement_list ::= statement_list EOL statement */
2121
+ 102, /* (3) statement ::= */
2122
+ 102, /* (4) statement ::= direction */
2123
+ 102, /* (5) statement ::= lvalue ASSIGN rvalue */
2124
+ 102, /* (6) statement ::= PLACENAME COLON unnamed_statement */
2125
+ 102, /* (7) statement ::= PLACENAME COLON position */
2126
+ 102, /* (8) statement ::= unnamed_statement */
2127
+ 102, /* (9) statement ::= print prlist */
2128
+ 102, /* (10) statement ::= ASSERT LP expr EQ expr RP */
2129
+ 102, /* (11) statement ::= ASSERT LP position EQ position RP */
2130
+ 102, /* (12) statement ::= DEFINE ID CODEBLOCK */
2131
+ 119, /* (13) rvalue ::= PLACENAME */
2132
+ 127, /* (14) pritem ::= FILL */
2133
+ 127, /* (15) pritem ::= COLOR */
2134
+ 127, /* (16) pritem ::= THICKNESS */
2135
+ 127, /* (17) pritem ::= rvalue */
2136
+ 127, /* (18) pritem ::= STRING */
2137
+ 128, /* (19) prsep ::= COMMA */
2138
+ 103, /* (20) unnamed_statement ::= basetype attribute_list */
2139
+ 104, /* (21) basetype ::= CLASSNAME */
2140
+ 104, /* (22) basetype ::= STRING textposition */
2141
+ 104, /* (23) basetype ::= LB savelist statement_list RB */
2142
+ 130, /* (24) savelist ::= */
2143
+ 122, /* (25) relexpr ::= expr */
2144
+ 122, /* (26) relexpr ::= expr PERCENT */
2145
+ 123, /* (27) optrelexpr ::= */
2146
+ 129, /* (28) attribute_list ::= relexpr alist */
2147
+ 132, /* (29) attribute ::= numproperty relexpr */
2148
+ 132, /* (30) attribute ::= dashproperty expr */
2149
+ 132, /* (31) attribute ::= dashproperty */
2150
+ 132, /* (32) attribute ::= colorproperty rvalue */
2151
+ 132, /* (33) attribute ::= go direction optrelexpr */
2152
+ 132, /* (34) attribute ::= go direction even position */
2153
+ 132, /* (35) attribute ::= CLOSE */
2154
+ 132, /* (36) attribute ::= CHOP */
2155
+ 132, /* (37) attribute ::= FROM position */
2156
+ 132, /* (38) attribute ::= TO position */
2157
+ 132, /* (39) attribute ::= THEN */
2158
+ 132, /* (40) attribute ::= THEN optrelexpr HEADING expr */
2159
+ 132, /* (41) attribute ::= THEN optrelexpr EDGEPT */
2160
+ 132, /* (42) attribute ::= GO optrelexpr HEADING expr */
2161
+ 132, /* (43) attribute ::= GO optrelexpr EDGEPT */
2162
+ 132, /* (44) attribute ::= AT position */
2163
+ 132, /* (45) attribute ::= SAME */
2164
+ 132, /* (46) attribute ::= SAME AS object */
2165
+ 132, /* (47) attribute ::= STRING textposition */
2166
+ 132, /* (48) attribute ::= FIT */
2167
+ 132, /* (49) attribute ::= BEHIND object */
2168
+ 135, /* (50) withclause ::= DOT_E edge AT position */
2169
+ 135, /* (51) withclause ::= edge AT position */
2170
+ 106, /* (52) numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2171
+ 134, /* (53) boolproperty ::= CW */
2172
+ 134, /* (54) boolproperty ::= CCW */
2173
+ 134, /* (55) boolproperty ::= LARROW */
2174
+ 134, /* (56) boolproperty ::= RARROW */
2175
+ 134, /* (57) boolproperty ::= LRARROW */
2176
+ 134, /* (58) boolproperty ::= INVIS */
2177
+ 134, /* (59) boolproperty ::= THICK */
2178
+ 134, /* (60) boolproperty ::= THIN */
2179
+ 134, /* (61) boolproperty ::= SOLID */
2180
+ 118, /* (62) textposition ::= */
2181
+ 118, /* (63) textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2182
+ 113, /* (64) position ::= expr COMMA expr */
2183
+ 113, /* (65) position ::= place PLUS expr COMMA expr */
2184
+ 113, /* (66) position ::= place MINUS expr COMMA expr */
2185
+ 113, /* (67) position ::= place PLUS LP expr COMMA expr RP */
2186
+ 113, /* (68) position ::= place MINUS LP expr COMMA expr RP */
2187
+ 113, /* (69) position ::= LP position COMMA position RP */
2188
+ 113, /* (70) position ::= LP position RP */
2189
+ 113, /* (71) position ::= expr between position AND position */
2190
+ 113, /* (72) position ::= expr LT position COMMA position GT */
2191
+ 113, /* (73) position ::= expr ABOVE position */
2192
+ 113, /* (74) position ::= expr BELOW position */
2193
+ 113, /* (75) position ::= expr LEFT OF position */
2194
+ 113, /* (76) position ::= expr RIGHT OF position */
2195
+ 113, /* (77) position ::= expr ON HEADING EDGEPT OF position */
2196
+ 113, /* (78) position ::= expr HEADING EDGEPT OF position */
2197
+ 113, /* (79) position ::= expr EDGEPT OF position */
2198
+ 113, /* (80) position ::= expr ON HEADING expr FROM position */
2199
+ 113, /* (81) position ::= expr HEADING expr FROM position */
2200
+ 114, /* (82) place ::= edge OF object */
2201
+ 137, /* (83) place2 ::= object */
2202
+ 137, /* (84) place2 ::= object DOT_E edge */
2203
+ 137, /* (85) place2 ::= NTH VERTEX OF object */
2204
+ 115, /* (86) object ::= nth */
2205
+ 115, /* (87) object ::= nth OF|IN object */
2206
+ 116, /* (88) objectname ::= THIS */
2207
+ 116, /* (89) objectname ::= PLACENAME */
2208
+ 116, /* (90) objectname ::= objectname DOT_U PLACENAME */
2209
+ 117, /* (91) nth ::= NTH CLASSNAME */
2210
+ 117, /* (92) nth ::= NTH LAST CLASSNAME */
2211
+ 117, /* (93) nth ::= LAST CLASSNAME */
2212
+ 117, /* (94) nth ::= LAST */
2213
+ 117, /* (95) nth ::= NTH LB RB */
2214
+ 117, /* (96) nth ::= NTH LAST LB RB */
2215
+ 117, /* (97) nth ::= LAST LB RB */
2216
+ 105, /* (98) expr ::= expr PLUS expr */
2217
+ 105, /* (99) expr ::= expr MINUS expr */
2218
+ 105, /* (100) expr ::= expr STAR expr */
2219
+ 105, /* (101) expr ::= expr SLASH expr */
2220
+ 105, /* (102) expr ::= MINUS expr */
2221
+ 105, /* (103) expr ::= PLUS expr */
2222
+ 105, /* (104) expr ::= LP expr RP */
2223
+ 105, /* (105) expr ::= LP FILL|COLOR|THICKNESS RP */
2224
+ 105, /* (106) expr ::= NUMBER */
2225
+ 105, /* (107) expr ::= ID */
2226
+ 105, /* (108) expr ::= FUNC1 LP expr RP */
2227
+ 105, /* (109) expr ::= FUNC2 LP expr COMMA expr RP */
2228
+ 105, /* (110) expr ::= DIST LP position COMMA position RP */
2229
+ 105, /* (111) expr ::= place2 DOT_XY X */
2230
+ 105, /* (112) expr ::= place2 DOT_XY Y */
2231
+ 105, /* (113) expr ::= object DOT_L numproperty */
2232
+ 105, /* (114) expr ::= object DOT_L dashproperty */
2233
+ 105, /* (115) expr ::= object DOT_L colorproperty */
2234
+ 120, /* (116) lvalue ::= ID */
2235
+ 120, /* (117) lvalue ::= FILL */
2236
+ 120, /* (118) lvalue ::= COLOR */
2237
+ 120, /* (119) lvalue ::= THICKNESS */
2238
+ 119, /* (120) rvalue ::= expr */
2239
+ 125, /* (121) print ::= PRINT */
2240
+ 126, /* (122) prlist ::= pritem */
2241
+ 126, /* (123) prlist ::= prlist prsep pritem */
2242
+ 109, /* (124) direction ::= UP */
2243
+ 109, /* (125) direction ::= DOWN */
2244
+ 109, /* (126) direction ::= LEFT */
2245
+ 109, /* (127) direction ::= RIGHT */
2246
+ 123, /* (128) optrelexpr ::= relexpr */
2247
+ 129, /* (129) attribute_list ::= alist */
2248
+ 131, /* (130) alist ::= */
2249
+ 131, /* (131) alist ::= alist attribute */
2250
+ 132, /* (132) attribute ::= boolproperty */
2251
+ 132, /* (133) attribute ::= WITH withclause */
2252
+ 133, /* (134) go ::= GO */
2253
+ 133, /* (135) go ::= */
2254
+ 121, /* (136) even ::= UNTIL EVEN WITH */
2255
+ 121, /* (137) even ::= EVEN WITH */
2256
+ 110, /* (138) dashproperty ::= DOTTED */
2257
+ 110, /* (139) dashproperty ::= DASHED */
2258
+ 111, /* (140) colorproperty ::= FILL */
2259
+ 111, /* (141) colorproperty ::= COLOR */
2260
+ 113, /* (142) position ::= place */
2261
+ 136, /* (143) between ::= WAY BETWEEN */
2262
+ 136, /* (144) between ::= BETWEEN */
2263
+ 136, /* (145) between ::= OF THE WAY BETWEEN */
2264
+ 114, /* (146) place ::= place2 */
2265
+ 107, /* (147) edge ::= CENTER */
2266
+ 107, /* (148) edge ::= EDGEPT */
2267
+ 107, /* (149) edge ::= TOP */
2268
+ 107, /* (150) edge ::= BOTTOM */
2269
+ 107, /* (151) edge ::= START */
2270
+ 107, /* (152) edge ::= END */
2271
+ 107, /* (153) edge ::= RIGHT */
2272
+ 107, /* (154) edge ::= LEFT */
2273
+ 115, /* (155) object ::= objectname */
22212274
};
22222275
22232276
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
22242277
** of symbols on the right-hand side of that rule. */
22252278
static const signed char yyRuleInfoNRhs[] = {
@@ -2419,620 +2472,620 @@
24192472
** break;
24202473
*/
24212474
/********** Begin reduce actions **********************************************/
24222475
YYMINORTYPE yylhsminor;
24232476
case 0: /* document ::= statement_list */
2424
-#line 549 "pikchr.y"
2425
-{pik_render(p,yymsp[0].minor.yy235);}
2426
-#line 2451 "pikchr.c"
2477
+#line 563 "pikchr.y"
2478
+{pik_render(p,yymsp[0].minor.yy23);}
2479
+#line 2479 "pikchr.c"
24272480
break;
24282481
case 1: /* statement_list ::= statement */
2429
-#line 552 "pikchr.y"
2430
-{ yylhsminor.yy235 = pik_elist_append(p,0,yymsp[0].minor.yy162); }
2431
-#line 2456 "pikchr.c"
2432
- yymsp[0].minor.yy235 = yylhsminor.yy235;
2482
+#line 566 "pikchr.y"
2483
+{ yylhsminor.yy23 = pik_elist_append(p,0,yymsp[0].minor.yy54); }
2484
+#line 2484 "pikchr.c"
2485
+ yymsp[0].minor.yy23 = yylhsminor.yy23;
24332486
break;
24342487
case 2: /* statement_list ::= statement_list EOL statement */
2435
-#line 554 "pikchr.y"
2436
-{ yylhsminor.yy235 = pik_elist_append(p,yymsp[-2].minor.yy235,yymsp[0].minor.yy162); }
2437
-#line 2462 "pikchr.c"
2438
- yymsp[-2].minor.yy235 = yylhsminor.yy235;
2488
+#line 568 "pikchr.y"
2489
+{ yylhsminor.yy23 = pik_elist_append(p,yymsp[-2].minor.yy23,yymsp[0].minor.yy54); }
2490
+#line 2490 "pikchr.c"
2491
+ yymsp[-2].minor.yy23 = yylhsminor.yy23;
24392492
break;
24402493
case 3: /* statement ::= */
2441
-#line 557 "pikchr.y"
2442
-{ yymsp[1].minor.yy162 = 0; }
2443
-#line 2468 "pikchr.c"
2494
+#line 571 "pikchr.y"
2495
+{ yymsp[1].minor.yy54 = 0; }
2496
+#line 2496 "pikchr.c"
24442497
break;
24452498
case 4: /* statement ::= direction */
2446
-#line 558 "pikchr.y"
2447
-{ pik_set_direction(p,yymsp[0].minor.yy0.eCode); yylhsminor.yy162=0; }
2448
-#line 2473 "pikchr.c"
2449
- yymsp[0].minor.yy162 = yylhsminor.yy162;
2499
+#line 572 "pikchr.y"
2500
+{ pik_set_direction(p,yymsp[0].minor.yy0.eCode); yylhsminor.yy54=0; }
2501
+#line 2501 "pikchr.c"
2502
+ yymsp[0].minor.yy54 = yylhsminor.yy54;
24502503
break;
24512504
case 5: /* statement ::= lvalue ASSIGN rvalue */
2452
-#line 559 "pikchr.y"
2453
-{pik_set_var(p,&yymsp[-2].minor.yy0,yymsp[0].minor.yy21,&yymsp[-1].minor.yy0); yylhsminor.yy162=0;}
2454
-#line 2479 "pikchr.c"
2455
- yymsp[-2].minor.yy162 = yylhsminor.yy162;
2505
+#line 573 "pikchr.y"
2506
+{pik_set_var(p,&yymsp[-2].minor.yy0,yymsp[0].minor.yy129,&yymsp[-1].minor.yy0); yylhsminor.yy54=0;}
2507
+#line 2507 "pikchr.c"
2508
+ yymsp[-2].minor.yy54 = yylhsminor.yy54;
24562509
break;
24572510
case 6: /* statement ::= PLACENAME COLON unnamed_statement */
2458
-#line 561 "pikchr.y"
2459
-{ yylhsminor.yy162 = yymsp[0].minor.yy162; pik_elem_setname(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0); }
2460
-#line 2485 "pikchr.c"
2461
- yymsp[-2].minor.yy162 = yylhsminor.yy162;
2511
+#line 575 "pikchr.y"
2512
+{ yylhsminor.yy54 = yymsp[0].minor.yy54; pik_elem_setname(p,yymsp[0].minor.yy54,&yymsp[-2].minor.yy0); }
2513
+#line 2513 "pikchr.c"
2514
+ yymsp[-2].minor.yy54 = yylhsminor.yy54;
24622515
break;
24632516
case 7: /* statement ::= PLACENAME COLON position */
2464
-#line 563 "pikchr.y"
2465
-{ yylhsminor.yy162 = pik_elem_new(p,0,0,0);
2466
- if(yylhsminor.yy162){ yylhsminor.yy162->ptAt = yymsp[0].minor.yy63; pik_elem_setname(p,yylhsminor.yy162,&yymsp[-2].minor.yy0); }}
2467
-#line 2492 "pikchr.c"
2468
- yymsp[-2].minor.yy162 = yylhsminor.yy162;
2517
+#line 577 "pikchr.y"
2518
+{ yylhsminor.yy54 = pik_elem_new(p,0,0,0);
2519
+ if(yylhsminor.yy54){ yylhsminor.yy54->ptAt = yymsp[0].minor.yy187; pik_elem_setname(p,yylhsminor.yy54,&yymsp[-2].minor.yy0); }}
2520
+#line 2520 "pikchr.c"
2521
+ yymsp[-2].minor.yy54 = yylhsminor.yy54;
24692522
break;
24702523
case 8: /* statement ::= unnamed_statement */
2471
-#line 565 "pikchr.y"
2472
-{yylhsminor.yy162 = yymsp[0].minor.yy162;}
2473
-#line 2498 "pikchr.c"
2474
- yymsp[0].minor.yy162 = yylhsminor.yy162;
2524
+#line 579 "pikchr.y"
2525
+{yylhsminor.yy54 = yymsp[0].minor.yy54;}
2526
+#line 2526 "pikchr.c"
2527
+ yymsp[0].minor.yy54 = yylhsminor.yy54;
24752528
break;
24762529
case 9: /* statement ::= print prlist */
2477
-#line 566 "pikchr.y"
2478
-{pik_append(p,"<br>\n",5); yymsp[-1].minor.yy162=0;}
2479
-#line 2504 "pikchr.c"
2530
+#line 580 "pikchr.y"
2531
+{pik_append(p,"<br>\n",5); yymsp[-1].minor.yy54=0;}
2532
+#line 2532 "pikchr.c"
24802533
break;
24812534
case 10: /* statement ::= ASSERT LP expr EQ expr RP */
2482
-#line 571 "pikchr.y"
2483
-{yymsp[-5].minor.yy162=pik_assert(p,yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy21);}
2484
-#line 2509 "pikchr.c"
2535
+#line 585 "pikchr.y"
2536
+{yymsp[-5].minor.yy54=pik_assert(p,yymsp[-3].minor.yy129,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy129);}
2537
+#line 2537 "pikchr.c"
24852538
break;
24862539
case 11: /* statement ::= ASSERT LP position EQ position RP */
2487
-#line 573 "pikchr.y"
2488
-{yymsp[-5].minor.yy162=pik_position_assert(p,&yymsp[-3].minor.yy63,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy63);}
2489
-#line 2514 "pikchr.c"
2540
+#line 587 "pikchr.y"
2541
+{yymsp[-5].minor.yy54=pik_position_assert(p,&yymsp[-3].minor.yy187,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy187);}
2542
+#line 2542 "pikchr.c"
24902543
break;
24912544
case 12: /* statement ::= DEFINE ID CODEBLOCK */
2492
-#line 574 "pikchr.y"
2493
-{yymsp[-2].minor.yy162=0; pik_add_macro(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
2494
-#line 2519 "pikchr.c"
2545
+#line 588 "pikchr.y"
2546
+{yymsp[-2].minor.yy54=0; pik_add_macro(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
2547
+#line 2547 "pikchr.c"
24952548
break;
24962549
case 13: /* rvalue ::= PLACENAME */
2497
-#line 585 "pikchr.y"
2498
-{yylhsminor.yy21 = pik_lookup_color(p,&yymsp[0].minor.yy0);}
2499
-#line 2524 "pikchr.c"
2500
- yymsp[0].minor.yy21 = yylhsminor.yy21;
2550
+#line 599 "pikchr.y"
2551
+{yylhsminor.yy129 = pik_lookup_color(p,&yymsp[0].minor.yy0);}
2552
+#line 2552 "pikchr.c"
2553
+ yymsp[0].minor.yy129 = yylhsminor.yy129;
25012554
break;
25022555
case 14: /* pritem ::= FILL */
25032556
case 15: /* pritem ::= COLOR */ yytestcase(yyruleno==15);
25042557
case 16: /* pritem ::= THICKNESS */ yytestcase(yyruleno==16);
2505
-#line 590 "pikchr.y"
2558
+#line 604 "pikchr.y"
25062559
{pik_append_num(p,"",pik_value(p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.n,0));}
2507
-#line 2532 "pikchr.c"
2560
+#line 2560 "pikchr.c"
25082561
break;
25092562
case 17: /* pritem ::= rvalue */
2510
-#line 593 "pikchr.y"
2511
-{pik_append_num(p,"",yymsp[0].minor.yy21);}
2512
-#line 2537 "pikchr.c"
2563
+#line 607 "pikchr.y"
2564
+{pik_append_num(p,"",yymsp[0].minor.yy129);}
2565
+#line 2565 "pikchr.c"
25132566
break;
25142567
case 18: /* pritem ::= STRING */
2515
-#line 594 "pikchr.y"
2568
+#line 608 "pikchr.y"
25162569
{pik_append_text(p,yymsp[0].minor.yy0.z+1,yymsp[0].minor.yy0.n-2,0);}
2517
-#line 2542 "pikchr.c"
2570
+#line 2570 "pikchr.c"
25182571
break;
25192572
case 19: /* prsep ::= COMMA */
2520
-#line 595 "pikchr.y"
2573
+#line 609 "pikchr.y"
25212574
{pik_append(p, " ", 1);}
2522
-#line 2547 "pikchr.c"
2575
+#line 2575 "pikchr.c"
25232576
break;
25242577
case 20: /* unnamed_statement ::= basetype attribute_list */
2525
-#line 598 "pikchr.y"
2526
-{yylhsminor.yy162 = yymsp[-1].minor.yy162; pik_after_adding_attributes(p,yylhsminor.yy162);}
2527
-#line 2552 "pikchr.c"
2528
- yymsp[-1].minor.yy162 = yylhsminor.yy162;
2578
+#line 614 "pikchr.y"
2579
+{yylhsminor.yy54 = yymsp[-1].minor.yy54; pik_after_adding_attributes(p,yylhsminor.yy54);}
2580
+#line 2580 "pikchr.c"
2581
+ yymsp[-1].minor.yy54 = yylhsminor.yy54;
25292582
break;
25302583
case 21: /* basetype ::= CLASSNAME */
2531
-#line 600 "pikchr.y"
2532
-{yylhsminor.yy162 = pik_elem_new(p,&yymsp[0].minor.yy0,0,0); }
2533
-#line 2558 "pikchr.c"
2534
- yymsp[0].minor.yy162 = yylhsminor.yy162;
2584
+#line 616 "pikchr.y"
2585
+{yylhsminor.yy54 = pik_elem_new(p,&yymsp[0].minor.yy0,0,0); }
2586
+#line 2586 "pikchr.c"
2587
+ yymsp[0].minor.yy54 = yylhsminor.yy54;
25352588
break;
25362589
case 22: /* basetype ::= STRING textposition */
2537
-#line 602 "pikchr.y"
2538
-{yymsp[-1].minor.yy0.eCode = yymsp[0].minor.yy188; yylhsminor.yy162 = pik_elem_new(p,0,&yymsp[-1].minor.yy0,0); }
2539
-#line 2564 "pikchr.c"
2540
- yymsp[-1].minor.yy162 = yylhsminor.yy162;
2590
+#line 618 "pikchr.y"
2591
+{yymsp[-1].minor.yy0.eCode = yymsp[0].minor.yy272; yylhsminor.yy54 = pik_elem_new(p,0,&yymsp[-1].minor.yy0,0); }
2592
+#line 2592 "pikchr.c"
2593
+ yymsp[-1].minor.yy54 = yylhsminor.yy54;
25412594
break;
25422595
case 23: /* basetype ::= LB savelist statement_list RB */
2543
-#line 604 "pikchr.y"
2544
-{ p->list = yymsp[-2].minor.yy235; yymsp[-3].minor.yy162 = pik_elem_new(p,0,0,yymsp[-1].minor.yy235); if(yymsp[-3].minor.yy162) yymsp[-3].minor.yy162->errTok = yymsp[0].minor.yy0; }
2545
-#line 2570 "pikchr.c"
2596
+#line 620 "pikchr.y"
2597
+{ p->list = yymsp[-2].minor.yy23; yymsp[-3].minor.yy54 = pik_elem_new(p,0,0,yymsp[-1].minor.yy23); if(yymsp[-3].minor.yy54) yymsp[-3].minor.yy54->errTok = yymsp[0].minor.yy0; }
2598
+#line 2598 "pikchr.c"
25462599
break;
25472600
case 24: /* savelist ::= */
2548
-#line 609 "pikchr.y"
2549
-{yymsp[1].minor.yy235 = p->list; p->list = 0;}
2550
-#line 2575 "pikchr.c"
2601
+#line 625 "pikchr.y"
2602
+{yymsp[1].minor.yy23 = p->list; p->list = 0;}
2603
+#line 2603 "pikchr.c"
25512604
break;
25522605
case 25: /* relexpr ::= expr */
2553
-#line 616 "pikchr.y"
2554
-{yylhsminor.yy72.rAbs = yymsp[0].minor.yy21; yylhsminor.yy72.rRel = 0;}
2555
-#line 2580 "pikchr.c"
2556
- yymsp[0].minor.yy72 = yylhsminor.yy72;
2606
+#line 632 "pikchr.y"
2607
+{yylhsminor.yy28.rAbs = yymsp[0].minor.yy129; yylhsminor.yy28.rRel = 0;}
2608
+#line 2608 "pikchr.c"
2609
+ yymsp[0].minor.yy28 = yylhsminor.yy28;
25572610
break;
25582611
case 26: /* relexpr ::= expr PERCENT */
2559
-#line 617 "pikchr.y"
2560
-{yylhsminor.yy72.rAbs = 0; yylhsminor.yy72.rRel = yymsp[-1].minor.yy21/100;}
2561
-#line 2586 "pikchr.c"
2562
- yymsp[-1].minor.yy72 = yylhsminor.yy72;
2612
+#line 633 "pikchr.y"
2613
+{yylhsminor.yy28.rAbs = 0; yylhsminor.yy28.rRel = yymsp[-1].minor.yy129/100;}
2614
+#line 2614 "pikchr.c"
2615
+ yymsp[-1].minor.yy28 = yylhsminor.yy28;
25632616
break;
25642617
case 27: /* optrelexpr ::= */
2565
-#line 619 "pikchr.y"
2566
-{yymsp[1].minor.yy72.rAbs = 0; yymsp[1].minor.yy72.rRel = 1.0;}
2567
-#line 2592 "pikchr.c"
2618
+#line 635 "pikchr.y"
2619
+{yymsp[1].minor.yy28.rAbs = 0; yymsp[1].minor.yy28.rRel = 1.0;}
2620
+#line 2620 "pikchr.c"
25682621
break;
25692622
case 28: /* attribute_list ::= relexpr alist */
2570
-#line 621 "pikchr.y"
2571
-{pik_add_direction(p,0,&yymsp[-1].minor.yy72);}
2572
-#line 2597 "pikchr.c"
2623
+#line 637 "pikchr.y"
2624
+{pik_add_direction(p,0,&yymsp[-1].minor.yy28);}
2625
+#line 2625 "pikchr.c"
25732626
break;
25742627
case 29: /* attribute ::= numproperty relexpr */
2575
-#line 625 "pikchr.y"
2576
-{ pik_set_numprop(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72); }
2577
-#line 2602 "pikchr.c"
2628
+#line 641 "pikchr.y"
2629
+{ pik_set_numprop(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy28); }
2630
+#line 2630 "pikchr.c"
25782631
break;
25792632
case 30: /* attribute ::= dashproperty expr */
2580
-#line 626 "pikchr.y"
2581
-{ pik_set_dashed(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy21); }
2582
-#line 2607 "pikchr.c"
2633
+#line 642 "pikchr.y"
2634
+{ pik_set_dashed(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy129); }
2635
+#line 2635 "pikchr.c"
25832636
break;
25842637
case 31: /* attribute ::= dashproperty */
2585
-#line 627 "pikchr.y"
2638
+#line 643 "pikchr.y"
25862639
{ pik_set_dashed(p,&yymsp[0].minor.yy0,0); }
2587
-#line 2612 "pikchr.c"
2640
+#line 2640 "pikchr.c"
25882641
break;
25892642
case 32: /* attribute ::= colorproperty rvalue */
2590
-#line 628 "pikchr.y"
2591
-{ pik_set_clrprop(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21); }
2592
-#line 2617 "pikchr.c"
2643
+#line 644 "pikchr.y"
2644
+{ pik_set_clrprop(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy129); }
2645
+#line 2645 "pikchr.c"
25932646
break;
25942647
case 33: /* attribute ::= go direction optrelexpr */
2595
-#line 629 "pikchr.y"
2596
-{ pik_add_direction(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72);}
2597
-#line 2622 "pikchr.c"
2648
+#line 645 "pikchr.y"
2649
+{ pik_add_direction(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy28);}
2650
+#line 2650 "pikchr.c"
25982651
break;
25992652
case 34: /* attribute ::= go direction even position */
2600
-#line 630 "pikchr.y"
2601
-{pik_evenwith(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63);}
2602
-#line 2627 "pikchr.c"
2653
+#line 646 "pikchr.y"
2654
+{pik_evenwith(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy187);}
2655
+#line 2655 "pikchr.c"
26032656
break;
26042657
case 35: /* attribute ::= CLOSE */
2605
-#line 631 "pikchr.y"
2658
+#line 647 "pikchr.y"
26062659
{ pik_close_path(p,&yymsp[0].minor.yy0); }
2607
-#line 2632 "pikchr.c"
2660
+#line 2660 "pikchr.c"
26082661
break;
26092662
case 36: /* attribute ::= CHOP */
2610
-#line 632 "pikchr.y"
2663
+#line 648 "pikchr.y"
26112664
{ p->cur->bChop = 1; }
2612
-#line 2637 "pikchr.c"
2665
+#line 2665 "pikchr.c"
26132666
break;
26142667
case 37: /* attribute ::= FROM position */
2615
-#line 633 "pikchr.y"
2616
-{ pik_set_from(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2617
-#line 2642 "pikchr.c"
2668
+#line 649 "pikchr.y"
2669
+{ pik_set_from(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy187); }
2670
+#line 2670 "pikchr.c"
26182671
break;
26192672
case 38: /* attribute ::= TO position */
2620
-#line 634 "pikchr.y"
2621
-{ pik_add_to(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2622
-#line 2647 "pikchr.c"
2673
+#line 650 "pikchr.y"
2674
+{ pik_add_to(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy187); }
2675
+#line 2675 "pikchr.c"
26232676
break;
26242677
case 39: /* attribute ::= THEN */
2625
-#line 635 "pikchr.y"
2678
+#line 651 "pikchr.y"
26262679
{ pik_then(p, &yymsp[0].minor.yy0, p->cur); }
2627
-#line 2652 "pikchr.c"
2680
+#line 2680 "pikchr.c"
26282681
break;
26292682
case 40: /* attribute ::= THEN optrelexpr HEADING expr */
26302683
case 42: /* attribute ::= GO optrelexpr HEADING expr */ yytestcase(yyruleno==42);
2631
-#line 637 "pikchr.y"
2632
-{pik_move_hdg(p,&yymsp[-2].minor.yy72,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21,0,&yymsp[-3].minor.yy0);}
2633
-#line 2658 "pikchr.c"
2684
+#line 653 "pikchr.y"
2685
+{pik_move_hdg(p,&yymsp[-2].minor.yy28,&yymsp[-1].minor.yy0,yymsp[0].minor.yy129,0,&yymsp[-3].minor.yy0);}
2686
+#line 2686 "pikchr.c"
26342687
break;
26352688
case 41: /* attribute ::= THEN optrelexpr EDGEPT */
26362689
case 43: /* attribute ::= GO optrelexpr EDGEPT */ yytestcase(yyruleno==43);
2637
-#line 638 "pikchr.y"
2638
-{pik_move_hdg(p,&yymsp[-1].minor.yy72,0,0,&yymsp[0].minor.yy0,&yymsp[-2].minor.yy0);}
2639
-#line 2664 "pikchr.c"
2690
+#line 654 "pikchr.y"
2691
+{pik_move_hdg(p,&yymsp[-1].minor.yy28,0,0,&yymsp[0].minor.yy0,&yymsp[-2].minor.yy0);}
2692
+#line 2692 "pikchr.c"
26402693
break;
26412694
case 44: /* attribute ::= AT position */
2642
-#line 643 "pikchr.y"
2643
-{ pik_set_at(p,0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2644
-#line 2669 "pikchr.c"
2695
+#line 659 "pikchr.y"
2696
+{ pik_set_at(p,0,&yymsp[0].minor.yy187,&yymsp[-1].minor.yy0); }
2697
+#line 2697 "pikchr.c"
26452698
break;
26462699
case 45: /* attribute ::= SAME */
2647
-#line 645 "pikchr.y"
2700
+#line 661 "pikchr.y"
26482701
{pik_same(p,0,&yymsp[0].minor.yy0);}
2649
-#line 2674 "pikchr.c"
2702
+#line 2702 "pikchr.c"
26502703
break;
26512704
case 46: /* attribute ::= SAME AS object */
2652
-#line 646 "pikchr.y"
2653
-{pik_same(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2654
-#line 2679 "pikchr.c"
2705
+#line 662 "pikchr.y"
2706
+{pik_same(p,yymsp[0].minor.yy54,&yymsp[-2].minor.yy0);}
2707
+#line 2707 "pikchr.c"
26552708
break;
26562709
case 47: /* attribute ::= STRING textposition */
2657
-#line 647 "pikchr.y"
2658
-{pik_add_txt(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy188);}
2659
-#line 2684 "pikchr.c"
2710
+#line 663 "pikchr.y"
2711
+{pik_add_txt(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy272);}
2712
+#line 2712 "pikchr.c"
26602713
break;
26612714
case 48: /* attribute ::= FIT */
2662
-#line 648 "pikchr.y"
2663
-{pik_size_to_fit(p,&yymsp[0].minor.yy0,3); }
2664
-#line 2689 "pikchr.c"
2715
+#line 664 "pikchr.y"
2716
+{pik_size_to_fit(p,0,&yymsp[0].minor.yy0,3); }
2717
+#line 2717 "pikchr.c"
26652718
break;
26662719
case 49: /* attribute ::= BEHIND object */
2667
-#line 649 "pikchr.y"
2668
-{pik_behind(p,yymsp[0].minor.yy162);}
2669
-#line 2694 "pikchr.c"
2720
+#line 665 "pikchr.y"
2721
+{pik_behind(p,yymsp[0].minor.yy54);}
2722
+#line 2722 "pikchr.c"
26702723
break;
26712724
case 50: /* withclause ::= DOT_E edge AT position */
26722725
case 51: /* withclause ::= edge AT position */ yytestcase(yyruleno==51);
2673
-#line 657 "pikchr.y"
2674
-{ pik_set_at(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2675
-#line 2700 "pikchr.c"
2726
+#line 673 "pikchr.y"
2727
+{ pik_set_at(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy187,&yymsp[-1].minor.yy0); }
2728
+#line 2728 "pikchr.c"
26762729
break;
26772730
case 52: /* numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2678
-#line 661 "pikchr.y"
2731
+#line 677 "pikchr.y"
26792732
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
2680
-#line 2705 "pikchr.c"
2733
+#line 2733 "pikchr.c"
26812734
yymsp[0].minor.yy0 = yylhsminor.yy0;
26822735
break;
26832736
case 53: /* boolproperty ::= CW */
2684
-#line 672 "pikchr.y"
2737
+#line 688 "pikchr.y"
26852738
{p->cur->cw = 1;}
2686
-#line 2711 "pikchr.c"
2739
+#line 2739 "pikchr.c"
26872740
break;
26882741
case 54: /* boolproperty ::= CCW */
2689
-#line 673 "pikchr.y"
2742
+#line 689 "pikchr.y"
26902743
{p->cur->cw = 0;}
2691
-#line 2716 "pikchr.c"
2744
+#line 2744 "pikchr.c"
26922745
break;
26932746
case 55: /* boolproperty ::= LARROW */
2694
-#line 674 "pikchr.y"
2747
+#line 690 "pikchr.y"
26952748
{p->cur->larrow=1; p->cur->rarrow=0; }
2696
-#line 2721 "pikchr.c"
2749
+#line 2749 "pikchr.c"
26972750
break;
26982751
case 56: /* boolproperty ::= RARROW */
2699
-#line 675 "pikchr.y"
2752
+#line 691 "pikchr.y"
27002753
{p->cur->larrow=0; p->cur->rarrow=1; }
2701
-#line 2726 "pikchr.c"
2754
+#line 2754 "pikchr.c"
27022755
break;
27032756
case 57: /* boolproperty ::= LRARROW */
2704
-#line 676 "pikchr.y"
2757
+#line 692 "pikchr.y"
27052758
{p->cur->larrow=1; p->cur->rarrow=1; }
2706
-#line 2731 "pikchr.c"
2759
+#line 2759 "pikchr.c"
27072760
break;
27082761
case 58: /* boolproperty ::= INVIS */
2709
-#line 677 "pikchr.y"
2762
+#line 693 "pikchr.y"
27102763
{p->cur->sw = -0.00001;}
2711
-#line 2736 "pikchr.c"
2764
+#line 2764 "pikchr.c"
27122765
break;
27132766
case 59: /* boolproperty ::= THICK */
2714
-#line 678 "pikchr.y"
2767
+#line 694 "pikchr.y"
27152768
{p->cur->sw *= 1.5;}
2716
-#line 2741 "pikchr.c"
2769
+#line 2769 "pikchr.c"
27172770
break;
27182771
case 60: /* boolproperty ::= THIN */
2719
-#line 679 "pikchr.y"
2772
+#line 695 "pikchr.y"
27202773
{p->cur->sw *= 0.67;}
2721
-#line 2746 "pikchr.c"
2774
+#line 2774 "pikchr.c"
27222775
break;
27232776
case 61: /* boolproperty ::= SOLID */
2724
-#line 680 "pikchr.y"
2777
+#line 696 "pikchr.y"
27252778
{p->cur->sw = pik_value(p,"thickness",9,0);
27262779
p->cur->dotted = p->cur->dashed = 0.0;}
2727
-#line 2752 "pikchr.c"
2780
+#line 2780 "pikchr.c"
27282781
break;
27292782
case 62: /* textposition ::= */
2730
-#line 683 "pikchr.y"
2731
-{yymsp[1].minor.yy188 = 0;}
2732
-#line 2757 "pikchr.c"
2783
+#line 699 "pikchr.y"
2784
+{yymsp[1].minor.yy272 = 0;}
2785
+#line 2785 "pikchr.c"
27332786
break;
27342787
case 63: /* textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2735
-#line 686 "pikchr.y"
2736
-{yylhsminor.yy188 = (short int)pik_text_position(yymsp[-1].minor.yy188,&yymsp[0].minor.yy0);}
2737
-#line 2762 "pikchr.c"
2738
- yymsp[-1].minor.yy188 = yylhsminor.yy188;
2788
+#line 702 "pikchr.y"
2789
+{yylhsminor.yy272 = (short int)pik_text_position(yymsp[-1].minor.yy272,&yymsp[0].minor.yy0);}
2790
+#line 2790 "pikchr.c"
2791
+ yymsp[-1].minor.yy272 = yylhsminor.yy272;
27392792
break;
27402793
case 64: /* position ::= expr COMMA expr */
2741
-#line 689 "pikchr.y"
2742
-{yylhsminor.yy63.x=yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[0].minor.yy21;}
2743
-#line 2768 "pikchr.c"
2744
- yymsp[-2].minor.yy63 = yylhsminor.yy63;
2794
+#line 705 "pikchr.y"
2795
+{yylhsminor.yy187.x=yymsp[-2].minor.yy129; yylhsminor.yy187.y=yymsp[0].minor.yy129;}
2796
+#line 2796 "pikchr.c"
2797
+ yymsp[-2].minor.yy187 = yylhsminor.yy187;
27452798
break;
27462799
case 65: /* position ::= place PLUS expr COMMA expr */
2747
-#line 691 "pikchr.y"
2748
-{yylhsminor.yy63.x=yymsp[-4].minor.yy63.x+yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y+yymsp[0].minor.yy21;}
2749
-#line 2774 "pikchr.c"
2750
- yymsp[-4].minor.yy63 = yylhsminor.yy63;
2800
+#line 707 "pikchr.y"
2801
+{yylhsminor.yy187.x=yymsp[-4].minor.yy187.x+yymsp[-2].minor.yy129; yylhsminor.yy187.y=yymsp[-4].minor.yy187.y+yymsp[0].minor.yy129;}
2802
+#line 2802 "pikchr.c"
2803
+ yymsp[-4].minor.yy187 = yylhsminor.yy187;
27512804
break;
27522805
case 66: /* position ::= place MINUS expr COMMA expr */
2753
-#line 692 "pikchr.y"
2754
-{yylhsminor.yy63.x=yymsp[-4].minor.yy63.x-yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y-yymsp[0].minor.yy21;}
2755
-#line 2780 "pikchr.c"
2756
- yymsp[-4].minor.yy63 = yylhsminor.yy63;
2806
+#line 708 "pikchr.y"
2807
+{yylhsminor.yy187.x=yymsp[-4].minor.yy187.x-yymsp[-2].minor.yy129; yylhsminor.yy187.y=yymsp[-4].minor.yy187.y-yymsp[0].minor.yy129;}
2808
+#line 2808 "pikchr.c"
2809
+ yymsp[-4].minor.yy187 = yylhsminor.yy187;
27572810
break;
27582811
case 67: /* position ::= place PLUS LP expr COMMA expr RP */
2759
-#line 694 "pikchr.y"
2760
-{yylhsminor.yy63.x=yymsp[-6].minor.yy63.x+yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y+yymsp[-1].minor.yy21;}
2761
-#line 2786 "pikchr.c"
2762
- yymsp[-6].minor.yy63 = yylhsminor.yy63;
2812
+#line 710 "pikchr.y"
2813
+{yylhsminor.yy187.x=yymsp[-6].minor.yy187.x+yymsp[-3].minor.yy129; yylhsminor.yy187.y=yymsp[-6].minor.yy187.y+yymsp[-1].minor.yy129;}
2814
+#line 2814 "pikchr.c"
2815
+ yymsp[-6].minor.yy187 = yylhsminor.yy187;
27632816
break;
27642817
case 68: /* position ::= place MINUS LP expr COMMA expr RP */
2765
-#line 696 "pikchr.y"
2766
-{yylhsminor.yy63.x=yymsp[-6].minor.yy63.x-yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y-yymsp[-1].minor.yy21;}
2767
-#line 2792 "pikchr.c"
2768
- yymsp[-6].minor.yy63 = yylhsminor.yy63;
2818
+#line 712 "pikchr.y"
2819
+{yylhsminor.yy187.x=yymsp[-6].minor.yy187.x-yymsp[-3].minor.yy129; yylhsminor.yy187.y=yymsp[-6].minor.yy187.y-yymsp[-1].minor.yy129;}
2820
+#line 2820 "pikchr.c"
2821
+ yymsp[-6].minor.yy187 = yylhsminor.yy187;
27692822
break;
27702823
case 69: /* position ::= LP position COMMA position RP */
2771
-#line 697 "pikchr.y"
2772
-{yymsp[-4].minor.yy63.x=yymsp[-3].minor.yy63.x; yymsp[-4].minor.yy63.y=yymsp[-1].minor.yy63.y;}
2773
-#line 2798 "pikchr.c"
2824
+#line 713 "pikchr.y"
2825
+{yymsp[-4].minor.yy187.x=yymsp[-3].minor.yy187.x; yymsp[-4].minor.yy187.y=yymsp[-1].minor.yy187.y;}
2826
+#line 2826 "pikchr.c"
27742827
break;
27752828
case 70: /* position ::= LP position RP */
2776
-#line 698 "pikchr.y"
2777
-{yymsp[-2].minor.yy63=yymsp[-1].minor.yy63;}
2778
-#line 2803 "pikchr.c"
2829
+#line 714 "pikchr.y"
2830
+{yymsp[-2].minor.yy187=yymsp[-1].minor.yy187;}
2831
+#line 2831 "pikchr.c"
27792832
break;
27802833
case 71: /* position ::= expr between position AND position */
2781
-#line 700 "pikchr.y"
2782
-{yylhsminor.yy63 = pik_position_between(yymsp[-4].minor.yy21,yymsp[-2].minor.yy63,yymsp[0].minor.yy63);}
2783
-#line 2808 "pikchr.c"
2784
- yymsp[-4].minor.yy63 = yylhsminor.yy63;
2834
+#line 716 "pikchr.y"
2835
+{yylhsminor.yy187 = pik_position_between(yymsp[-4].minor.yy129,yymsp[-2].minor.yy187,yymsp[0].minor.yy187);}
2836
+#line 2836 "pikchr.c"
2837
+ yymsp[-4].minor.yy187 = yylhsminor.yy187;
27852838
break;
27862839
case 72: /* position ::= expr LT position COMMA position GT */
2787
-#line 702 "pikchr.y"
2788
-{yylhsminor.yy63 = pik_position_between(yymsp[-5].minor.yy21,yymsp[-3].minor.yy63,yymsp[-1].minor.yy63);}
2789
-#line 2814 "pikchr.c"
2790
- yymsp[-5].minor.yy63 = yylhsminor.yy63;
2840
+#line 718 "pikchr.y"
2841
+{yylhsminor.yy187 = pik_position_between(yymsp[-5].minor.yy129,yymsp[-3].minor.yy187,yymsp[-1].minor.yy187);}
2842
+#line 2842 "pikchr.c"
2843
+ yymsp[-5].minor.yy187 = yylhsminor.yy187;
27912844
break;
27922845
case 73: /* position ::= expr ABOVE position */
2793
-#line 703 "pikchr.y"
2794
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y += yymsp[-2].minor.yy21;}
2795
-#line 2820 "pikchr.c"
2796
- yymsp[-2].minor.yy63 = yylhsminor.yy63;
2846
+#line 719 "pikchr.y"
2847
+{yylhsminor.yy187=yymsp[0].minor.yy187; yylhsminor.yy187.y += yymsp[-2].minor.yy129;}
2848
+#line 2848 "pikchr.c"
2849
+ yymsp[-2].minor.yy187 = yylhsminor.yy187;
27972850
break;
27982851
case 74: /* position ::= expr BELOW position */
2799
-#line 704 "pikchr.y"
2800
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y -= yymsp[-2].minor.yy21;}
2801
-#line 2826 "pikchr.c"
2802
- yymsp[-2].minor.yy63 = yylhsminor.yy63;
2852
+#line 720 "pikchr.y"
2853
+{yylhsminor.yy187=yymsp[0].minor.yy187; yylhsminor.yy187.y -= yymsp[-2].minor.yy129;}
2854
+#line 2854 "pikchr.c"
2855
+ yymsp[-2].minor.yy187 = yylhsminor.yy187;
28032856
break;
28042857
case 75: /* position ::= expr LEFT OF position */
2805
-#line 705 "pikchr.y"
2806
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x -= yymsp[-3].minor.yy21;}
2807
-#line 2832 "pikchr.c"
2808
- yymsp[-3].minor.yy63 = yylhsminor.yy63;
2858
+#line 721 "pikchr.y"
2859
+{yylhsminor.yy187=yymsp[0].minor.yy187; yylhsminor.yy187.x -= yymsp[-3].minor.yy129;}
2860
+#line 2860 "pikchr.c"
2861
+ yymsp[-3].minor.yy187 = yylhsminor.yy187;
28092862
break;
28102863
case 76: /* position ::= expr RIGHT OF position */
2811
-#line 706 "pikchr.y"
2812
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x += yymsp[-3].minor.yy21;}
2813
-#line 2838 "pikchr.c"
2814
- yymsp[-3].minor.yy63 = yylhsminor.yy63;
2864
+#line 722 "pikchr.y"
2865
+{yylhsminor.yy187=yymsp[0].minor.yy187; yylhsminor.yy187.x += yymsp[-3].minor.yy129;}
2866
+#line 2866 "pikchr.c"
2867
+ yymsp[-3].minor.yy187 = yylhsminor.yy187;
28152868
break;
28162869
case 77: /* position ::= expr ON HEADING EDGEPT OF position */
2817
-#line 708 "pikchr.y"
2818
-{yylhsminor.yy63 = pik_position_at_hdg(yymsp[-5].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2819
-#line 2844 "pikchr.c"
2820
- yymsp[-5].minor.yy63 = yylhsminor.yy63;
2870
+#line 724 "pikchr.y"
2871
+{yylhsminor.yy187 = pik_position_at_hdg(yymsp[-5].minor.yy129,&yymsp[-2].minor.yy0,yymsp[0].minor.yy187);}
2872
+#line 2872 "pikchr.c"
2873
+ yymsp[-5].minor.yy187 = yylhsminor.yy187;
28212874
break;
28222875
case 78: /* position ::= expr HEADING EDGEPT OF position */
2823
-#line 710 "pikchr.y"
2824
-{yylhsminor.yy63 = pik_position_at_hdg(yymsp[-4].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2825
-#line 2850 "pikchr.c"
2826
- yymsp[-4].minor.yy63 = yylhsminor.yy63;
2876
+#line 726 "pikchr.y"
2877
+{yylhsminor.yy187 = pik_position_at_hdg(yymsp[-4].minor.yy129,&yymsp[-2].minor.yy0,yymsp[0].minor.yy187);}
2878
+#line 2878 "pikchr.c"
2879
+ yymsp[-4].minor.yy187 = yylhsminor.yy187;
28272880
break;
28282881
case 79: /* position ::= expr EDGEPT OF position */
2829
-#line 712 "pikchr.y"
2830
-{yylhsminor.yy63 = pik_position_at_hdg(yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2831
-#line 2856 "pikchr.c"
2832
- yymsp[-3].minor.yy63 = yylhsminor.yy63;
2882
+#line 728 "pikchr.y"
2883
+{yylhsminor.yy187 = pik_position_at_hdg(yymsp[-3].minor.yy129,&yymsp[-2].minor.yy0,yymsp[0].minor.yy187);}
2884
+#line 2884 "pikchr.c"
2885
+ yymsp[-3].minor.yy187 = yylhsminor.yy187;
28332886
break;
28342887
case 80: /* position ::= expr ON HEADING expr FROM position */
2835
-#line 714 "pikchr.y"
2836
-{yylhsminor.yy63 = pik_position_at_angle(yymsp[-5].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2837
-#line 2862 "pikchr.c"
2838
- yymsp[-5].minor.yy63 = yylhsminor.yy63;
2888
+#line 730 "pikchr.y"
2889
+{yylhsminor.yy187 = pik_position_at_angle(yymsp[-5].minor.yy129,yymsp[-2].minor.yy129,yymsp[0].minor.yy187);}
2890
+#line 2890 "pikchr.c"
2891
+ yymsp[-5].minor.yy187 = yylhsminor.yy187;
28392892
break;
28402893
case 81: /* position ::= expr HEADING expr FROM position */
2841
-#line 716 "pikchr.y"
2842
-{yylhsminor.yy63 = pik_position_at_angle(yymsp[-4].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2843
-#line 2868 "pikchr.c"
2844
- yymsp[-4].minor.yy63 = yylhsminor.yy63;
2894
+#line 732 "pikchr.y"
2895
+{yylhsminor.yy187 = pik_position_at_angle(yymsp[-4].minor.yy129,yymsp[-2].minor.yy129,yymsp[0].minor.yy187);}
2896
+#line 2896 "pikchr.c"
2897
+ yymsp[-4].minor.yy187 = yylhsminor.yy187;
28452898
break;
28462899
case 82: /* place ::= edge OF object */
2847
-#line 728 "pikchr.y"
2848
-{yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2849
-#line 2874 "pikchr.c"
2850
- yymsp[-2].minor.yy63 = yylhsminor.yy63;
2900
+#line 744 "pikchr.y"
2901
+{yylhsminor.yy187 = pik_place_of_elem(p,yymsp[0].minor.yy54,&yymsp[-2].minor.yy0);}
2902
+#line 2902 "pikchr.c"
2903
+ yymsp[-2].minor.yy187 = yylhsminor.yy187;
28512904
break;
28522905
case 83: /* place2 ::= object */
2853
-#line 729 "pikchr.y"
2854
-{yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,0);}
2855
-#line 2880 "pikchr.c"
2856
- yymsp[0].minor.yy63 = yylhsminor.yy63;
2906
+#line 745 "pikchr.y"
2907
+{yylhsminor.yy187 = pik_place_of_elem(p,yymsp[0].minor.yy54,0);}
2908
+#line 2908 "pikchr.c"
2909
+ yymsp[0].minor.yy187 = yylhsminor.yy187;
28572910
break;
28582911
case 84: /* place2 ::= object DOT_E edge */
2859
-#line 730 "pikchr.y"
2860
-{yylhsminor.yy63 = pik_place_of_elem(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2861
-#line 2886 "pikchr.c"
2862
- yymsp[-2].minor.yy63 = yylhsminor.yy63;
2912
+#line 746 "pikchr.y"
2913
+{yylhsminor.yy187 = pik_place_of_elem(p,yymsp[-2].minor.yy54,&yymsp[0].minor.yy0);}
2914
+#line 2914 "pikchr.c"
2915
+ yymsp[-2].minor.yy187 = yylhsminor.yy187;
28632916
break;
28642917
case 85: /* place2 ::= NTH VERTEX OF object */
2865
-#line 731 "pikchr.y"
2866
-{yylhsminor.yy63 = pik_nth_vertex(p,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,yymsp[0].minor.yy162);}
2867
-#line 2892 "pikchr.c"
2868
- yymsp[-3].minor.yy63 = yylhsminor.yy63;
2918
+#line 747 "pikchr.y"
2919
+{yylhsminor.yy187 = pik_nth_vertex(p,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,yymsp[0].minor.yy54);}
2920
+#line 2920 "pikchr.c"
2921
+ yymsp[-3].minor.yy187 = yylhsminor.yy187;
28692922
break;
28702923
case 86: /* object ::= nth */
2871
-#line 743 "pikchr.y"
2872
-{yylhsminor.yy162 = pik_find_nth(p,0,&yymsp[0].minor.yy0);}
2873
-#line 2898 "pikchr.c"
2874
- yymsp[0].minor.yy162 = yylhsminor.yy162;
2924
+#line 759 "pikchr.y"
2925
+{yylhsminor.yy54 = pik_find_nth(p,0,&yymsp[0].minor.yy0);}
2926
+#line 2926 "pikchr.c"
2927
+ yymsp[0].minor.yy54 = yylhsminor.yy54;
28752928
break;
28762929
case 87: /* object ::= nth OF|IN object */
2877
-#line 744 "pikchr.y"
2878
-{yylhsminor.yy162 = pik_find_nth(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2879
-#line 2904 "pikchr.c"
2880
- yymsp[-2].minor.yy162 = yylhsminor.yy162;
2930
+#line 760 "pikchr.y"
2931
+{yylhsminor.yy54 = pik_find_nth(p,yymsp[0].minor.yy54,&yymsp[-2].minor.yy0);}
2932
+#line 2932 "pikchr.c"
2933
+ yymsp[-2].minor.yy54 = yylhsminor.yy54;
28812934
break;
28822935
case 88: /* objectname ::= THIS */
2883
-#line 746 "pikchr.y"
2884
-{yymsp[0].minor.yy162 = p->cur;}
2885
-#line 2910 "pikchr.c"
2936
+#line 762 "pikchr.y"
2937
+{yymsp[0].minor.yy54 = p->cur;}
2938
+#line 2938 "pikchr.c"
28862939
break;
28872940
case 89: /* objectname ::= PLACENAME */
2888
-#line 747 "pikchr.y"
2889
-{yylhsminor.yy162 = pik_find_byname(p,0,&yymsp[0].minor.yy0);}
2890
-#line 2915 "pikchr.c"
2891
- yymsp[0].minor.yy162 = yylhsminor.yy162;
2941
+#line 763 "pikchr.y"
2942
+{yylhsminor.yy54 = pik_find_byname(p,0,&yymsp[0].minor.yy0);}
2943
+#line 2943 "pikchr.c"
2944
+ yymsp[0].minor.yy54 = yylhsminor.yy54;
28922945
break;
28932946
case 90: /* objectname ::= objectname DOT_U PLACENAME */
2894
-#line 749 "pikchr.y"
2895
-{yylhsminor.yy162 = pik_find_byname(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2896
-#line 2921 "pikchr.c"
2897
- yymsp[-2].minor.yy162 = yylhsminor.yy162;
2947
+#line 765 "pikchr.y"
2948
+{yylhsminor.yy54 = pik_find_byname(p,yymsp[-2].minor.yy54,&yymsp[0].minor.yy0);}
2949
+#line 2949 "pikchr.c"
2950
+ yymsp[-2].minor.yy54 = yylhsminor.yy54;
28982951
break;
28992952
case 91: /* nth ::= NTH CLASSNAME */
2900
-#line 751 "pikchr.y"
2953
+#line 767 "pikchr.y"
29012954
{yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-1].minor.yy0); }
2902
-#line 2927 "pikchr.c"
2955
+#line 2955 "pikchr.c"
29032956
yymsp[-1].minor.yy0 = yylhsminor.yy0;
29042957
break;
29052958
case 92: /* nth ::= NTH LAST CLASSNAME */
2906
-#line 752 "pikchr.y"
2959
+#line 768 "pikchr.y"
29072960
{yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-2].minor.yy0); }
2908
-#line 2933 "pikchr.c"
2961
+#line 2961 "pikchr.c"
29092962
yymsp[-2].minor.yy0 = yylhsminor.yy0;
29102963
break;
29112964
case 93: /* nth ::= LAST CLASSNAME */
2912
-#line 753 "pikchr.y"
2965
+#line 769 "pikchr.y"
29132966
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.eCode = -1;}
2914
-#line 2939 "pikchr.c"
2967
+#line 2967 "pikchr.c"
29152968
break;
29162969
case 94: /* nth ::= LAST */
2917
-#line 754 "pikchr.y"
2970
+#line 770 "pikchr.y"
29182971
{yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -1;}
2919
-#line 2944 "pikchr.c"
2972
+#line 2972 "pikchr.c"
29202973
yymsp[0].minor.yy0 = yylhsminor.yy0;
29212974
break;
29222975
case 95: /* nth ::= NTH LB RB */
2923
-#line 755 "pikchr.y"
2976
+#line 771 "pikchr.y"
29242977
{yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-2].minor.yy0);}
2925
-#line 2950 "pikchr.c"
2978
+#line 2978 "pikchr.c"
29262979
yymsp[-2].minor.yy0 = yylhsminor.yy0;
29272980
break;
29282981
case 96: /* nth ::= NTH LAST LB RB */
2929
-#line 756 "pikchr.y"
2982
+#line 772 "pikchr.y"
29302983
{yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-3].minor.yy0);}
2931
-#line 2956 "pikchr.c"
2984
+#line 2984 "pikchr.c"
29322985
yymsp[-3].minor.yy0 = yylhsminor.yy0;
29332986
break;
29342987
case 97: /* nth ::= LAST LB RB */
2935
-#line 757 "pikchr.y"
2988
+#line 773 "pikchr.y"
29362989
{yymsp[-2].minor.yy0=yymsp[-1].minor.yy0; yymsp[-2].minor.yy0.eCode = -1; }
2937
-#line 2962 "pikchr.c"
2990
+#line 2990 "pikchr.c"
29382991
break;
29392992
case 98: /* expr ::= expr PLUS expr */
2940
-#line 759 "pikchr.y"
2941
-{yylhsminor.yy21=yymsp[-2].minor.yy21+yymsp[0].minor.yy21;}
2942
-#line 2967 "pikchr.c"
2943
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
2993
+#line 775 "pikchr.y"
2994
+{yylhsminor.yy129=yymsp[-2].minor.yy129+yymsp[0].minor.yy129;}
2995
+#line 2995 "pikchr.c"
2996
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
29442997
break;
29452998
case 99: /* expr ::= expr MINUS expr */
2946
-#line 760 "pikchr.y"
2947
-{yylhsminor.yy21=yymsp[-2].minor.yy21-yymsp[0].minor.yy21;}
2948
-#line 2973 "pikchr.c"
2949
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
2999
+#line 776 "pikchr.y"
3000
+{yylhsminor.yy129=yymsp[-2].minor.yy129-yymsp[0].minor.yy129;}
3001
+#line 3001 "pikchr.c"
3002
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
29503003
break;
29513004
case 100: /* expr ::= expr STAR expr */
2952
-#line 761 "pikchr.y"
2953
-{yylhsminor.yy21=yymsp[-2].minor.yy21*yymsp[0].minor.yy21;}
2954
-#line 2979 "pikchr.c"
2955
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
3005
+#line 777 "pikchr.y"
3006
+{yylhsminor.yy129=yymsp[-2].minor.yy129*yymsp[0].minor.yy129;}
3007
+#line 3007 "pikchr.c"
3008
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
29563009
break;
29573010
case 101: /* expr ::= expr SLASH expr */
2958
-#line 762 "pikchr.y"
3011
+#line 778 "pikchr.y"
29593012
{
2960
- if( yymsp[0].minor.yy21==0.0 ){ pik_error(p, &yymsp[-1].minor.yy0, "division by zero"); yylhsminor.yy21 = 0.0; }
2961
- else{ yylhsminor.yy21 = yymsp[-2].minor.yy21/yymsp[0].minor.yy21; }
3013
+ if( yymsp[0].minor.yy129==0.0 ){ pik_error(p, &yymsp[-1].minor.yy0, "division by zero"); yylhsminor.yy129 = 0.0; }
3014
+ else{ yylhsminor.yy129 = yymsp[-2].minor.yy129/yymsp[0].minor.yy129; }
29623015
}
2963
-#line 2988 "pikchr.c"
2964
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
3016
+#line 3016 "pikchr.c"
3017
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
29653018
break;
29663019
case 102: /* expr ::= MINUS expr */
2967
-#line 766 "pikchr.y"
2968
-{yymsp[-1].minor.yy21=-yymsp[0].minor.yy21;}
2969
-#line 2994 "pikchr.c"
3020
+#line 782 "pikchr.y"
3021
+{yymsp[-1].minor.yy129=-yymsp[0].minor.yy129;}
3022
+#line 3022 "pikchr.c"
29703023
break;
29713024
case 103: /* expr ::= PLUS expr */
2972
-#line 767 "pikchr.y"
2973
-{yymsp[-1].minor.yy21=yymsp[0].minor.yy21;}
2974
-#line 2999 "pikchr.c"
3025
+#line 783 "pikchr.y"
3026
+{yymsp[-1].minor.yy129=yymsp[0].minor.yy129;}
3027
+#line 3027 "pikchr.c"
29753028
break;
29763029
case 104: /* expr ::= LP expr RP */
2977
-#line 768 "pikchr.y"
2978
-{yymsp[-2].minor.yy21=yymsp[-1].minor.yy21;}
2979
-#line 3004 "pikchr.c"
3030
+#line 784 "pikchr.y"
3031
+{yymsp[-2].minor.yy129=yymsp[-1].minor.yy129;}
3032
+#line 3032 "pikchr.c"
29803033
break;
29813034
case 105: /* expr ::= LP FILL|COLOR|THICKNESS RP */
2982
-#line 769 "pikchr.y"
2983
-{yymsp[-2].minor.yy21=pik_get_var(p,&yymsp[-1].minor.yy0);}
2984
-#line 3009 "pikchr.c"
3035
+#line 785 "pikchr.y"
3036
+{yymsp[-2].minor.yy129=pik_get_var(p,&yymsp[-1].minor.yy0);}
3037
+#line 3037 "pikchr.c"
29853038
break;
29863039
case 106: /* expr ::= NUMBER */
2987
-#line 770 "pikchr.y"
2988
-{yylhsminor.yy21=pik_atof(&yymsp[0].minor.yy0);}
2989
-#line 3014 "pikchr.c"
2990
- yymsp[0].minor.yy21 = yylhsminor.yy21;
3040
+#line 786 "pikchr.y"
3041
+{yylhsminor.yy129=pik_atof(&yymsp[0].minor.yy0);}
3042
+#line 3042 "pikchr.c"
3043
+ yymsp[0].minor.yy129 = yylhsminor.yy129;
29913044
break;
29923045
case 107: /* expr ::= ID */
2993
-#line 771 "pikchr.y"
2994
-{yylhsminor.yy21=pik_get_var(p,&yymsp[0].minor.yy0);}
2995
-#line 3020 "pikchr.c"
2996
- yymsp[0].minor.yy21 = yylhsminor.yy21;
3046
+#line 787 "pikchr.y"
3047
+{yylhsminor.yy129=pik_get_var(p,&yymsp[0].minor.yy0);}
3048
+#line 3048 "pikchr.c"
3049
+ yymsp[0].minor.yy129 = yylhsminor.yy129;
29973050
break;
29983051
case 108: /* expr ::= FUNC1 LP expr RP */
2999
-#line 772 "pikchr.y"
3000
-{yylhsminor.yy21 = pik_func(p,&yymsp[-3].minor.yy0,yymsp[-1].minor.yy21,0.0);}
3001
-#line 3026 "pikchr.c"
3002
- yymsp[-3].minor.yy21 = yylhsminor.yy21;
3052
+#line 788 "pikchr.y"
3053
+{yylhsminor.yy129 = pik_func(p,&yymsp[-3].minor.yy0,yymsp[-1].minor.yy129,0.0);}
3054
+#line 3054 "pikchr.c"
3055
+ yymsp[-3].minor.yy129 = yylhsminor.yy129;
30033056
break;
30043057
case 109: /* expr ::= FUNC2 LP expr COMMA expr RP */
3005
-#line 773 "pikchr.y"
3006
-{yylhsminor.yy21 = pik_func(p,&yymsp[-5].minor.yy0,yymsp[-3].minor.yy21,yymsp[-1].minor.yy21);}
3007
-#line 3032 "pikchr.c"
3008
- yymsp[-5].minor.yy21 = yylhsminor.yy21;
3058
+#line 789 "pikchr.y"
3059
+{yylhsminor.yy129 = pik_func(p,&yymsp[-5].minor.yy0,yymsp[-3].minor.yy129,yymsp[-1].minor.yy129);}
3060
+#line 3060 "pikchr.c"
3061
+ yymsp[-5].minor.yy129 = yylhsminor.yy129;
30093062
break;
30103063
case 110: /* expr ::= DIST LP position COMMA position RP */
3011
-#line 774 "pikchr.y"
3012
-{yymsp[-5].minor.yy21 = pik_dist(&yymsp[-3].minor.yy63,&yymsp[-1].minor.yy63);}
3013
-#line 3038 "pikchr.c"
3064
+#line 790 "pikchr.y"
3065
+{yymsp[-5].minor.yy129 = pik_dist(&yymsp[-3].minor.yy187,&yymsp[-1].minor.yy187);}
3066
+#line 3066 "pikchr.c"
30143067
break;
30153068
case 111: /* expr ::= place2 DOT_XY X */
3016
-#line 775 "pikchr.y"
3017
-{yylhsminor.yy21 = yymsp[-2].minor.yy63.x;}
3018
-#line 3043 "pikchr.c"
3019
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
3069
+#line 791 "pikchr.y"
3070
+{yylhsminor.yy129 = yymsp[-2].minor.yy187.x;}
3071
+#line 3071 "pikchr.c"
3072
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
30203073
break;
30213074
case 112: /* expr ::= place2 DOT_XY Y */
3022
-#line 776 "pikchr.y"
3023
-{yylhsminor.yy21 = yymsp[-2].minor.yy63.y;}
3024
-#line 3049 "pikchr.c"
3025
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
3075
+#line 792 "pikchr.y"
3076
+{yylhsminor.yy129 = yymsp[-2].minor.yy187.y;}
3077
+#line 3077 "pikchr.c"
3078
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
30263079
break;
30273080
case 113: /* expr ::= object DOT_L numproperty */
30283081
case 114: /* expr ::= object DOT_L dashproperty */ yytestcase(yyruleno==114);
30293082
case 115: /* expr ::= object DOT_L colorproperty */ yytestcase(yyruleno==115);
3030
-#line 777 "pikchr.y"
3031
-{yylhsminor.yy21=pik_property_of(yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
3032
-#line 3057 "pikchr.c"
3033
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
3083
+#line 793 "pikchr.y"
3084
+{yylhsminor.yy129=pik_property_of(yymsp[-2].minor.yy54,&yymsp[0].minor.yy0);}
3085
+#line 3085 "pikchr.c"
3086
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
30343087
break;
30353088
default:
30363089
/* (116) lvalue ::= ID */ yytestcase(yyruleno==116);
30373090
/* (117) lvalue ::= FILL */ yytestcase(yyruleno==117);
30383091
/* (118) lvalue ::= COLOR */ yytestcase(yyruleno==118);
@@ -3130,19 +3183,19 @@
31303183
){
31313184
pik_parserARG_FETCH
31323185
pik_parserCTX_FETCH
31333186
#define TOKEN yyminor
31343187
/************ Begin %syntax_error code ****************************************/
3135
-#line 537 "pikchr.y"
3188
+#line 551 "pikchr.y"
31363189
31373190
if( TOKEN.z && TOKEN.z[0] ){
31383191
pik_error(p, &TOKEN, "syntax error");
31393192
}else{
31403193
pik_error(p, 0, "syntax error");
31413194
}
31423195
UNUSED_PARAMETER(yymajor);
3143
-#line 3168 "pikchr.c"
3196
+#line 3196 "pikchr.c"
31443197
/************ End %syntax_error code ******************************************/
31453198
pik_parserARG_STORE /* Suppress warning about unused %extra_argument variable */
31463199
pik_parserCTX_STORE
31473200
}
31483201
@@ -3407,11 +3460,11 @@
34073460
#else
34083461
(void)iToken;
34093462
return 0;
34103463
#endif
34113464
}
3412
-#line 782 "pikchr.y"
3465
+#line 798 "pikchr.y"
34133466
34143467
34153468
34163469
/* Chart of the 148 official CSS color names with their
34173470
** corresponding RGB values thru Color Module Level 4:
@@ -3634,42 +3687,57 @@
36343687
** than true arcs. Multiple reasons: (1) the legacy-PIC parameters
36353688
** that control arcs are obscure and I could not figure out what they
36363689
** mean based on available documentation. (2) Arcs are rarely used,
36373690
** and so do not seem that important.
36383691
*/
3639
-static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale){
3692
+static PPoint arcControlPoint(int cw, PPoint f, PPoint t){
36403693
PPoint m;
36413694
PNum dx, dy;
36423695
m.x = 0.5*(f.x+t.x);
36433696
m.y = 0.5*(f.y+t.y);
36443697
dx = t.x - f.x;
36453698
dy = t.y - f.y;
36463699
if( cw ){
3647
- m.x -= 0.5*rScale*dy;
3648
- m.y += 0.5*rScale*dx;
3700
+ m.x -= 0.5*dy;
3701
+ m.y += 0.5*dx;
36493702
}else{
3650
- m.x += 0.5*rScale*dy;
3651
- m.y -= 0.5*rScale*dx;
3703
+ m.x += 0.5*dy;
3704
+ m.y -= 0.5*dx;
36523705
}
36533706
return m;
36543707
}
36553708
static void arcCheck(Pik *p, PObj *pObj){
3656
- PPoint m;
3709
+ PPoint f, m, t;
3710
+ PNum sw;
3711
+ int i;
36573712
if( p->nTPath>2 ){
36583713
pik_error(p, &pObj->errTok, "arc geometry error");
36593714
return;
36603715
}
3661
- m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5);
3662
- pik_bbox_add_xy(&pObj->bbox, m.x, m.y);
3716
+ f = p->aTPath[0];
3717
+ t = p->aTPath[1];
3718
+ m = arcControlPoint(pObj->cw, f, t);
3719
+ sw = pObj->sw;
3720
+ for(i=1; i<16; i++){
3721
+ PNum t1, t2, a, b, c, x, y;
3722
+ t1 = 0.0625*i;
3723
+ t2 = 1.0 - t1;
3724
+ a = t2*t2;
3725
+ b = 2*t1*t2;
3726
+ c = t1*t1;
3727
+ x = a*f.x + b*m.x + c*t.x;
3728
+ y = a*f.y + b*m.y + c*t.y;
3729
+ pik_bbox_addellipse(&pObj->bbox, x, y, sw, sw);
3730
+ }
36633731
}
36643732
static void arcRender(Pik *p, PObj *pObj){
36653733
PPoint f, m, t;
36663734
if( pObj->nPath<2 ) return;
36673735
if( pObj->sw<0.0 ) return;
36683736
f = pObj->aPath[0];
36693737
t = pObj->aPath[1];
3670
- m = arcControlPoint(pObj->cw,f,t,1.0);
3738
+ m = arcControlPoint(pObj->cw,f,t);
36713739
if( pObj->larrow ){
36723740
pik_draw_arrowhead(p,&m,&f,pObj);
36733741
}
36743742
if( pObj->rarrow ){
36753743
pik_draw_arrowhead(p,&m,&t,pObj);
@@ -4338,11 +4406,11 @@
43384406
static PPoint textOffset(Pik *p, PObj *pObj, int cp){
43394407
/* Automatically slim-down the width and height of text
43404408
** statements so that the bounding box tightly encloses the text,
43414409
** then get boxOffset() to do the offset computation.
43424410
*/
4343
- pik_size_to_fit(p, &pObj->errTok,3);
4411
+ pik_size_to_fit(p, pObj, &pObj->errTok,3);
43444412
return boxOffset(p, pObj, cp);
43454413
}
43464414
static void textRender(Pik *p, PObj *pObj){
43474415
pik_append_txt(p, pObj, 0);
43484416
}
@@ -6347,16 +6415,15 @@
63476415
**
63486416
** 1: Fit horizontally only
63496417
** 2: Fit vertically only
63506418
** 3: Fit both ways
63516419
*/
6352
-static void pik_size_to_fit(Pik *p, PToken *pFit, int eWhich){
6353
- PObj *pObj;
6420
+static void pik_size_to_fit(Pik *p, PObj *pObj, PToken *pFit, int eWhich){
63546421
PNum w, h;
63556422
PBox bbox;
63566423
if( p->nErr ) return;
6357
- pObj = p->cur;
6424
+ if( pObj==0 ) pObj = p->cur;
63586425
63596426
if( pObj->nTxt==0 ){
63606427
pik_error(0, pFit, "no text to fit to");
63616428
return;
63626429
}
@@ -6495,13 +6562,13 @@
64956562
unsigned int i;
64966563
mid = (first+last)/2;
64976564
zClr = aColor[mid].zName;
64986565
for(i=0; i<pId->n; i++){
64996566
c1 = zClr[i]&0x7f;
6500
- if( isupper(c1) ) c1 = tolower(c1);
6567
+ if( IsUpper(c1) ) c1 = ToLower(c1);
65016568
c2 = pId->z[i]&0x7f;
6502
- if( isupper(c2) ) c2 = tolower(c2);
6569
+ if( IsUpper(c2) ) c2 = ToLower(c2);
65036570
c = c2 - c1;
65046571
if( c ) break;
65056572
}
65066573
if( c==0 && aColor[mid].zName[pId->n] ) c = -1;
65076574
if( c==0 ) return (double)aColor[mid].val;
@@ -6896,20 +6963,20 @@
68966963
*/
68976964
if( pObj->h<=0.0 ){
68986965
if( pObj->nTxt==0 ){
68996966
pObj->h = 0.0;
69006967
}else if( pObj->w<=0.0 ){
6901
- pik_size_to_fit(p, &pObj->errTok, 3);
6968
+ pik_size_to_fit(p, pObj, &pObj->errTok, 3);
69026969
}else{
6903
- pik_size_to_fit(p, &pObj->errTok, 2);
6970
+ pik_size_to_fit(p, pObj, &pObj->errTok, 2);
69046971
}
69056972
}
69066973
if( pObj->w<=0.0 ){
69076974
if( pObj->nTxt==0 ){
69086975
pObj->w = 0.0;
69096976
}else{
6910
- pik_size_to_fit(p, &pObj->errTok, 1);
6977
+ pik_size_to_fit(p, pObj, &pObj->errTok, 1);
69116978
}
69126979
}
69136980
ofst = pik_elem_offset(p, pObj, pObj->eWith);
69146981
dx = (pObj->with.x - ofst.x) - pObj->ptAt.x;
69156982
dy = (pObj->with.y - ofst.y) - pObj->ptAt.y;
@@ -7235,11 +7302,12 @@
72357302
pik_append_num(p, " width=\"", p->wSVG);
72367303
pik_append_num(p, "\" height=\"", p->hSVG);
72377304
pik_append(p, "\"", 1);
72387305
}
72397306
pik_append_dis(p, " viewBox=\"0 0 ",w,"");
7240
- pik_append_dis(p, " ",h,"\">\n");
7307
+ pik_append_dis(p, " ",h,"\"");
7308
+ pik_append(p, " data-pikchr-date=\"" MANIFEST_ISODATE "\">\n", -1);
72417309
pik_elist_render(p, pList);
72427310
pik_append(p,"</svg>\n", -1);
72437311
}else{
72447312
p->wSVG = -1;
72457313
p->hSVG = -1;
@@ -7319,10 +7387,11 @@
73197387
{ "n", 1, T_EDGEPT, 0, CP_N },
73207388
{ "ne", 2, T_EDGEPT, 0, CP_NE },
73217389
{ "north", 5, T_EDGEPT, 0, CP_N },
73227390
{ "nw", 2, T_EDGEPT, 0, CP_NW },
73237391
{ "of", 2, T_OF, 0, 0 },
7392
+ { "pikchr_date",11, T_ISODATE, 0, 0, },
73247393
{ "previous", 8, T_LAST, 0, 0, },
73257394
{ "print", 5, T_PRINT, 0, 0 },
73267395
{ "rad", 3, T_RADIUS, 0, 0 },
73277396
{ "radius", 6, T_RADIUS, 0, 0 },
73287397
{ "right", 5, T_RIGHT, DIR_RIGHT, CP_E },
@@ -7605,11 +7674,11 @@
76057674
}
76067675
default: {
76077676
c = z[0];
76087677
if( c=='.' ){
76097678
unsigned char c1 = z[1];
7610
- if( islower(c1) ){
7679
+ if( IsLower(c1) ){
76117680
const PikWord *pFound;
76127681
for(i=2; (c = z[i])>='a' && c<='z'; i++){}
76137682
pFound = pik_find_word((const char*)z+1, i-1,
76147683
pik_keywords, count(pik_keywords));
76157684
if( pFound && (pFound->eEdge>0 ||
@@ -7625,15 +7694,15 @@
76257694
}else{
76267695
/* Any other "dot" */
76277696
pToken->eType = T_DOT_L;
76287697
}
76297698
return 1;
7630
- }else if( isdigit(c1) ){
7699
+ }else if( IsDigit(c1) ){
76317700
i = 0;
76327701
/* no-op. Fall through to number handling */
7633
- }else if( isupper(c1) ){
7634
- for(i=2; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7702
+ }else if( IsUpper(c1) ){
7703
+ for(i=2; (c = z[i])!=0 && (IsAlnum(c) || c=='_'); i++){}
76357704
pToken->eType = T_DOT_U;
76367705
return 1;
76377706
}else{
76387707
pToken->eType = T_ERROR;
76397708
return 1;
@@ -7644,11 +7713,11 @@
76447713
int isInt = 1;
76457714
if( c!='.' ){
76467715
nDigit = 1;
76477716
for(i=1; (c = z[i])>='0' && c<='9'; i++){ nDigit++; }
76487717
if( i==1 && (c=='x' || c=='X') ){
7649
- for(i=2; (c = z[i])!=0 && isxdigit(c); i++){}
7718
+ for(i=2; (c = z[i])!=0 && IsXDigit(c); i++){}
76507719
pToken->eType = T_NUMBER;
76517720
return i;
76527721
}
76537722
}else{
76547723
isInt = 0;
@@ -7700,13 +7769,13 @@
77007769
){
77017770
i += 2;
77027771
}
77037772
pToken->eType = T_NUMBER;
77047773
return i;
7705
- }else if( islower(c) ){
7774
+ }else if( IsLower(c) ){
77067775
const PikWord *pFound;
7707
- for(i=1; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7776
+ for(i=1; (c = z[i])!=0 && (IsAlnum(c) || c=='_'); i++){}
77087777
pFound = pik_find_word((const char*)z, i,
77097778
pik_keywords, count(pik_keywords));
77107779
if( pFound ){
77117780
pToken->eType = pFound->eType;
77127781
pToken->eCode = pFound->eCode;
@@ -7719,19 +7788,19 @@
77197788
}else{
77207789
pToken->eType = T_ID;
77217790
}
77227791
return i;
77237792
}else if( c>='A' && c<='Z' ){
7724
- for(i=1; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7793
+ for(i=1; (c = z[i])!=0 && (IsAlnum(c) || c=='_'); i++){}
77257794
pToken->eType = T_PLACENAME;
77267795
return i;
7727
- }else if( c=='$' && z[1]>='1' && z[1]<='9' && !isdigit(z[2]) ){
7796
+ }else if( c=='$' && z[1]>='1' && z[1]<='9' && !IsDigit(z[2]) ){
77287797
pToken->eType = T_PARAMETER;
77297798
pToken->eCode = z[1] - '1';
77307799
return 2;
77317800
}else if( c=='_' || c=='$' || c=='@' ){
7732
- for(i=1; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7801
+ for(i=1; (c = z[i])!=0 && (IsAlnum(c) || c=='_'); i++){}
77337802
pToken->eType = T_ID;
77347803
return i;
77357804
}else{
77367805
pToken->eType = T_ERROR;
77377806
return 1;
@@ -7814,12 +7883,12 @@
78147883
/* Remove leading and trailing whitespace from each argument.
78157884
** If what remains is one of $1, $2, ... $9 then transfer the
78167885
** corresponding argument from the outer context */
78177886
for(j=0; j<=nArg; j++){
78187887
PToken *t = &args[j];
7819
- while( t->n>0 && isspace(t->z[0]) ){ t->n--; t->z++; }
7820
- while( t->n>0 && isspace(t->z[t->n-1]) ){ t->n--; }
7888
+ while( t->n>0 && IsSpace(t->z[0]) ){ t->n--; t->z++; }
7889
+ while( t->n>0 && IsSpace(t->z[t->n-1]) ){ t->n--; }
78217890
if( t->n==2 && t->z[0]=='$' && t->z[1]>='1' && t->z[1]<='9' ){
78227891
if( pOuter ) *t = pOuter[t->z[1]-'1'];
78237892
else t->n = 0;
78247893
}
78257894
}
@@ -7896,21 +7965,36 @@
78967965
pMac->inUse = 0;
78977966
}else{
78987967
#if 0
78997968
printf("******** Token %s (%d): \"%.*s\" **************\n",
79007969
yyTokenName[token.eType], token.eType,
7901
- (int)(isspace(token.z[0]) ? 0 : sz), token.z);
7970
+ (int)(IsSpace(token.z[0]) ? 0 : sz), token.z);
79027971
#endif
79037972
token.n = (unsigned short)(sz & 0xffff);
79047973
if( p->nToken++ > PIKCHR_TOKEN_LIMIT ){
79057974
pik_error(p, &token, "script is too complex");
79067975
break;
7976
+ }
7977
+ if( token.eType==T_ISODATE ){
7978
+ token.z = "\"" MANIFEST_ISODATE "\"";
7979
+ token.n = sizeof(MANIFEST_ISODATE)+1;
7980
+ token.eType = T_STRING;
79077981
}
79087982
pik_parser(pParser, token.eType, token);
79097983
}
79107984
}
79117985
}
7986
+
7987
+/*
7988
+** Return the version name.
7989
+*/
7990
+const char *pikchr_version(void)
7991
+ /* Emscripten workaround, else it chokes on the inlined version */;
7992
+
7993
+const char *pikchr_version(void){
7994
+ return RELEASE_VERSION " " MANIFEST_ISODATE;
7995
+}
79127996
79137997
/*
79147998
** Parse the PIKCHR script contained in zText[]. Return a rendering. Or
79157999
** if an error is encountered, return the error text. The error message
79168000
** is HTML formatted. So regardless of what happens, the return text
@@ -8130,10 +8214,14 @@
81308214
exit(1);
81318215
}
81328216
bSvgOnly = 1;
81338217
mFlags |= PIKCHR_PLAINTEXT_ERRORS;
81348218
}else
8219
+ if( strcmp(z,"version")==0 || strcmp(z,"v")==0 ){
8220
+ printf("pikchr %s\n", pikchr_version());
8221
+ return 0;
8222
+ }else
81358223
{
81368224
fprintf(stderr,"unknown option: \"%s\"\n", argv[i]);
81378225
usage(argv[0]);
81388226
}
81398227
continue;
@@ -8242,6 +8330,6 @@
82428330
82438331
82448332
#endif /* PIKCHR_TCL */
82458333
82468334
8247
-#line 8272 "pikchr.c"
8335
+#line 8335 "pikchr.c"
82488336
--- extsrc/pikchr.c
+++ extsrc/pikchr.c
@@ -1,8 +1,47 @@
1 /* This file is automatically generated by Lemon from input grammar
2 ** source file "pikchr.y".
3 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4 /*
5 ** Zero-Clause BSD license:
6 **
7 ** Copyright (C) 2020-09-01 by D. Richard Hipp <[email protected]>
8 **
@@ -125,10 +164,22 @@
125 #include <assert.h>
126 #define count(X) (sizeof(X)/sizeof(X[0]))
127 #ifndef M_PI
128 # define M_PI 3.1415926535897932385
129 #endif
 
 
 
 
 
 
 
 
 
 
 
 
130
131 /* Limit the number of tokens in a single script to avoid run-away
132 ** macro expansion attacks. See forum post
133 ** https://pikchr.org/home/forumpost/ef8684c6955a411a
134 */
@@ -474,11 +525,11 @@
474 static void pik_bbox_addbox(PBox*,PBox*);
475 static void pik_bbox_add_xy(PBox*,PNum,PNum);
476 static void pik_bbox_addellipse(PBox*,PNum x,PNum y,PNum rx,PNum ry);
477 static void pik_add_txt(Pik*,PToken*,int);
478 static int pik_text_length(const PToken *pToken, const int isMonospace);
479 static void pik_size_to_fit(Pik*,PToken*,int);
480 static int pik_text_position(int,PToken*);
481 static PNum pik_property_of(PObj*,PToken*);
482 static PNum pik_func(Pik*,PToken*,PNum,PNum);
483 static PPoint pik_position_between(PNum x, PPoint p1, PPoint p2);
484 static PPoint pik_position_at_angle(PNum dist, PNum r, PPoint pt);
@@ -492,11 +543,11 @@
492 static PObj *pik_position_assert(Pik*,PPoint*,PToken*,PPoint*);
493 static PNum pik_dist(PPoint*,PPoint*);
494 static void pik_add_macro(Pik*,PToken *pId,PToken *pCode);
495
496
497 #line 523 "pikchr.c"
498 /**************** End of %include directives **********************************/
499 /* These constants specify the various numeric values for terminal symbols.
500 ***************** Begin token definitions *************************************/
501 #ifndef T_ID
502 #define T_ID 1
@@ -522,84 +573,85 @@
522 #define T_COLOR 21
523 #define T_THICKNESS 22
524 #define T_PRINT 23
525 #define T_STRING 24
526 #define T_COMMA 25
527 #define T_CLASSNAME 26
528 #define T_LB 27
529 #define T_RB 28
530 #define T_UP 29
531 #define T_DOWN 30
532 #define T_LEFT 31
533 #define T_RIGHT 32
534 #define T_CLOSE 33
535 #define T_CHOP 34
536 #define T_FROM 35
537 #define T_TO 36
538 #define T_THEN 37
539 #define T_HEADING 38
540 #define T_GO 39
541 #define T_AT 40
542 #define T_WITH 41
543 #define T_SAME 42
544 #define T_AS 43
545 #define T_FIT 44
546 #define T_BEHIND 45
547 #define T_UNTIL 46
548 #define T_EVEN 47
549 #define T_DOT_E 48
550 #define T_HEIGHT 49
551 #define T_WIDTH 50
552 #define T_RADIUS 51
553 #define T_DIAMETER 52
554 #define T_DOTTED 53
555 #define T_DASHED 54
556 #define T_CW 55
557 #define T_CCW 56
558 #define T_LARROW 57
559 #define T_RARROW 58
560 #define T_LRARROW 59
561 #define T_INVIS 60
562 #define T_THICK 61
563 #define T_THIN 62
564 #define T_SOLID 63
565 #define T_CENTER 64
566 #define T_LJUST 65
567 #define T_RJUST 66
568 #define T_ABOVE 67
569 #define T_BELOW 68
570 #define T_ITALIC 69
571 #define T_BOLD 70
572 #define T_MONO 71
573 #define T_ALIGNED 72
574 #define T_BIG 73
575 #define T_SMALL 74
576 #define T_AND 75
577 #define T_LT 76
578 #define T_GT 77
579 #define T_ON 78
580 #define T_WAY 79
581 #define T_BETWEEN 80
582 #define T_THE 81
583 #define T_NTH 82
584 #define T_VERTEX 83
585 #define T_TOP 84
586 #define T_BOTTOM 85
587 #define T_START 86
588 #define T_END 87
589 #define T_IN 88
590 #define T_THIS 89
591 #define T_DOT_U 90
592 #define T_LAST 91
593 #define T_NUMBER 92
594 #define T_FUNC1 93
595 #define T_FUNC2 94
596 #define T_DIST 95
597 #define T_DOT_XY 96
598 #define T_X 97
599 #define T_Y 98
600 #define T_DOT_L 99
 
601 #endif
602 /**************** End token definitions ***************************************/
603
604 /* The next sections is a series of control #defines.
605 ** various aspects of the generated parser.
@@ -660,22 +712,22 @@
660 #ifndef INTERFACE
661 # define INTERFACE 1
662 #endif
663 /************* Begin control #defines *****************************************/
664 #define YYCODETYPE unsigned char
665 #define YYNOCODE 136
666 #define YYACTIONTYPE unsigned short int
667 #define pik_parserTOKENTYPE PToken
668 typedef union {
669 int yyinit;
670 pik_parserTOKENTYPE yy0;
671 PNum yy21;
672 PPoint yy63;
673 PRel yy72;
674 PObj* yy162;
675 short int yy188;
676 PList* yy235;
677 } YYMINORTYPE;
678 #ifndef YYSTACKDEPTH
679 #define YYSTACKDEPTH 100
680 #endif
681 #define pik_parserARG_SDECL
@@ -693,21 +745,21 @@
693 #define pik_parserCTX_STORE yypParser->p=p;
694 #define YYFALLBACK 1
695 #define YYNSTATE 164
696 #define YYNRULE 156
697 #define YYNRULE_WITH_ACTION 116
698 #define YYNTOKEN 100
699 #define YY_MAX_SHIFT 163
700 #define YY_MIN_SHIFTREDUCE 287
701 #define YY_MAX_SHIFTREDUCE 442
702 #define YY_ERROR_ACTION 443
703 #define YY_ACCEPT_ACTION 444
704 #define YY_NO_ACTION 445
705 #define YY_MIN_REDUCE 446
706 #define YY_MAX_REDUCE 601
707 #define YY_MIN_DSTRCTR 100
708 #define YY_MAX_DSTRCTR 103
709 /************* End control #defines *******************************************/
710 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
711
712 /* Define the yytestcase() macro to be a no-op if is not already defined
713 ** otherwise.
@@ -786,324 +838,322 @@
786 ** yy_reduce_ofst[] For each state, the offset into yy_action for
787 ** shifting non-terminals after a reduce.
788 ** yy_default[] Default action for each state.
789 **
790 *********** Begin parsing tables **********************************************/
791 #define YY_ACTTAB_COUNT (1313)
792 static const YYACTIONTYPE yy_action[] = {
793 /* 0 */ 575, 495, 161, 119, 25, 452, 29, 74, 129, 148,
794 /* 10 */ 575, 492, 161, 119, 453, 113, 120, 161, 119, 530,
795 /* 20 */ 427, 428, 339, 559, 81, 30, 560, 561, 575, 64,
796 /* 30 */ 63, 62, 61, 322, 323, 9, 8, 33, 149, 32,
797 /* 40 */ 7, 71, 127, 38, 335, 66, 48, 37, 28, 339,
798 /* 50 */ 339, 339, 339, 425, 426, 340, 341, 342, 343, 344,
799 /* 60 */ 345, 346, 347, 348, 474, 528, 161, 119, 577, 77,
800 /* 70 */ 577, 73, 306, 148, 474, 533, 161, 119, 112, 113,
801 /* 80 */ 120, 161, 119, 128, 427, 428, 339, 31, 81, 531,
802 /* 90 */ 161, 119, 474, 35, 330, 378, 158, 322, 323, 9,
803 /* 100 */ 8, 33, 149, 32, 7, 71, 127, 328, 335, 66,
804 /* 110 */ 579, 378, 158, 339, 339, 339, 339, 425, 426, 340,
805 /* 120 */ 341, 342, 343, 344, 345, 346, 347, 348, 394, 435,
806 /* 130 */ 46, 59, 60, 64, 63, 62, 61, 357, 36, 376,
807 /* 140 */ 54, 51, 2, 47, 403, 13, 297, 411, 412, 413,
808 /* 150 */ 414, 80, 162, 308, 79, 133, 310, 126, 441, 440,
809 /* 160 */ 118, 123, 83, 404, 405, 406, 408, 80, 84, 308,
810 /* 170 */ 79, 299, 411, 412, 413, 414, 118, 69, 350, 350,
811 /* 180 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 62,
812 /* 190 */ 61, 434, 64, 63, 62, 61, 313, 398, 399, 427,
813 /* 200 */ 428, 339, 380, 157, 64, 63, 62, 61, 122, 106,
814 /* 210 */ 535, 436, 437, 438, 439, 298, 375, 391, 117, 393,
815 /* 220 */ 155, 154, 153, 394, 435, 49, 59, 60, 339, 339,
816 /* 230 */ 339, 339, 425, 426, 376, 3, 4, 2, 64, 63,
817 /* 240 */ 62, 61, 156, 156, 156, 394, 379, 159, 59, 60,
818 /* 250 */ 76, 67, 535, 441, 440, 5, 102, 6, 535, 42,
819 /* 260 */ 131, 535, 69, 107, 301, 302, 303, 394, 305, 15,
820 /* 270 */ 59, 60, 120, 161, 119, 446, 463, 424, 376, 423,
821 /* 280 */ 1, 42, 397, 78, 78, 36, 434, 11, 394, 435,
822 /* 290 */ 356, 59, 60, 12, 152, 139, 432, 14, 16, 376,
823 /* 300 */ 18, 65, 2, 138, 106, 430, 436, 437, 438, 439,
824 /* 310 */ 44, 375, 19, 117, 393, 155, 154, 153, 441, 440,
825 /* 320 */ 142, 140, 64, 63, 62, 61, 106, 20, 68, 376,
826 /* 330 */ 359, 107, 23, 375, 45, 117, 393, 155, 154, 153,
827 /* 340 */ 120, 161, 119, 55, 463, 114, 26, 57, 106, 147,
828 /* 350 */ 146, 434, 569, 58, 392, 375, 43, 117, 393, 155,
829 /* 360 */ 154, 153, 152, 384, 64, 63, 62, 61, 382, 106,
830 /* 370 */ 383, 436, 437, 438, 439, 377, 375, 70, 117, 393,
831 /* 380 */ 155, 154, 153, 160, 39, 22, 21, 445, 142, 140,
832 /* 390 */ 64, 63, 62, 61, 24, 17, 145, 141, 431, 108,
833 /* 400 */ 445, 445, 445, 391, 445, 445, 375, 445, 117, 445,
834 /* 410 */ 445, 55, 74, 445, 148, 445, 445, 147, 146, 124,
835 /* 420 */ 113, 120, 161, 119, 43, 445, 445, 142, 140, 64,
836 /* 430 */ 63, 62, 61, 445, 394, 445, 445, 59, 60, 64,
837 /* 440 */ 63, 62, 61, 149, 445, 376, 445, 445, 42, 445,
838 /* 450 */ 55, 445, 391, 22, 21, 445, 147, 146, 445, 445,
839 /* 460 */ 52, 445, 24, 43, 145, 141, 431, 394, 445, 445,
840 /* 470 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 132,
841 /* 480 */ 130, 42, 445, 445, 445, 355, 156, 156, 156, 445,
842 /* 490 */ 445, 445, 22, 21, 445, 394, 473, 445, 59, 60,
843 /* 500 */ 445, 24, 445, 145, 141, 431, 376, 445, 107, 42,
844 /* 510 */ 64, 63, 62, 61, 445, 106, 445, 120, 161, 119,
845 /* 520 */ 445, 478, 375, 354, 117, 393, 155, 154, 153, 445,
846 /* 530 */ 394, 143, 473, 59, 60, 64, 63, 62, 61, 152,
847 /* 540 */ 445, 376, 445, 445, 42, 445, 445, 445, 106, 64,
848 /* 550 */ 63, 62, 61, 445, 445, 375, 50, 117, 393, 155,
849 /* 560 */ 154, 153, 445, 394, 144, 445, 59, 60, 445, 445,
850 /* 570 */ 53, 72, 445, 148, 376, 445, 106, 42, 125, 113,
851 /* 580 */ 120, 161, 119, 375, 445, 117, 393, 155, 154, 153,
852 /* 590 */ 394, 445, 445, 59, 60, 445, 445, 445, 445, 445,
853 /* 600 */ 445, 102, 149, 445, 42, 445, 74, 445, 148, 445,
854 /* 610 */ 445, 106, 445, 497, 113, 120, 161, 119, 375, 445,
855 /* 620 */ 117, 393, 155, 154, 153, 394, 445, 445, 59, 60,
856 /* 630 */ 445, 445, 88, 445, 445, 445, 376, 149, 445, 40,
857 /* 640 */ 445, 120, 161, 119, 106, 445, 445, 435, 110, 110,
858 /* 650 */ 445, 375, 445, 117, 393, 155, 154, 153, 394, 445,
859 /* 660 */ 445, 59, 60, 152, 85, 445, 445, 445, 445, 376,
860 /* 670 */ 445, 106, 41, 120, 161, 119, 441, 440, 375, 445,
861 /* 680 */ 117, 393, 155, 154, 153, 448, 454, 29, 445, 445,
862 /* 690 */ 74, 450, 148, 75, 88, 152, 445, 496, 113, 120,
863 /* 700 */ 161, 119, 163, 120, 161, 119, 106, 27, 445, 434,
864 /* 710 */ 111, 111, 445, 375, 445, 117, 393, 155, 154, 153,
865 /* 720 */ 445, 149, 445, 445, 445, 152, 74, 445, 148, 436,
866 /* 730 */ 437, 438, 439, 490, 113, 120, 161, 119, 445, 106,
867 /* 740 */ 121, 447, 454, 29, 445, 445, 375, 450, 117, 393,
868 /* 750 */ 155, 154, 153, 445, 445, 445, 445, 149, 163, 74,
869 /* 760 */ 445, 148, 444, 27, 445, 445, 484, 113, 120, 161,
870 /* 770 */ 119, 445, 445, 445, 74, 445, 148, 445, 445, 445,
871 /* 780 */ 445, 483, 113, 120, 161, 119, 74, 445, 148, 86,
872 /* 790 */ 149, 445, 445, 480, 113, 120, 161, 119, 120, 161,
873 /* 800 */ 119, 445, 74, 445, 148, 149, 445, 445, 445, 134,
874 /* 810 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
875 /* 820 */ 152, 517, 113, 120, 161, 119, 88, 64, 63, 62,
876 /* 830 */ 61, 445, 445, 149, 445, 120, 161, 119, 445, 74,
877 /* 840 */ 396, 148, 475, 445, 445, 149, 137, 113, 120, 161,
878 /* 850 */ 119, 74, 445, 148, 445, 445, 445, 152, 525, 113,
879 /* 860 */ 120, 161, 119, 445, 74, 445, 148, 445, 445, 445,
880 /* 870 */ 149, 527, 113, 120, 161, 119, 445, 445, 445, 74,
881 /* 880 */ 445, 148, 149, 445, 445, 445, 524, 113, 120, 161,
882 /* 890 */ 119, 74, 445, 148, 98, 149, 445, 445, 526, 113,
883 /* 900 */ 120, 161, 119, 120, 161, 119, 445, 74, 445, 148,
884 /* 910 */ 149, 445, 445, 445, 523, 113, 120, 161, 119, 74,
885 /* 920 */ 445, 148, 149, 445, 445, 152, 522, 113, 120, 161,
886 /* 930 */ 119, 89, 64, 63, 62, 61, 445, 445, 149, 445,
887 /* 940 */ 120, 161, 119, 445, 74, 395, 148, 445, 445, 445,
888 /* 950 */ 149, 521, 113, 120, 161, 119, 74, 445, 148, 445,
889 /* 960 */ 445, 445, 152, 520, 113, 120, 161, 119, 445, 74,
890 /* 970 */ 445, 148, 445, 445, 445, 149, 519, 113, 120, 161,
891 /* 980 */ 119, 445, 445, 445, 74, 445, 148, 149, 445, 445,
892 /* 990 */ 445, 150, 113, 120, 161, 119, 74, 445, 148, 90,
893 /* 1000 */ 149, 445, 445, 151, 113, 120, 161, 119, 120, 161,
894 /* 1010 */ 119, 445, 74, 445, 148, 149, 445, 435, 445, 136,
895 /* 1020 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
896 /* 1030 */ 152, 135, 113, 120, 161, 119, 64, 63, 62, 61,
897 /* 1040 */ 445, 445, 445, 149, 445, 445, 441, 440, 445, 88,
898 /* 1050 */ 445, 445, 445, 445, 445, 149, 445, 56, 120, 161,
899 /* 1060 */ 119, 88, 445, 445, 10, 479, 479, 445, 445, 445,
900 /* 1070 */ 120, 161, 119, 445, 445, 445, 445, 82, 445, 434,
901 /* 1080 */ 152, 445, 445, 445, 466, 445, 34, 109, 447, 454,
902 /* 1090 */ 29, 445, 152, 445, 450, 445, 445, 445, 107, 436,
903 /* 1100 */ 437, 438, 439, 87, 445, 163, 445, 120, 161, 119,
904 /* 1110 */ 27, 451, 120, 161, 119, 99, 445, 64, 63, 62,
905 /* 1120 */ 61, 445, 100, 445, 120, 161, 119, 101, 445, 152,
906 /* 1130 */ 391, 120, 161, 119, 152, 445, 120, 161, 119, 91,
907 /* 1140 */ 445, 445, 445, 445, 445, 445, 152, 445, 120, 161,
908 /* 1150 */ 119, 103, 445, 152, 92, 445, 445, 445, 152, 445,
909 /* 1160 */ 120, 161, 119, 120, 161, 119, 93, 445, 445, 104,
910 /* 1170 */ 152, 445, 445, 445, 445, 120, 161, 119, 120, 161,
911 /* 1180 */ 119, 445, 152, 445, 94, 152, 445, 445, 445, 445,
912 /* 1190 */ 445, 445, 105, 120, 161, 119, 445, 152, 445, 95,
913 /* 1200 */ 152, 120, 161, 119, 445, 445, 445, 96, 120, 161,
914 /* 1210 */ 119, 445, 445, 445, 445, 152, 120, 161, 119, 445,
915 /* 1220 */ 445, 445, 445, 152, 445, 445, 445, 445, 445, 445,
916 /* 1230 */ 152, 97, 445, 445, 549, 445, 445, 548, 152, 445,
917 /* 1240 */ 120, 161, 119, 120, 161, 119, 120, 161, 119, 445,
918 /* 1250 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
919 /* 1260 */ 445, 445, 152, 547, 445, 152, 546, 445, 152, 115,
920 /* 1270 */ 445, 445, 120, 161, 119, 120, 161, 119, 120, 161,
921 /* 1280 */ 119, 116, 445, 445, 445, 445, 445, 445, 445, 445,
922 /* 1290 */ 120, 161, 119, 445, 152, 445, 445, 152, 445, 445,
923 /* 1300 */ 152, 445, 445, 445, 445, 445, 445, 445, 445, 445,
924 /* 1310 */ 445, 445, 152,
925 };
926 static const YYCODETYPE yy_lookahead[] = {
927 /* 0 */ 0, 113, 114, 115, 134, 102, 103, 104, 106, 106,
928 /* 10 */ 10, 113, 114, 115, 111, 112, 113, 114, 115, 106,
929 /* 20 */ 20, 21, 22, 105, 24, 126, 108, 109, 28, 4,
930 /* 30 */ 5, 6, 7, 33, 34, 35, 36, 37, 135, 39,
931 /* 40 */ 40, 41, 42, 105, 44, 45, 108, 109, 107, 49,
932 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
933 /* 60 */ 60, 61, 62, 63, 0, 113, 114, 115, 130, 131,
934 /* 70 */ 132, 104, 25, 106, 10, 113, 114, 115, 111, 112,
935 /* 80 */ 113, 114, 115, 106, 20, 21, 22, 128, 24, 113,
936 /* 90 */ 114, 115, 28, 129, 2, 26, 27, 33, 34, 35,
937 /* 100 */ 36, 37, 135, 39, 40, 41, 42, 2, 44, 45,
938 /* 110 */ 133, 26, 27, 49, 50, 51, 52, 53, 54, 55,
939 /* 120 */ 56, 57, 58, 59, 60, 61, 62, 63, 1, 2,
940 /* 130 */ 38, 4, 5, 4, 5, 6, 7, 17, 10, 12,
941 /* 140 */ 4, 5, 15, 38, 1, 25, 17, 29, 30, 31,
942 /* 150 */ 32, 24, 83, 26, 27, 12, 28, 14, 31, 32,
943 /* 160 */ 91, 18, 116, 20, 21, 22, 23, 24, 116, 26,
944 /* 170 */ 27, 19, 29, 30, 31, 32, 91, 3, 64, 65,
945 /* 180 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 6,
946 /* 190 */ 7, 64, 4, 5, 6, 7, 8, 97, 98, 20,
947 /* 200 */ 21, 22, 26, 27, 4, 5, 6, 7, 1, 82,
948 /* 210 */ 48, 84, 85, 86, 87, 17, 89, 17, 91, 92,
949 /* 220 */ 93, 94, 95, 1, 2, 25, 4, 5, 49, 50,
950 /* 230 */ 51, 52, 53, 54, 12, 16, 15, 15, 4, 5,
951 /* 240 */ 6, 7, 20, 21, 22, 1, 26, 27, 4, 5,
952 /* 250 */ 48, 43, 90, 31, 32, 40, 12, 40, 96, 15,
953 /* 260 */ 47, 99, 88, 104, 20, 21, 22, 1, 24, 35,
954 /* 270 */ 4, 5, 113, 114, 115, 0, 117, 41, 12, 41,
955 /* 280 */ 13, 15, 17, 124, 125, 10, 64, 25, 1, 2,
956 /* 290 */ 17, 4, 5, 75, 135, 81, 80, 3, 3, 12,
957 /* 300 */ 3, 99, 15, 79, 82, 80, 84, 85, 86, 87,
958 /* 310 */ 38, 89, 3, 91, 92, 93, 94, 95, 31, 32,
959 /* 320 */ 2, 3, 4, 5, 6, 7, 82, 3, 3, 12,
960 /* 330 */ 77, 104, 25, 89, 16, 91, 92, 93, 94, 95,
961 /* 340 */ 113, 114, 115, 25, 117, 96, 15, 15, 82, 31,
962 /* 350 */ 32, 64, 125, 15, 17, 89, 38, 91, 92, 93,
963 /* 360 */ 94, 95, 135, 28, 4, 5, 6, 7, 28, 82,
964 /* 370 */ 28, 84, 85, 86, 87, 12, 89, 3, 91, 92,
965 /* 380 */ 93, 94, 95, 90, 11, 67, 68, 136, 2, 3,
966 /* 390 */ 4, 5, 6, 7, 76, 35, 78, 79, 80, 82,
967 /* 400 */ 136, 136, 136, 17, 136, 136, 89, 136, 91, 136,
968 /* 410 */ 136, 25, 104, 136, 106, 136, 136, 31, 32, 111,
969 /* 420 */ 112, 113, 114, 115, 38, 136, 136, 2, 3, 4,
970 /* 430 */ 5, 6, 7, 136, 1, 136, 136, 4, 5, 4,
971 /* 440 */ 5, 6, 7, 135, 136, 12, 136, 136, 15, 136,
972 /* 450 */ 25, 136, 17, 67, 68, 136, 31, 32, 136, 136,
973 /* 460 */ 25, 136, 76, 38, 78, 79, 80, 1, 136, 136,
974 /* 470 */ 4, 5, 4, 5, 6, 7, 136, 136, 12, 46,
975 /* 480 */ 47, 15, 136, 136, 136, 17, 20, 21, 22, 136,
976 /* 490 */ 136, 136, 67, 68, 136, 1, 2, 136, 4, 5,
977 /* 500 */ 136, 76, 136, 78, 79, 80, 12, 136, 104, 15,
978 /* 510 */ 4, 5, 6, 7, 136, 82, 136, 113, 114, 115,
979 /* 520 */ 136, 117, 89, 17, 91, 92, 93, 94, 95, 136,
980 /* 530 */ 1, 2, 38, 4, 5, 4, 5, 6, 7, 135,
981 /* 540 */ 136, 12, 136, 136, 15, 136, 136, 136, 82, 4,
982 /* 550 */ 5, 6, 7, 136, 136, 89, 25, 91, 92, 93,
983 /* 560 */ 94, 95, 136, 1, 2, 136, 4, 5, 136, 136,
984 /* 570 */ 25, 104, 136, 106, 12, 136, 82, 15, 111, 112,
985 /* 580 */ 113, 114, 115, 89, 136, 91, 92, 93, 94, 95,
986 /* 590 */ 1, 136, 136, 4, 5, 136, 136, 136, 136, 136,
987 /* 600 */ 136, 12, 135, 136, 15, 136, 104, 136, 106, 136,
988 /* 610 */ 136, 82, 136, 111, 112, 113, 114, 115, 89, 136,
989 /* 620 */ 91, 92, 93, 94, 95, 1, 136, 136, 4, 5,
990 /* 630 */ 136, 136, 104, 136, 136, 136, 12, 135, 136, 15,
991 /* 640 */ 136, 113, 114, 115, 82, 136, 136, 2, 120, 121,
992 /* 650 */ 136, 89, 136, 91, 92, 93, 94, 95, 1, 136,
993 /* 660 */ 136, 4, 5, 135, 104, 136, 136, 136, 136, 12,
994 /* 670 */ 136, 82, 15, 113, 114, 115, 31, 32, 89, 136,
995 /* 680 */ 91, 92, 93, 94, 95, 101, 102, 103, 136, 136,
996 /* 690 */ 104, 107, 106, 48, 104, 135, 136, 111, 112, 113,
997 /* 700 */ 114, 115, 118, 113, 114, 115, 82, 123, 136, 64,
998 /* 710 */ 120, 121, 136, 89, 136, 91, 92, 93, 94, 95,
999 /* 720 */ 136, 135, 136, 136, 136, 135, 104, 136, 106, 84,
1000 /* 730 */ 85, 86, 87, 111, 112, 113, 114, 115, 136, 82,
1001 /* 740 */ 100, 101, 102, 103, 136, 136, 89, 107, 91, 92,
1002 /* 750 */ 93, 94, 95, 136, 136, 136, 136, 135, 118, 104,
1003 /* 760 */ 136, 106, 122, 123, 136, 136, 111, 112, 113, 114,
1004 /* 770 */ 115, 136, 136, 136, 104, 136, 106, 136, 136, 136,
1005 /* 780 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1006 /* 790 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1007 /* 800 */ 115, 136, 104, 136, 106, 135, 136, 136, 136, 111,
1008 /* 810 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1009 /* 820 */ 135, 111, 112, 113, 114, 115, 104, 4, 5, 6,
1010 /* 830 */ 7, 136, 136, 135, 136, 113, 114, 115, 136, 104,
1011 /* 840 */ 17, 106, 120, 136, 136, 135, 111, 112, 113, 114,
1012 /* 850 */ 115, 104, 136, 106, 136, 136, 136, 135, 111, 112,
1013 /* 860 */ 113, 114, 115, 136, 104, 136, 106, 136, 136, 136,
1014 /* 870 */ 135, 111, 112, 113, 114, 115, 136, 136, 136, 104,
1015 /* 880 */ 136, 106, 135, 136, 136, 136, 111, 112, 113, 114,
1016 /* 890 */ 115, 104, 136, 106, 104, 135, 136, 136, 111, 112,
1017 /* 900 */ 113, 114, 115, 113, 114, 115, 136, 104, 136, 106,
1018 /* 910 */ 135, 136, 136, 136, 111, 112, 113, 114, 115, 104,
1019 /* 920 */ 136, 106, 135, 136, 136, 135, 111, 112, 113, 114,
1020 /* 930 */ 115, 104, 4, 5, 6, 7, 136, 136, 135, 136,
1021 /* 940 */ 113, 114, 115, 136, 104, 17, 106, 136, 136, 136,
1022 /* 950 */ 135, 111, 112, 113, 114, 115, 104, 136, 106, 136,
1023 /* 960 */ 136, 136, 135, 111, 112, 113, 114, 115, 136, 104,
1024 /* 970 */ 136, 106, 136, 136, 136, 135, 111, 112, 113, 114,
1025 /* 980 */ 115, 136, 136, 136, 104, 136, 106, 135, 136, 136,
1026 /* 990 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1027 /* 1000 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1028 /* 1010 */ 115, 136, 104, 136, 106, 135, 136, 2, 136, 111,
1029 /* 1020 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1030 /* 1030 */ 135, 111, 112, 113, 114, 115, 4, 5, 6, 7,
1031 /* 1040 */ 136, 136, 136, 135, 136, 136, 31, 32, 136, 104,
1032 /* 1050 */ 136, 136, 136, 136, 136, 135, 136, 25, 113, 114,
1033 /* 1060 */ 115, 104, 136, 136, 119, 120, 121, 136, 136, 136,
1034 /* 1070 */ 113, 114, 115, 136, 136, 136, 136, 120, 136, 64,
1035 /* 1080 */ 135, 136, 136, 136, 127, 136, 129, 100, 101, 102,
1036 /* 1090 */ 103, 136, 135, 136, 107, 136, 136, 136, 104, 84,
1037 /* 1100 */ 85, 86, 87, 104, 136, 118, 136, 113, 114, 115,
1038 /* 1110 */ 123, 117, 113, 114, 115, 104, 136, 4, 5, 6,
1039 /* 1120 */ 7, 136, 104, 136, 113, 114, 115, 104, 136, 135,
1040 /* 1130 */ 17, 113, 114, 115, 135, 136, 113, 114, 115, 104,
1041 /* 1140 */ 136, 136, 136, 136, 136, 136, 135, 136, 113, 114,
1042 /* 1150 */ 115, 104, 136, 135, 104, 136, 136, 136, 135, 136,
1043 /* 1160 */ 113, 114, 115, 113, 114, 115, 104, 136, 136, 104,
1044 /* 1170 */ 135, 136, 136, 136, 136, 113, 114, 115, 113, 114,
1045 /* 1180 */ 115, 136, 135, 136, 104, 135, 136, 136, 136, 136,
1046 /* 1190 */ 136, 136, 104, 113, 114, 115, 136, 135, 136, 104,
1047 /* 1200 */ 135, 113, 114, 115, 136, 136, 136, 104, 113, 114,
1048 /* 1210 */ 115, 136, 136, 136, 136, 135, 113, 114, 115, 136,
1049 /* 1220 */ 136, 136, 136, 135, 136, 136, 136, 136, 136, 136,
1050 /* 1230 */ 135, 104, 136, 136, 104, 136, 136, 104, 135, 136,
1051 /* 1240 */ 113, 114, 115, 113, 114, 115, 113, 114, 115, 136,
1052 /* 1250 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1053 /* 1260 */ 136, 136, 135, 104, 136, 135, 104, 136, 135, 104,
1054 /* 1270 */ 136, 136, 113, 114, 115, 113, 114, 115, 113, 114,
1055 /* 1280 */ 115, 104, 136, 136, 136, 136, 136, 136, 136, 136,
1056 /* 1290 */ 113, 114, 115, 136, 135, 136, 136, 135, 136, 136,
1057 /* 1300 */ 135, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1058 /* 1310 */ 136, 136, 135, 100, 100, 100, 100, 100, 100, 100,
1059 /* 1320 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1060 /* 1330 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1061 /* 1340 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1062 /* 1350 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1063 /* 1360 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1064 /* 1370 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1065 /* 1380 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1066 /* 1390 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1067 /* 1400 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1068 /* 1410 */ 100, 100, 100,
1069 };
1070 #define YY_SHIFT_COUNT (163)
1071 #define YY_SHIFT_MIN (0)
1072 #define YY_SHIFT_MAX (1113)
1073 static const unsigned short int yy_shift_ofst[] = {
1074 /* 0 */ 143, 127, 222, 287, 287, 287, 287, 287, 287, 287,
1075 /* 10 */ 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
1076 /* 20 */ 287, 287, 287, 287, 287, 287, 287, 244, 433, 266,
1077 /* 30 */ 244, 143, 494, 494, 0, 64, 143, 589, 266, 589,
1078 /* 40 */ 466, 466, 466, 529, 562, 266, 266, 266, 266, 266,
1079 /* 50 */ 266, 624, 266, 266, 657, 266, 266, 266, 266, 266,
1080 /* 60 */ 266, 266, 266, 266, 266, 179, 317, 317, 317, 317,
1081 /* 70 */ 317, 645, 318, 386, 425, 1015, 1015, 118, 47, 1313,
1082 /* 80 */ 1313, 1313, 1313, 114, 114, 200, 435, 129, 188, 234,
1083 /* 90 */ 360, 468, 531, 506, 545, 823, 1032, 928, 1113, 25,
1084 /* 100 */ 25, 25, 162, 25, 25, 25, 69, 25, 85, 128,
1085 /* 110 */ 92, 105, 120, 136, 100, 183, 183, 176, 220, 174,
1086 /* 120 */ 202, 275, 152, 207, 198, 219, 221, 208, 215, 217,
1087 /* 130 */ 236, 238, 213, 267, 265, 262, 218, 273, 216, 224,
1088 /* 140 */ 214, 225, 294, 295, 297, 272, 309, 324, 325, 249,
1089 /* 150 */ 253, 307, 249, 331, 332, 338, 337, 335, 340, 342,
1090 /* 160 */ 363, 293, 374, 373,
1091 };
1092 #define YY_REDUCE_COUNT (82)
1093 #define YY_REDUCE_MIN (-130)
1094 #define YY_REDUCE_MAX (1177)
1095 static const short yy_reduce_ofst[] = {
1096 /* 0 */ 640, -97, -33, 308, 467, 502, 586, 622, 655, 670,
1097 /* 10 */ 682, 698, 710, 735, 747, 760, 775, 787, 803, 815,
1098 /* 20 */ 840, 852, 865, 880, 892, 908, 920, 159, 945, 957,
1099 /* 30 */ 227, 987, 528, 590, -62, -62, 584, 404, 722, 994,
1100 /* 40 */ 560, 685, 790, 827, 895, 999, 1011, 1018, 1023, 1035,
1101 /* 50 */ 1047, 1050, 1062, 1065, 1080, 1088, 1095, 1103, 1127, 1130,
1102 /* 60 */ 1133, 1159, 1162, 1165, 1177, -82, -112, -102, -48, -38,
1103 /* 70 */ -24, -23, -130, -130, -130, -98, -87, -59, -101, -41,
1104 /* 80 */ 46, 52, -36,
1105 };
1106 static const YYACTIONTYPE yy_default[] = {
1107 /* 0 */ 449, 443, 443, 443, 443, 443, 443, 443, 443, 443,
1108 /* 10 */ 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
1109 /* 20 */ 443, 443, 443, 443, 443, 443, 443, 443, 473, 576,
@@ -1164,10 +1214,11 @@
1164 0, /* COLOR => nothing */
1165 0, /* THICKNESS => nothing */
1166 0, /* PRINT => nothing */
1167 0, /* STRING => nothing */
1168 0, /* COMMA => nothing */
 
1169 0, /* CLASSNAME => nothing */
1170 0, /* LB => nothing */
1171 0, /* RB => nothing */
1172 0, /* UP => nothing */
1173 0, /* DOWN => nothing */
@@ -1347,120 +1398,122 @@
1347 /* 21 */ "COLOR",
1348 /* 22 */ "THICKNESS",
1349 /* 23 */ "PRINT",
1350 /* 24 */ "STRING",
1351 /* 25 */ "COMMA",
1352 /* 26 */ "CLASSNAME",
1353 /* 27 */ "LB",
1354 /* 28 */ "RB",
1355 /* 29 */ "UP",
1356 /* 30 */ "DOWN",
1357 /* 31 */ "LEFT",
1358 /* 32 */ "RIGHT",
1359 /* 33 */ "CLOSE",
1360 /* 34 */ "CHOP",
1361 /* 35 */ "FROM",
1362 /* 36 */ "TO",
1363 /* 37 */ "THEN",
1364 /* 38 */ "HEADING",
1365 /* 39 */ "GO",
1366 /* 40 */ "AT",
1367 /* 41 */ "WITH",
1368 /* 42 */ "SAME",
1369 /* 43 */ "AS",
1370 /* 44 */ "FIT",
1371 /* 45 */ "BEHIND",
1372 /* 46 */ "UNTIL",
1373 /* 47 */ "EVEN",
1374 /* 48 */ "DOT_E",
1375 /* 49 */ "HEIGHT",
1376 /* 50 */ "WIDTH",
1377 /* 51 */ "RADIUS",
1378 /* 52 */ "DIAMETER",
1379 /* 53 */ "DOTTED",
1380 /* 54 */ "DASHED",
1381 /* 55 */ "CW",
1382 /* 56 */ "CCW",
1383 /* 57 */ "LARROW",
1384 /* 58 */ "RARROW",
1385 /* 59 */ "LRARROW",
1386 /* 60 */ "INVIS",
1387 /* 61 */ "THICK",
1388 /* 62 */ "THIN",
1389 /* 63 */ "SOLID",
1390 /* 64 */ "CENTER",
1391 /* 65 */ "LJUST",
1392 /* 66 */ "RJUST",
1393 /* 67 */ "ABOVE",
1394 /* 68 */ "BELOW",
1395 /* 69 */ "ITALIC",
1396 /* 70 */ "BOLD",
1397 /* 71 */ "MONO",
1398 /* 72 */ "ALIGNED",
1399 /* 73 */ "BIG",
1400 /* 74 */ "SMALL",
1401 /* 75 */ "AND",
1402 /* 76 */ "LT",
1403 /* 77 */ "GT",
1404 /* 78 */ "ON",
1405 /* 79 */ "WAY",
1406 /* 80 */ "BETWEEN",
1407 /* 81 */ "THE",
1408 /* 82 */ "NTH",
1409 /* 83 */ "VERTEX",
1410 /* 84 */ "TOP",
1411 /* 85 */ "BOTTOM",
1412 /* 86 */ "START",
1413 /* 87 */ "END",
1414 /* 88 */ "IN",
1415 /* 89 */ "THIS",
1416 /* 90 */ "DOT_U",
1417 /* 91 */ "LAST",
1418 /* 92 */ "NUMBER",
1419 /* 93 */ "FUNC1",
1420 /* 94 */ "FUNC2",
1421 /* 95 */ "DIST",
1422 /* 96 */ "DOT_XY",
1423 /* 97 */ "X",
1424 /* 98 */ "Y",
1425 /* 99 */ "DOT_L",
1426 /* 100 */ "statement_list",
1427 /* 101 */ "statement",
1428 /* 102 */ "unnamed_statement",
1429 /* 103 */ "basetype",
1430 /* 104 */ "expr",
1431 /* 105 */ "numproperty",
1432 /* 106 */ "edge",
1433 /* 107 */ "direction",
1434 /* 108 */ "dashproperty",
1435 /* 109 */ "colorproperty",
1436 /* 110 */ "locproperty",
1437 /* 111 */ "position",
1438 /* 112 */ "place",
1439 /* 113 */ "object",
1440 /* 114 */ "objectname",
1441 /* 115 */ "nth",
1442 /* 116 */ "textposition",
1443 /* 117 */ "rvalue",
1444 /* 118 */ "lvalue",
1445 /* 119 */ "even",
1446 /* 120 */ "relexpr",
1447 /* 121 */ "optrelexpr",
1448 /* 122 */ "document",
1449 /* 123 */ "print",
1450 /* 124 */ "prlist",
1451 /* 125 */ "pritem",
1452 /* 126 */ "prsep",
1453 /* 127 */ "attribute_list",
1454 /* 128 */ "savelist",
1455 /* 129 */ "alist",
1456 /* 130 */ "attribute",
1457 /* 131 */ "go",
1458 /* 132 */ "boolproperty",
1459 /* 133 */ "withclause",
1460 /* 134 */ "between",
1461 /* 135 */ "place2",
 
 
1462 };
1463 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
1464
1465 #ifndef NDEBUG
1466 /* For tracing reduce actions, the names of all rules are required.
@@ -1743,24 +1796,24 @@
1743 ** Note: during a reduce, the only symbols destroyed are those
1744 ** which appear on the RHS of the rule, but which are *not* used
1745 ** inside the C code.
1746 */
1747 /********* Begin destructor definitions ***************************************/
1748 case 100: /* statement_list */
1749 {
1750 #line 511 "pikchr.y"
1751 pik_elist_free(p,(yypminor->yy235));
1752 #line 1777 "pikchr.c"
1753 }
1754 break;
1755 case 101: /* statement */
1756 case 102: /* unnamed_statement */
1757 case 103: /* basetype */
1758 {
1759 #line 513 "pikchr.y"
1760 pik_elem_free(p,(yypminor->yy162));
1761 #line 1786 "pikchr.c"
1762 }
1763 break;
1764 /********* End destructor definitions *****************************************/
1765 default: break; /* If no destructor action specified: do nothing */
1766 }
@@ -1991,14 +2044,14 @@
1991 #endif
1992 while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
1993 /* Here code is inserted which will execute if the parser
1994 ** stack every overflows */
1995 /******** Begin %stack_overflow code ******************************************/
1996 #line 545 "pikchr.y"
1997
1998 pik_error(p, 0, "parser stack overflow");
1999 #line 2024 "pikchr.c"
2000 /******** End %stack_overflow code ********************************************/
2001 pik_parserARG_STORE /* Suppress warning about unused %extra_argument var */
2002 pik_parserCTX_STORE
2003 }
2004
@@ -2060,166 +2113,166 @@
2060 }
2061
2062 /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
2063 ** of that rule */
2064 static const YYCODETYPE yyRuleInfoLhs[] = {
2065 122, /* (0) document ::= statement_list */
2066 100, /* (1) statement_list ::= statement */
2067 100, /* (2) statement_list ::= statement_list EOL statement */
2068 101, /* (3) statement ::= */
2069 101, /* (4) statement ::= direction */
2070 101, /* (5) statement ::= lvalue ASSIGN rvalue */
2071 101, /* (6) statement ::= PLACENAME COLON unnamed_statement */
2072 101, /* (7) statement ::= PLACENAME COLON position */
2073 101, /* (8) statement ::= unnamed_statement */
2074 101, /* (9) statement ::= print prlist */
2075 101, /* (10) statement ::= ASSERT LP expr EQ expr RP */
2076 101, /* (11) statement ::= ASSERT LP position EQ position RP */
2077 101, /* (12) statement ::= DEFINE ID CODEBLOCK */
2078 117, /* (13) rvalue ::= PLACENAME */
2079 125, /* (14) pritem ::= FILL */
2080 125, /* (15) pritem ::= COLOR */
2081 125, /* (16) pritem ::= THICKNESS */
2082 125, /* (17) pritem ::= rvalue */
2083 125, /* (18) pritem ::= STRING */
2084 126, /* (19) prsep ::= COMMA */
2085 102, /* (20) unnamed_statement ::= basetype attribute_list */
2086 103, /* (21) basetype ::= CLASSNAME */
2087 103, /* (22) basetype ::= STRING textposition */
2088 103, /* (23) basetype ::= LB savelist statement_list RB */
2089 128, /* (24) savelist ::= */
2090 120, /* (25) relexpr ::= expr */
2091 120, /* (26) relexpr ::= expr PERCENT */
2092 121, /* (27) optrelexpr ::= */
2093 127, /* (28) attribute_list ::= relexpr alist */
2094 130, /* (29) attribute ::= numproperty relexpr */
2095 130, /* (30) attribute ::= dashproperty expr */
2096 130, /* (31) attribute ::= dashproperty */
2097 130, /* (32) attribute ::= colorproperty rvalue */
2098 130, /* (33) attribute ::= go direction optrelexpr */
2099 130, /* (34) attribute ::= go direction even position */
2100 130, /* (35) attribute ::= CLOSE */
2101 130, /* (36) attribute ::= CHOP */
2102 130, /* (37) attribute ::= FROM position */
2103 130, /* (38) attribute ::= TO position */
2104 130, /* (39) attribute ::= THEN */
2105 130, /* (40) attribute ::= THEN optrelexpr HEADING expr */
2106 130, /* (41) attribute ::= THEN optrelexpr EDGEPT */
2107 130, /* (42) attribute ::= GO optrelexpr HEADING expr */
2108 130, /* (43) attribute ::= GO optrelexpr EDGEPT */
2109 130, /* (44) attribute ::= AT position */
2110 130, /* (45) attribute ::= SAME */
2111 130, /* (46) attribute ::= SAME AS object */
2112 130, /* (47) attribute ::= STRING textposition */
2113 130, /* (48) attribute ::= FIT */
2114 130, /* (49) attribute ::= BEHIND object */
2115 133, /* (50) withclause ::= DOT_E edge AT position */
2116 133, /* (51) withclause ::= edge AT position */
2117 105, /* (52) numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2118 132, /* (53) boolproperty ::= CW */
2119 132, /* (54) boolproperty ::= CCW */
2120 132, /* (55) boolproperty ::= LARROW */
2121 132, /* (56) boolproperty ::= RARROW */
2122 132, /* (57) boolproperty ::= LRARROW */
2123 132, /* (58) boolproperty ::= INVIS */
2124 132, /* (59) boolproperty ::= THICK */
2125 132, /* (60) boolproperty ::= THIN */
2126 132, /* (61) boolproperty ::= SOLID */
2127 116, /* (62) textposition ::= */
2128 116, /* (63) textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2129 111, /* (64) position ::= expr COMMA expr */
2130 111, /* (65) position ::= place PLUS expr COMMA expr */
2131 111, /* (66) position ::= place MINUS expr COMMA expr */
2132 111, /* (67) position ::= place PLUS LP expr COMMA expr RP */
2133 111, /* (68) position ::= place MINUS LP expr COMMA expr RP */
2134 111, /* (69) position ::= LP position COMMA position RP */
2135 111, /* (70) position ::= LP position RP */
2136 111, /* (71) position ::= expr between position AND position */
2137 111, /* (72) position ::= expr LT position COMMA position GT */
2138 111, /* (73) position ::= expr ABOVE position */
2139 111, /* (74) position ::= expr BELOW position */
2140 111, /* (75) position ::= expr LEFT OF position */
2141 111, /* (76) position ::= expr RIGHT OF position */
2142 111, /* (77) position ::= expr ON HEADING EDGEPT OF position */
2143 111, /* (78) position ::= expr HEADING EDGEPT OF position */
2144 111, /* (79) position ::= expr EDGEPT OF position */
2145 111, /* (80) position ::= expr ON HEADING expr FROM position */
2146 111, /* (81) position ::= expr HEADING expr FROM position */
2147 112, /* (82) place ::= edge OF object */
2148 135, /* (83) place2 ::= object */
2149 135, /* (84) place2 ::= object DOT_E edge */
2150 135, /* (85) place2 ::= NTH VERTEX OF object */
2151 113, /* (86) object ::= nth */
2152 113, /* (87) object ::= nth OF|IN object */
2153 114, /* (88) objectname ::= THIS */
2154 114, /* (89) objectname ::= PLACENAME */
2155 114, /* (90) objectname ::= objectname DOT_U PLACENAME */
2156 115, /* (91) nth ::= NTH CLASSNAME */
2157 115, /* (92) nth ::= NTH LAST CLASSNAME */
2158 115, /* (93) nth ::= LAST CLASSNAME */
2159 115, /* (94) nth ::= LAST */
2160 115, /* (95) nth ::= NTH LB RB */
2161 115, /* (96) nth ::= NTH LAST LB RB */
2162 115, /* (97) nth ::= LAST LB RB */
2163 104, /* (98) expr ::= expr PLUS expr */
2164 104, /* (99) expr ::= expr MINUS expr */
2165 104, /* (100) expr ::= expr STAR expr */
2166 104, /* (101) expr ::= expr SLASH expr */
2167 104, /* (102) expr ::= MINUS expr */
2168 104, /* (103) expr ::= PLUS expr */
2169 104, /* (104) expr ::= LP expr RP */
2170 104, /* (105) expr ::= LP FILL|COLOR|THICKNESS RP */
2171 104, /* (106) expr ::= NUMBER */
2172 104, /* (107) expr ::= ID */
2173 104, /* (108) expr ::= FUNC1 LP expr RP */
2174 104, /* (109) expr ::= FUNC2 LP expr COMMA expr RP */
2175 104, /* (110) expr ::= DIST LP position COMMA position RP */
2176 104, /* (111) expr ::= place2 DOT_XY X */
2177 104, /* (112) expr ::= place2 DOT_XY Y */
2178 104, /* (113) expr ::= object DOT_L numproperty */
2179 104, /* (114) expr ::= object DOT_L dashproperty */
2180 104, /* (115) expr ::= object DOT_L colorproperty */
2181 118, /* (116) lvalue ::= ID */
2182 118, /* (117) lvalue ::= FILL */
2183 118, /* (118) lvalue ::= COLOR */
2184 118, /* (119) lvalue ::= THICKNESS */
2185 117, /* (120) rvalue ::= expr */
2186 123, /* (121) print ::= PRINT */
2187 124, /* (122) prlist ::= pritem */
2188 124, /* (123) prlist ::= prlist prsep pritem */
2189 107, /* (124) direction ::= UP */
2190 107, /* (125) direction ::= DOWN */
2191 107, /* (126) direction ::= LEFT */
2192 107, /* (127) direction ::= RIGHT */
2193 121, /* (128) optrelexpr ::= relexpr */
2194 127, /* (129) attribute_list ::= alist */
2195 129, /* (130) alist ::= */
2196 129, /* (131) alist ::= alist attribute */
2197 130, /* (132) attribute ::= boolproperty */
2198 130, /* (133) attribute ::= WITH withclause */
2199 131, /* (134) go ::= GO */
2200 131, /* (135) go ::= */
2201 119, /* (136) even ::= UNTIL EVEN WITH */
2202 119, /* (137) even ::= EVEN WITH */
2203 108, /* (138) dashproperty ::= DOTTED */
2204 108, /* (139) dashproperty ::= DASHED */
2205 109, /* (140) colorproperty ::= FILL */
2206 109, /* (141) colorproperty ::= COLOR */
2207 111, /* (142) position ::= place */
2208 134, /* (143) between ::= WAY BETWEEN */
2209 134, /* (144) between ::= BETWEEN */
2210 134, /* (145) between ::= OF THE WAY BETWEEN */
2211 112, /* (146) place ::= place2 */
2212 106, /* (147) edge ::= CENTER */
2213 106, /* (148) edge ::= EDGEPT */
2214 106, /* (149) edge ::= TOP */
2215 106, /* (150) edge ::= BOTTOM */
2216 106, /* (151) edge ::= START */
2217 106, /* (152) edge ::= END */
2218 106, /* (153) edge ::= RIGHT */
2219 106, /* (154) edge ::= LEFT */
2220 113, /* (155) object ::= objectname */
2221 };
2222
2223 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
2224 ** of symbols on the right-hand side of that rule. */
2225 static const signed char yyRuleInfoNRhs[] = {
@@ -2419,620 +2472,620 @@
2419 ** break;
2420 */
2421 /********** Begin reduce actions **********************************************/
2422 YYMINORTYPE yylhsminor;
2423 case 0: /* document ::= statement_list */
2424 #line 549 "pikchr.y"
2425 {pik_render(p,yymsp[0].minor.yy235);}
2426 #line 2451 "pikchr.c"
2427 break;
2428 case 1: /* statement_list ::= statement */
2429 #line 552 "pikchr.y"
2430 { yylhsminor.yy235 = pik_elist_append(p,0,yymsp[0].minor.yy162); }
2431 #line 2456 "pikchr.c"
2432 yymsp[0].minor.yy235 = yylhsminor.yy235;
2433 break;
2434 case 2: /* statement_list ::= statement_list EOL statement */
2435 #line 554 "pikchr.y"
2436 { yylhsminor.yy235 = pik_elist_append(p,yymsp[-2].minor.yy235,yymsp[0].minor.yy162); }
2437 #line 2462 "pikchr.c"
2438 yymsp[-2].minor.yy235 = yylhsminor.yy235;
2439 break;
2440 case 3: /* statement ::= */
2441 #line 557 "pikchr.y"
2442 { yymsp[1].minor.yy162 = 0; }
2443 #line 2468 "pikchr.c"
2444 break;
2445 case 4: /* statement ::= direction */
2446 #line 558 "pikchr.y"
2447 { pik_set_direction(p,yymsp[0].minor.yy0.eCode); yylhsminor.yy162=0; }
2448 #line 2473 "pikchr.c"
2449 yymsp[0].minor.yy162 = yylhsminor.yy162;
2450 break;
2451 case 5: /* statement ::= lvalue ASSIGN rvalue */
2452 #line 559 "pikchr.y"
2453 {pik_set_var(p,&yymsp[-2].minor.yy0,yymsp[0].minor.yy21,&yymsp[-1].minor.yy0); yylhsminor.yy162=0;}
2454 #line 2479 "pikchr.c"
2455 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2456 break;
2457 case 6: /* statement ::= PLACENAME COLON unnamed_statement */
2458 #line 561 "pikchr.y"
2459 { yylhsminor.yy162 = yymsp[0].minor.yy162; pik_elem_setname(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0); }
2460 #line 2485 "pikchr.c"
2461 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2462 break;
2463 case 7: /* statement ::= PLACENAME COLON position */
2464 #line 563 "pikchr.y"
2465 { yylhsminor.yy162 = pik_elem_new(p,0,0,0);
2466 if(yylhsminor.yy162){ yylhsminor.yy162->ptAt = yymsp[0].minor.yy63; pik_elem_setname(p,yylhsminor.yy162,&yymsp[-2].minor.yy0); }}
2467 #line 2492 "pikchr.c"
2468 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2469 break;
2470 case 8: /* statement ::= unnamed_statement */
2471 #line 565 "pikchr.y"
2472 {yylhsminor.yy162 = yymsp[0].minor.yy162;}
2473 #line 2498 "pikchr.c"
2474 yymsp[0].minor.yy162 = yylhsminor.yy162;
2475 break;
2476 case 9: /* statement ::= print prlist */
2477 #line 566 "pikchr.y"
2478 {pik_append(p,"<br>\n",5); yymsp[-1].minor.yy162=0;}
2479 #line 2504 "pikchr.c"
2480 break;
2481 case 10: /* statement ::= ASSERT LP expr EQ expr RP */
2482 #line 571 "pikchr.y"
2483 {yymsp[-5].minor.yy162=pik_assert(p,yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy21);}
2484 #line 2509 "pikchr.c"
2485 break;
2486 case 11: /* statement ::= ASSERT LP position EQ position RP */
2487 #line 573 "pikchr.y"
2488 {yymsp[-5].minor.yy162=pik_position_assert(p,&yymsp[-3].minor.yy63,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy63);}
2489 #line 2514 "pikchr.c"
2490 break;
2491 case 12: /* statement ::= DEFINE ID CODEBLOCK */
2492 #line 574 "pikchr.y"
2493 {yymsp[-2].minor.yy162=0; pik_add_macro(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
2494 #line 2519 "pikchr.c"
2495 break;
2496 case 13: /* rvalue ::= PLACENAME */
2497 #line 585 "pikchr.y"
2498 {yylhsminor.yy21 = pik_lookup_color(p,&yymsp[0].minor.yy0);}
2499 #line 2524 "pikchr.c"
2500 yymsp[0].minor.yy21 = yylhsminor.yy21;
2501 break;
2502 case 14: /* pritem ::= FILL */
2503 case 15: /* pritem ::= COLOR */ yytestcase(yyruleno==15);
2504 case 16: /* pritem ::= THICKNESS */ yytestcase(yyruleno==16);
2505 #line 590 "pikchr.y"
2506 {pik_append_num(p,"",pik_value(p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.n,0));}
2507 #line 2532 "pikchr.c"
2508 break;
2509 case 17: /* pritem ::= rvalue */
2510 #line 593 "pikchr.y"
2511 {pik_append_num(p,"",yymsp[0].minor.yy21);}
2512 #line 2537 "pikchr.c"
2513 break;
2514 case 18: /* pritem ::= STRING */
2515 #line 594 "pikchr.y"
2516 {pik_append_text(p,yymsp[0].minor.yy0.z+1,yymsp[0].minor.yy0.n-2,0);}
2517 #line 2542 "pikchr.c"
2518 break;
2519 case 19: /* prsep ::= COMMA */
2520 #line 595 "pikchr.y"
2521 {pik_append(p, " ", 1);}
2522 #line 2547 "pikchr.c"
2523 break;
2524 case 20: /* unnamed_statement ::= basetype attribute_list */
2525 #line 598 "pikchr.y"
2526 {yylhsminor.yy162 = yymsp[-1].minor.yy162; pik_after_adding_attributes(p,yylhsminor.yy162);}
2527 #line 2552 "pikchr.c"
2528 yymsp[-1].minor.yy162 = yylhsminor.yy162;
2529 break;
2530 case 21: /* basetype ::= CLASSNAME */
2531 #line 600 "pikchr.y"
2532 {yylhsminor.yy162 = pik_elem_new(p,&yymsp[0].minor.yy0,0,0); }
2533 #line 2558 "pikchr.c"
2534 yymsp[0].minor.yy162 = yylhsminor.yy162;
2535 break;
2536 case 22: /* basetype ::= STRING textposition */
2537 #line 602 "pikchr.y"
2538 {yymsp[-1].minor.yy0.eCode = yymsp[0].minor.yy188; yylhsminor.yy162 = pik_elem_new(p,0,&yymsp[-1].minor.yy0,0); }
2539 #line 2564 "pikchr.c"
2540 yymsp[-1].minor.yy162 = yylhsminor.yy162;
2541 break;
2542 case 23: /* basetype ::= LB savelist statement_list RB */
2543 #line 604 "pikchr.y"
2544 { p->list = yymsp[-2].minor.yy235; yymsp[-3].minor.yy162 = pik_elem_new(p,0,0,yymsp[-1].minor.yy235); if(yymsp[-3].minor.yy162) yymsp[-3].minor.yy162->errTok = yymsp[0].minor.yy0; }
2545 #line 2570 "pikchr.c"
2546 break;
2547 case 24: /* savelist ::= */
2548 #line 609 "pikchr.y"
2549 {yymsp[1].minor.yy235 = p->list; p->list = 0;}
2550 #line 2575 "pikchr.c"
2551 break;
2552 case 25: /* relexpr ::= expr */
2553 #line 616 "pikchr.y"
2554 {yylhsminor.yy72.rAbs = yymsp[0].minor.yy21; yylhsminor.yy72.rRel = 0;}
2555 #line 2580 "pikchr.c"
2556 yymsp[0].minor.yy72 = yylhsminor.yy72;
2557 break;
2558 case 26: /* relexpr ::= expr PERCENT */
2559 #line 617 "pikchr.y"
2560 {yylhsminor.yy72.rAbs = 0; yylhsminor.yy72.rRel = yymsp[-1].minor.yy21/100;}
2561 #line 2586 "pikchr.c"
2562 yymsp[-1].minor.yy72 = yylhsminor.yy72;
2563 break;
2564 case 27: /* optrelexpr ::= */
2565 #line 619 "pikchr.y"
2566 {yymsp[1].minor.yy72.rAbs = 0; yymsp[1].minor.yy72.rRel = 1.0;}
2567 #line 2592 "pikchr.c"
2568 break;
2569 case 28: /* attribute_list ::= relexpr alist */
2570 #line 621 "pikchr.y"
2571 {pik_add_direction(p,0,&yymsp[-1].minor.yy72);}
2572 #line 2597 "pikchr.c"
2573 break;
2574 case 29: /* attribute ::= numproperty relexpr */
2575 #line 625 "pikchr.y"
2576 { pik_set_numprop(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72); }
2577 #line 2602 "pikchr.c"
2578 break;
2579 case 30: /* attribute ::= dashproperty expr */
2580 #line 626 "pikchr.y"
2581 { pik_set_dashed(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy21); }
2582 #line 2607 "pikchr.c"
2583 break;
2584 case 31: /* attribute ::= dashproperty */
2585 #line 627 "pikchr.y"
2586 { pik_set_dashed(p,&yymsp[0].minor.yy0,0); }
2587 #line 2612 "pikchr.c"
2588 break;
2589 case 32: /* attribute ::= colorproperty rvalue */
2590 #line 628 "pikchr.y"
2591 { pik_set_clrprop(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21); }
2592 #line 2617 "pikchr.c"
2593 break;
2594 case 33: /* attribute ::= go direction optrelexpr */
2595 #line 629 "pikchr.y"
2596 { pik_add_direction(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72);}
2597 #line 2622 "pikchr.c"
2598 break;
2599 case 34: /* attribute ::= go direction even position */
2600 #line 630 "pikchr.y"
2601 {pik_evenwith(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63);}
2602 #line 2627 "pikchr.c"
2603 break;
2604 case 35: /* attribute ::= CLOSE */
2605 #line 631 "pikchr.y"
2606 { pik_close_path(p,&yymsp[0].minor.yy0); }
2607 #line 2632 "pikchr.c"
2608 break;
2609 case 36: /* attribute ::= CHOP */
2610 #line 632 "pikchr.y"
2611 { p->cur->bChop = 1; }
2612 #line 2637 "pikchr.c"
2613 break;
2614 case 37: /* attribute ::= FROM position */
2615 #line 633 "pikchr.y"
2616 { pik_set_from(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2617 #line 2642 "pikchr.c"
2618 break;
2619 case 38: /* attribute ::= TO position */
2620 #line 634 "pikchr.y"
2621 { pik_add_to(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2622 #line 2647 "pikchr.c"
2623 break;
2624 case 39: /* attribute ::= THEN */
2625 #line 635 "pikchr.y"
2626 { pik_then(p, &yymsp[0].minor.yy0, p->cur); }
2627 #line 2652 "pikchr.c"
2628 break;
2629 case 40: /* attribute ::= THEN optrelexpr HEADING expr */
2630 case 42: /* attribute ::= GO optrelexpr HEADING expr */ yytestcase(yyruleno==42);
2631 #line 637 "pikchr.y"
2632 {pik_move_hdg(p,&yymsp[-2].minor.yy72,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21,0,&yymsp[-3].minor.yy0);}
2633 #line 2658 "pikchr.c"
2634 break;
2635 case 41: /* attribute ::= THEN optrelexpr EDGEPT */
2636 case 43: /* attribute ::= GO optrelexpr EDGEPT */ yytestcase(yyruleno==43);
2637 #line 638 "pikchr.y"
2638 {pik_move_hdg(p,&yymsp[-1].minor.yy72,0,0,&yymsp[0].minor.yy0,&yymsp[-2].minor.yy0);}
2639 #line 2664 "pikchr.c"
2640 break;
2641 case 44: /* attribute ::= AT position */
2642 #line 643 "pikchr.y"
2643 { pik_set_at(p,0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2644 #line 2669 "pikchr.c"
2645 break;
2646 case 45: /* attribute ::= SAME */
2647 #line 645 "pikchr.y"
2648 {pik_same(p,0,&yymsp[0].minor.yy0);}
2649 #line 2674 "pikchr.c"
2650 break;
2651 case 46: /* attribute ::= SAME AS object */
2652 #line 646 "pikchr.y"
2653 {pik_same(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2654 #line 2679 "pikchr.c"
2655 break;
2656 case 47: /* attribute ::= STRING textposition */
2657 #line 647 "pikchr.y"
2658 {pik_add_txt(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy188);}
2659 #line 2684 "pikchr.c"
2660 break;
2661 case 48: /* attribute ::= FIT */
2662 #line 648 "pikchr.y"
2663 {pik_size_to_fit(p,&yymsp[0].minor.yy0,3); }
2664 #line 2689 "pikchr.c"
2665 break;
2666 case 49: /* attribute ::= BEHIND object */
2667 #line 649 "pikchr.y"
2668 {pik_behind(p,yymsp[0].minor.yy162);}
2669 #line 2694 "pikchr.c"
2670 break;
2671 case 50: /* withclause ::= DOT_E edge AT position */
2672 case 51: /* withclause ::= edge AT position */ yytestcase(yyruleno==51);
2673 #line 657 "pikchr.y"
2674 { pik_set_at(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2675 #line 2700 "pikchr.c"
2676 break;
2677 case 52: /* numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2678 #line 661 "pikchr.y"
2679 {yylhsminor.yy0 = yymsp[0].minor.yy0;}
2680 #line 2705 "pikchr.c"
2681 yymsp[0].minor.yy0 = yylhsminor.yy0;
2682 break;
2683 case 53: /* boolproperty ::= CW */
2684 #line 672 "pikchr.y"
2685 {p->cur->cw = 1;}
2686 #line 2711 "pikchr.c"
2687 break;
2688 case 54: /* boolproperty ::= CCW */
2689 #line 673 "pikchr.y"
2690 {p->cur->cw = 0;}
2691 #line 2716 "pikchr.c"
2692 break;
2693 case 55: /* boolproperty ::= LARROW */
2694 #line 674 "pikchr.y"
2695 {p->cur->larrow=1; p->cur->rarrow=0; }
2696 #line 2721 "pikchr.c"
2697 break;
2698 case 56: /* boolproperty ::= RARROW */
2699 #line 675 "pikchr.y"
2700 {p->cur->larrow=0; p->cur->rarrow=1; }
2701 #line 2726 "pikchr.c"
2702 break;
2703 case 57: /* boolproperty ::= LRARROW */
2704 #line 676 "pikchr.y"
2705 {p->cur->larrow=1; p->cur->rarrow=1; }
2706 #line 2731 "pikchr.c"
2707 break;
2708 case 58: /* boolproperty ::= INVIS */
2709 #line 677 "pikchr.y"
2710 {p->cur->sw = -0.00001;}
2711 #line 2736 "pikchr.c"
2712 break;
2713 case 59: /* boolproperty ::= THICK */
2714 #line 678 "pikchr.y"
2715 {p->cur->sw *= 1.5;}
2716 #line 2741 "pikchr.c"
2717 break;
2718 case 60: /* boolproperty ::= THIN */
2719 #line 679 "pikchr.y"
2720 {p->cur->sw *= 0.67;}
2721 #line 2746 "pikchr.c"
2722 break;
2723 case 61: /* boolproperty ::= SOLID */
2724 #line 680 "pikchr.y"
2725 {p->cur->sw = pik_value(p,"thickness",9,0);
2726 p->cur->dotted = p->cur->dashed = 0.0;}
2727 #line 2752 "pikchr.c"
2728 break;
2729 case 62: /* textposition ::= */
2730 #line 683 "pikchr.y"
2731 {yymsp[1].minor.yy188 = 0;}
2732 #line 2757 "pikchr.c"
2733 break;
2734 case 63: /* textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2735 #line 686 "pikchr.y"
2736 {yylhsminor.yy188 = (short int)pik_text_position(yymsp[-1].minor.yy188,&yymsp[0].minor.yy0);}
2737 #line 2762 "pikchr.c"
2738 yymsp[-1].minor.yy188 = yylhsminor.yy188;
2739 break;
2740 case 64: /* position ::= expr COMMA expr */
2741 #line 689 "pikchr.y"
2742 {yylhsminor.yy63.x=yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[0].minor.yy21;}
2743 #line 2768 "pikchr.c"
2744 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2745 break;
2746 case 65: /* position ::= place PLUS expr COMMA expr */
2747 #line 691 "pikchr.y"
2748 {yylhsminor.yy63.x=yymsp[-4].minor.yy63.x+yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y+yymsp[0].minor.yy21;}
2749 #line 2774 "pikchr.c"
2750 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2751 break;
2752 case 66: /* position ::= place MINUS expr COMMA expr */
2753 #line 692 "pikchr.y"
2754 {yylhsminor.yy63.x=yymsp[-4].minor.yy63.x-yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y-yymsp[0].minor.yy21;}
2755 #line 2780 "pikchr.c"
2756 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2757 break;
2758 case 67: /* position ::= place PLUS LP expr COMMA expr RP */
2759 #line 694 "pikchr.y"
2760 {yylhsminor.yy63.x=yymsp[-6].minor.yy63.x+yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y+yymsp[-1].minor.yy21;}
2761 #line 2786 "pikchr.c"
2762 yymsp[-6].minor.yy63 = yylhsminor.yy63;
2763 break;
2764 case 68: /* position ::= place MINUS LP expr COMMA expr RP */
2765 #line 696 "pikchr.y"
2766 {yylhsminor.yy63.x=yymsp[-6].minor.yy63.x-yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y-yymsp[-1].minor.yy21;}
2767 #line 2792 "pikchr.c"
2768 yymsp[-6].minor.yy63 = yylhsminor.yy63;
2769 break;
2770 case 69: /* position ::= LP position COMMA position RP */
2771 #line 697 "pikchr.y"
2772 {yymsp[-4].minor.yy63.x=yymsp[-3].minor.yy63.x; yymsp[-4].minor.yy63.y=yymsp[-1].minor.yy63.y;}
2773 #line 2798 "pikchr.c"
2774 break;
2775 case 70: /* position ::= LP position RP */
2776 #line 698 "pikchr.y"
2777 {yymsp[-2].minor.yy63=yymsp[-1].minor.yy63;}
2778 #line 2803 "pikchr.c"
2779 break;
2780 case 71: /* position ::= expr between position AND position */
2781 #line 700 "pikchr.y"
2782 {yylhsminor.yy63 = pik_position_between(yymsp[-4].minor.yy21,yymsp[-2].minor.yy63,yymsp[0].minor.yy63);}
2783 #line 2808 "pikchr.c"
2784 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2785 break;
2786 case 72: /* position ::= expr LT position COMMA position GT */
2787 #line 702 "pikchr.y"
2788 {yylhsminor.yy63 = pik_position_between(yymsp[-5].minor.yy21,yymsp[-3].minor.yy63,yymsp[-1].minor.yy63);}
2789 #line 2814 "pikchr.c"
2790 yymsp[-5].minor.yy63 = yylhsminor.yy63;
2791 break;
2792 case 73: /* position ::= expr ABOVE position */
2793 #line 703 "pikchr.y"
2794 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y += yymsp[-2].minor.yy21;}
2795 #line 2820 "pikchr.c"
2796 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2797 break;
2798 case 74: /* position ::= expr BELOW position */
2799 #line 704 "pikchr.y"
2800 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y -= yymsp[-2].minor.yy21;}
2801 #line 2826 "pikchr.c"
2802 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2803 break;
2804 case 75: /* position ::= expr LEFT OF position */
2805 #line 705 "pikchr.y"
2806 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x -= yymsp[-3].minor.yy21;}
2807 #line 2832 "pikchr.c"
2808 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2809 break;
2810 case 76: /* position ::= expr RIGHT OF position */
2811 #line 706 "pikchr.y"
2812 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x += yymsp[-3].minor.yy21;}
2813 #line 2838 "pikchr.c"
2814 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2815 break;
2816 case 77: /* position ::= expr ON HEADING EDGEPT OF position */
2817 #line 708 "pikchr.y"
2818 {yylhsminor.yy63 = pik_position_at_hdg(yymsp[-5].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2819 #line 2844 "pikchr.c"
2820 yymsp[-5].minor.yy63 = yylhsminor.yy63;
2821 break;
2822 case 78: /* position ::= expr HEADING EDGEPT OF position */
2823 #line 710 "pikchr.y"
2824 {yylhsminor.yy63 = pik_position_at_hdg(yymsp[-4].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2825 #line 2850 "pikchr.c"
2826 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2827 break;
2828 case 79: /* position ::= expr EDGEPT OF position */
2829 #line 712 "pikchr.y"
2830 {yylhsminor.yy63 = pik_position_at_hdg(yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2831 #line 2856 "pikchr.c"
2832 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2833 break;
2834 case 80: /* position ::= expr ON HEADING expr FROM position */
2835 #line 714 "pikchr.y"
2836 {yylhsminor.yy63 = pik_position_at_angle(yymsp[-5].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2837 #line 2862 "pikchr.c"
2838 yymsp[-5].minor.yy63 = yylhsminor.yy63;
2839 break;
2840 case 81: /* position ::= expr HEADING expr FROM position */
2841 #line 716 "pikchr.y"
2842 {yylhsminor.yy63 = pik_position_at_angle(yymsp[-4].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2843 #line 2868 "pikchr.c"
2844 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2845 break;
2846 case 82: /* place ::= edge OF object */
2847 #line 728 "pikchr.y"
2848 {yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2849 #line 2874 "pikchr.c"
2850 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2851 break;
2852 case 83: /* place2 ::= object */
2853 #line 729 "pikchr.y"
2854 {yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,0);}
2855 #line 2880 "pikchr.c"
2856 yymsp[0].minor.yy63 = yylhsminor.yy63;
2857 break;
2858 case 84: /* place2 ::= object DOT_E edge */
2859 #line 730 "pikchr.y"
2860 {yylhsminor.yy63 = pik_place_of_elem(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2861 #line 2886 "pikchr.c"
2862 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2863 break;
2864 case 85: /* place2 ::= NTH VERTEX OF object */
2865 #line 731 "pikchr.y"
2866 {yylhsminor.yy63 = pik_nth_vertex(p,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,yymsp[0].minor.yy162);}
2867 #line 2892 "pikchr.c"
2868 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2869 break;
2870 case 86: /* object ::= nth */
2871 #line 743 "pikchr.y"
2872 {yylhsminor.yy162 = pik_find_nth(p,0,&yymsp[0].minor.yy0);}
2873 #line 2898 "pikchr.c"
2874 yymsp[0].minor.yy162 = yylhsminor.yy162;
2875 break;
2876 case 87: /* object ::= nth OF|IN object */
2877 #line 744 "pikchr.y"
2878 {yylhsminor.yy162 = pik_find_nth(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2879 #line 2904 "pikchr.c"
2880 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2881 break;
2882 case 88: /* objectname ::= THIS */
2883 #line 746 "pikchr.y"
2884 {yymsp[0].minor.yy162 = p->cur;}
2885 #line 2910 "pikchr.c"
2886 break;
2887 case 89: /* objectname ::= PLACENAME */
2888 #line 747 "pikchr.y"
2889 {yylhsminor.yy162 = pik_find_byname(p,0,&yymsp[0].minor.yy0);}
2890 #line 2915 "pikchr.c"
2891 yymsp[0].minor.yy162 = yylhsminor.yy162;
2892 break;
2893 case 90: /* objectname ::= objectname DOT_U PLACENAME */
2894 #line 749 "pikchr.y"
2895 {yylhsminor.yy162 = pik_find_byname(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2896 #line 2921 "pikchr.c"
2897 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2898 break;
2899 case 91: /* nth ::= NTH CLASSNAME */
2900 #line 751 "pikchr.y"
2901 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-1].minor.yy0); }
2902 #line 2927 "pikchr.c"
2903 yymsp[-1].minor.yy0 = yylhsminor.yy0;
2904 break;
2905 case 92: /* nth ::= NTH LAST CLASSNAME */
2906 #line 752 "pikchr.y"
2907 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-2].minor.yy0); }
2908 #line 2933 "pikchr.c"
2909 yymsp[-2].minor.yy0 = yylhsminor.yy0;
2910 break;
2911 case 93: /* nth ::= LAST CLASSNAME */
2912 #line 753 "pikchr.y"
2913 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.eCode = -1;}
2914 #line 2939 "pikchr.c"
2915 break;
2916 case 94: /* nth ::= LAST */
2917 #line 754 "pikchr.y"
2918 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -1;}
2919 #line 2944 "pikchr.c"
2920 yymsp[0].minor.yy0 = yylhsminor.yy0;
2921 break;
2922 case 95: /* nth ::= NTH LB RB */
2923 #line 755 "pikchr.y"
2924 {yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-2].minor.yy0);}
2925 #line 2950 "pikchr.c"
2926 yymsp[-2].minor.yy0 = yylhsminor.yy0;
2927 break;
2928 case 96: /* nth ::= NTH LAST LB RB */
2929 #line 756 "pikchr.y"
2930 {yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-3].minor.yy0);}
2931 #line 2956 "pikchr.c"
2932 yymsp[-3].minor.yy0 = yylhsminor.yy0;
2933 break;
2934 case 97: /* nth ::= LAST LB RB */
2935 #line 757 "pikchr.y"
2936 {yymsp[-2].minor.yy0=yymsp[-1].minor.yy0; yymsp[-2].minor.yy0.eCode = -1; }
2937 #line 2962 "pikchr.c"
2938 break;
2939 case 98: /* expr ::= expr PLUS expr */
2940 #line 759 "pikchr.y"
2941 {yylhsminor.yy21=yymsp[-2].minor.yy21+yymsp[0].minor.yy21;}
2942 #line 2967 "pikchr.c"
2943 yymsp[-2].minor.yy21 = yylhsminor.yy21;
2944 break;
2945 case 99: /* expr ::= expr MINUS expr */
2946 #line 760 "pikchr.y"
2947 {yylhsminor.yy21=yymsp[-2].minor.yy21-yymsp[0].minor.yy21;}
2948 #line 2973 "pikchr.c"
2949 yymsp[-2].minor.yy21 = yylhsminor.yy21;
2950 break;
2951 case 100: /* expr ::= expr STAR expr */
2952 #line 761 "pikchr.y"
2953 {yylhsminor.yy21=yymsp[-2].minor.yy21*yymsp[0].minor.yy21;}
2954 #line 2979 "pikchr.c"
2955 yymsp[-2].minor.yy21 = yylhsminor.yy21;
2956 break;
2957 case 101: /* expr ::= expr SLASH expr */
2958 #line 762 "pikchr.y"
2959 {
2960 if( yymsp[0].minor.yy21==0.0 ){ pik_error(p, &yymsp[-1].minor.yy0, "division by zero"); yylhsminor.yy21 = 0.0; }
2961 else{ yylhsminor.yy21 = yymsp[-2].minor.yy21/yymsp[0].minor.yy21; }
2962 }
2963 #line 2988 "pikchr.c"
2964 yymsp[-2].minor.yy21 = yylhsminor.yy21;
2965 break;
2966 case 102: /* expr ::= MINUS expr */
2967 #line 766 "pikchr.y"
2968 {yymsp[-1].minor.yy21=-yymsp[0].minor.yy21;}
2969 #line 2994 "pikchr.c"
2970 break;
2971 case 103: /* expr ::= PLUS expr */
2972 #line 767 "pikchr.y"
2973 {yymsp[-1].minor.yy21=yymsp[0].minor.yy21;}
2974 #line 2999 "pikchr.c"
2975 break;
2976 case 104: /* expr ::= LP expr RP */
2977 #line 768 "pikchr.y"
2978 {yymsp[-2].minor.yy21=yymsp[-1].minor.yy21;}
2979 #line 3004 "pikchr.c"
2980 break;
2981 case 105: /* expr ::= LP FILL|COLOR|THICKNESS RP */
2982 #line 769 "pikchr.y"
2983 {yymsp[-2].minor.yy21=pik_get_var(p,&yymsp[-1].minor.yy0);}
2984 #line 3009 "pikchr.c"
2985 break;
2986 case 106: /* expr ::= NUMBER */
2987 #line 770 "pikchr.y"
2988 {yylhsminor.yy21=pik_atof(&yymsp[0].minor.yy0);}
2989 #line 3014 "pikchr.c"
2990 yymsp[0].minor.yy21 = yylhsminor.yy21;
2991 break;
2992 case 107: /* expr ::= ID */
2993 #line 771 "pikchr.y"
2994 {yylhsminor.yy21=pik_get_var(p,&yymsp[0].minor.yy0);}
2995 #line 3020 "pikchr.c"
2996 yymsp[0].minor.yy21 = yylhsminor.yy21;
2997 break;
2998 case 108: /* expr ::= FUNC1 LP expr RP */
2999 #line 772 "pikchr.y"
3000 {yylhsminor.yy21 = pik_func(p,&yymsp[-3].minor.yy0,yymsp[-1].minor.yy21,0.0);}
3001 #line 3026 "pikchr.c"
3002 yymsp[-3].minor.yy21 = yylhsminor.yy21;
3003 break;
3004 case 109: /* expr ::= FUNC2 LP expr COMMA expr RP */
3005 #line 773 "pikchr.y"
3006 {yylhsminor.yy21 = pik_func(p,&yymsp[-5].minor.yy0,yymsp[-3].minor.yy21,yymsp[-1].minor.yy21);}
3007 #line 3032 "pikchr.c"
3008 yymsp[-5].minor.yy21 = yylhsminor.yy21;
3009 break;
3010 case 110: /* expr ::= DIST LP position COMMA position RP */
3011 #line 774 "pikchr.y"
3012 {yymsp[-5].minor.yy21 = pik_dist(&yymsp[-3].minor.yy63,&yymsp[-1].minor.yy63);}
3013 #line 3038 "pikchr.c"
3014 break;
3015 case 111: /* expr ::= place2 DOT_XY X */
3016 #line 775 "pikchr.y"
3017 {yylhsminor.yy21 = yymsp[-2].minor.yy63.x;}
3018 #line 3043 "pikchr.c"
3019 yymsp[-2].minor.yy21 = yylhsminor.yy21;
3020 break;
3021 case 112: /* expr ::= place2 DOT_XY Y */
3022 #line 776 "pikchr.y"
3023 {yylhsminor.yy21 = yymsp[-2].minor.yy63.y;}
3024 #line 3049 "pikchr.c"
3025 yymsp[-2].minor.yy21 = yylhsminor.yy21;
3026 break;
3027 case 113: /* expr ::= object DOT_L numproperty */
3028 case 114: /* expr ::= object DOT_L dashproperty */ yytestcase(yyruleno==114);
3029 case 115: /* expr ::= object DOT_L colorproperty */ yytestcase(yyruleno==115);
3030 #line 777 "pikchr.y"
3031 {yylhsminor.yy21=pik_property_of(yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
3032 #line 3057 "pikchr.c"
3033 yymsp[-2].minor.yy21 = yylhsminor.yy21;
3034 break;
3035 default:
3036 /* (116) lvalue ::= ID */ yytestcase(yyruleno==116);
3037 /* (117) lvalue ::= FILL */ yytestcase(yyruleno==117);
3038 /* (118) lvalue ::= COLOR */ yytestcase(yyruleno==118);
@@ -3130,19 +3183,19 @@
3130 ){
3131 pik_parserARG_FETCH
3132 pik_parserCTX_FETCH
3133 #define TOKEN yyminor
3134 /************ Begin %syntax_error code ****************************************/
3135 #line 537 "pikchr.y"
3136
3137 if( TOKEN.z && TOKEN.z[0] ){
3138 pik_error(p, &TOKEN, "syntax error");
3139 }else{
3140 pik_error(p, 0, "syntax error");
3141 }
3142 UNUSED_PARAMETER(yymajor);
3143 #line 3168 "pikchr.c"
3144 /************ End %syntax_error code ******************************************/
3145 pik_parserARG_STORE /* Suppress warning about unused %extra_argument variable */
3146 pik_parserCTX_STORE
3147 }
3148
@@ -3407,11 +3460,11 @@
3407 #else
3408 (void)iToken;
3409 return 0;
3410 #endif
3411 }
3412 #line 782 "pikchr.y"
3413
3414
3415
3416 /* Chart of the 148 official CSS color names with their
3417 ** corresponding RGB values thru Color Module Level 4:
@@ -3634,42 +3687,57 @@
3634 ** than true arcs. Multiple reasons: (1) the legacy-PIC parameters
3635 ** that control arcs are obscure and I could not figure out what they
3636 ** mean based on available documentation. (2) Arcs are rarely used,
3637 ** and so do not seem that important.
3638 */
3639 static PPoint arcControlPoint(int cw, PPoint f, PPoint t, PNum rScale){
3640 PPoint m;
3641 PNum dx, dy;
3642 m.x = 0.5*(f.x+t.x);
3643 m.y = 0.5*(f.y+t.y);
3644 dx = t.x - f.x;
3645 dy = t.y - f.y;
3646 if( cw ){
3647 m.x -= 0.5*rScale*dy;
3648 m.y += 0.5*rScale*dx;
3649 }else{
3650 m.x += 0.5*rScale*dy;
3651 m.y -= 0.5*rScale*dx;
3652 }
3653 return m;
3654 }
3655 static void arcCheck(Pik *p, PObj *pObj){
3656 PPoint m;
 
 
3657 if( p->nTPath>2 ){
3658 pik_error(p, &pObj->errTok, "arc geometry error");
3659 return;
3660 }
3661 m = arcControlPoint(pObj->cw, p->aTPath[0], p->aTPath[1], 0.5);
3662 pik_bbox_add_xy(&pObj->bbox, m.x, m.y);
 
 
 
 
 
 
 
 
 
 
 
 
 
3663 }
3664 static void arcRender(Pik *p, PObj *pObj){
3665 PPoint f, m, t;
3666 if( pObj->nPath<2 ) return;
3667 if( pObj->sw<0.0 ) return;
3668 f = pObj->aPath[0];
3669 t = pObj->aPath[1];
3670 m = arcControlPoint(pObj->cw,f,t,1.0);
3671 if( pObj->larrow ){
3672 pik_draw_arrowhead(p,&m,&f,pObj);
3673 }
3674 if( pObj->rarrow ){
3675 pik_draw_arrowhead(p,&m,&t,pObj);
@@ -4338,11 +4406,11 @@
4338 static PPoint textOffset(Pik *p, PObj *pObj, int cp){
4339 /* Automatically slim-down the width and height of text
4340 ** statements so that the bounding box tightly encloses the text,
4341 ** then get boxOffset() to do the offset computation.
4342 */
4343 pik_size_to_fit(p, &pObj->errTok,3);
4344 return boxOffset(p, pObj, cp);
4345 }
4346 static void textRender(Pik *p, PObj *pObj){
4347 pik_append_txt(p, pObj, 0);
4348 }
@@ -6347,16 +6415,15 @@
6347 **
6348 ** 1: Fit horizontally only
6349 ** 2: Fit vertically only
6350 ** 3: Fit both ways
6351 */
6352 static void pik_size_to_fit(Pik *p, PToken *pFit, int eWhich){
6353 PObj *pObj;
6354 PNum w, h;
6355 PBox bbox;
6356 if( p->nErr ) return;
6357 pObj = p->cur;
6358
6359 if( pObj->nTxt==0 ){
6360 pik_error(0, pFit, "no text to fit to");
6361 return;
6362 }
@@ -6495,13 +6562,13 @@
6495 unsigned int i;
6496 mid = (first+last)/2;
6497 zClr = aColor[mid].zName;
6498 for(i=0; i<pId->n; i++){
6499 c1 = zClr[i]&0x7f;
6500 if( isupper(c1) ) c1 = tolower(c1);
6501 c2 = pId->z[i]&0x7f;
6502 if( isupper(c2) ) c2 = tolower(c2);
6503 c = c2 - c1;
6504 if( c ) break;
6505 }
6506 if( c==0 && aColor[mid].zName[pId->n] ) c = -1;
6507 if( c==0 ) return (double)aColor[mid].val;
@@ -6896,20 +6963,20 @@
6896 */
6897 if( pObj->h<=0.0 ){
6898 if( pObj->nTxt==0 ){
6899 pObj->h = 0.0;
6900 }else if( pObj->w<=0.0 ){
6901 pik_size_to_fit(p, &pObj->errTok, 3);
6902 }else{
6903 pik_size_to_fit(p, &pObj->errTok, 2);
6904 }
6905 }
6906 if( pObj->w<=0.0 ){
6907 if( pObj->nTxt==0 ){
6908 pObj->w = 0.0;
6909 }else{
6910 pik_size_to_fit(p, &pObj->errTok, 1);
6911 }
6912 }
6913 ofst = pik_elem_offset(p, pObj, pObj->eWith);
6914 dx = (pObj->with.x - ofst.x) - pObj->ptAt.x;
6915 dy = (pObj->with.y - ofst.y) - pObj->ptAt.y;
@@ -7235,11 +7302,12 @@
7235 pik_append_num(p, " width=\"", p->wSVG);
7236 pik_append_num(p, "\" height=\"", p->hSVG);
7237 pik_append(p, "\"", 1);
7238 }
7239 pik_append_dis(p, " viewBox=\"0 0 ",w,"");
7240 pik_append_dis(p, " ",h,"\">\n");
 
7241 pik_elist_render(p, pList);
7242 pik_append(p,"</svg>\n", -1);
7243 }else{
7244 p->wSVG = -1;
7245 p->hSVG = -1;
@@ -7319,10 +7387,11 @@
7319 { "n", 1, T_EDGEPT, 0, CP_N },
7320 { "ne", 2, T_EDGEPT, 0, CP_NE },
7321 { "north", 5, T_EDGEPT, 0, CP_N },
7322 { "nw", 2, T_EDGEPT, 0, CP_NW },
7323 { "of", 2, T_OF, 0, 0 },
 
7324 { "previous", 8, T_LAST, 0, 0, },
7325 { "print", 5, T_PRINT, 0, 0 },
7326 { "rad", 3, T_RADIUS, 0, 0 },
7327 { "radius", 6, T_RADIUS, 0, 0 },
7328 { "right", 5, T_RIGHT, DIR_RIGHT, CP_E },
@@ -7605,11 +7674,11 @@
7605 }
7606 default: {
7607 c = z[0];
7608 if( c=='.' ){
7609 unsigned char c1 = z[1];
7610 if( islower(c1) ){
7611 const PikWord *pFound;
7612 for(i=2; (c = z[i])>='a' && c<='z'; i++){}
7613 pFound = pik_find_word((const char*)z+1, i-1,
7614 pik_keywords, count(pik_keywords));
7615 if( pFound && (pFound->eEdge>0 ||
@@ -7625,15 +7694,15 @@
7625 }else{
7626 /* Any other "dot" */
7627 pToken->eType = T_DOT_L;
7628 }
7629 return 1;
7630 }else if( isdigit(c1) ){
7631 i = 0;
7632 /* no-op. Fall through to number handling */
7633 }else if( isupper(c1) ){
7634 for(i=2; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7635 pToken->eType = T_DOT_U;
7636 return 1;
7637 }else{
7638 pToken->eType = T_ERROR;
7639 return 1;
@@ -7644,11 +7713,11 @@
7644 int isInt = 1;
7645 if( c!='.' ){
7646 nDigit = 1;
7647 for(i=1; (c = z[i])>='0' && c<='9'; i++){ nDigit++; }
7648 if( i==1 && (c=='x' || c=='X') ){
7649 for(i=2; (c = z[i])!=0 && isxdigit(c); i++){}
7650 pToken->eType = T_NUMBER;
7651 return i;
7652 }
7653 }else{
7654 isInt = 0;
@@ -7700,13 +7769,13 @@
7700 ){
7701 i += 2;
7702 }
7703 pToken->eType = T_NUMBER;
7704 return i;
7705 }else if( islower(c) ){
7706 const PikWord *pFound;
7707 for(i=1; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7708 pFound = pik_find_word((const char*)z, i,
7709 pik_keywords, count(pik_keywords));
7710 if( pFound ){
7711 pToken->eType = pFound->eType;
7712 pToken->eCode = pFound->eCode;
@@ -7719,19 +7788,19 @@
7719 }else{
7720 pToken->eType = T_ID;
7721 }
7722 return i;
7723 }else if( c>='A' && c<='Z' ){
7724 for(i=1; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7725 pToken->eType = T_PLACENAME;
7726 return i;
7727 }else if( c=='$' && z[1]>='1' && z[1]<='9' && !isdigit(z[2]) ){
7728 pToken->eType = T_PARAMETER;
7729 pToken->eCode = z[1] - '1';
7730 return 2;
7731 }else if( c=='_' || c=='$' || c=='@' ){
7732 for(i=1; (c = z[i])!=0 && (isalnum(c) || c=='_'); i++){}
7733 pToken->eType = T_ID;
7734 return i;
7735 }else{
7736 pToken->eType = T_ERROR;
7737 return 1;
@@ -7814,12 +7883,12 @@
7814 /* Remove leading and trailing whitespace from each argument.
7815 ** If what remains is one of $1, $2, ... $9 then transfer the
7816 ** corresponding argument from the outer context */
7817 for(j=0; j<=nArg; j++){
7818 PToken *t = &args[j];
7819 while( t->n>0 && isspace(t->z[0]) ){ t->n--; t->z++; }
7820 while( t->n>0 && isspace(t->z[t->n-1]) ){ t->n--; }
7821 if( t->n==2 && t->z[0]=='$' && t->z[1]>='1' && t->z[1]<='9' ){
7822 if( pOuter ) *t = pOuter[t->z[1]-'1'];
7823 else t->n = 0;
7824 }
7825 }
@@ -7896,21 +7965,36 @@
7896 pMac->inUse = 0;
7897 }else{
7898 #if 0
7899 printf("******** Token %s (%d): \"%.*s\" **************\n",
7900 yyTokenName[token.eType], token.eType,
7901 (int)(isspace(token.z[0]) ? 0 : sz), token.z);
7902 #endif
7903 token.n = (unsigned short)(sz & 0xffff);
7904 if( p->nToken++ > PIKCHR_TOKEN_LIMIT ){
7905 pik_error(p, &token, "script is too complex");
7906 break;
 
 
 
 
 
7907 }
7908 pik_parser(pParser, token.eType, token);
7909 }
7910 }
7911 }
 
 
 
 
 
 
 
 
 
 
7912
7913 /*
7914 ** Parse the PIKCHR script contained in zText[]. Return a rendering. Or
7915 ** if an error is encountered, return the error text. The error message
7916 ** is HTML formatted. So regardless of what happens, the return text
@@ -8130,10 +8214,14 @@
8130 exit(1);
8131 }
8132 bSvgOnly = 1;
8133 mFlags |= PIKCHR_PLAINTEXT_ERRORS;
8134 }else
 
 
 
 
8135 {
8136 fprintf(stderr,"unknown option: \"%s\"\n", argv[i]);
8137 usage(argv[0]);
8138 }
8139 continue;
@@ -8242,6 +8330,6 @@
8242
8243
8244 #endif /* PIKCHR_TCL */
8245
8246
8247 #line 8272 "pikchr.c"
8248
--- extsrc/pikchr.c
+++ extsrc/pikchr.c
@@ -1,8 +1,47 @@
1 /* This file is automatically generated by Lemon from input grammar
2 ** source file "pikchr.y".
3 */
4 /*
5 ** 2000-05-29
6 **
7 ** The author disclaims copyright to this source code. In place of
8 ** a legal notice, here is a blessing:
9 **
10 ** May you do good and not evil.
11 ** May you find forgiveness for yourself and forgive others.
12 ** May you share freely, never taking more than you give.
13 **
14 *************************************************************************
15 ** Driver template for the LEMON parser generator.
16 **
17 ** The "lemon" program processes an LALR(1) input grammar file, then uses
18 ** this template to construct a parser. The "lemon" program inserts text
19 ** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
20 ** interstitial "-" characters) contained in this template is changed into
21 ** the value of the %name directive from the grammar. Otherwise, the content
22 ** of this template is copied straight through into the generate parser
23 ** source file.
24 **
25 ** The following is the concatenation of all %include directives from the
26 ** input grammar file:
27 */
28 /************ Begin %include sections from the grammar ************************/
29 #line 1 "VERSION.h"
30 #define MANIFEST_UUID "8a43b020141f772a0ac45291a7fd73041d2efba5e3665c6bd2f334ad9b2e9845"
31 #define MANIFEST_VERSION "[8a43b02014]"
32 #define MANIFEST_DATE "2025-03-19 16:19:43"
33 #define MANIFEST_YEAR "2025"
34 #define MANIFEST_ISODATE "20250319161943"
35 #define MANIFEST_NUMERIC_DATE 20250319
36 #define MANIFEST_NUMERIC_TIME 161943
37 #define RELEASE_VERSION "1.0"
38 #define RELEASE_VERSION_NUMBER 10000
39 #define RELEASE_RESOURCE_VERSION 1,0,0,0
40 #define COMPILER "gcc-13.3.0"
41 #line 2 "pikchr.y"
42
43 /*
44 ** Zero-Clause BSD license:
45 **
46 ** Copyright (C) 2020-09-01 by D. Richard Hipp <[email protected]>
47 **
@@ -125,10 +164,22 @@
164 #include <assert.h>
165 #define count(X) (sizeof(X)/sizeof(X[0]))
166 #ifndef M_PI
167 # define M_PI 3.1415926535897932385
168 #endif
169
170 /*
171 ** Typesafe version of ctype.h macros. Cygwin requires this, I'm told.
172 */
173 #define IsUpper(X) isupper((unsigned char)(X))
174 #define IsLower(X) islower((unsigned char)(X))
175 #define ToLower(X) tolower((unsigned char)(X))
176 #define IsDigit(X) isdigit((unsigned char)(X))
177 #define IsXDigit(X) isxdigit((unsigned char)(X))
178 #define IsSpace(X) isspace((unsigned char)(X))
179 #define IsAlnum(X) isalnum((unsigned char)(X))
180
181
182 /* Limit the number of tokens in a single script to avoid run-away
183 ** macro expansion attacks. See forum post
184 ** https://pikchr.org/home/forumpost/ef8684c6955a411a
185 */
@@ -474,11 +525,11 @@
525 static void pik_bbox_addbox(PBox*,PBox*);
526 static void pik_bbox_add_xy(PBox*,PNum,PNum);
527 static void pik_bbox_addellipse(PBox*,PNum x,PNum y,PNum rx,PNum ry);
528 static void pik_add_txt(Pik*,PToken*,int);
529 static int pik_text_length(const PToken *pToken, const int isMonospace);
530 static void pik_size_to_fit(Pik*,PObj*,PToken*,int);
531 static int pik_text_position(int,PToken*);
532 static PNum pik_property_of(PObj*,PToken*);
533 static PNum pik_func(Pik*,PToken*,PNum,PNum);
534 static PPoint pik_position_between(PNum x, PPoint p1, PPoint p2);
535 static PPoint pik_position_at_angle(PNum dist, PNum r, PPoint pt);
@@ -492,11 +543,11 @@
543 static PObj *pik_position_assert(Pik*,PPoint*,PToken*,PPoint*);
544 static PNum pik_dist(PPoint*,PPoint*);
545 static void pik_add_macro(Pik*,PToken *pId,PToken *pCode);
546
547
548 #line 549 "pikchr.c"
549 /**************** End of %include directives **********************************/
550 /* These constants specify the various numeric values for terminal symbols.
551 ***************** Begin token definitions *************************************/
552 #ifndef T_ID
553 #define T_ID 1
@@ -522,84 +573,85 @@
573 #define T_COLOR 21
574 #define T_THICKNESS 22
575 #define T_PRINT 23
576 #define T_STRING 24
577 #define T_COMMA 25
578 #define T_ISODATE 26
579 #define T_CLASSNAME 27
580 #define T_LB 28
581 #define T_RB 29
582 #define T_UP 30
583 #define T_DOWN 31
584 #define T_LEFT 32
585 #define T_RIGHT 33
586 #define T_CLOSE 34
587 #define T_CHOP 35
588 #define T_FROM 36
589 #define T_TO 37
590 #define T_THEN 38
591 #define T_HEADING 39
592 #define T_GO 40
593 #define T_AT 41
594 #define T_WITH 42
595 #define T_SAME 43
596 #define T_AS 44
597 #define T_FIT 45
598 #define T_BEHIND 46
599 #define T_UNTIL 47
600 #define T_EVEN 48
601 #define T_DOT_E 49
602 #define T_HEIGHT 50
603 #define T_WIDTH 51
604 #define T_RADIUS 52
605 #define T_DIAMETER 53
606 #define T_DOTTED 54
607 #define T_DASHED 55
608 #define T_CW 56
609 #define T_CCW 57
610 #define T_LARROW 58
611 #define T_RARROW 59
612 #define T_LRARROW 60
613 #define T_INVIS 61
614 #define T_THICK 62
615 #define T_THIN 63
616 #define T_SOLID 64
617 #define T_CENTER 65
618 #define T_LJUST 66
619 #define T_RJUST 67
620 #define T_ABOVE 68
621 #define T_BELOW 69
622 #define T_ITALIC 70
623 #define T_BOLD 71
624 #define T_MONO 72
625 #define T_ALIGNED 73
626 #define T_BIG 74
627 #define T_SMALL 75
628 #define T_AND 76
629 #define T_LT 77
630 #define T_GT 78
631 #define T_ON 79
632 #define T_WAY 80
633 #define T_BETWEEN 81
634 #define T_THE 82
635 #define T_NTH 83
636 #define T_VERTEX 84
637 #define T_TOP 85
638 #define T_BOTTOM 86
639 #define T_START 87
640 #define T_END 88
641 #define T_IN 89
642 #define T_THIS 90
643 #define T_DOT_U 91
644 #define T_LAST 92
645 #define T_NUMBER 93
646 #define T_FUNC1 94
647 #define T_FUNC2 95
648 #define T_DIST 96
649 #define T_DOT_XY 97
650 #define T_X 98
651 #define T_Y 99
652 #define T_DOT_L 100
653 #endif
654 /**************** End token definitions ***************************************/
655
656 /* The next sections is a series of control #defines.
657 ** various aspects of the generated parser.
@@ -660,22 +712,22 @@
712 #ifndef INTERFACE
713 # define INTERFACE 1
714 #endif
715 /************* Begin control #defines *****************************************/
716 #define YYCODETYPE unsigned char
717 #define YYNOCODE 138
718 #define YYACTIONTYPE unsigned short int
719 #define pik_parserTOKENTYPE PToken
720 typedef union {
721 int yyinit;
722 pik_parserTOKENTYPE yy0;
723 PList* yy23;
724 PRel yy28;
725 PObj* yy54;
726 PNum yy129;
727 PPoint yy187;
728 short int yy272;
729 } YYMINORTYPE;
730 #ifndef YYSTACKDEPTH
731 #define YYSTACKDEPTH 100
732 #endif
733 #define pik_parserARG_SDECL
@@ -693,21 +745,21 @@
745 #define pik_parserCTX_STORE yypParser->p=p;
746 #define YYFALLBACK 1
747 #define YYNSTATE 164
748 #define YYNRULE 156
749 #define YYNRULE_WITH_ACTION 116
750 #define YYNTOKEN 101
751 #define YY_MAX_SHIFT 163
752 #define YY_MIN_SHIFTREDUCE 287
753 #define YY_MAX_SHIFTREDUCE 442
754 #define YY_ERROR_ACTION 443
755 #define YY_ACCEPT_ACTION 444
756 #define YY_NO_ACTION 445
757 #define YY_MIN_REDUCE 446
758 #define YY_MAX_REDUCE 601
759 #define YY_MIN_DSTRCTR 101
760 #define YY_MAX_DSTRCTR 104
761 /************* End control #defines *******************************************/
762 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
763
764 /* Define the yytestcase() macro to be a no-op if is not already defined
765 ** otherwise.
@@ -786,324 +838,322 @@
838 ** yy_reduce_ofst[] For each state, the offset into yy_action for
839 ** shifting non-terminals after a reduce.
840 ** yy_default[] Default action for each state.
841 **
842 *********** Begin parsing tables **********************************************/
843 #define YY_ACTTAB_COUNT (1305)
844 static const YYACTIONTYPE yy_action[] = {
845 /* 0 */ 575, 495, 161, 119, 25, 452, 29, 74, 129, 148,
846 /* 10 */ 575, 64, 63, 62, 61, 453, 113, 120, 161, 119,
847 /* 20 */ 427, 428, 339, 357, 81, 121, 447, 454, 29, 575,
848 /* 30 */ 530, 13, 50, 450, 322, 323, 9, 8, 33, 149,
849 /* 40 */ 32, 7, 71, 127, 163, 335, 66, 28, 444, 27,
850 /* 50 */ 339, 339, 339, 339, 425, 426, 340, 341, 342, 343,
851 /* 60 */ 344, 345, 346, 347, 348, 474, 64, 63, 62, 61,
852 /* 70 */ 54, 51, 73, 306, 148, 474, 492, 161, 119, 297,
853 /* 80 */ 112, 113, 120, 161, 119, 427, 428, 339, 30, 81,
854 /* 90 */ 109, 447, 454, 29, 474, 528, 161, 119, 450, 322,
855 /* 100 */ 323, 9, 8, 33, 149, 32, 7, 71, 127, 163,
856 /* 110 */ 335, 66, 535, 36, 27, 339, 339, 339, 339, 425,
857 /* 120 */ 426, 340, 341, 342, 343, 344, 345, 346, 347, 348,
858 /* 130 */ 394, 435, 310, 59, 60, 64, 63, 62, 61, 313,
859 /* 140 */ 74, 376, 148, 69, 2, 533, 161, 119, 124, 113,
860 /* 150 */ 120, 161, 119, 80, 535, 31, 308, 79, 83, 107,
861 /* 160 */ 535, 441, 440, 535, 394, 435, 299, 59, 60, 120,
862 /* 170 */ 161, 119, 149, 463, 376, 376, 330, 84, 2, 122,
863 /* 180 */ 78, 78, 38, 156, 156, 156, 48, 37, 559, 328,
864 /* 190 */ 128, 152, 560, 561, 434, 441, 440, 350, 350, 350,
865 /* 200 */ 350, 350, 350, 350, 350, 350, 350, 350, 577, 77,
866 /* 210 */ 577, 35, 106, 46, 436, 437, 438, 439, 579, 375,
867 /* 220 */ 298, 117, 393, 155, 154, 153, 47, 4, 434, 69,
868 /* 230 */ 394, 435, 3, 59, 60, 411, 412, 413, 414, 398,
869 /* 240 */ 399, 376, 62, 61, 2, 108, 106, 5, 436, 437,
870 /* 250 */ 438, 439, 375, 375, 117, 117, 393, 155, 154, 153,
871 /* 260 */ 76, 441, 440, 67, 6, 142, 140, 64, 63, 62,
872 /* 270 */ 61, 380, 157, 424, 427, 428, 339, 379, 159, 45,
873 /* 280 */ 423, 72, 131, 148, 531, 161, 119, 1, 55, 125,
874 /* 290 */ 113, 120, 161, 119, 434, 147, 146, 64, 63, 62,
875 /* 300 */ 61, 397, 43, 11, 339, 339, 339, 339, 425, 426,
876 /* 310 */ 355, 65, 106, 149, 436, 437, 438, 439, 74, 375,
877 /* 320 */ 148, 117, 393, 155, 154, 153, 497, 113, 120, 161,
878 /* 330 */ 119, 22, 21, 12, 142, 140, 64, 63, 62, 61,
879 /* 340 */ 24, 356, 145, 141, 431, 64, 63, 62, 61, 391,
880 /* 350 */ 149, 448, 454, 29, 378, 158, 85, 55, 450, 394,
881 /* 360 */ 432, 138, 59, 60, 147, 146, 120, 161, 119, 163,
882 /* 370 */ 102, 43, 139, 42, 27, 430, 14, 15, 301, 302,
883 /* 380 */ 303, 446, 305, 16, 44, 74, 18, 148, 152, 19,
884 /* 390 */ 20, 36, 68, 496, 113, 120, 161, 119, 114, 359,
885 /* 400 */ 22, 21, 23, 142, 140, 64, 63, 62, 61, 24,
886 /* 410 */ 107, 145, 141, 431, 26, 57, 377, 149, 58, 118,
887 /* 420 */ 120, 161, 119, 392, 463, 384, 55, 64, 63, 62,
888 /* 430 */ 61, 382, 569, 147, 146, 160, 383, 435, 39, 70,
889 /* 440 */ 43, 106, 152, 445, 445, 88, 445, 445, 375, 445,
890 /* 450 */ 117, 393, 155, 154, 153, 120, 161, 119, 445, 17,
891 /* 460 */ 445, 10, 479, 479, 445, 445, 435, 441, 440, 22,
892 /* 470 */ 21, 445, 403, 64, 63, 62, 61, 152, 24, 445,
893 /* 480 */ 145, 141, 431, 133, 75, 126, 354, 445, 445, 123,
894 /* 490 */ 445, 404, 405, 406, 408, 80, 441, 440, 308, 79,
895 /* 500 */ 434, 411, 412, 413, 414, 394, 445, 445, 59, 60,
896 /* 510 */ 64, 63, 62, 61, 445, 445, 376, 445, 445, 42,
897 /* 520 */ 436, 437, 438, 439, 156, 156, 156, 394, 445, 434,
898 /* 530 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 445,
899 /* 540 */ 445, 42, 445, 394, 473, 391, 59, 60, 445, 436,
900 /* 550 */ 437, 438, 439, 49, 376, 445, 74, 42, 148, 445,
901 /* 560 */ 88, 445, 445, 445, 490, 113, 120, 161, 119, 445,
902 /* 570 */ 120, 161, 119, 132, 130, 394, 143, 475, 59, 60,
903 /* 580 */ 445, 473, 64, 63, 62, 61, 376, 106, 149, 42,
904 /* 590 */ 445, 445, 152, 445, 375, 391, 117, 393, 155, 154,
905 /* 600 */ 153, 394, 144, 52, 59, 60, 445, 445, 445, 106,
906 /* 610 */ 445, 445, 376, 445, 445, 42, 375, 445, 117, 393,
907 /* 620 */ 155, 154, 153, 445, 445, 106, 64, 63, 62, 61,
908 /* 630 */ 445, 445, 375, 445, 117, 393, 155, 154, 153, 394,
909 /* 640 */ 445, 445, 59, 60, 88, 445, 445, 53, 445, 445,
910 /* 650 */ 376, 445, 445, 42, 120, 161, 119, 106, 445, 445,
911 /* 660 */ 445, 110, 110, 445, 375, 445, 117, 393, 155, 154,
912 /* 670 */ 153, 394, 445, 445, 59, 60, 152, 107, 445, 445,
913 /* 680 */ 445, 445, 102, 106, 445, 42, 445, 120, 161, 119,
914 /* 690 */ 375, 451, 117, 393, 155, 154, 153, 394, 445, 445,
915 /* 700 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 152,
916 /* 710 */ 445, 40, 445, 394, 445, 396, 59, 60, 445, 445,
917 /* 720 */ 445, 106, 445, 445, 376, 88, 445, 41, 375, 445,
918 /* 730 */ 117, 393, 155, 154, 153, 120, 161, 119, 74, 445,
919 /* 740 */ 148, 445, 111, 111, 107, 445, 484, 113, 120, 161,
920 /* 750 */ 119, 445, 445, 106, 120, 161, 119, 152, 478, 445,
921 /* 760 */ 375, 86, 117, 393, 155, 154, 153, 445, 445, 445,
922 /* 770 */ 149, 120, 161, 119, 445, 445, 152, 445, 445, 106,
923 /* 780 */ 445, 64, 63, 62, 61, 445, 375, 445, 117, 393,
924 /* 790 */ 155, 154, 153, 152, 395, 106, 64, 63, 62, 61,
925 /* 800 */ 98, 445, 375, 445, 117, 393, 155, 154, 153, 445,
926 /* 810 */ 120, 161, 119, 445, 74, 445, 148, 56, 445, 74,
927 /* 820 */ 445, 148, 483, 113, 120, 161, 119, 480, 113, 120,
928 /* 830 */ 161, 119, 152, 74, 445, 148, 445, 89, 445, 445,
929 /* 840 */ 445, 134, 113, 120, 161, 119, 149, 120, 161, 119,
930 /* 850 */ 445, 149, 74, 445, 148, 445, 445, 445, 378, 158,
931 /* 860 */ 517, 113, 120, 161, 119, 149, 74, 445, 148, 152,
932 /* 870 */ 445, 74, 445, 148, 137, 113, 120, 161, 119, 525,
933 /* 880 */ 113, 120, 161, 119, 149, 74, 445, 148, 64, 63,
934 /* 890 */ 62, 61, 445, 527, 113, 120, 161, 119, 149, 445,
935 /* 900 */ 445, 391, 445, 149, 445, 445, 445, 445, 445, 445,
936 /* 910 */ 74, 445, 148, 445, 445, 162, 445, 149, 524, 113,
937 /* 920 */ 120, 161, 119, 118, 445, 74, 445, 148, 445, 445,
938 /* 930 */ 445, 445, 445, 526, 113, 120, 161, 119, 445, 74,
939 /* 940 */ 445, 148, 149, 445, 445, 445, 445, 523, 113, 120,
940 /* 950 */ 161, 119, 74, 445, 148, 445, 445, 149, 445, 445,
941 /* 960 */ 522, 113, 120, 161, 119, 445, 74, 445, 148, 445,
942 /* 970 */ 445, 149, 445, 445, 521, 113, 120, 161, 119, 74,
943 /* 980 */ 445, 148, 445, 445, 149, 445, 445, 520, 113, 120,
944 /* 990 */ 161, 119, 445, 74, 445, 148, 445, 445, 149, 445,
945 /* 1000 */ 445, 519, 113, 120, 161, 119, 445, 445, 445, 445,
946 /* 1010 */ 445, 149, 445, 445, 445, 445, 445, 445, 74, 445,
947 /* 1020 */ 148, 445, 445, 445, 445, 149, 150, 113, 120, 161,
948 /* 1030 */ 119, 74, 445, 148, 445, 445, 445, 445, 445, 151,
949 /* 1040 */ 113, 120, 161, 119, 445, 74, 445, 148, 445, 445,
950 /* 1050 */ 149, 445, 445, 136, 113, 120, 161, 119, 74, 445,
951 /* 1060 */ 148, 445, 445, 149, 445, 445, 135, 113, 120, 161,
952 /* 1070 */ 119, 445, 88, 445, 445, 445, 445, 149, 445, 445,
953 /* 1080 */ 445, 90, 120, 161, 119, 445, 445, 445, 445, 82,
954 /* 1090 */ 149, 120, 161, 119, 445, 87, 466, 445, 34, 99,
955 /* 1100 */ 445, 445, 445, 445, 152, 120, 161, 119, 100, 120,
956 /* 1110 */ 161, 119, 445, 152, 445, 445, 445, 445, 120, 161,
957 /* 1120 */ 119, 445, 445, 445, 101, 445, 445, 152, 445, 445,
958 /* 1130 */ 445, 152, 91, 445, 120, 161, 119, 103, 445, 445,
959 /* 1140 */ 152, 445, 120, 161, 119, 445, 445, 120, 161, 119,
960 /* 1150 */ 445, 92, 445, 445, 445, 445, 152, 445, 445, 445,
961 /* 1160 */ 93, 120, 161, 119, 152, 445, 104, 445, 445, 152,
962 /* 1170 */ 120, 161, 119, 445, 94, 445, 120, 161, 119, 445,
963 /* 1180 */ 445, 445, 445, 152, 120, 161, 119, 445, 445, 105,
964 /* 1190 */ 445, 445, 152, 445, 445, 445, 445, 95, 152, 120,
965 /* 1200 */ 161, 119, 96, 445, 445, 97, 152, 120, 161, 119,
966 /* 1210 */ 445, 445, 120, 161, 119, 120, 161, 119, 445, 445,
967 /* 1220 */ 445, 152, 445, 445, 445, 445, 445, 445, 445, 152,
968 /* 1230 */ 549, 445, 445, 548, 152, 445, 445, 152, 547, 445,
969 /* 1240 */ 120, 161, 119, 120, 161, 119, 546, 445, 120, 161,
970 /* 1250 */ 119, 445, 445, 445, 445, 445, 120, 161, 119, 445,
971 /* 1260 */ 445, 445, 152, 445, 445, 152, 445, 445, 445, 115,
972 /* 1270 */ 152, 445, 116, 445, 445, 445, 445, 445, 152, 120,
973 /* 1280 */ 161, 119, 120, 161, 119, 445, 445, 445, 445, 445,
974 /* 1290 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
975 /* 1300 */ 445, 152, 445, 445, 152,
 
976 };
977 static const YYCODETYPE yy_lookahead[] = {
978 /* 0 */ 0, 115, 116, 117, 136, 103, 104, 105, 107, 107,
979 /* 10 */ 10, 4, 5, 6, 7, 113, 114, 115, 116, 117,
980 /* 20 */ 20, 21, 22, 17, 24, 101, 102, 103, 104, 29,
981 /* 30 */ 107, 25, 25, 109, 34, 35, 36, 37, 38, 137,
982 /* 40 */ 40, 41, 42, 43, 120, 45, 46, 109, 124, 125,
983 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
984 /* 60 */ 60, 61, 62, 63, 64, 0, 4, 5, 6, 7,
985 /* 70 */ 4, 5, 105, 25, 107, 10, 115, 116, 117, 17,
986 /* 80 */ 113, 114, 115, 116, 117, 20, 21, 22, 128, 24,
987 /* 90 */ 101, 102, 103, 104, 29, 115, 116, 117, 109, 34,
988 /* 100 */ 35, 36, 37, 38, 137, 40, 41, 42, 43, 120,
989 /* 110 */ 45, 46, 49, 10, 125, 50, 51, 52, 53, 54,
990 /* 120 */ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
991 /* 130 */ 1, 2, 29, 4, 5, 4, 5, 6, 7, 8,
992 /* 140 */ 105, 12, 107, 3, 15, 115, 116, 117, 113, 114,
993 /* 150 */ 115, 116, 117, 24, 91, 130, 27, 28, 118, 105,
994 /* 160 */ 97, 32, 33, 100, 1, 2, 19, 4, 5, 115,
995 /* 170 */ 116, 117, 137, 119, 12, 12, 2, 118, 15, 1,
996 /* 180 */ 126, 127, 106, 20, 21, 22, 110, 111, 106, 2,
997 /* 190 */ 107, 137, 110, 111, 65, 32, 33, 65, 66, 67,
998 /* 200 */ 68, 69, 70, 71, 72, 73, 74, 75, 132, 133,
999 /* 210 */ 134, 131, 83, 39, 85, 86, 87, 88, 135, 90,
1000 /* 220 */ 17, 92, 93, 94, 95, 96, 39, 15, 65, 89,
1001 /* 230 */ 1, 2, 16, 4, 5, 30, 31, 32, 33, 98,
1002 /* 240 */ 99, 12, 6, 7, 15, 83, 83, 41, 85, 86,
1003 /* 250 */ 87, 88, 90, 90, 92, 92, 93, 94, 95, 96,
1004 /* 260 */ 49, 32, 33, 44, 41, 2, 3, 4, 5, 6,
1005 /* 270 */ 7, 27, 28, 42, 20, 21, 22, 27, 28, 16,
1006 /* 280 */ 42, 105, 48, 107, 115, 116, 117, 13, 25, 113,
1007 /* 290 */ 114, 115, 116, 117, 65, 32, 33, 4, 5, 6,
1008 /* 300 */ 7, 17, 39, 25, 50, 51, 52, 53, 54, 55,
1009 /* 310 */ 17, 100, 83, 137, 85, 86, 87, 88, 105, 90,
1010 /* 320 */ 107, 92, 93, 94, 95, 96, 113, 114, 115, 116,
1011 /* 330 */ 117, 68, 69, 76, 2, 3, 4, 5, 6, 7,
1012 /* 340 */ 77, 17, 79, 80, 81, 4, 5, 6, 7, 17,
1013 /* 350 */ 137, 102, 103, 104, 27, 28, 105, 25, 109, 1,
1014 /* 360 */ 81, 80, 4, 5, 32, 33, 115, 116, 117, 120,
1015 /* 370 */ 12, 39, 82, 15, 125, 81, 3, 36, 20, 21,
1016 /* 380 */ 22, 0, 24, 3, 39, 105, 3, 107, 137, 3,
1017 /* 390 */ 3, 10, 3, 113, 114, 115, 116, 117, 97, 78,
1018 /* 400 */ 68, 69, 25, 2, 3, 4, 5, 6, 7, 77,
1019 /* 410 */ 105, 79, 80, 81, 15, 15, 12, 137, 15, 92,
1020 /* 420 */ 115, 116, 117, 17, 119, 29, 25, 4, 5, 6,
1021 /* 430 */ 7, 29, 127, 32, 33, 91, 29, 2, 11, 3,
1022 /* 440 */ 39, 83, 137, 138, 138, 105, 138, 138, 90, 138,
1023 /* 450 */ 92, 93, 94, 95, 96, 115, 116, 117, 138, 36,
1024 /* 460 */ 138, 121, 122, 123, 138, 138, 2, 32, 33, 68,
1025 /* 470 */ 69, 138, 1, 4, 5, 6, 7, 137, 77, 138,
1026 /* 480 */ 79, 80, 81, 12, 49, 14, 17, 138, 138, 18,
1027 /* 490 */ 138, 20, 21, 22, 23, 24, 32, 33, 27, 28,
1028 /* 500 */ 65, 30, 31, 32, 33, 1, 138, 138, 4, 5,
1029 /* 510 */ 4, 5, 6, 7, 138, 138, 12, 138, 138, 15,
1030 /* 520 */ 85, 86, 87, 88, 20, 21, 22, 1, 138, 65,
1031 /* 530 */ 4, 5, 4, 5, 6, 7, 138, 138, 12, 138,
1032 /* 540 */ 138, 15, 138, 1, 2, 17, 4, 5, 138, 85,
1033 /* 550 */ 86, 87, 88, 25, 12, 138, 105, 15, 107, 138,
1034 /* 560 */ 105, 138, 138, 138, 113, 114, 115, 116, 117, 138,
1035 /* 570 */ 115, 116, 117, 47, 48, 1, 2, 122, 4, 5,
1036 /* 580 */ 138, 39, 4, 5, 6, 7, 12, 83, 137, 15,
1037 /* 590 */ 138, 138, 137, 138, 90, 17, 92, 93, 94, 95,
1038 /* 600 */ 96, 1, 2, 25, 4, 5, 138, 138, 138, 83,
1039 /* 610 */ 138, 138, 12, 138, 138, 15, 90, 138, 92, 93,
1040 /* 620 */ 94, 95, 96, 138, 138, 83, 4, 5, 6, 7,
1041 /* 630 */ 138, 138, 90, 138, 92, 93, 94, 95, 96, 1,
1042 /* 640 */ 138, 138, 4, 5, 105, 138, 138, 25, 138, 138,
1043 /* 650 */ 12, 138, 138, 15, 115, 116, 117, 83, 138, 138,
1044 /* 660 */ 138, 122, 123, 138, 90, 138, 92, 93, 94, 95,
1045 /* 670 */ 96, 1, 138, 138, 4, 5, 137, 105, 138, 138,
1046 /* 680 */ 138, 138, 12, 83, 138, 15, 138, 115, 116, 117,
1047 /* 690 */ 90, 119, 92, 93, 94, 95, 96, 1, 138, 138,
1048 /* 700 */ 4, 5, 4, 5, 6, 7, 138, 138, 12, 137,
1049 /* 710 */ 138, 15, 138, 1, 138, 17, 4, 5, 138, 138,
1050 /* 720 */ 138, 83, 138, 138, 12, 105, 138, 15, 90, 138,
1051 /* 730 */ 92, 93, 94, 95, 96, 115, 116, 117, 105, 138,
1052 /* 740 */ 107, 138, 122, 123, 105, 138, 113, 114, 115, 116,
1053 /* 750 */ 117, 138, 138, 83, 115, 116, 117, 137, 119, 138,
1054 /* 760 */ 90, 105, 92, 93, 94, 95, 96, 138, 138, 138,
1055 /* 770 */ 137, 115, 116, 117, 138, 138, 137, 138, 138, 83,
1056 /* 780 */ 138, 4, 5, 6, 7, 138, 90, 138, 92, 93,
1057 /* 790 */ 94, 95, 96, 137, 17, 83, 4, 5, 6, 7,
1058 /* 800 */ 105, 138, 90, 138, 92, 93, 94, 95, 96, 138,
1059 /* 810 */ 115, 116, 117, 138, 105, 138, 107, 25, 138, 105,
1060 /* 820 */ 138, 107, 113, 114, 115, 116, 117, 113, 114, 115,
1061 /* 830 */ 116, 117, 137, 105, 138, 107, 138, 105, 138, 138,
1062 /* 840 */ 138, 113, 114, 115, 116, 117, 137, 115, 116, 117,
1063 /* 850 */ 138, 137, 105, 138, 107, 138, 138, 138, 27, 28,
1064 /* 860 */ 113, 114, 115, 116, 117, 137, 105, 138, 107, 137,
1065 /* 870 */ 138, 105, 138, 107, 113, 114, 115, 116, 117, 113,
1066 /* 880 */ 114, 115, 116, 117, 137, 105, 138, 107, 4, 5,
1067 /* 890 */ 6, 7, 138, 113, 114, 115, 116, 117, 137, 138,
1068 /* 900 */ 138, 17, 138, 137, 138, 138, 138, 138, 138, 138,
1069 /* 910 */ 105, 138, 107, 138, 138, 84, 138, 137, 113, 114,
1070 /* 920 */ 115, 116, 117, 92, 138, 105, 138, 107, 138, 138,
1071 /* 930 */ 138, 138, 138, 113, 114, 115, 116, 117, 138, 105,
1072 /* 940 */ 138, 107, 137, 138, 138, 138, 138, 113, 114, 115,
1073 /* 950 */ 116, 117, 105, 138, 107, 138, 138, 137, 138, 138,
1074 /* 960 */ 113, 114, 115, 116, 117, 138, 105, 138, 107, 138,
1075 /* 970 */ 138, 137, 138, 138, 113, 114, 115, 116, 117, 105,
1076 /* 980 */ 138, 107, 138, 138, 137, 138, 138, 113, 114, 115,
1077 /* 990 */ 116, 117, 138, 105, 138, 107, 138, 138, 137, 138,
1078 /* 1000 */ 138, 113, 114, 115, 116, 117, 138, 138, 138, 138,
1079 /* 1010 */ 138, 137, 138, 138, 138, 138, 138, 138, 105, 138,
1080 /* 1020 */ 107, 138, 138, 138, 138, 137, 113, 114, 115, 116,
1081 /* 1030 */ 117, 105, 138, 107, 138, 138, 138, 138, 138, 113,
1082 /* 1040 */ 114, 115, 116, 117, 138, 105, 138, 107, 138, 138,
1083 /* 1050 */ 137, 138, 138, 113, 114, 115, 116, 117, 105, 138,
1084 /* 1060 */ 107, 138, 138, 137, 138, 138, 113, 114, 115, 116,
1085 /* 1070 */ 117, 138, 105, 138, 138, 138, 138, 137, 138, 138,
1086 /* 1080 */ 138, 105, 115, 116, 117, 138, 138, 138, 138, 122,
1087 /* 1090 */ 137, 115, 116, 117, 138, 105, 129, 138, 131, 105,
1088 /* 1100 */ 138, 138, 138, 138, 137, 115, 116, 117, 105, 115,
1089 /* 1110 */ 116, 117, 138, 137, 138, 138, 138, 138, 115, 116,
1090 /* 1120 */ 117, 138, 138, 138, 105, 138, 138, 137, 138, 138,
1091 /* 1130 */ 138, 137, 105, 138, 115, 116, 117, 105, 138, 138,
1092 /* 1140 */ 137, 138, 115, 116, 117, 138, 138, 115, 116, 117,
1093 /* 1150 */ 138, 105, 138, 138, 138, 138, 137, 138, 138, 138,
1094 /* 1160 */ 105, 115, 116, 117, 137, 138, 105, 138, 138, 137,
1095 /* 1170 */ 115, 116, 117, 138, 105, 138, 115, 116, 117, 138,
1096 /* 1180 */ 138, 138, 138, 137, 115, 116, 117, 138, 138, 105,
1097 /* 1190 */ 138, 138, 137, 138, 138, 138, 138, 105, 137, 115,
1098 /* 1200 */ 116, 117, 105, 138, 138, 105, 137, 115, 116, 117,
1099 /* 1210 */ 138, 138, 115, 116, 117, 115, 116, 117, 138, 138,
1100 /* 1220 */ 138, 137, 138, 138, 138, 138, 138, 138, 138, 137,
1101 /* 1230 */ 105, 138, 138, 105, 137, 138, 138, 137, 105, 138,
1102 /* 1240 */ 115, 116, 117, 115, 116, 117, 105, 138, 115, 116,
1103 /* 1250 */ 117, 138, 138, 138, 138, 138, 115, 116, 117, 138,
1104 /* 1260 */ 138, 138, 137, 138, 138, 137, 138, 138, 138, 105,
1105 /* 1270 */ 137, 138, 105, 138, 138, 138, 138, 138, 137, 115,
1106 /* 1280 */ 116, 117, 115, 116, 117, 138, 138, 138, 138, 138,
1107 /* 1290 */ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
1108 /* 1300 */ 138, 137, 138, 138, 137, 101, 101, 101, 101, 101,
1109 /* 1310 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1110 /* 1320 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1111 /* 1330 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1112 /* 1340 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1113 /* 1350 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1114 /* 1360 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1115 /* 1370 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1116 /* 1380 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1117 /* 1390 */ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
1118 /* 1400 */ 101, 101, 101, 101, 101, 101,
 
1119 };
1120 #define YY_SHIFT_COUNT (163)
1121 #define YY_SHIFT_MIN (0)
1122 #define YY_SHIFT_MAX (884)
1123 static const unsigned short int yy_shift_ofst[] = {
1124 /* 0 */ 471, 129, 163, 229, 229, 229, 229, 229, 229, 229,
1125 /* 10 */ 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
1126 /* 20 */ 229, 229, 229, 229, 229, 229, 229, 358, 526, 638,
1127 /* 30 */ 358, 471, 542, 542, 0, 65, 471, 670, 638, 670,
1128 /* 40 */ 504, 504, 504, 574, 600, 638, 638, 638, 638, 638,
1129 /* 50 */ 638, 696, 638, 638, 712, 638, 638, 638, 638, 638,
1130 /* 60 */ 638, 638, 638, 638, 638, 254, 162, 162, 162, 162,
1131 /* 70 */ 162, 435, 263, 332, 401, 464, 464, 205, 48, 1305,
1132 /* 80 */ 1305, 1305, 1305, 132, 132, 528, 578, 62, 131, 341,
1133 /* 90 */ 423, 293, 7, 469, 622, 698, 792, 777, 884, 506,
1134 /* 100 */ 506, 506, 63, 506, 506, 506, 831, 506, 327, 103,
1135 /* 110 */ 174, 187, 6, 66, 141, 236, 236, 244, 250, 140,
1136 /* 120 */ 211, 381, 147, 178, 203, 216, 212, 219, 206, 223,
1137 /* 130 */ 231, 238, 234, 274, 284, 278, 257, 324, 279, 281,
1138 /* 140 */ 290, 294, 373, 380, 383, 345, 386, 387, 389, 301,
1139 /* 150 */ 321, 377, 301, 399, 400, 403, 406, 396, 402, 407,
1140 /* 160 */ 404, 344, 436, 427,
1141 };
1142 #define YY_REDUCE_COUNT (82)
1143 #define YY_REDUCE_MIN (-132)
1144 #define YY_REDUCE_MAX (1167)
1145 static const short yy_reduce_ofst[] = {
1146 /* 0 */ -76, -98, -33, 35, 176, 213, 280, 451, 633, 709,
1147 /* 10 */ 714, 728, 747, 761, 766, 780, 805, 820, 834, 847,
1148 /* 20 */ 861, 874, 888, 913, 926, 940, 953, 54, 340, 967,
1149 /* 30 */ 305, -11, 539, 620, 76, 76, 249, 639, 455, 572,
1150 /* 40 */ 251, 656, 695, 732, 976, 990, 994, 1003, 1019, 1027,
1151 /* 50 */ 1032, 1046, 1055, 1061, 1069, 1084, 1092, 1097, 1100, 1125,
1152 /* 60 */ 1128, 1133, 1141, 1164, 1167, 82, -114, -39, -20, 30,
1153 /* 70 */ 169, 83, -132, -132, -132, -99, -77, -62, -40, 25,
1154 /* 80 */ 40, 59, 80,
1155 };
1156 static const YYACTIONTYPE yy_default[] = {
1157 /* 0 */ 449, 443, 443, 443, 443, 443, 443, 443, 443, 443,
1158 /* 10 */ 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
1159 /* 20 */ 443, 443, 443, 443, 443, 443, 443, 443, 473, 576,
@@ -1164,10 +1214,11 @@
1214 0, /* COLOR => nothing */
1215 0, /* THICKNESS => nothing */
1216 0, /* PRINT => nothing */
1217 0, /* STRING => nothing */
1218 0, /* COMMA => nothing */
1219 0, /* ISODATE => nothing */
1220 0, /* CLASSNAME => nothing */
1221 0, /* LB => nothing */
1222 0, /* RB => nothing */
1223 0, /* UP => nothing */
1224 0, /* DOWN => nothing */
@@ -1347,120 +1398,122 @@
1398 /* 21 */ "COLOR",
1399 /* 22 */ "THICKNESS",
1400 /* 23 */ "PRINT",
1401 /* 24 */ "STRING",
1402 /* 25 */ "COMMA",
1403 /* 26 */ "ISODATE",
1404 /* 27 */ "CLASSNAME",
1405 /* 28 */ "LB",
1406 /* 29 */ "RB",
1407 /* 30 */ "UP",
1408 /* 31 */ "DOWN",
1409 /* 32 */ "LEFT",
1410 /* 33 */ "RIGHT",
1411 /* 34 */ "CLOSE",
1412 /* 35 */ "CHOP",
1413 /* 36 */ "FROM",
1414 /* 37 */ "TO",
1415 /* 38 */ "THEN",
1416 /* 39 */ "HEADING",
1417 /* 40 */ "GO",
1418 /* 41 */ "AT",
1419 /* 42 */ "WITH",
1420 /* 43 */ "SAME",
1421 /* 44 */ "AS",
1422 /* 45 */ "FIT",
1423 /* 46 */ "BEHIND",
1424 /* 47 */ "UNTIL",
1425 /* 48 */ "EVEN",