Fossil SCM

Merge from trunk.

brickviking 2025-03-10 10:06 UTC bv-infotool merge
Commit 4850a59591a5301f9c4f2ba85ac60d7e61c5f3e5d996b2223ffc4b0bca059fb4
+1 -1
--- auto.def
+++ auto.def
@@ -36,11 +36,11 @@
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]} {
4646
puts [get-define MINIMUM_SQLITE_VERSION]
4747
--- auto.def
+++ auto.def
@@ -36,11 +36,11 @@
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
--- auto.def
+++ auto.def
@@ -36,11 +36,11 @@
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
--- extsrc/pikchr-worker.js
+++ extsrc/pikchr-worker.js
@@ -206,16 +206,17 @@
206206
data:{step: ++f.last.step, text: text||null}
207207
});
208208
}
209209
};
210210
211
- importScripts('pikchr.js');
211
+ importScripts('pikchr-v7583078860.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
@@ -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
@@ -206,16 +206,17 @@
206 data:{step: ++f.last.step, text: text||null}
207 });
208 }
209 };
210
211 importScripts('pikchr-v7583078860.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
+1096 -1035
--- 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 "052f07296e76ab2312caf2a4bf6237e574b3e533c7a36ee8f34db833baa3efb4"
31
+#define MANIFEST_VERSION "[052f07296e]"
32
+#define MANIFEST_DATE "2025-03-05 10:54:16"
33
+#define MANIFEST_YEAR "2025"
34
+#define MANIFEST_ISODATE "20250305105416"
35
+#define MANIFEST_NUMERIC_DATE 20250305
36
+#define MANIFEST_NUMERIC_TIME 105416
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
**
@@ -486,11 +525,11 @@
486525
static void pik_bbox_addbox(PBox*,PBox*);
487526
static void pik_bbox_add_xy(PBox*,PNum,PNum);
488527
static void pik_bbox_addellipse(PBox*,PNum x,PNum y,PNum rx,PNum ry);
489528
static void pik_add_txt(Pik*,PToken*,int);
490529
static int pik_text_length(const PToken *pToken, const int isMonospace);
491
-static void pik_size_to_fit(Pik*,PToken*,int);
530
+static void pik_size_to_fit(Pik*,PObj*,PToken*,int);
492531
static int pik_text_position(int,PToken*);
493532
static PNum pik_property_of(PObj*,PToken*);
494533
static PNum pik_func(Pik*,PToken*,PNum,PNum);
495534
static PPoint pik_position_between(PNum x, PPoint p1, PPoint p2);
496535
static PPoint pik_position_at_angle(PNum dist, PNum r, PPoint pt);
@@ -504,11 +543,11 @@
504543
static PObj *pik_position_assert(Pik*,PPoint*,PToken*,PPoint*);
505544
static PNum pik_dist(PPoint*,PPoint*);
506545
static void pik_add_macro(Pik*,PToken *pId,PToken *pCode);
507546
508547
509
-#line 535 "pikchr.c"
548
+#line 549 "pikchr.c"
510549
/**************** End of %include directives **********************************/
511550
/* These constants specify the various numeric values for terminal symbols.
512551
***************** Begin token definitions *************************************/
513552
#ifndef T_ID
514553
#define T_ID 1
@@ -534,84 +573,85 @@
534573
#define T_COLOR 21
535574
#define T_THICKNESS 22
536575
#define T_PRINT 23
537576
#define T_STRING 24
538577
#define T_COMMA 25
539
-#define T_CLASSNAME 26
540
-#define T_LB 27
541
-#define T_RB 28
542
-#define T_UP 29
543
-#define T_DOWN 30
544
-#define T_LEFT 31
545
-#define T_RIGHT 32
546
-#define T_CLOSE 33
547
-#define T_CHOP 34
548
-#define T_FROM 35
549
-#define T_TO 36
550
-#define T_THEN 37
551
-#define T_HEADING 38
552
-#define T_GO 39
553
-#define T_AT 40
554
-#define T_WITH 41
555
-#define T_SAME 42
556
-#define T_AS 43
557
-#define T_FIT 44
558
-#define T_BEHIND 45
559
-#define T_UNTIL 46
560
-#define T_EVEN 47
561
-#define T_DOT_E 48
562
-#define T_HEIGHT 49
563
-#define T_WIDTH 50
564
-#define T_RADIUS 51
565
-#define T_DIAMETER 52
566
-#define T_DOTTED 53
567
-#define T_DASHED 54
568
-#define T_CW 55
569
-#define T_CCW 56
570
-#define T_LARROW 57
571
-#define T_RARROW 58
572
-#define T_LRARROW 59
573
-#define T_INVIS 60
574
-#define T_THICK 61
575
-#define T_THIN 62
576
-#define T_SOLID 63
577
-#define T_CENTER 64
578
-#define T_LJUST 65
579
-#define T_RJUST 66
580
-#define T_ABOVE 67
581
-#define T_BELOW 68
582
-#define T_ITALIC 69
583
-#define T_BOLD 70
584
-#define T_MONO 71
585
-#define T_ALIGNED 72
586
-#define T_BIG 73
587
-#define T_SMALL 74
588
-#define T_AND 75
589
-#define T_LT 76
590
-#define T_GT 77
591
-#define T_ON 78
592
-#define T_WAY 79
593
-#define T_BETWEEN 80
594
-#define T_THE 81
595
-#define T_NTH 82
596
-#define T_VERTEX 83
597
-#define T_TOP 84
598
-#define T_BOTTOM 85
599
-#define T_START 86
600
-#define T_END 87
601
-#define T_IN 88
602
-#define T_THIS 89
603
-#define T_DOT_U 90
604
-#define T_LAST 91
605
-#define T_NUMBER 92
606
-#define T_FUNC1 93
607
-#define T_FUNC2 94
608
-#define T_DIST 95
609
-#define T_DOT_XY 96
610
-#define T_X 97
611
-#define T_Y 98
612
-#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
613653
#endif
614654
/**************** End token definitions ***************************************/
615655
616656
/* The next sections is a series of control #defines.
617657
** various aspects of the generated parser.
@@ -672,22 +712,22 @@
672712
#ifndef INTERFACE
673713
# define INTERFACE 1
674714
#endif
675715
/************* Begin control #defines *****************************************/
676716
#define YYCODETYPE unsigned char
677
-#define YYNOCODE 136
717
+#define YYNOCODE 138
678718
#define YYACTIONTYPE unsigned short int
679719
#define pik_parserTOKENTYPE PToken
680720
typedef union {
681721
int yyinit;
682722
pik_parserTOKENTYPE yy0;
683
- PNum yy21;
684
- PPoint yy63;
685
- PRel yy72;
686
- PObj* yy162;
687
- short int yy188;
688
- PList* yy235;
723
+ PList* yy23;
724
+ PRel yy28;
725
+ PObj* yy54;
726
+ PNum yy129;
727
+ PPoint yy187;
728
+ short int yy272;
689729
} YYMINORTYPE;
690730
#ifndef YYSTACKDEPTH
691731
#define YYSTACKDEPTH 100
692732
#endif
693733
#define pik_parserARG_SDECL
@@ -705,21 +745,21 @@
705745
#define pik_parserCTX_STORE yypParser->p=p;
706746
#define YYFALLBACK 1
707747
#define YYNSTATE 164
708748
#define YYNRULE 156
709749
#define YYNRULE_WITH_ACTION 116
710
-#define YYNTOKEN 100
750
+#define YYNTOKEN 101
711751
#define YY_MAX_SHIFT 163
712752
#define YY_MIN_SHIFTREDUCE 287
713753
#define YY_MAX_SHIFTREDUCE 442
714754
#define YY_ERROR_ACTION 443
715755
#define YY_ACCEPT_ACTION 444
716756
#define YY_NO_ACTION 445
717757
#define YY_MIN_REDUCE 446
718758
#define YY_MAX_REDUCE 601
719
-#define YY_MIN_DSTRCTR 100
720
-#define YY_MAX_DSTRCTR 103
759
+#define YY_MIN_DSTRCTR 101
760
+#define YY_MAX_DSTRCTR 104
721761
/************* End control #defines *******************************************/
722762
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
723763
724764
/* Define the yytestcase() macro to be a no-op if is not already defined
725765
** otherwise.
@@ -798,324 +838,322 @@
798838
** yy_reduce_ofst[] For each state, the offset into yy_action for
799839
** shifting non-terminals after a reduce.
800840
** yy_default[] Default action for each state.
801841
**
802842
*********** Begin parsing tables **********************************************/
803
-#define YY_ACTTAB_COUNT (1313)
843
+#define YY_ACTTAB_COUNT (1305)
804844
static const YYACTIONTYPE yy_action[] = {
805845
/* 0 */ 575, 495, 161, 119, 25, 452, 29, 74, 129, 148,
806
- /* 10 */ 575, 492, 161, 119, 453, 113, 120, 161, 119, 530,
807
- /* 20 */ 427, 428, 339, 559, 81, 30, 560, 561, 575, 64,
808
- /* 30 */ 63, 62, 61, 322, 323, 9, 8, 33, 149, 32,
809
- /* 40 */ 7, 71, 127, 38, 335, 66, 48, 37, 28, 339,
810
- /* 50 */ 339, 339, 339, 425, 426, 340, 341, 342, 343, 344,
811
- /* 60 */ 345, 346, 347, 348, 474, 528, 161, 119, 577, 77,
812
- /* 70 */ 577, 73, 306, 148, 474, 533, 161, 119, 112, 113,
813
- /* 80 */ 120, 161, 119, 128, 427, 428, 339, 31, 81, 531,
814
- /* 90 */ 161, 119, 474, 35, 330, 378, 158, 322, 323, 9,
815
- /* 100 */ 8, 33, 149, 32, 7, 71, 127, 328, 335, 66,
816
- /* 110 */ 579, 378, 158, 339, 339, 339, 339, 425, 426, 340,
817
- /* 120 */ 341, 342, 343, 344, 345, 346, 347, 348, 394, 435,
818
- /* 130 */ 46, 59, 60, 64, 63, 62, 61, 357, 36, 376,
819
- /* 140 */ 54, 51, 2, 47, 403, 13, 297, 411, 412, 413,
820
- /* 150 */ 414, 80, 162, 308, 79, 133, 310, 126, 441, 440,
821
- /* 160 */ 118, 123, 83, 404, 405, 406, 408, 80, 84, 308,
822
- /* 170 */ 79, 299, 411, 412, 413, 414, 118, 69, 350, 350,
823
- /* 180 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 62,
824
- /* 190 */ 61, 434, 64, 63, 62, 61, 313, 398, 399, 427,
825
- /* 200 */ 428, 339, 380, 157, 64, 63, 62, 61, 122, 106,
826
- /* 210 */ 535, 436, 437, 438, 439, 298, 375, 391, 117, 393,
827
- /* 220 */ 155, 154, 153, 394, 435, 49, 59, 60, 339, 339,
828
- /* 230 */ 339, 339, 425, 426, 376, 3, 4, 2, 64, 63,
829
- /* 240 */ 62, 61, 156, 156, 156, 394, 379, 159, 59, 60,
830
- /* 250 */ 76, 67, 535, 441, 440, 5, 102, 6, 535, 42,
831
- /* 260 */ 131, 535, 69, 107, 301, 302, 303, 394, 305, 15,
832
- /* 270 */ 59, 60, 120, 161, 119, 446, 463, 424, 376, 423,
833
- /* 280 */ 1, 42, 397, 78, 78, 36, 434, 11, 394, 435,
834
- /* 290 */ 356, 59, 60, 12, 152, 139, 432, 14, 16, 376,
835
- /* 300 */ 18, 65, 2, 138, 106, 430, 436, 437, 438, 439,
836
- /* 310 */ 44, 375, 19, 117, 393, 155, 154, 153, 441, 440,
837
- /* 320 */ 142, 140, 64, 63, 62, 61, 106, 20, 68, 376,
838
- /* 330 */ 359, 107, 23, 375, 45, 117, 393, 155, 154, 153,
839
- /* 340 */ 120, 161, 119, 55, 463, 114, 26, 57, 106, 147,
840
- /* 350 */ 146, 434, 569, 58, 392, 375, 43, 117, 393, 155,
841
- /* 360 */ 154, 153, 152, 384, 64, 63, 62, 61, 382, 106,
842
- /* 370 */ 383, 436, 437, 438, 439, 377, 375, 70, 117, 393,
843
- /* 380 */ 155, 154, 153, 160, 39, 22, 21, 445, 142, 140,
844
- /* 390 */ 64, 63, 62, 61, 24, 17, 145, 141, 431, 108,
845
- /* 400 */ 445, 445, 445, 391, 445, 445, 375, 445, 117, 445,
846
- /* 410 */ 445, 55, 74, 445, 148, 445, 445, 147, 146, 124,
847
- /* 420 */ 113, 120, 161, 119, 43, 445, 445, 142, 140, 64,
848
- /* 430 */ 63, 62, 61, 445, 394, 445, 445, 59, 60, 64,
849
- /* 440 */ 63, 62, 61, 149, 445, 376, 445, 445, 42, 445,
850
- /* 450 */ 55, 445, 391, 22, 21, 445, 147, 146, 445, 445,
851
- /* 460 */ 52, 445, 24, 43, 145, 141, 431, 394, 445, 445,
852
- /* 470 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 132,
853
- /* 480 */ 130, 42, 445, 445, 445, 355, 156, 156, 156, 445,
854
- /* 490 */ 445, 445, 22, 21, 445, 394, 473, 445, 59, 60,
855
- /* 500 */ 445, 24, 445, 145, 141, 431, 376, 445, 107, 42,
856
- /* 510 */ 64, 63, 62, 61, 445, 106, 445, 120, 161, 119,
857
- /* 520 */ 445, 478, 375, 354, 117, 393, 155, 154, 153, 445,
858
- /* 530 */ 394, 143, 473, 59, 60, 64, 63, 62, 61, 152,
859
- /* 540 */ 445, 376, 445, 445, 42, 445, 445, 445, 106, 64,
860
- /* 550 */ 63, 62, 61, 445, 445, 375, 50, 117, 393, 155,
861
- /* 560 */ 154, 153, 445, 394, 144, 445, 59, 60, 445, 445,
862
- /* 570 */ 53, 72, 445, 148, 376, 445, 106, 42, 125, 113,
863
- /* 580 */ 120, 161, 119, 375, 445, 117, 393, 155, 154, 153,
864
- /* 590 */ 394, 445, 445, 59, 60, 445, 445, 445, 445, 445,
865
- /* 600 */ 445, 102, 149, 445, 42, 445, 74, 445, 148, 445,
866
- /* 610 */ 445, 106, 445, 497, 113, 120, 161, 119, 375, 445,
867
- /* 620 */ 117, 393, 155, 154, 153, 394, 445, 445, 59, 60,
868
- /* 630 */ 445, 445, 88, 445, 445, 445, 376, 149, 445, 40,
869
- /* 640 */ 445, 120, 161, 119, 106, 445, 445, 435, 110, 110,
870
- /* 650 */ 445, 375, 445, 117, 393, 155, 154, 153, 394, 445,
871
- /* 660 */ 445, 59, 60, 152, 85, 445, 445, 445, 445, 376,
872
- /* 670 */ 445, 106, 41, 120, 161, 119, 441, 440, 375, 445,
873
- /* 680 */ 117, 393, 155, 154, 153, 448, 454, 29, 445, 445,
874
- /* 690 */ 74, 450, 148, 75, 88, 152, 445, 496, 113, 120,
875
- /* 700 */ 161, 119, 163, 120, 161, 119, 106, 27, 445, 434,
876
- /* 710 */ 111, 111, 445, 375, 445, 117, 393, 155, 154, 153,
877
- /* 720 */ 445, 149, 445, 445, 445, 152, 74, 445, 148, 436,
878
- /* 730 */ 437, 438, 439, 490, 113, 120, 161, 119, 445, 106,
879
- /* 740 */ 121, 447, 454, 29, 445, 445, 375, 450, 117, 393,
880
- /* 750 */ 155, 154, 153, 445, 445, 445, 445, 149, 163, 74,
881
- /* 760 */ 445, 148, 444, 27, 445, 445, 484, 113, 120, 161,
882
- /* 770 */ 119, 445, 445, 445, 74, 445, 148, 445, 445, 445,
883
- /* 780 */ 445, 483, 113, 120, 161, 119, 74, 445, 148, 86,
884
- /* 790 */ 149, 445, 445, 480, 113, 120, 161, 119, 120, 161,
885
- /* 800 */ 119, 445, 74, 445, 148, 149, 445, 445, 445, 134,
886
- /* 810 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
887
- /* 820 */ 152, 517, 113, 120, 161, 119, 88, 64, 63, 62,
888
- /* 830 */ 61, 445, 445, 149, 445, 120, 161, 119, 445, 74,
889
- /* 840 */ 396, 148, 475, 445, 445, 149, 137, 113, 120, 161,
890
- /* 850 */ 119, 74, 445, 148, 445, 445, 445, 152, 525, 113,
891
- /* 860 */ 120, 161, 119, 445, 74, 445, 148, 445, 445, 445,
892
- /* 870 */ 149, 527, 113, 120, 161, 119, 445, 445, 445, 74,
893
- /* 880 */ 445, 148, 149, 445, 445, 445, 524, 113, 120, 161,
894
- /* 890 */ 119, 74, 445, 148, 98, 149, 445, 445, 526, 113,
895
- /* 900 */ 120, 161, 119, 120, 161, 119, 445, 74, 445, 148,
896
- /* 910 */ 149, 445, 445, 445, 523, 113, 120, 161, 119, 74,
897
- /* 920 */ 445, 148, 149, 445, 445, 152, 522, 113, 120, 161,
898
- /* 930 */ 119, 89, 64, 63, 62, 61, 445, 445, 149, 445,
899
- /* 940 */ 120, 161, 119, 445, 74, 395, 148, 445, 445, 445,
900
- /* 950 */ 149, 521, 113, 120, 161, 119, 74, 445, 148, 445,
901
- /* 960 */ 445, 445, 152, 520, 113, 120, 161, 119, 445, 74,
902
- /* 970 */ 445, 148, 445, 445, 445, 149, 519, 113, 120, 161,
903
- /* 980 */ 119, 445, 445, 445, 74, 445, 148, 149, 445, 445,
904
- /* 990 */ 445, 150, 113, 120, 161, 119, 74, 445, 148, 90,
905
- /* 1000 */ 149, 445, 445, 151, 113, 120, 161, 119, 120, 161,
906
- /* 1010 */ 119, 445, 74, 445, 148, 149, 445, 435, 445, 136,
907
- /* 1020 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
908
- /* 1030 */ 152, 135, 113, 120, 161, 119, 64, 63, 62, 61,
909
- /* 1040 */ 445, 445, 445, 149, 445, 445, 441, 440, 445, 88,
910
- /* 1050 */ 445, 445, 445, 445, 445, 149, 445, 56, 120, 161,
911
- /* 1060 */ 119, 88, 445, 445, 10, 479, 479, 445, 445, 445,
912
- /* 1070 */ 120, 161, 119, 445, 445, 445, 445, 82, 445, 434,
913
- /* 1080 */ 152, 445, 445, 445, 466, 445, 34, 109, 447, 454,
914
- /* 1090 */ 29, 445, 152, 445, 450, 445, 445, 445, 107, 436,
915
- /* 1100 */ 437, 438, 439, 87, 445, 163, 445, 120, 161, 119,
916
- /* 1110 */ 27, 451, 120, 161, 119, 99, 445, 64, 63, 62,
917
- /* 1120 */ 61, 445, 100, 445, 120, 161, 119, 101, 445, 152,
918
- /* 1130 */ 391, 120, 161, 119, 152, 445, 120, 161, 119, 91,
919
- /* 1140 */ 445, 445, 445, 445, 445, 445, 152, 445, 120, 161,
920
- /* 1150 */ 119, 103, 445, 152, 92, 445, 445, 445, 152, 445,
921
- /* 1160 */ 120, 161, 119, 120, 161, 119, 93, 445, 445, 104,
922
- /* 1170 */ 152, 445, 445, 445, 445, 120, 161, 119, 120, 161,
923
- /* 1180 */ 119, 445, 152, 445, 94, 152, 445, 445, 445, 445,
924
- /* 1190 */ 445, 445, 105, 120, 161, 119, 445, 152, 445, 95,
925
- /* 1200 */ 152, 120, 161, 119, 445, 445, 445, 96, 120, 161,
926
- /* 1210 */ 119, 445, 445, 445, 445, 152, 120, 161, 119, 445,
927
- /* 1220 */ 445, 445, 445, 152, 445, 445, 445, 445, 445, 445,
928
- /* 1230 */ 152, 97, 445, 445, 549, 445, 445, 548, 152, 445,
929
- /* 1240 */ 120, 161, 119, 120, 161, 119, 120, 161, 119, 445,
930
- /* 1250 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
931
- /* 1260 */ 445, 445, 152, 547, 445, 152, 546, 445, 152, 115,
932
- /* 1270 */ 445, 445, 120, 161, 119, 120, 161, 119, 120, 161,
933
- /* 1280 */ 119, 116, 445, 445, 445, 445, 445, 445, 445, 445,
934
- /* 1290 */ 120, 161, 119, 445, 152, 445, 445, 152, 445, 445,
935
- /* 1300 */ 152, 445, 445, 445, 445, 445, 445, 445, 445, 445,
936
- /* 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,
937976
};
938977
static const YYCODETYPE yy_lookahead[] = {
939
- /* 0 */ 0, 113, 114, 115, 134, 102, 103, 104, 106, 106,
940
- /* 10 */ 10, 113, 114, 115, 111, 112, 113, 114, 115, 106,
941
- /* 20 */ 20, 21, 22, 105, 24, 126, 108, 109, 28, 4,
942
- /* 30 */ 5, 6, 7, 33, 34, 35, 36, 37, 135, 39,
943
- /* 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,
944983
/* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
945
- /* 60 */ 60, 61, 62, 63, 0, 113, 114, 115, 130, 131,
946
- /* 70 */ 132, 104, 25, 106, 10, 113, 114, 115, 111, 112,
947
- /* 80 */ 113, 114, 115, 106, 20, 21, 22, 128, 24, 113,
948
- /* 90 */ 114, 115, 28, 129, 2, 26, 27, 33, 34, 35,
949
- /* 100 */ 36, 37, 135, 39, 40, 41, 42, 2, 44, 45,
950
- /* 110 */ 133, 26, 27, 49, 50, 51, 52, 53, 54, 55,
951
- /* 120 */ 56, 57, 58, 59, 60, 61, 62, 63, 1, 2,
952
- /* 130 */ 38, 4, 5, 4, 5, 6, 7, 17, 10, 12,
953
- /* 140 */ 4, 5, 15, 38, 1, 25, 17, 29, 30, 31,
954
- /* 150 */ 32, 24, 83, 26, 27, 12, 28, 14, 31, 32,
955
- /* 160 */ 91, 18, 116, 20, 21, 22, 23, 24, 116, 26,
956
- /* 170 */ 27, 19, 29, 30, 31, 32, 91, 3, 64, 65,
957
- /* 180 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 6,
958
- /* 190 */ 7, 64, 4, 5, 6, 7, 8, 97, 98, 20,
959
- /* 200 */ 21, 22, 26, 27, 4, 5, 6, 7, 1, 82,
960
- /* 210 */ 48, 84, 85, 86, 87, 17, 89, 17, 91, 92,
961
- /* 220 */ 93, 94, 95, 1, 2, 25, 4, 5, 49, 50,
962
- /* 230 */ 51, 52, 53, 54, 12, 16, 15, 15, 4, 5,
963
- /* 240 */ 6, 7, 20, 21, 22, 1, 26, 27, 4, 5,
964
- /* 250 */ 48, 43, 90, 31, 32, 40, 12, 40, 96, 15,
965
- /* 260 */ 47, 99, 88, 104, 20, 21, 22, 1, 24, 35,
966
- /* 270 */ 4, 5, 113, 114, 115, 0, 117, 41, 12, 41,
967
- /* 280 */ 13, 15, 17, 124, 125, 10, 64, 25, 1, 2,
968
- /* 290 */ 17, 4, 5, 75, 135, 81, 80, 3, 3, 12,
969
- /* 300 */ 3, 99, 15, 79, 82, 80, 84, 85, 86, 87,
970
- /* 310 */ 38, 89, 3, 91, 92, 93, 94, 95, 31, 32,
971
- /* 320 */ 2, 3, 4, 5, 6, 7, 82, 3, 3, 12,
972
- /* 330 */ 77, 104, 25, 89, 16, 91, 92, 93, 94, 95,
973
- /* 340 */ 113, 114, 115, 25, 117, 96, 15, 15, 82, 31,
974
- /* 350 */ 32, 64, 125, 15, 17, 89, 38, 91, 92, 93,
975
- /* 360 */ 94, 95, 135, 28, 4, 5, 6, 7, 28, 82,
976
- /* 370 */ 28, 84, 85, 86, 87, 12, 89, 3, 91, 92,
977
- /* 380 */ 93, 94, 95, 90, 11, 67, 68, 136, 2, 3,
978
- /* 390 */ 4, 5, 6, 7, 76, 35, 78, 79, 80, 82,
979
- /* 400 */ 136, 136, 136, 17, 136, 136, 89, 136, 91, 136,
980
- /* 410 */ 136, 25, 104, 136, 106, 136, 136, 31, 32, 111,
981
- /* 420 */ 112, 113, 114, 115, 38, 136, 136, 2, 3, 4,
982
- /* 430 */ 5, 6, 7, 136, 1, 136, 136, 4, 5, 4,
983
- /* 440 */ 5, 6, 7, 135, 136, 12, 136, 136, 15, 136,
984
- /* 450 */ 25, 136, 17, 67, 68, 136, 31, 32, 136, 136,
985
- /* 460 */ 25, 136, 76, 38, 78, 79, 80, 1, 136, 136,
986
- /* 470 */ 4, 5, 4, 5, 6, 7, 136, 136, 12, 46,
987
- /* 480 */ 47, 15, 136, 136, 136, 17, 20, 21, 22, 136,
988
- /* 490 */ 136, 136, 67, 68, 136, 1, 2, 136, 4, 5,
989
- /* 500 */ 136, 76, 136, 78, 79, 80, 12, 136, 104, 15,
990
- /* 510 */ 4, 5, 6, 7, 136, 82, 136, 113, 114, 115,
991
- /* 520 */ 136, 117, 89, 17, 91, 92, 93, 94, 95, 136,
992
- /* 530 */ 1, 2, 38, 4, 5, 4, 5, 6, 7, 135,
993
- /* 540 */ 136, 12, 136, 136, 15, 136, 136, 136, 82, 4,
994
- /* 550 */ 5, 6, 7, 136, 136, 89, 25, 91, 92, 93,
995
- /* 560 */ 94, 95, 136, 1, 2, 136, 4, 5, 136, 136,
996
- /* 570 */ 25, 104, 136, 106, 12, 136, 82, 15, 111, 112,
997
- /* 580 */ 113, 114, 115, 89, 136, 91, 92, 93, 94, 95,
998
- /* 590 */ 1, 136, 136, 4, 5, 136, 136, 136, 136, 136,
999
- /* 600 */ 136, 12, 135, 136, 15, 136, 104, 136, 106, 136,
1000
- /* 610 */ 136, 82, 136, 111, 112, 113, 114, 115, 89, 136,
1001
- /* 620 */ 91, 92, 93, 94, 95, 1, 136, 136, 4, 5,
1002
- /* 630 */ 136, 136, 104, 136, 136, 136, 12, 135, 136, 15,
1003
- /* 640 */ 136, 113, 114, 115, 82, 136, 136, 2, 120, 121,
1004
- /* 650 */ 136, 89, 136, 91, 92, 93, 94, 95, 1, 136,
1005
- /* 660 */ 136, 4, 5, 135, 104, 136, 136, 136, 136, 12,
1006
- /* 670 */ 136, 82, 15, 113, 114, 115, 31, 32, 89, 136,
1007
- /* 680 */ 91, 92, 93, 94, 95, 101, 102, 103, 136, 136,
1008
- /* 690 */ 104, 107, 106, 48, 104, 135, 136, 111, 112, 113,
1009
- /* 700 */ 114, 115, 118, 113, 114, 115, 82, 123, 136, 64,
1010
- /* 710 */ 120, 121, 136, 89, 136, 91, 92, 93, 94, 95,
1011
- /* 720 */ 136, 135, 136, 136, 136, 135, 104, 136, 106, 84,
1012
- /* 730 */ 85, 86, 87, 111, 112, 113, 114, 115, 136, 82,
1013
- /* 740 */ 100, 101, 102, 103, 136, 136, 89, 107, 91, 92,
1014
- /* 750 */ 93, 94, 95, 136, 136, 136, 136, 135, 118, 104,
1015
- /* 760 */ 136, 106, 122, 123, 136, 136, 111, 112, 113, 114,
1016
- /* 770 */ 115, 136, 136, 136, 104, 136, 106, 136, 136, 136,
1017
- /* 780 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1018
- /* 790 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1019
- /* 800 */ 115, 136, 104, 136, 106, 135, 136, 136, 136, 111,
1020
- /* 810 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1021
- /* 820 */ 135, 111, 112, 113, 114, 115, 104, 4, 5, 6,
1022
- /* 830 */ 7, 136, 136, 135, 136, 113, 114, 115, 136, 104,
1023
- /* 840 */ 17, 106, 120, 136, 136, 135, 111, 112, 113, 114,
1024
- /* 850 */ 115, 104, 136, 106, 136, 136, 136, 135, 111, 112,
1025
- /* 860 */ 113, 114, 115, 136, 104, 136, 106, 136, 136, 136,
1026
- /* 870 */ 135, 111, 112, 113, 114, 115, 136, 136, 136, 104,
1027
- /* 880 */ 136, 106, 135, 136, 136, 136, 111, 112, 113, 114,
1028
- /* 890 */ 115, 104, 136, 106, 104, 135, 136, 136, 111, 112,
1029
- /* 900 */ 113, 114, 115, 113, 114, 115, 136, 104, 136, 106,
1030
- /* 910 */ 135, 136, 136, 136, 111, 112, 113, 114, 115, 104,
1031
- /* 920 */ 136, 106, 135, 136, 136, 135, 111, 112, 113, 114,
1032
- /* 930 */ 115, 104, 4, 5, 6, 7, 136, 136, 135, 136,
1033
- /* 940 */ 113, 114, 115, 136, 104, 17, 106, 136, 136, 136,
1034
- /* 950 */ 135, 111, 112, 113, 114, 115, 104, 136, 106, 136,
1035
- /* 960 */ 136, 136, 135, 111, 112, 113, 114, 115, 136, 104,
1036
- /* 970 */ 136, 106, 136, 136, 136, 135, 111, 112, 113, 114,
1037
- /* 980 */ 115, 136, 136, 136, 104, 136, 106, 135, 136, 136,
1038
- /* 990 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1039
- /* 1000 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1040
- /* 1010 */ 115, 136, 104, 136, 106, 135, 136, 2, 136, 111,
1041
- /* 1020 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1042
- /* 1030 */ 135, 111, 112, 113, 114, 115, 4, 5, 6, 7,
1043
- /* 1040 */ 136, 136, 136, 135, 136, 136, 31, 32, 136, 104,
1044
- /* 1050 */ 136, 136, 136, 136, 136, 135, 136, 25, 113, 114,
1045
- /* 1060 */ 115, 104, 136, 136, 119, 120, 121, 136, 136, 136,
1046
- /* 1070 */ 113, 114, 115, 136, 136, 136, 136, 120, 136, 64,
1047
- /* 1080 */ 135, 136, 136, 136, 127, 136, 129, 100, 101, 102,
1048
- /* 1090 */ 103, 136, 135, 136, 107, 136, 136, 136, 104, 84,
1049
- /* 1100 */ 85, 86, 87, 104, 136, 118, 136, 113, 114, 115,
1050
- /* 1110 */ 123, 117, 113, 114, 115, 104, 136, 4, 5, 6,
1051
- /* 1120 */ 7, 136, 104, 136, 113, 114, 115, 104, 136, 135,
1052
- /* 1130 */ 17, 113, 114, 115, 135, 136, 113, 114, 115, 104,
1053
- /* 1140 */ 136, 136, 136, 136, 136, 136, 135, 136, 113, 114,
1054
- /* 1150 */ 115, 104, 136, 135, 104, 136, 136, 136, 135, 136,
1055
- /* 1160 */ 113, 114, 115, 113, 114, 115, 104, 136, 136, 104,
1056
- /* 1170 */ 135, 136, 136, 136, 136, 113, 114, 115, 113, 114,
1057
- /* 1180 */ 115, 136, 135, 136, 104, 135, 136, 136, 136, 136,
1058
- /* 1190 */ 136, 136, 104, 113, 114, 115, 136, 135, 136, 104,
1059
- /* 1200 */ 135, 113, 114, 115, 136, 136, 136, 104, 113, 114,
1060
- /* 1210 */ 115, 136, 136, 136, 136, 135, 113, 114, 115, 136,
1061
- /* 1220 */ 136, 136, 136, 135, 136, 136, 136, 136, 136, 136,
1062
- /* 1230 */ 135, 104, 136, 136, 104, 136, 136, 104, 135, 136,
1063
- /* 1240 */ 113, 114, 115, 113, 114, 115, 113, 114, 115, 136,
1064
- /* 1250 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1065
- /* 1260 */ 136, 136, 135, 104, 136, 135, 104, 136, 135, 104,
1066
- /* 1270 */ 136, 136, 113, 114, 115, 113, 114, 115, 113, 114,
1067
- /* 1280 */ 115, 104, 136, 136, 136, 136, 136, 136, 136, 136,
1068
- /* 1290 */ 113, 114, 115, 136, 135, 136, 136, 135, 136, 136,
1069
- /* 1300 */ 135, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1070
- /* 1310 */ 136, 136, 135, 100, 100, 100, 100, 100, 100, 100,
1071
- /* 1320 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1072
- /* 1330 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1073
- /* 1340 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1074
- /* 1350 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1075
- /* 1360 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1076
- /* 1370 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1077
- /* 1380 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1078
- /* 1390 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1079
- /* 1400 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1080
- /* 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,
10811119
};
10821120
#define YY_SHIFT_COUNT (163)
10831121
#define YY_SHIFT_MIN (0)
1084
-#define YY_SHIFT_MAX (1113)
1122
+#define YY_SHIFT_MAX (884)
10851123
static const unsigned short int yy_shift_ofst[] = {
1086
- /* 0 */ 143, 127, 222, 287, 287, 287, 287, 287, 287, 287,
1087
- /* 10 */ 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
1088
- /* 20 */ 287, 287, 287, 287, 287, 287, 287, 244, 433, 266,
1089
- /* 30 */ 244, 143, 494, 494, 0, 64, 143, 589, 266, 589,
1090
- /* 40 */ 466, 466, 466, 529, 562, 266, 266, 266, 266, 266,
1091
- /* 50 */ 266, 624, 266, 266, 657, 266, 266, 266, 266, 266,
1092
- /* 60 */ 266, 266, 266, 266, 266, 179, 317, 317, 317, 317,
1093
- /* 70 */ 317, 645, 318, 386, 425, 1015, 1015, 118, 47, 1313,
1094
- /* 80 */ 1313, 1313, 1313, 114, 114, 200, 435, 129, 188, 234,
1095
- /* 90 */ 360, 468, 531, 506, 545, 823, 1032, 928, 1113, 25,
1096
- /* 100 */ 25, 25, 162, 25, 25, 25, 69, 25, 85, 128,
1097
- /* 110 */ 92, 105, 120, 136, 100, 183, 183, 176, 220, 174,
1098
- /* 120 */ 202, 275, 152, 207, 198, 219, 221, 208, 215, 217,
1099
- /* 130 */ 236, 238, 213, 267, 265, 262, 218, 273, 216, 224,
1100
- /* 140 */ 214, 225, 294, 295, 297, 272, 309, 324, 325, 249,
1101
- /* 150 */ 253, 307, 249, 331, 332, 338, 337, 335, 340, 342,
1102
- /* 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,
11031141
};
11041142
#define YY_REDUCE_COUNT (82)
1105
-#define YY_REDUCE_MIN (-130)
1106
-#define YY_REDUCE_MAX (1177)
1143
+#define YY_REDUCE_MIN (-132)
1144
+#define YY_REDUCE_MAX (1167)
11071145
static const short yy_reduce_ofst[] = {
1108
- /* 0 */ 640, -97, -33, 308, 467, 502, 586, 622, 655, 670,
1109
- /* 10 */ 682, 698, 710, 735, 747, 760, 775, 787, 803, 815,
1110
- /* 20 */ 840, 852, 865, 880, 892, 908, 920, 159, 945, 957,
1111
- /* 30 */ 227, 987, 528, 590, -62, -62, 584, 404, 722, 994,
1112
- /* 40 */ 560, 685, 790, 827, 895, 999, 1011, 1018, 1023, 1035,
1113
- /* 50 */ 1047, 1050, 1062, 1065, 1080, 1088, 1095, 1103, 1127, 1130,
1114
- /* 60 */ 1133, 1159, 1162, 1165, 1177, -82, -112, -102, -48, -38,
1115
- /* 70 */ -24, -23, -130, -130, -130, -98, -87, -59, -101, -41,
1116
- /* 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,
11171155
};
11181156
static const YYACTIONTYPE yy_default[] = {
11191157
/* 0 */ 449, 443, 443, 443, 443, 443, 443, 443, 443, 443,
11201158
/* 10 */ 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
11211159
/* 20 */ 443, 443, 443, 443, 443, 443, 443, 443, 473, 576,
@@ -1176,10 +1214,11 @@
11761214
0, /* COLOR => nothing */
11771215
0, /* THICKNESS => nothing */
11781216
0, /* PRINT => nothing */
11791217
0, /* STRING => nothing */
11801218
0, /* COMMA => nothing */
1219
+ 0, /* ISODATE => nothing */
11811220
0, /* CLASSNAME => nothing */
11821221
0, /* LB => nothing */
11831222
0, /* RB => nothing */
11841223
0, /* UP => nothing */
11851224
0, /* DOWN => nothing */
@@ -1359,120 +1398,122 @@
13591398
/* 21 */ "COLOR",
13601399
/* 22 */ "THICKNESS",
13611400
/* 23 */ "PRINT",
13621401
/* 24 */ "STRING",
13631402
/* 25 */ "COMMA",
1364
- /* 26 */ "CLASSNAME",
1365
- /* 27 */ "LB",
1366
- /* 28 */ "RB",
1367
- /* 29 */ "UP",
1368
- /* 30 */ "DOWN",
1369
- /* 31 */ "LEFT",
1370
- /* 32 */ "RIGHT",
1371
- /* 33 */ "CLOSE",
1372
- /* 34 */ "CHOP",
1373
- /* 35 */ "FROM",
1374
- /* 36 */ "TO",
1375
- /* 37 */ "THEN",
1376
- /* 38 */ "HEADING",
1377
- /* 39 */ "GO",
1378
- /* 40 */ "AT",
1379
- /* 41 */ "WITH",
1380
- /* 42 */ "SAME",
1381
- /* 43 */ "AS",
1382
- /* 44 */ "FIT",
1383
- /* 45 */ "BEHIND",
1384
- /* 46 */ "UNTIL",
1385
- /* 47 */ "EVEN",
1386
- /* 48 */ "DOT_E",
1387
- /* 49 */ "HEIGHT",
1388
- /* 50 */ "WIDTH",
1389
- /* 51 */ "RADIUS",
1390
- /* 52 */ "DIAMETER",
1391
- /* 53 */ "DOTTED",
1392
- /* 54 */ "DASHED",
1393
- /* 55 */ "CW",
1394
- /* 56 */ "CCW",
1395
- /* 57 */ "LARROW",
1396
- /* 58 */ "RARROW",
1397
- /* 59 */ "LRARROW",
1398
- /* 60 */ "INVIS",
1399
- /* 61 */ "THICK",
1400
- /* 62 */ "THIN",
1401
- /* 63 */ "SOLID",
1402
- /* 64 */ "CENTER",
1403
- /* 65 */ "LJUST",
1404
- /* 66 */ "RJUST",
1405
- /* 67 */ "ABOVE",
1406
- /* 68 */ "BELOW",
1407
- /* 69 */ "ITALIC",
1408
- /* 70 */ "BOLD",
1409
- /* 71 */ "MONO",
1410
- /* 72 */ "ALIGNED",
1411
- /* 73 */ "BIG",
1412
- /* 74 */ "SMALL",
1413
- /* 75 */ "AND",
1414
- /* 76 */ "LT",
1415
- /* 77 */ "GT",
1416
- /* 78 */ "ON",
1417
- /* 79 */ "WAY",
1418
- /* 80 */ "BETWEEN",
1419
- /* 81 */ "THE",
1420
- /* 82 */ "NTH",
1421
- /* 83 */ "VERTEX",
1422
- /* 84 */ "TOP",
1423
- /* 85 */ "BOTTOM",
1424
- /* 86 */ "START",
1425
- /* 87 */ "END",
1426
- /* 88 */ "IN",
1427
- /* 89 */ "THIS",
1428
- /* 90 */ "DOT_U",
1429
- /* 91 */ "LAST",
1430
- /* 92 */ "NUMBER",
1431
- /* 93 */ "FUNC1",
1432
- /* 94 */ "FUNC2",
1433
- /* 95 */ "DIST",
1434
- /* 96 */ "DOT_XY",
1435
- /* 97 */ "X",
1436
- /* 98 */ "Y",
1437
- /* 99 */ "DOT_L",
1438
- /* 100 */ "statement_list",
1439
- /* 101 */ "statement",
1440
- /* 102 */ "unnamed_statement",
1441
- /* 103 */ "basetype",
1442
- /* 104 */ "expr",
1443
- /* 105 */ "numproperty",
1444
- /* 106 */ "edge",
1445
- /* 107 */ "direction",
1446
- /* 108 */ "dashproperty",
1447
- /* 109 */ "colorproperty",
1448
- /* 110 */ "locproperty",
1449
- /* 111 */ "position",
1450
- /* 112 */ "place",
1451
- /* 113 */ "object",
1452
- /* 114 */ "objectname",
1453
- /* 115 */ "nth",
1454
- /* 116 */ "textposition",
1455
- /* 117 */ "rvalue",
1456
- /* 118 */ "lvalue",
1457
- /* 119 */ "even",
1458
- /* 120 */ "relexpr",
1459
- /* 121 */ "optrelexpr",
1460
- /* 122 */ "document",
1461
- /* 123 */ "print",
1462
- /* 124 */ "prlist",
1463
- /* 125 */ "pritem",
1464
- /* 126 */ "prsep",
1465
- /* 127 */ "attribute_list",
1466
- /* 128 */ "savelist",
1467
- /* 129 */ "alist",
1468
- /* 130 */ "attribute",
1469
- /* 131 */ "go",
1470
- /* 132 */ "boolproperty",
1471
- /* 133 */ "withclause",
1472
- /* 134 */ "between",
1473
- /* 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",
14741515
};
14751516
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
14761517
14771518
#ifndef NDEBUG
14781519
/* For tracing reduce actions, the names of all rules are required.
@@ -1755,24 +1796,24 @@
17551796
** Note: during a reduce, the only symbols destroyed are those
17561797
** which appear on the RHS of the rule, but which are *not* used
17571798
** inside the C code.
17581799
*/
17591800
/********* Begin destructor definitions ***************************************/
1760
- case 100: /* statement_list */
1761
-{
1762
-#line 523 "pikchr.y"
1763
-pik_elist_free(p,(yypminor->yy235));
1764
-#line 1789 "pikchr.c"
1765
-}
1766
- break;
1767
- case 101: /* statement */
1768
- case 102: /* unnamed_statement */
1769
- case 103: /* basetype */
1770
-{
1771
-#line 525 "pikchr.y"
1772
-pik_elem_free(p,(yypminor->yy162));
1773
-#line 1798 "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"
17741815
}
17751816
break;
17761817
/********* End destructor definitions *****************************************/
17771818
default: break; /* If no destructor action specified: do nothing */
17781819
}
@@ -2003,14 +2044,14 @@
20032044
#endif
20042045
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
20052046
/* Here code is inserted which will execute if the parser
20062047
** stack every overflows */
20072048
/******** Begin %stack_overflow code ******************************************/
2008
-#line 557 "pikchr.y"
2049
+#line 559 "pikchr.y"
20092050
20102051
pik_error(p, 0, "parser stack overflow");
2011
-#line 2036 "pikchr.c"
2052
+#line 2052 "pikchr.c"
20122053
/******** End %stack_overflow code ********************************************/
20132054
pik_parserARG_STORE /* Suppress warning about unused %extra_argument var */
20142055
pik_parserCTX_STORE
20152056
}
20162057
@@ -2072,166 +2113,166 @@
20722113
}
20732114
20742115
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
20752116
** of that rule */
20762117
static const YYCODETYPE yyRuleInfoLhs[] = {
2077
- 122, /* (0) document ::= statement_list */
2078
- 100, /* (1) statement_list ::= statement */
2079
- 100, /* (2) statement_list ::= statement_list EOL statement */
2080
- 101, /* (3) statement ::= */
2081
- 101, /* (4) statement ::= direction */
2082
- 101, /* (5) statement ::= lvalue ASSIGN rvalue */
2083
- 101, /* (6) statement ::= PLACENAME COLON unnamed_statement */
2084
- 101, /* (7) statement ::= PLACENAME COLON position */
2085
- 101, /* (8) statement ::= unnamed_statement */
2086
- 101, /* (9) statement ::= print prlist */
2087
- 101, /* (10) statement ::= ASSERT LP expr EQ expr RP */
2088
- 101, /* (11) statement ::= ASSERT LP position EQ position RP */
2089
- 101, /* (12) statement ::= DEFINE ID CODEBLOCK */
2090
- 117, /* (13) rvalue ::= PLACENAME */
2091
- 125, /* (14) pritem ::= FILL */
2092
- 125, /* (15) pritem ::= COLOR */
2093
- 125, /* (16) pritem ::= THICKNESS */
2094
- 125, /* (17) pritem ::= rvalue */
2095
- 125, /* (18) pritem ::= STRING */
2096
- 126, /* (19) prsep ::= COMMA */
2097
- 102, /* (20) unnamed_statement ::= basetype attribute_list */
2098
- 103, /* (21) basetype ::= CLASSNAME */
2099
- 103, /* (22) basetype ::= STRING textposition */
2100
- 103, /* (23) basetype ::= LB savelist statement_list RB */
2101
- 128, /* (24) savelist ::= */
2102
- 120, /* (25) relexpr ::= expr */
2103
- 120, /* (26) relexpr ::= expr PERCENT */
2104
- 121, /* (27) optrelexpr ::= */
2105
- 127, /* (28) attribute_list ::= relexpr alist */
2106
- 130, /* (29) attribute ::= numproperty relexpr */
2107
- 130, /* (30) attribute ::= dashproperty expr */
2108
- 130, /* (31) attribute ::= dashproperty */
2109
- 130, /* (32) attribute ::= colorproperty rvalue */
2110
- 130, /* (33) attribute ::= go direction optrelexpr */
2111
- 130, /* (34) attribute ::= go direction even position */
2112
- 130, /* (35) attribute ::= CLOSE */
2113
- 130, /* (36) attribute ::= CHOP */
2114
- 130, /* (37) attribute ::= FROM position */
2115
- 130, /* (38) attribute ::= TO position */
2116
- 130, /* (39) attribute ::= THEN */
2117
- 130, /* (40) attribute ::= THEN optrelexpr HEADING expr */
2118
- 130, /* (41) attribute ::= THEN optrelexpr EDGEPT */
2119
- 130, /* (42) attribute ::= GO optrelexpr HEADING expr */
2120
- 130, /* (43) attribute ::= GO optrelexpr EDGEPT */
2121
- 130, /* (44) attribute ::= AT position */
2122
- 130, /* (45) attribute ::= SAME */
2123
- 130, /* (46) attribute ::= SAME AS object */
2124
- 130, /* (47) attribute ::= STRING textposition */
2125
- 130, /* (48) attribute ::= FIT */
2126
- 130, /* (49) attribute ::= BEHIND object */
2127
- 133, /* (50) withclause ::= DOT_E edge AT position */
2128
- 133, /* (51) withclause ::= edge AT position */
2129
- 105, /* (52) numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2130
- 132, /* (53) boolproperty ::= CW */
2131
- 132, /* (54) boolproperty ::= CCW */
2132
- 132, /* (55) boolproperty ::= LARROW */
2133
- 132, /* (56) boolproperty ::= RARROW */
2134
- 132, /* (57) boolproperty ::= LRARROW */
2135
- 132, /* (58) boolproperty ::= INVIS */
2136
- 132, /* (59) boolproperty ::= THICK */
2137
- 132, /* (60) boolproperty ::= THIN */
2138
- 132, /* (61) boolproperty ::= SOLID */
2139
- 116, /* (62) textposition ::= */
2140
- 116, /* (63) textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2141
- 111, /* (64) position ::= expr COMMA expr */
2142
- 111, /* (65) position ::= place PLUS expr COMMA expr */
2143
- 111, /* (66) position ::= place MINUS expr COMMA expr */
2144
- 111, /* (67) position ::= place PLUS LP expr COMMA expr RP */
2145
- 111, /* (68) position ::= place MINUS LP expr COMMA expr RP */
2146
- 111, /* (69) position ::= LP position COMMA position RP */
2147
- 111, /* (70) position ::= LP position RP */
2148
- 111, /* (71) position ::= expr between position AND position */
2149
- 111, /* (72) position ::= expr LT position COMMA position GT */
2150
- 111, /* (73) position ::= expr ABOVE position */
2151
- 111, /* (74) position ::= expr BELOW position */
2152
- 111, /* (75) position ::= expr LEFT OF position */
2153
- 111, /* (76) position ::= expr RIGHT OF position */
2154
- 111, /* (77) position ::= expr ON HEADING EDGEPT OF position */
2155
- 111, /* (78) position ::= expr HEADING EDGEPT OF position */
2156
- 111, /* (79) position ::= expr EDGEPT OF position */
2157
- 111, /* (80) position ::= expr ON HEADING expr FROM position */
2158
- 111, /* (81) position ::= expr HEADING expr FROM position */
2159
- 112, /* (82) place ::= edge OF object */
2160
- 135, /* (83) place2 ::= object */
2161
- 135, /* (84) place2 ::= object DOT_E edge */
2162
- 135, /* (85) place2 ::= NTH VERTEX OF object */
2163
- 113, /* (86) object ::= nth */
2164
- 113, /* (87) object ::= nth OF|IN object */
2165
- 114, /* (88) objectname ::= THIS */
2166
- 114, /* (89) objectname ::= PLACENAME */
2167
- 114, /* (90) objectname ::= objectname DOT_U PLACENAME */
2168
- 115, /* (91) nth ::= NTH CLASSNAME */
2169
- 115, /* (92) nth ::= NTH LAST CLASSNAME */
2170
- 115, /* (93) nth ::= LAST CLASSNAME */
2171
- 115, /* (94) nth ::= LAST */
2172
- 115, /* (95) nth ::= NTH LB RB */
2173
- 115, /* (96) nth ::= NTH LAST LB RB */
2174
- 115, /* (97) nth ::= LAST LB RB */
2175
- 104, /* (98) expr ::= expr PLUS expr */
2176
- 104, /* (99) expr ::= expr MINUS expr */
2177
- 104, /* (100) expr ::= expr STAR expr */
2178
- 104, /* (101) expr ::= expr SLASH expr */
2179
- 104, /* (102) expr ::= MINUS expr */
2180
- 104, /* (103) expr ::= PLUS expr */
2181
- 104, /* (104) expr ::= LP expr RP */
2182
- 104, /* (105) expr ::= LP FILL|COLOR|THICKNESS RP */
2183
- 104, /* (106) expr ::= NUMBER */
2184
- 104, /* (107) expr ::= ID */
2185
- 104, /* (108) expr ::= FUNC1 LP expr RP */
2186
- 104, /* (109) expr ::= FUNC2 LP expr COMMA expr RP */
2187
- 104, /* (110) expr ::= DIST LP position COMMA position RP */
2188
- 104, /* (111) expr ::= place2 DOT_XY X */
2189
- 104, /* (112) expr ::= place2 DOT_XY Y */
2190
- 104, /* (113) expr ::= object DOT_L numproperty */
2191
- 104, /* (114) expr ::= object DOT_L dashproperty */
2192
- 104, /* (115) expr ::= object DOT_L colorproperty */
2193
- 118, /* (116) lvalue ::= ID */
2194
- 118, /* (117) lvalue ::= FILL */
2195
- 118, /* (118) lvalue ::= COLOR */
2196
- 118, /* (119) lvalue ::= THICKNESS */
2197
- 117, /* (120) rvalue ::= expr */
2198
- 123, /* (121) print ::= PRINT */
2199
- 124, /* (122) prlist ::= pritem */
2200
- 124, /* (123) prlist ::= prlist prsep pritem */
2201
- 107, /* (124) direction ::= UP */
2202
- 107, /* (125) direction ::= DOWN */
2203
- 107, /* (126) direction ::= LEFT */
2204
- 107, /* (127) direction ::= RIGHT */
2205
- 121, /* (128) optrelexpr ::= relexpr */
2206
- 127, /* (129) attribute_list ::= alist */
2207
- 129, /* (130) alist ::= */
2208
- 129, /* (131) alist ::= alist attribute */
2209
- 130, /* (132) attribute ::= boolproperty */
2210
- 130, /* (133) attribute ::= WITH withclause */
2211
- 131, /* (134) go ::= GO */
2212
- 131, /* (135) go ::= */
2213
- 119, /* (136) even ::= UNTIL EVEN WITH */
2214
- 119, /* (137) even ::= EVEN WITH */
2215
- 108, /* (138) dashproperty ::= DOTTED */
2216
- 108, /* (139) dashproperty ::= DASHED */
2217
- 109, /* (140) colorproperty ::= FILL */
2218
- 109, /* (141) colorproperty ::= COLOR */
2219
- 111, /* (142) position ::= place */
2220
- 134, /* (143) between ::= WAY BETWEEN */
2221
- 134, /* (144) between ::= BETWEEN */
2222
- 134, /* (145) between ::= OF THE WAY BETWEEN */
2223
- 112, /* (146) place ::= place2 */
2224
- 106, /* (147) edge ::= CENTER */
2225
- 106, /* (148) edge ::= EDGEPT */
2226
- 106, /* (149) edge ::= TOP */
2227
- 106, /* (150) edge ::= BOTTOM */
2228
- 106, /* (151) edge ::= START */
2229
- 106, /* (152) edge ::= END */
2230
- 106, /* (153) edge ::= RIGHT */
2231
- 106, /* (154) edge ::= LEFT */
2232
- 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 */
22332274
};
22342275
22352276
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
22362277
** of symbols on the right-hand side of that rule. */
22372278
static const signed char yyRuleInfoNRhs[] = {
@@ -2431,620 +2472,620 @@
24312472
** break;
24322473
*/
24332474
/********** Begin reduce actions **********************************************/
24342475
YYMINORTYPE yylhsminor;
24352476
case 0: /* document ::= statement_list */
2436
-#line 561 "pikchr.y"
2437
-{pik_render(p,yymsp[0].minor.yy235);}
2438
-#line 2463 "pikchr.c"
2477
+#line 563 "pikchr.y"
2478
+{pik_render(p,yymsp[0].minor.yy23);}
2479
+#line 2479 "pikchr.c"
24392480
break;
24402481
case 1: /* statement_list ::= statement */
2441
-#line 564 "pikchr.y"
2442
-{ yylhsminor.yy235 = pik_elist_append(p,0,yymsp[0].minor.yy162); }
2443
-#line 2468 "pikchr.c"
2444
- 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;
24452486
break;
24462487
case 2: /* statement_list ::= statement_list EOL statement */
2447
-#line 566 "pikchr.y"
2448
-{ yylhsminor.yy235 = pik_elist_append(p,yymsp[-2].minor.yy235,yymsp[0].minor.yy162); }
2449
-#line 2474 "pikchr.c"
2450
- 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;
24512492
break;
24522493
case 3: /* statement ::= */
2453
-#line 569 "pikchr.y"
2454
-{ yymsp[1].minor.yy162 = 0; }
2455
-#line 2480 "pikchr.c"
2494
+#line 571 "pikchr.y"
2495
+{ yymsp[1].minor.yy54 = 0; }
2496
+#line 2496 "pikchr.c"
24562497
break;
24572498
case 4: /* statement ::= direction */
2458
-#line 570 "pikchr.y"
2459
-{ pik_set_direction(p,yymsp[0].minor.yy0.eCode); yylhsminor.yy162=0; }
2460
-#line 2485 "pikchr.c"
2461
- 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;
24622503
break;
24632504
case 5: /* statement ::= lvalue ASSIGN rvalue */
2464
-#line 571 "pikchr.y"
2465
-{pik_set_var(p,&yymsp[-2].minor.yy0,yymsp[0].minor.yy21,&yymsp[-1].minor.yy0); yylhsminor.yy162=0;}
2466
-#line 2491 "pikchr.c"
2467
- 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;
24682509
break;
24692510
case 6: /* statement ::= PLACENAME COLON unnamed_statement */
2470
-#line 573 "pikchr.y"
2471
-{ yylhsminor.yy162 = yymsp[0].minor.yy162; pik_elem_setname(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0); }
2472
-#line 2497 "pikchr.c"
2473
- 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;
24742515
break;
24752516
case 7: /* statement ::= PLACENAME COLON position */
2476
-#line 575 "pikchr.y"
2477
-{ yylhsminor.yy162 = pik_elem_new(p,0,0,0);
2478
- if(yylhsminor.yy162){ yylhsminor.yy162->ptAt = yymsp[0].minor.yy63; pik_elem_setname(p,yylhsminor.yy162,&yymsp[-2].minor.yy0); }}
2479
-#line 2504 "pikchr.c"
2480
- 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;
24812522
break;
24822523
case 8: /* statement ::= unnamed_statement */
2483
-#line 577 "pikchr.y"
2484
-{yylhsminor.yy162 = yymsp[0].minor.yy162;}
2485
-#line 2510 "pikchr.c"
2486
- 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;
24872528
break;
24882529
case 9: /* statement ::= print prlist */
2489
-#line 578 "pikchr.y"
2490
-{pik_append(p,"<br>\n",5); yymsp[-1].minor.yy162=0;}
2491
-#line 2516 "pikchr.c"
2530
+#line 580 "pikchr.y"
2531
+{pik_append(p,"<br>\n",5); yymsp[-1].minor.yy54=0;}
2532
+#line 2532 "pikchr.c"
24922533
break;
24932534
case 10: /* statement ::= ASSERT LP expr EQ expr RP */
2494
-#line 583 "pikchr.y"
2495
-{yymsp[-5].minor.yy162=pik_assert(p,yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy21);}
2496
-#line 2521 "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"
24972538
break;
24982539
case 11: /* statement ::= ASSERT LP position EQ position RP */
2499
-#line 585 "pikchr.y"
2500
-{yymsp[-5].minor.yy162=pik_position_assert(p,&yymsp[-3].minor.yy63,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy63);}
2501
-#line 2526 "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"
25022543
break;
25032544
case 12: /* statement ::= DEFINE ID CODEBLOCK */
2504
-#line 586 "pikchr.y"
2505
-{yymsp[-2].minor.yy162=0; pik_add_macro(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
2506
-#line 2531 "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"
25072548
break;
25082549
case 13: /* rvalue ::= PLACENAME */
2509
-#line 597 "pikchr.y"
2510
-{yylhsminor.yy21 = pik_lookup_color(p,&yymsp[0].minor.yy0);}
2511
-#line 2536 "pikchr.c"
2512
- 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;
25132554
break;
25142555
case 14: /* pritem ::= FILL */
25152556
case 15: /* pritem ::= COLOR */ yytestcase(yyruleno==15);
25162557
case 16: /* pritem ::= THICKNESS */ yytestcase(yyruleno==16);
2517
-#line 602 "pikchr.y"
2558
+#line 604 "pikchr.y"
25182559
{pik_append_num(p,"",pik_value(p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.n,0));}
2519
-#line 2544 "pikchr.c"
2560
+#line 2560 "pikchr.c"
25202561
break;
25212562
case 17: /* pritem ::= rvalue */
2522
-#line 605 "pikchr.y"
2523
-{pik_append_num(p,"",yymsp[0].minor.yy21);}
2524
-#line 2549 "pikchr.c"
2563
+#line 607 "pikchr.y"
2564
+{pik_append_num(p,"",yymsp[0].minor.yy129);}
2565
+#line 2565 "pikchr.c"
25252566
break;
25262567
case 18: /* pritem ::= STRING */
2527
-#line 606 "pikchr.y"
2568
+#line 608 "pikchr.y"
25282569
{pik_append_text(p,yymsp[0].minor.yy0.z+1,yymsp[0].minor.yy0.n-2,0);}
2529
-#line 2554 "pikchr.c"
2570
+#line 2570 "pikchr.c"
25302571
break;
25312572
case 19: /* prsep ::= COMMA */
2532
-#line 607 "pikchr.y"
2573
+#line 609 "pikchr.y"
25332574
{pik_append(p, " ", 1);}
2534
-#line 2559 "pikchr.c"
2575
+#line 2575 "pikchr.c"
25352576
break;
25362577
case 20: /* unnamed_statement ::= basetype attribute_list */
2537
-#line 610 "pikchr.y"
2538
-{yylhsminor.yy162 = yymsp[-1].minor.yy162; pik_after_adding_attributes(p,yylhsminor.yy162);}
2539
-#line 2564 "pikchr.c"
2540
- 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;
25412582
break;
25422583
case 21: /* basetype ::= CLASSNAME */
2543
-#line 612 "pikchr.y"
2544
-{yylhsminor.yy162 = pik_elem_new(p,&yymsp[0].minor.yy0,0,0); }
2545
-#line 2570 "pikchr.c"
2546
- 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;
25472588
break;
25482589
case 22: /* basetype ::= STRING textposition */
2549
-#line 614 "pikchr.y"
2550
-{yymsp[-1].minor.yy0.eCode = yymsp[0].minor.yy188; yylhsminor.yy162 = pik_elem_new(p,0,&yymsp[-1].minor.yy0,0); }
2551
-#line 2576 "pikchr.c"
2552
- 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;
25532594
break;
25542595
case 23: /* basetype ::= LB savelist statement_list RB */
2555
-#line 616 "pikchr.y"
2556
-{ 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; }
2557
-#line 2582 "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"
25582599
break;
25592600
case 24: /* savelist ::= */
2560
-#line 621 "pikchr.y"
2561
-{yymsp[1].minor.yy235 = p->list; p->list = 0;}
2562
-#line 2587 "pikchr.c"
2601
+#line 625 "pikchr.y"
2602
+{yymsp[1].minor.yy23 = p->list; p->list = 0;}
2603
+#line 2603 "pikchr.c"
25632604
break;
25642605
case 25: /* relexpr ::= expr */
2565
-#line 628 "pikchr.y"
2566
-{yylhsminor.yy72.rAbs = yymsp[0].minor.yy21; yylhsminor.yy72.rRel = 0;}
2567
-#line 2592 "pikchr.c"
2568
- 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;
25692610
break;
25702611
case 26: /* relexpr ::= expr PERCENT */
2571
-#line 629 "pikchr.y"
2572
-{yylhsminor.yy72.rAbs = 0; yylhsminor.yy72.rRel = yymsp[-1].minor.yy21/100;}
2573
-#line 2598 "pikchr.c"
2574
- 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;
25752616
break;
25762617
case 27: /* optrelexpr ::= */
2577
-#line 631 "pikchr.y"
2578
-{yymsp[1].minor.yy72.rAbs = 0; yymsp[1].minor.yy72.rRel = 1.0;}
2579
-#line 2604 "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"
25802621
break;
25812622
case 28: /* attribute_list ::= relexpr alist */
2582
-#line 633 "pikchr.y"
2583
-{pik_add_direction(p,0,&yymsp[-1].minor.yy72);}
2584
-#line 2609 "pikchr.c"
2623
+#line 637 "pikchr.y"
2624
+{pik_add_direction(p,0,&yymsp[-1].minor.yy28);}
2625
+#line 2625 "pikchr.c"
25852626
break;
25862627
case 29: /* attribute ::= numproperty relexpr */
2587
-#line 637 "pikchr.y"
2588
-{ pik_set_numprop(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72); }
2589
-#line 2614 "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"
25902631
break;
25912632
case 30: /* attribute ::= dashproperty expr */
2592
-#line 638 "pikchr.y"
2593
-{ pik_set_dashed(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy21); }
2594
-#line 2619 "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"
25952636
break;
25962637
case 31: /* attribute ::= dashproperty */
2597
-#line 639 "pikchr.y"
2638
+#line 643 "pikchr.y"
25982639
{ pik_set_dashed(p,&yymsp[0].minor.yy0,0); }
2599
-#line 2624 "pikchr.c"
2640
+#line 2640 "pikchr.c"
26002641
break;
26012642
case 32: /* attribute ::= colorproperty rvalue */
2602
-#line 640 "pikchr.y"
2603
-{ pik_set_clrprop(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21); }
2604
-#line 2629 "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"
26052646
break;
26062647
case 33: /* attribute ::= go direction optrelexpr */
2607
-#line 641 "pikchr.y"
2608
-{ pik_add_direction(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72);}
2609
-#line 2634 "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"
26102651
break;
26112652
case 34: /* attribute ::= go direction even position */
2612
-#line 642 "pikchr.y"
2613
-{pik_evenwith(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63);}
2614
-#line 2639 "pikchr.c"
2653
+#line 646 "pikchr.y"
2654
+{pik_evenwith(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy187);}
2655
+#line 2655 "pikchr.c"
26152656
break;
26162657
case 35: /* attribute ::= CLOSE */
2617
-#line 643 "pikchr.y"
2658
+#line 647 "pikchr.y"
26182659
{ pik_close_path(p,&yymsp[0].minor.yy0); }
2619
-#line 2644 "pikchr.c"
2660
+#line 2660 "pikchr.c"
26202661
break;
26212662
case 36: /* attribute ::= CHOP */
2622
-#line 644 "pikchr.y"
2663
+#line 648 "pikchr.y"
26232664
{ p->cur->bChop = 1; }
2624
-#line 2649 "pikchr.c"
2665
+#line 2665 "pikchr.c"
26252666
break;
26262667
case 37: /* attribute ::= FROM position */
2627
-#line 645 "pikchr.y"
2628
-{ pik_set_from(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2629
-#line 2654 "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"
26302671
break;
26312672
case 38: /* attribute ::= TO position */
2632
-#line 646 "pikchr.y"
2633
-{ pik_add_to(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2634
-#line 2659 "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"
26352676
break;
26362677
case 39: /* attribute ::= THEN */
2637
-#line 647 "pikchr.y"
2678
+#line 651 "pikchr.y"
26382679
{ pik_then(p, &yymsp[0].minor.yy0, p->cur); }
2639
-#line 2664 "pikchr.c"
2680
+#line 2680 "pikchr.c"
26402681
break;
26412682
case 40: /* attribute ::= THEN optrelexpr HEADING expr */
26422683
case 42: /* attribute ::= GO optrelexpr HEADING expr */ yytestcase(yyruleno==42);
2643
-#line 649 "pikchr.y"
2644
-{pik_move_hdg(p,&yymsp[-2].minor.yy72,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21,0,&yymsp[-3].minor.yy0);}
2645
-#line 2670 "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"
26462687
break;
26472688
case 41: /* attribute ::= THEN optrelexpr EDGEPT */
26482689
case 43: /* attribute ::= GO optrelexpr EDGEPT */ yytestcase(yyruleno==43);
2649
-#line 650 "pikchr.y"
2650
-{pik_move_hdg(p,&yymsp[-1].minor.yy72,0,0,&yymsp[0].minor.yy0,&yymsp[-2].minor.yy0);}
2651
-#line 2676 "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"
26522693
break;
26532694
case 44: /* attribute ::= AT position */
2654
-#line 655 "pikchr.y"
2655
-{ pik_set_at(p,0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2656
-#line 2681 "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"
26572698
break;
26582699
case 45: /* attribute ::= SAME */
2659
-#line 657 "pikchr.y"
2700
+#line 661 "pikchr.y"
26602701
{pik_same(p,0,&yymsp[0].minor.yy0);}
2661
-#line 2686 "pikchr.c"
2702
+#line 2702 "pikchr.c"
26622703
break;
26632704
case 46: /* attribute ::= SAME AS object */
2664
-#line 658 "pikchr.y"
2665
-{pik_same(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2666
-#line 2691 "pikchr.c"
2705
+#line 662 "pikchr.y"
2706
+{pik_same(p,yymsp[0].minor.yy54,&yymsp[-2].minor.yy0);}
2707
+#line 2707 "pikchr.c"
26672708
break;
26682709
case 47: /* attribute ::= STRING textposition */
2669
-#line 659 "pikchr.y"
2670
-{pik_add_txt(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy188);}
2671
-#line 2696 "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"
26722713
break;
26732714
case 48: /* attribute ::= FIT */
2674
-#line 660 "pikchr.y"
2675
-{pik_size_to_fit(p,&yymsp[0].minor.yy0,3); }
2676
-#line 2701 "pikchr.c"
2715
+#line 664 "pikchr.y"
2716
+{pik_size_to_fit(p,0,&yymsp[0].minor.yy0,3); }
2717
+#line 2717 "pikchr.c"
26772718
break;
26782719
case 49: /* attribute ::= BEHIND object */
2679
-#line 661 "pikchr.y"
2680
-{pik_behind(p,yymsp[0].minor.yy162);}
2681
-#line 2706 "pikchr.c"
2720
+#line 665 "pikchr.y"
2721
+{pik_behind(p,yymsp[0].minor.yy54);}
2722
+#line 2722 "pikchr.c"
26822723
break;
26832724
case 50: /* withclause ::= DOT_E edge AT position */
26842725
case 51: /* withclause ::= edge AT position */ yytestcase(yyruleno==51);
2685
-#line 669 "pikchr.y"
2686
-{ pik_set_at(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2687
-#line 2712 "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"
26882729
break;
26892730
case 52: /* numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2690
-#line 673 "pikchr.y"
2731
+#line 677 "pikchr.y"
26912732
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
2692
-#line 2717 "pikchr.c"
2733
+#line 2733 "pikchr.c"
26932734
yymsp[0].minor.yy0 = yylhsminor.yy0;
26942735
break;
26952736
case 53: /* boolproperty ::= CW */
2696
-#line 684 "pikchr.y"
2737
+#line 688 "pikchr.y"
26972738
{p->cur->cw = 1;}
2698
-#line 2723 "pikchr.c"
2739
+#line 2739 "pikchr.c"
26992740
break;
27002741
case 54: /* boolproperty ::= CCW */
2701
-#line 685 "pikchr.y"
2742
+#line 689 "pikchr.y"
27022743
{p->cur->cw = 0;}
2703
-#line 2728 "pikchr.c"
2744
+#line 2744 "pikchr.c"
27042745
break;
27052746
case 55: /* boolproperty ::= LARROW */
2706
-#line 686 "pikchr.y"
2747
+#line 690 "pikchr.y"
27072748
{p->cur->larrow=1; p->cur->rarrow=0; }
2708
-#line 2733 "pikchr.c"
2749
+#line 2749 "pikchr.c"
27092750
break;
27102751
case 56: /* boolproperty ::= RARROW */
2711
-#line 687 "pikchr.y"
2752
+#line 691 "pikchr.y"
27122753
{p->cur->larrow=0; p->cur->rarrow=1; }
2713
-#line 2738 "pikchr.c"
2754
+#line 2754 "pikchr.c"
27142755
break;
27152756
case 57: /* boolproperty ::= LRARROW */
2716
-#line 688 "pikchr.y"
2757
+#line 692 "pikchr.y"
27172758
{p->cur->larrow=1; p->cur->rarrow=1; }
2718
-#line 2743 "pikchr.c"
2759
+#line 2759 "pikchr.c"
27192760
break;
27202761
case 58: /* boolproperty ::= INVIS */
2721
-#line 689 "pikchr.y"
2762
+#line 693 "pikchr.y"
27222763
{p->cur->sw = -0.00001;}
2723
-#line 2748 "pikchr.c"
2764
+#line 2764 "pikchr.c"
27242765
break;
27252766
case 59: /* boolproperty ::= THICK */
2726
-#line 690 "pikchr.y"
2767
+#line 694 "pikchr.y"
27272768
{p->cur->sw *= 1.5;}
2728
-#line 2753 "pikchr.c"
2769
+#line 2769 "pikchr.c"
27292770
break;
27302771
case 60: /* boolproperty ::= THIN */
2731
-#line 691 "pikchr.y"
2772
+#line 695 "pikchr.y"
27322773
{p->cur->sw *= 0.67;}
2733
-#line 2758 "pikchr.c"
2774
+#line 2774 "pikchr.c"
27342775
break;
27352776
case 61: /* boolproperty ::= SOLID */
2736
-#line 692 "pikchr.y"
2777
+#line 696 "pikchr.y"
27372778
{p->cur->sw = pik_value(p,"thickness",9,0);
27382779
p->cur->dotted = p->cur->dashed = 0.0;}
2739
-#line 2764 "pikchr.c"
2780
+#line 2780 "pikchr.c"
27402781
break;
27412782
case 62: /* textposition ::= */
2742
-#line 695 "pikchr.y"
2743
-{yymsp[1].minor.yy188 = 0;}
2744
-#line 2769 "pikchr.c"
2783
+#line 699 "pikchr.y"
2784
+{yymsp[1].minor.yy272 = 0;}
2785
+#line 2785 "pikchr.c"
27452786
break;
27462787
case 63: /* textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2747
-#line 698 "pikchr.y"
2748
-{yylhsminor.yy188 = (short int)pik_text_position(yymsp[-1].minor.yy188,&yymsp[0].minor.yy0);}
2749
-#line 2774 "pikchr.c"
2750
- 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;
27512792
break;
27522793
case 64: /* position ::= expr COMMA expr */
2753
-#line 701 "pikchr.y"
2754
-{yylhsminor.yy63.x=yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[0].minor.yy21;}
2755
-#line 2780 "pikchr.c"
2756
- 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;
27572798
break;
27582799
case 65: /* position ::= place PLUS expr COMMA expr */
2759
-#line 703 "pikchr.y"
2760
-{yylhsminor.yy63.x=yymsp[-4].minor.yy63.x+yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y+yymsp[0].minor.yy21;}
2761
-#line 2786 "pikchr.c"
2762
- 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;
27632804
break;
27642805
case 66: /* position ::= place MINUS expr COMMA expr */
2765
-#line 704 "pikchr.y"
2766
-{yylhsminor.yy63.x=yymsp[-4].minor.yy63.x-yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y-yymsp[0].minor.yy21;}
2767
-#line 2792 "pikchr.c"
2768
- 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;
27692810
break;
27702811
case 67: /* position ::= place PLUS LP expr COMMA expr RP */
2771
-#line 706 "pikchr.y"
2772
-{yylhsminor.yy63.x=yymsp[-6].minor.yy63.x+yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y+yymsp[-1].minor.yy21;}
2773
-#line 2798 "pikchr.c"
2774
- 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;
27752816
break;
27762817
case 68: /* position ::= place MINUS LP expr COMMA expr RP */
2777
-#line 708 "pikchr.y"
2778
-{yylhsminor.yy63.x=yymsp[-6].minor.yy63.x-yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y-yymsp[-1].minor.yy21;}
2779
-#line 2804 "pikchr.c"
2780
- 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;
27812822
break;
27822823
case 69: /* position ::= LP position COMMA position RP */
2783
-#line 709 "pikchr.y"
2784
-{yymsp[-4].minor.yy63.x=yymsp[-3].minor.yy63.x; yymsp[-4].minor.yy63.y=yymsp[-1].minor.yy63.y;}
2785
-#line 2810 "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"
27862827
break;
27872828
case 70: /* position ::= LP position RP */
2788
-#line 710 "pikchr.y"
2789
-{yymsp[-2].minor.yy63=yymsp[-1].minor.yy63;}
2790
-#line 2815 "pikchr.c"
2829
+#line 714 "pikchr.y"
2830
+{yymsp[-2].minor.yy187=yymsp[-1].minor.yy187;}
2831
+#line 2831 "pikchr.c"
27912832
break;
27922833
case 71: /* position ::= expr between position AND position */
2793
-#line 712 "pikchr.y"
2794
-{yylhsminor.yy63 = pik_position_between(yymsp[-4].minor.yy21,yymsp[-2].minor.yy63,yymsp[0].minor.yy63);}
2795
-#line 2820 "pikchr.c"
2796
- 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;
27972838
break;
27982839
case 72: /* position ::= expr LT position COMMA position GT */
2799
-#line 714 "pikchr.y"
2800
-{yylhsminor.yy63 = pik_position_between(yymsp[-5].minor.yy21,yymsp[-3].minor.yy63,yymsp[-1].minor.yy63);}
2801
-#line 2826 "pikchr.c"
2802
- 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;
28032844
break;
28042845
case 73: /* position ::= expr ABOVE position */
2805
-#line 715 "pikchr.y"
2806
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y += yymsp[-2].minor.yy21;}
2807
-#line 2832 "pikchr.c"
2808
- 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;
28092850
break;
28102851
case 74: /* position ::= expr BELOW position */
2811
-#line 716 "pikchr.y"
2812
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y -= yymsp[-2].minor.yy21;}
2813
-#line 2838 "pikchr.c"
2814
- 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;
28152856
break;
28162857
case 75: /* position ::= expr LEFT OF position */
2817
-#line 717 "pikchr.y"
2818
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x -= yymsp[-3].minor.yy21;}
2819
-#line 2844 "pikchr.c"
2820
- 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;
28212862
break;
28222863
case 76: /* position ::= expr RIGHT OF position */
2823
-#line 718 "pikchr.y"
2824
-{yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x += yymsp[-3].minor.yy21;}
2825
-#line 2850 "pikchr.c"
2826
- 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;
28272868
break;
28282869
case 77: /* position ::= expr ON HEADING EDGEPT OF position */
2829
-#line 720 "pikchr.y"
2830
-{yylhsminor.yy63 = pik_position_at_hdg(yymsp[-5].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2831
-#line 2856 "pikchr.c"
2832
- 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;
28332874
break;
28342875
case 78: /* position ::= expr HEADING EDGEPT OF position */
2835
-#line 722 "pikchr.y"
2836
-{yylhsminor.yy63 = pik_position_at_hdg(yymsp[-4].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2837
-#line 2862 "pikchr.c"
2838
- 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;
28392880
break;
28402881
case 79: /* position ::= expr EDGEPT OF position */
2841
-#line 724 "pikchr.y"
2842
-{yylhsminor.yy63 = pik_position_at_hdg(yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2843
-#line 2868 "pikchr.c"
2844
- 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;
28452886
break;
28462887
case 80: /* position ::= expr ON HEADING expr FROM position */
2847
-#line 726 "pikchr.y"
2848
-{yylhsminor.yy63 = pik_position_at_angle(yymsp[-5].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2849
-#line 2874 "pikchr.c"
2850
- 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;
28512892
break;
28522893
case 81: /* position ::= expr HEADING expr FROM position */
2853
-#line 728 "pikchr.y"
2854
-{yylhsminor.yy63 = pik_position_at_angle(yymsp[-4].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2855
-#line 2880 "pikchr.c"
2856
- 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;
28572898
break;
28582899
case 82: /* place ::= edge OF object */
2859
-#line 740 "pikchr.y"
2860
-{yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2861
-#line 2886 "pikchr.c"
2862
- 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;
28632904
break;
28642905
case 83: /* place2 ::= object */
2865
-#line 741 "pikchr.y"
2866
-{yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,0);}
2867
-#line 2892 "pikchr.c"
2868
- 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;
28692910
break;
28702911
case 84: /* place2 ::= object DOT_E edge */
2871
-#line 742 "pikchr.y"
2872
-{yylhsminor.yy63 = pik_place_of_elem(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2873
-#line 2898 "pikchr.c"
2874
- 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;
28752916
break;
28762917
case 85: /* place2 ::= NTH VERTEX OF object */
2877
-#line 743 "pikchr.y"
2878
-{yylhsminor.yy63 = pik_nth_vertex(p,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,yymsp[0].minor.yy162);}
2879
-#line 2904 "pikchr.c"
2880
- 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;
28812922
break;
28822923
case 86: /* object ::= nth */
2883
-#line 755 "pikchr.y"
2884
-{yylhsminor.yy162 = pik_find_nth(p,0,&yymsp[0].minor.yy0);}
2885
-#line 2910 "pikchr.c"
2886
- 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;
28872928
break;
28882929
case 87: /* object ::= nth OF|IN object */
2889
-#line 756 "pikchr.y"
2890
-{yylhsminor.yy162 = pik_find_nth(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2891
-#line 2916 "pikchr.c"
2892
- 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;
28932934
break;
28942935
case 88: /* objectname ::= THIS */
2895
-#line 758 "pikchr.y"
2896
-{yymsp[0].minor.yy162 = p->cur;}
2897
-#line 2922 "pikchr.c"
2936
+#line 762 "pikchr.y"
2937
+{yymsp[0].minor.yy54 = p->cur;}
2938
+#line 2938 "pikchr.c"
28982939
break;
28992940
case 89: /* objectname ::= PLACENAME */
2900
-#line 759 "pikchr.y"
2901
-{yylhsminor.yy162 = pik_find_byname(p,0,&yymsp[0].minor.yy0);}
2902
-#line 2927 "pikchr.c"
2903
- 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;
29042945
break;
29052946
case 90: /* objectname ::= objectname DOT_U PLACENAME */
2906
-#line 761 "pikchr.y"
2907
-{yylhsminor.yy162 = pik_find_byname(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2908
-#line 2933 "pikchr.c"
2909
- 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;
29102951
break;
29112952
case 91: /* nth ::= NTH CLASSNAME */
2912
-#line 763 "pikchr.y"
2953
+#line 767 "pikchr.y"
29132954
{yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-1].minor.yy0); }
2914
-#line 2939 "pikchr.c"
2955
+#line 2955 "pikchr.c"
29152956
yymsp[-1].minor.yy0 = yylhsminor.yy0;
29162957
break;
29172958
case 92: /* nth ::= NTH LAST CLASSNAME */
2918
-#line 764 "pikchr.y"
2959
+#line 768 "pikchr.y"
29192960
{yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-2].minor.yy0); }
2920
-#line 2945 "pikchr.c"
2961
+#line 2961 "pikchr.c"
29212962
yymsp[-2].minor.yy0 = yylhsminor.yy0;
29222963
break;
29232964
case 93: /* nth ::= LAST CLASSNAME */
2924
-#line 765 "pikchr.y"
2965
+#line 769 "pikchr.y"
29252966
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.eCode = -1;}
2926
-#line 2951 "pikchr.c"
2967
+#line 2967 "pikchr.c"
29272968
break;
29282969
case 94: /* nth ::= LAST */
2929
-#line 766 "pikchr.y"
2970
+#line 770 "pikchr.y"
29302971
{yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -1;}
2931
-#line 2956 "pikchr.c"
2972
+#line 2972 "pikchr.c"
29322973
yymsp[0].minor.yy0 = yylhsminor.yy0;
29332974
break;
29342975
case 95: /* nth ::= NTH LB RB */
2935
-#line 767 "pikchr.y"
2976
+#line 771 "pikchr.y"
29362977
{yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-2].minor.yy0);}
2937
-#line 2962 "pikchr.c"
2978
+#line 2978 "pikchr.c"
29382979
yymsp[-2].minor.yy0 = yylhsminor.yy0;
29392980
break;
29402981
case 96: /* nth ::= NTH LAST LB RB */
2941
-#line 768 "pikchr.y"
2982
+#line 772 "pikchr.y"
29422983
{yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-3].minor.yy0);}
2943
-#line 2968 "pikchr.c"
2984
+#line 2984 "pikchr.c"
29442985
yymsp[-3].minor.yy0 = yylhsminor.yy0;
29452986
break;
29462987
case 97: /* nth ::= LAST LB RB */
2947
-#line 769 "pikchr.y"
2988
+#line 773 "pikchr.y"
29482989
{yymsp[-2].minor.yy0=yymsp[-1].minor.yy0; yymsp[-2].minor.yy0.eCode = -1; }
2949
-#line 2974 "pikchr.c"
2990
+#line 2990 "pikchr.c"
29502991
break;
29512992
case 98: /* expr ::= expr PLUS expr */
2952
-#line 771 "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;
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;
29562997
break;
29572998
case 99: /* expr ::= expr MINUS expr */
2958
-#line 772 "pikchr.y"
2959
-{yylhsminor.yy21=yymsp[-2].minor.yy21-yymsp[0].minor.yy21;}
2960
-#line 2985 "pikchr.c"
2961
- 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;
29623003
break;
29633004
case 100: /* expr ::= expr STAR expr */
2964
-#line 773 "pikchr.y"
2965
-{yylhsminor.yy21=yymsp[-2].minor.yy21*yymsp[0].minor.yy21;}
2966
-#line 2991 "pikchr.c"
2967
- 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;
29683009
break;
29693010
case 101: /* expr ::= expr SLASH expr */
2970
-#line 774 "pikchr.y"
3011
+#line 778 "pikchr.y"
29713012
{
2972
- if( yymsp[0].minor.yy21==0.0 ){ pik_error(p, &yymsp[-1].minor.yy0, "division by zero"); yylhsminor.yy21 = 0.0; }
2973
- 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; }
29743015
}
2975
-#line 3000 "pikchr.c"
2976
- yymsp[-2].minor.yy21 = yylhsminor.yy21;
3016
+#line 3016 "pikchr.c"
3017
+ yymsp[-2].minor.yy129 = yylhsminor.yy129;
29773018
break;
29783019
case 102: /* expr ::= MINUS expr */
2979
-#line 778 "pikchr.y"
2980
-{yymsp[-1].minor.yy21=-yymsp[0].minor.yy21;}
2981
-#line 3006 "pikchr.c"
3020
+#line 782 "pikchr.y"
3021
+{yymsp[-1].minor.yy129=-yymsp[0].minor.yy129;}
3022
+#line 3022 "pikchr.c"
29823023
break;
29833024
case 103: /* expr ::= PLUS expr */
2984
-#line 779 "pikchr.y"
2985
-{yymsp[-1].minor.yy21=yymsp[0].minor.yy21;}
2986
-#line 3011 "pikchr.c"
3025
+#line 783 "pikchr.y"
3026
+{yymsp[-1].minor.yy129=yymsp[0].minor.yy129;}
3027
+#line 3027 "pikchr.c"
29873028
break;
29883029
case 104: /* expr ::= LP expr RP */
2989
-#line 780 "pikchr.y"
2990
-{yymsp[-2].minor.yy21=yymsp[-1].minor.yy21;}
2991
-#line 3016 "pikchr.c"
3030
+#line 784 "pikchr.y"
3031
+{yymsp[-2].minor.yy129=yymsp[-1].minor.yy129;}
3032
+#line 3032 "pikchr.c"
29923033
break;
29933034
case 105: /* expr ::= LP FILL|COLOR|THICKNESS RP */
2994
-#line 781 "pikchr.y"
2995
-{yymsp[-2].minor.yy21=pik_get_var(p,&yymsp[-1].minor.yy0);}
2996
-#line 3021 "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"
29973038
break;
29983039
case 106: /* expr ::= NUMBER */
2999
-#line 782 "pikchr.y"
3000
-{yylhsminor.yy21=pik_atof(&yymsp[0].minor.yy0);}
3001
-#line 3026 "pikchr.c"
3002
- 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;
30033044
break;
30043045
case 107: /* expr ::= ID */
3005
-#line 783 "pikchr.y"
3006
-{yylhsminor.yy21=pik_get_var(p,&yymsp[0].minor.yy0);}
3007
-#line 3032 "pikchr.c"
3008
- 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;
30093050
break;
30103051
case 108: /* expr ::= FUNC1 LP expr RP */
3011
-#line 784 "pikchr.y"
3012
-{yylhsminor.yy21 = pik_func(p,&yymsp[-3].minor.yy0,yymsp[-1].minor.yy21,0.0);}
3013
-#line 3038 "pikchr.c"
3014
- 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;
30153056
break;
30163057
case 109: /* expr ::= FUNC2 LP expr COMMA expr RP */
3017
-#line 785 "pikchr.y"
3018
-{yylhsminor.yy21 = pik_func(p,&yymsp[-5].minor.yy0,yymsp[-3].minor.yy21,yymsp[-1].minor.yy21);}
3019
-#line 3044 "pikchr.c"
3020
- 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;
30213062
break;
30223063
case 110: /* expr ::= DIST LP position COMMA position RP */
3023
-#line 786 "pikchr.y"
3024
-{yymsp[-5].minor.yy21 = pik_dist(&yymsp[-3].minor.yy63,&yymsp[-1].minor.yy63);}
3025
-#line 3050 "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"
30263067
break;
30273068
case 111: /* expr ::= place2 DOT_XY X */
3028
-#line 787 "pikchr.y"
3029
-{yylhsminor.yy21 = yymsp[-2].minor.yy63.x;}
3030
-#line 3055 "pikchr.c"
3031
- 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;
30323073
break;
30333074
case 112: /* expr ::= place2 DOT_XY Y */
3034
-#line 788 "pikchr.y"
3035
-{yylhsminor.yy21 = yymsp[-2].minor.yy63.y;}
3036
-#line 3061 "pikchr.c"
3037
- 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;
30383079
break;
30393080
case 113: /* expr ::= object DOT_L numproperty */
30403081
case 114: /* expr ::= object DOT_L dashproperty */ yytestcase(yyruleno==114);
30413082
case 115: /* expr ::= object DOT_L colorproperty */ yytestcase(yyruleno==115);
3042
-#line 789 "pikchr.y"
3043
-{yylhsminor.yy21=pik_property_of(yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
3044
-#line 3069 "pikchr.c"
3045
- 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;
30463087
break;
30473088
default:
30483089
/* (116) lvalue ::= ID */ yytestcase(yyruleno==116);
30493090
/* (117) lvalue ::= FILL */ yytestcase(yyruleno==117);
30503091
/* (118) lvalue ::= COLOR */ yytestcase(yyruleno==118);
@@ -3142,19 +3183,19 @@
31423183
){
31433184
pik_parserARG_FETCH
31443185
pik_parserCTX_FETCH
31453186
#define TOKEN yyminor
31463187
/************ Begin %syntax_error code ****************************************/
3147
-#line 549 "pikchr.y"
3188
+#line 551 "pikchr.y"
31483189
31493190
if( TOKEN.z && TOKEN.z[0] ){
31503191
pik_error(p, &TOKEN, "syntax error");
31513192
}else{
31523193
pik_error(p, 0, "syntax error");
31533194
}
31543195
UNUSED_PARAMETER(yymajor);
3155
-#line 3180 "pikchr.c"
3196
+#line 3196 "pikchr.c"
31563197
/************ End %syntax_error code ******************************************/
31573198
pik_parserARG_STORE /* Suppress warning about unused %extra_argument variable */
31583199
pik_parserCTX_STORE
31593200
}
31603201
@@ -3419,11 +3460,11 @@
34193460
#else
34203461
(void)iToken;
34213462
return 0;
34223463
#endif
34233464
}
3424
-#line 794 "pikchr.y"
3465
+#line 798 "pikchr.y"
34253466
34263467
34273468
34283469
/* Chart of the 148 official CSS color names with their
34293470
** corresponding RGB values thru Color Module Level 4:
@@ -4350,11 +4391,11 @@
43504391
static PPoint textOffset(Pik *p, PObj *pObj, int cp){
43514392
/* Automatically slim-down the width and height of text
43524393
** statements so that the bounding box tightly encloses the text,
43534394
** then get boxOffset() to do the offset computation.
43544395
*/
4355
- pik_size_to_fit(p, &pObj->errTok,3);
4396
+ pik_size_to_fit(p, pObj, &pObj->errTok,3);
43564397
return boxOffset(p, pObj, cp);
43574398
}
43584399
static void textRender(Pik *p, PObj *pObj){
43594400
pik_append_txt(p, pObj, 0);
43604401
}
@@ -6359,16 +6400,15 @@
63596400
**
63606401
** 1: Fit horizontally only
63616402
** 2: Fit vertically only
63626403
** 3: Fit both ways
63636404
*/
6364
-static void pik_size_to_fit(Pik *p, PToken *pFit, int eWhich){
6365
- PObj *pObj;
6405
+static void pik_size_to_fit(Pik *p, PObj *pObj, PToken *pFit, int eWhich){
63666406
PNum w, h;
63676407
PBox bbox;
63686408
if( p->nErr ) return;
6369
- pObj = p->cur;
6409
+ if( pObj==0 ) pObj = p->cur;
63706410
63716411
if( pObj->nTxt==0 ){
63726412
pik_error(0, pFit, "no text to fit to");
63736413
return;
63746414
}
@@ -6908,20 +6948,20 @@
69086948
*/
69096949
if( pObj->h<=0.0 ){
69106950
if( pObj->nTxt==0 ){
69116951
pObj->h = 0.0;
69126952
}else if( pObj->w<=0.0 ){
6913
- pik_size_to_fit(p, &pObj->errTok, 3);
6953
+ pik_size_to_fit(p, pObj, &pObj->errTok, 3);
69146954
}else{
6915
- pik_size_to_fit(p, &pObj->errTok, 2);
6955
+ pik_size_to_fit(p, pObj, &pObj->errTok, 2);
69166956
}
69176957
}
69186958
if( pObj->w<=0.0 ){
69196959
if( pObj->nTxt==0 ){
69206960
pObj->w = 0.0;
69216961
}else{
6922
- pik_size_to_fit(p, &pObj->errTok, 1);
6962
+ pik_size_to_fit(p, pObj, &pObj->errTok, 1);
69236963
}
69246964
}
69256965
ofst = pik_elem_offset(p, pObj, pObj->eWith);
69266966
dx = (pObj->with.x - ofst.x) - pObj->ptAt.x;
69276967
dy = (pObj->with.y - ofst.y) - pObj->ptAt.y;
@@ -7247,11 +7287,12 @@
72477287
pik_append_num(p, " width=\"", p->wSVG);
72487288
pik_append_num(p, "\" height=\"", p->hSVG);
72497289
pik_append(p, "\"", 1);
72507290
}
72517291
pik_append_dis(p, " viewBox=\"0 0 ",w,"");
7252
- pik_append_dis(p, " ",h,"\">\n");
7292
+ pik_append_dis(p, " ",h,"\"");
7293
+ pik_append(p, " data-pikchr-date=\"" MANIFEST_ISODATE "\">\n", -1);
72537294
pik_elist_render(p, pList);
72547295
pik_append(p,"</svg>\n", -1);
72557296
}else{
72567297
p->wSVG = -1;
72577298
p->hSVG = -1;
@@ -7331,10 +7372,11 @@
73317372
{ "n", 1, T_EDGEPT, 0, CP_N },
73327373
{ "ne", 2, T_EDGEPT, 0, CP_NE },
73337374
{ "north", 5, T_EDGEPT, 0, CP_N },
73347375
{ "nw", 2, T_EDGEPT, 0, CP_NW },
73357376
{ "of", 2, T_OF, 0, 0 },
7377
+ { "pikchr_date",11, T_ISODATE, 0, 0, },
73367378
{ "previous", 8, T_LAST, 0, 0, },
73377379
{ "print", 5, T_PRINT, 0, 0 },
73387380
{ "rad", 3, T_RADIUS, 0, 0 },
73397381
{ "radius", 6, T_RADIUS, 0, 0 },
73407382
{ "right", 5, T_RIGHT, DIR_RIGHT, CP_E },
@@ -7914,15 +7956,30 @@
79147956
#endif
79157957
token.n = (unsigned short)(sz & 0xffff);
79167958
if( p->nToken++ > PIKCHR_TOKEN_LIMIT ){
79177959
pik_error(p, &token, "script is too complex");
79187960
break;
7961
+ }
7962
+ if( token.eType==T_ISODATE ){
7963
+ token.z = "\"" MANIFEST_ISODATE "\"";
7964
+ token.n = sizeof(MANIFEST_ISODATE)+1;
7965
+ token.eType = T_STRING;
79197966
}
79207967
pik_parser(pParser, token.eType, token);
79217968
}
79227969
}
79237970
}
7971
+
7972
+/*
7973
+** Return the version name.
7974
+*/
7975
+const char *pikchr_version(void)
7976
+ /* Emscripten workaround, else it chokes on the inlined version */;
7977
+
7978
+const char *pikchr_version(void){
7979
+ return RELEASE_VERSION " " MANIFEST_ISODATE;
7980
+}
79247981
79257982
/*
79267983
** Parse the PIKCHR script contained in zText[]. Return a rendering. Or
79277984
** if an error is encountered, return the error text. The error message
79287985
** is HTML formatted. So regardless of what happens, the return text
@@ -8142,10 +8199,14 @@
81428199
exit(1);
81438200
}
81448201
bSvgOnly = 1;
81458202
mFlags |= PIKCHR_PLAINTEXT_ERRORS;
81468203
}else
8204
+ if( strcmp(z,"version")==0 || strcmp(z,"v")==0 ){
8205
+ printf("pikchr %s\n", pikchr_version());
8206
+ return 0;
8207
+ }else
81478208
{
81488209
fprintf(stderr,"unknown option: \"%s\"\n", argv[i]);
81498210
usage(argv[0]);
81508211
}
81518212
continue;
@@ -8254,6 +8315,6 @@
82548315
82558316
82568317
#endif /* PIKCHR_TCL */
82578318
82588319
8259
-#line 8284 "pikchr.c"
8320
+#line 8320 "pikchr.c"
82608321
--- 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 **
@@ -486,11 +525,11 @@
486 static void pik_bbox_addbox(PBox*,PBox*);
487 static void pik_bbox_add_xy(PBox*,PNum,PNum);
488 static void pik_bbox_addellipse(PBox*,PNum x,PNum y,PNum rx,PNum ry);
489 static void pik_add_txt(Pik*,PToken*,int);
490 static int pik_text_length(const PToken *pToken, const int isMonospace);
491 static void pik_size_to_fit(Pik*,PToken*,int);
492 static int pik_text_position(int,PToken*);
493 static PNum pik_property_of(PObj*,PToken*);
494 static PNum pik_func(Pik*,PToken*,PNum,PNum);
495 static PPoint pik_position_between(PNum x, PPoint p1, PPoint p2);
496 static PPoint pik_position_at_angle(PNum dist, PNum r, PPoint pt);
@@ -504,11 +543,11 @@
504 static PObj *pik_position_assert(Pik*,PPoint*,PToken*,PPoint*);
505 static PNum pik_dist(PPoint*,PPoint*);
506 static void pik_add_macro(Pik*,PToken *pId,PToken *pCode);
507
508
509 #line 535 "pikchr.c"
510 /**************** End of %include directives **********************************/
511 /* These constants specify the various numeric values for terminal symbols.
512 ***************** Begin token definitions *************************************/
513 #ifndef T_ID
514 #define T_ID 1
@@ -534,84 +573,85 @@
534 #define T_COLOR 21
535 #define T_THICKNESS 22
536 #define T_PRINT 23
537 #define T_STRING 24
538 #define T_COMMA 25
539 #define T_CLASSNAME 26
540 #define T_LB 27
541 #define T_RB 28
542 #define T_UP 29
543 #define T_DOWN 30
544 #define T_LEFT 31
545 #define T_RIGHT 32
546 #define T_CLOSE 33
547 #define T_CHOP 34
548 #define T_FROM 35
549 #define T_TO 36
550 #define T_THEN 37
551 #define T_HEADING 38
552 #define T_GO 39
553 #define T_AT 40
554 #define T_WITH 41
555 #define T_SAME 42
556 #define T_AS 43
557 #define T_FIT 44
558 #define T_BEHIND 45
559 #define T_UNTIL 46
560 #define T_EVEN 47
561 #define T_DOT_E 48
562 #define T_HEIGHT 49
563 #define T_WIDTH 50
564 #define T_RADIUS 51
565 #define T_DIAMETER 52
566 #define T_DOTTED 53
567 #define T_DASHED 54
568 #define T_CW 55
569 #define T_CCW 56
570 #define T_LARROW 57
571 #define T_RARROW 58
572 #define T_LRARROW 59
573 #define T_INVIS 60
574 #define T_THICK 61
575 #define T_THIN 62
576 #define T_SOLID 63
577 #define T_CENTER 64
578 #define T_LJUST 65
579 #define T_RJUST 66
580 #define T_ABOVE 67
581 #define T_BELOW 68
582 #define T_ITALIC 69
583 #define T_BOLD 70
584 #define T_MONO 71
585 #define T_ALIGNED 72
586 #define T_BIG 73
587 #define T_SMALL 74
588 #define T_AND 75
589 #define T_LT 76
590 #define T_GT 77
591 #define T_ON 78
592 #define T_WAY 79
593 #define T_BETWEEN 80
594 #define T_THE 81
595 #define T_NTH 82
596 #define T_VERTEX 83
597 #define T_TOP 84
598 #define T_BOTTOM 85
599 #define T_START 86
600 #define T_END 87
601 #define T_IN 88
602 #define T_THIS 89
603 #define T_DOT_U 90
604 #define T_LAST 91
605 #define T_NUMBER 92
606 #define T_FUNC1 93
607 #define T_FUNC2 94
608 #define T_DIST 95
609 #define T_DOT_XY 96
610 #define T_X 97
611 #define T_Y 98
612 #define T_DOT_L 99
 
613 #endif
614 /**************** End token definitions ***************************************/
615
616 /* The next sections is a series of control #defines.
617 ** various aspects of the generated parser.
@@ -672,22 +712,22 @@
672 #ifndef INTERFACE
673 # define INTERFACE 1
674 #endif
675 /************* Begin control #defines *****************************************/
676 #define YYCODETYPE unsigned char
677 #define YYNOCODE 136
678 #define YYACTIONTYPE unsigned short int
679 #define pik_parserTOKENTYPE PToken
680 typedef union {
681 int yyinit;
682 pik_parserTOKENTYPE yy0;
683 PNum yy21;
684 PPoint yy63;
685 PRel yy72;
686 PObj* yy162;
687 short int yy188;
688 PList* yy235;
689 } YYMINORTYPE;
690 #ifndef YYSTACKDEPTH
691 #define YYSTACKDEPTH 100
692 #endif
693 #define pik_parserARG_SDECL
@@ -705,21 +745,21 @@
705 #define pik_parserCTX_STORE yypParser->p=p;
706 #define YYFALLBACK 1
707 #define YYNSTATE 164
708 #define YYNRULE 156
709 #define YYNRULE_WITH_ACTION 116
710 #define YYNTOKEN 100
711 #define YY_MAX_SHIFT 163
712 #define YY_MIN_SHIFTREDUCE 287
713 #define YY_MAX_SHIFTREDUCE 442
714 #define YY_ERROR_ACTION 443
715 #define YY_ACCEPT_ACTION 444
716 #define YY_NO_ACTION 445
717 #define YY_MIN_REDUCE 446
718 #define YY_MAX_REDUCE 601
719 #define YY_MIN_DSTRCTR 100
720 #define YY_MAX_DSTRCTR 103
721 /************* End control #defines *******************************************/
722 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
723
724 /* Define the yytestcase() macro to be a no-op if is not already defined
725 ** otherwise.
@@ -798,324 +838,322 @@
798 ** yy_reduce_ofst[] For each state, the offset into yy_action for
799 ** shifting non-terminals after a reduce.
800 ** yy_default[] Default action for each state.
801 **
802 *********** Begin parsing tables **********************************************/
803 #define YY_ACTTAB_COUNT (1313)
804 static const YYACTIONTYPE yy_action[] = {
805 /* 0 */ 575, 495, 161, 119, 25, 452, 29, 74, 129, 148,
806 /* 10 */ 575, 492, 161, 119, 453, 113, 120, 161, 119, 530,
807 /* 20 */ 427, 428, 339, 559, 81, 30, 560, 561, 575, 64,
808 /* 30 */ 63, 62, 61, 322, 323, 9, 8, 33, 149, 32,
809 /* 40 */ 7, 71, 127, 38, 335, 66, 48, 37, 28, 339,
810 /* 50 */ 339, 339, 339, 425, 426, 340, 341, 342, 343, 344,
811 /* 60 */ 345, 346, 347, 348, 474, 528, 161, 119, 577, 77,
812 /* 70 */ 577, 73, 306, 148, 474, 533, 161, 119, 112, 113,
813 /* 80 */ 120, 161, 119, 128, 427, 428, 339, 31, 81, 531,
814 /* 90 */ 161, 119, 474, 35, 330, 378, 158, 322, 323, 9,
815 /* 100 */ 8, 33, 149, 32, 7, 71, 127, 328, 335, 66,
816 /* 110 */ 579, 378, 158, 339, 339, 339, 339, 425, 426, 340,
817 /* 120 */ 341, 342, 343, 344, 345, 346, 347, 348, 394, 435,
818 /* 130 */ 46, 59, 60, 64, 63, 62, 61, 357, 36, 376,
819 /* 140 */ 54, 51, 2, 47, 403, 13, 297, 411, 412, 413,
820 /* 150 */ 414, 80, 162, 308, 79, 133, 310, 126, 441, 440,
821 /* 160 */ 118, 123, 83, 404, 405, 406, 408, 80, 84, 308,
822 /* 170 */ 79, 299, 411, 412, 413, 414, 118, 69, 350, 350,
823 /* 180 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 62,
824 /* 190 */ 61, 434, 64, 63, 62, 61, 313, 398, 399, 427,
825 /* 200 */ 428, 339, 380, 157, 64, 63, 62, 61, 122, 106,
826 /* 210 */ 535, 436, 437, 438, 439, 298, 375, 391, 117, 393,
827 /* 220 */ 155, 154, 153, 394, 435, 49, 59, 60, 339, 339,
828 /* 230 */ 339, 339, 425, 426, 376, 3, 4, 2, 64, 63,
829 /* 240 */ 62, 61, 156, 156, 156, 394, 379, 159, 59, 60,
830 /* 250 */ 76, 67, 535, 441, 440, 5, 102, 6, 535, 42,
831 /* 260 */ 131, 535, 69, 107, 301, 302, 303, 394, 305, 15,
832 /* 270 */ 59, 60, 120, 161, 119, 446, 463, 424, 376, 423,
833 /* 280 */ 1, 42, 397, 78, 78, 36, 434, 11, 394, 435,
834 /* 290 */ 356, 59, 60, 12, 152, 139, 432, 14, 16, 376,
835 /* 300 */ 18, 65, 2, 138, 106, 430, 436, 437, 438, 439,
836 /* 310 */ 44, 375, 19, 117, 393, 155, 154, 153, 441, 440,
837 /* 320 */ 142, 140, 64, 63, 62, 61, 106, 20, 68, 376,
838 /* 330 */ 359, 107, 23, 375, 45, 117, 393, 155, 154, 153,
839 /* 340 */ 120, 161, 119, 55, 463, 114, 26, 57, 106, 147,
840 /* 350 */ 146, 434, 569, 58, 392, 375, 43, 117, 393, 155,
841 /* 360 */ 154, 153, 152, 384, 64, 63, 62, 61, 382, 106,
842 /* 370 */ 383, 436, 437, 438, 439, 377, 375, 70, 117, 393,
843 /* 380 */ 155, 154, 153, 160, 39, 22, 21, 445, 142, 140,
844 /* 390 */ 64, 63, 62, 61, 24, 17, 145, 141, 431, 108,
845 /* 400 */ 445, 445, 445, 391, 445, 445, 375, 445, 117, 445,
846 /* 410 */ 445, 55, 74, 445, 148, 445, 445, 147, 146, 124,
847 /* 420 */ 113, 120, 161, 119, 43, 445, 445, 142, 140, 64,
848 /* 430 */ 63, 62, 61, 445, 394, 445, 445, 59, 60, 64,
849 /* 440 */ 63, 62, 61, 149, 445, 376, 445, 445, 42, 445,
850 /* 450 */ 55, 445, 391, 22, 21, 445, 147, 146, 445, 445,
851 /* 460 */ 52, 445, 24, 43, 145, 141, 431, 394, 445, 445,
852 /* 470 */ 59, 60, 64, 63, 62, 61, 445, 445, 376, 132,
853 /* 480 */ 130, 42, 445, 445, 445, 355, 156, 156, 156, 445,
854 /* 490 */ 445, 445, 22, 21, 445, 394, 473, 445, 59, 60,
855 /* 500 */ 445, 24, 445, 145, 141, 431, 376, 445, 107, 42,
856 /* 510 */ 64, 63, 62, 61, 445, 106, 445, 120, 161, 119,
857 /* 520 */ 445, 478, 375, 354, 117, 393, 155, 154, 153, 445,
858 /* 530 */ 394, 143, 473, 59, 60, 64, 63, 62, 61, 152,
859 /* 540 */ 445, 376, 445, 445, 42, 445, 445, 445, 106, 64,
860 /* 550 */ 63, 62, 61, 445, 445, 375, 50, 117, 393, 155,
861 /* 560 */ 154, 153, 445, 394, 144, 445, 59, 60, 445, 445,
862 /* 570 */ 53, 72, 445, 148, 376, 445, 106, 42, 125, 113,
863 /* 580 */ 120, 161, 119, 375, 445, 117, 393, 155, 154, 153,
864 /* 590 */ 394, 445, 445, 59, 60, 445, 445, 445, 445, 445,
865 /* 600 */ 445, 102, 149, 445, 42, 445, 74, 445, 148, 445,
866 /* 610 */ 445, 106, 445, 497, 113, 120, 161, 119, 375, 445,
867 /* 620 */ 117, 393, 155, 154, 153, 394, 445, 445, 59, 60,
868 /* 630 */ 445, 445, 88, 445, 445, 445, 376, 149, 445, 40,
869 /* 640 */ 445, 120, 161, 119, 106, 445, 445, 435, 110, 110,
870 /* 650 */ 445, 375, 445, 117, 393, 155, 154, 153, 394, 445,
871 /* 660 */ 445, 59, 60, 152, 85, 445, 445, 445, 445, 376,
872 /* 670 */ 445, 106, 41, 120, 161, 119, 441, 440, 375, 445,
873 /* 680 */ 117, 393, 155, 154, 153, 448, 454, 29, 445, 445,
874 /* 690 */ 74, 450, 148, 75, 88, 152, 445, 496, 113, 120,
875 /* 700 */ 161, 119, 163, 120, 161, 119, 106, 27, 445, 434,
876 /* 710 */ 111, 111, 445, 375, 445, 117, 393, 155, 154, 153,
877 /* 720 */ 445, 149, 445, 445, 445, 152, 74, 445, 148, 436,
878 /* 730 */ 437, 438, 439, 490, 113, 120, 161, 119, 445, 106,
879 /* 740 */ 121, 447, 454, 29, 445, 445, 375, 450, 117, 393,
880 /* 750 */ 155, 154, 153, 445, 445, 445, 445, 149, 163, 74,
881 /* 760 */ 445, 148, 444, 27, 445, 445, 484, 113, 120, 161,
882 /* 770 */ 119, 445, 445, 445, 74, 445, 148, 445, 445, 445,
883 /* 780 */ 445, 483, 113, 120, 161, 119, 74, 445, 148, 86,
884 /* 790 */ 149, 445, 445, 480, 113, 120, 161, 119, 120, 161,
885 /* 800 */ 119, 445, 74, 445, 148, 149, 445, 445, 445, 134,
886 /* 810 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
887 /* 820 */ 152, 517, 113, 120, 161, 119, 88, 64, 63, 62,
888 /* 830 */ 61, 445, 445, 149, 445, 120, 161, 119, 445, 74,
889 /* 840 */ 396, 148, 475, 445, 445, 149, 137, 113, 120, 161,
890 /* 850 */ 119, 74, 445, 148, 445, 445, 445, 152, 525, 113,
891 /* 860 */ 120, 161, 119, 445, 74, 445, 148, 445, 445, 445,
892 /* 870 */ 149, 527, 113, 120, 161, 119, 445, 445, 445, 74,
893 /* 880 */ 445, 148, 149, 445, 445, 445, 524, 113, 120, 161,
894 /* 890 */ 119, 74, 445, 148, 98, 149, 445, 445, 526, 113,
895 /* 900 */ 120, 161, 119, 120, 161, 119, 445, 74, 445, 148,
896 /* 910 */ 149, 445, 445, 445, 523, 113, 120, 161, 119, 74,
897 /* 920 */ 445, 148, 149, 445, 445, 152, 522, 113, 120, 161,
898 /* 930 */ 119, 89, 64, 63, 62, 61, 445, 445, 149, 445,
899 /* 940 */ 120, 161, 119, 445, 74, 395, 148, 445, 445, 445,
900 /* 950 */ 149, 521, 113, 120, 161, 119, 74, 445, 148, 445,
901 /* 960 */ 445, 445, 152, 520, 113, 120, 161, 119, 445, 74,
902 /* 970 */ 445, 148, 445, 445, 445, 149, 519, 113, 120, 161,
903 /* 980 */ 119, 445, 445, 445, 74, 445, 148, 149, 445, 445,
904 /* 990 */ 445, 150, 113, 120, 161, 119, 74, 445, 148, 90,
905 /* 1000 */ 149, 445, 445, 151, 113, 120, 161, 119, 120, 161,
906 /* 1010 */ 119, 445, 74, 445, 148, 149, 445, 435, 445, 136,
907 /* 1020 */ 113, 120, 161, 119, 74, 445, 148, 149, 445, 445,
908 /* 1030 */ 152, 135, 113, 120, 161, 119, 64, 63, 62, 61,
909 /* 1040 */ 445, 445, 445, 149, 445, 445, 441, 440, 445, 88,
910 /* 1050 */ 445, 445, 445, 445, 445, 149, 445, 56, 120, 161,
911 /* 1060 */ 119, 88, 445, 445, 10, 479, 479, 445, 445, 445,
912 /* 1070 */ 120, 161, 119, 445, 445, 445, 445, 82, 445, 434,
913 /* 1080 */ 152, 445, 445, 445, 466, 445, 34, 109, 447, 454,
914 /* 1090 */ 29, 445, 152, 445, 450, 445, 445, 445, 107, 436,
915 /* 1100 */ 437, 438, 439, 87, 445, 163, 445, 120, 161, 119,
916 /* 1110 */ 27, 451, 120, 161, 119, 99, 445, 64, 63, 62,
917 /* 1120 */ 61, 445, 100, 445, 120, 161, 119, 101, 445, 152,
918 /* 1130 */ 391, 120, 161, 119, 152, 445, 120, 161, 119, 91,
919 /* 1140 */ 445, 445, 445, 445, 445, 445, 152, 445, 120, 161,
920 /* 1150 */ 119, 103, 445, 152, 92, 445, 445, 445, 152, 445,
921 /* 1160 */ 120, 161, 119, 120, 161, 119, 93, 445, 445, 104,
922 /* 1170 */ 152, 445, 445, 445, 445, 120, 161, 119, 120, 161,
923 /* 1180 */ 119, 445, 152, 445, 94, 152, 445, 445, 445, 445,
924 /* 1190 */ 445, 445, 105, 120, 161, 119, 445, 152, 445, 95,
925 /* 1200 */ 152, 120, 161, 119, 445, 445, 445, 96, 120, 161,
926 /* 1210 */ 119, 445, 445, 445, 445, 152, 120, 161, 119, 445,
927 /* 1220 */ 445, 445, 445, 152, 445, 445, 445, 445, 445, 445,
928 /* 1230 */ 152, 97, 445, 445, 549, 445, 445, 548, 152, 445,
929 /* 1240 */ 120, 161, 119, 120, 161, 119, 120, 161, 119, 445,
930 /* 1250 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
931 /* 1260 */ 445, 445, 152, 547, 445, 152, 546, 445, 152, 115,
932 /* 1270 */ 445, 445, 120, 161, 119, 120, 161, 119, 120, 161,
933 /* 1280 */ 119, 116, 445, 445, 445, 445, 445, 445, 445, 445,
934 /* 1290 */ 120, 161, 119, 445, 152, 445, 445, 152, 445, 445,
935 /* 1300 */ 152, 445, 445, 445, 445, 445, 445, 445, 445, 445,
936 /* 1310 */ 445, 445, 152,
937 };
938 static const YYCODETYPE yy_lookahead[] = {
939 /* 0 */ 0, 113, 114, 115, 134, 102, 103, 104, 106, 106,
940 /* 10 */ 10, 113, 114, 115, 111, 112, 113, 114, 115, 106,
941 /* 20 */ 20, 21, 22, 105, 24, 126, 108, 109, 28, 4,
942 /* 30 */ 5, 6, 7, 33, 34, 35, 36, 37, 135, 39,
943 /* 40 */ 40, 41, 42, 105, 44, 45, 108, 109, 107, 49,
944 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
945 /* 60 */ 60, 61, 62, 63, 0, 113, 114, 115, 130, 131,
946 /* 70 */ 132, 104, 25, 106, 10, 113, 114, 115, 111, 112,
947 /* 80 */ 113, 114, 115, 106, 20, 21, 22, 128, 24, 113,
948 /* 90 */ 114, 115, 28, 129, 2, 26, 27, 33, 34, 35,
949 /* 100 */ 36, 37, 135, 39, 40, 41, 42, 2, 44, 45,
950 /* 110 */ 133, 26, 27, 49, 50, 51, 52, 53, 54, 55,
951 /* 120 */ 56, 57, 58, 59, 60, 61, 62, 63, 1, 2,
952 /* 130 */ 38, 4, 5, 4, 5, 6, 7, 17, 10, 12,
953 /* 140 */ 4, 5, 15, 38, 1, 25, 17, 29, 30, 31,
954 /* 150 */ 32, 24, 83, 26, 27, 12, 28, 14, 31, 32,
955 /* 160 */ 91, 18, 116, 20, 21, 22, 23, 24, 116, 26,
956 /* 170 */ 27, 19, 29, 30, 31, 32, 91, 3, 64, 65,
957 /* 180 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 6,
958 /* 190 */ 7, 64, 4, 5, 6, 7, 8, 97, 98, 20,
959 /* 200 */ 21, 22, 26, 27, 4, 5, 6, 7, 1, 82,
960 /* 210 */ 48, 84, 85, 86, 87, 17, 89, 17, 91, 92,
961 /* 220 */ 93, 94, 95, 1, 2, 25, 4, 5, 49, 50,
962 /* 230 */ 51, 52, 53, 54, 12, 16, 15, 15, 4, 5,
963 /* 240 */ 6, 7, 20, 21, 22, 1, 26, 27, 4, 5,
964 /* 250 */ 48, 43, 90, 31, 32, 40, 12, 40, 96, 15,
965 /* 260 */ 47, 99, 88, 104, 20, 21, 22, 1, 24, 35,
966 /* 270 */ 4, 5, 113, 114, 115, 0, 117, 41, 12, 41,
967 /* 280 */ 13, 15, 17, 124, 125, 10, 64, 25, 1, 2,
968 /* 290 */ 17, 4, 5, 75, 135, 81, 80, 3, 3, 12,
969 /* 300 */ 3, 99, 15, 79, 82, 80, 84, 85, 86, 87,
970 /* 310 */ 38, 89, 3, 91, 92, 93, 94, 95, 31, 32,
971 /* 320 */ 2, 3, 4, 5, 6, 7, 82, 3, 3, 12,
972 /* 330 */ 77, 104, 25, 89, 16, 91, 92, 93, 94, 95,
973 /* 340 */ 113, 114, 115, 25, 117, 96, 15, 15, 82, 31,
974 /* 350 */ 32, 64, 125, 15, 17, 89, 38, 91, 92, 93,
975 /* 360 */ 94, 95, 135, 28, 4, 5, 6, 7, 28, 82,
976 /* 370 */ 28, 84, 85, 86, 87, 12, 89, 3, 91, 92,
977 /* 380 */ 93, 94, 95, 90, 11, 67, 68, 136, 2, 3,
978 /* 390 */ 4, 5, 6, 7, 76, 35, 78, 79, 80, 82,
979 /* 400 */ 136, 136, 136, 17, 136, 136, 89, 136, 91, 136,
980 /* 410 */ 136, 25, 104, 136, 106, 136, 136, 31, 32, 111,
981 /* 420 */ 112, 113, 114, 115, 38, 136, 136, 2, 3, 4,
982 /* 430 */ 5, 6, 7, 136, 1, 136, 136, 4, 5, 4,
983 /* 440 */ 5, 6, 7, 135, 136, 12, 136, 136, 15, 136,
984 /* 450 */ 25, 136, 17, 67, 68, 136, 31, 32, 136, 136,
985 /* 460 */ 25, 136, 76, 38, 78, 79, 80, 1, 136, 136,
986 /* 470 */ 4, 5, 4, 5, 6, 7, 136, 136, 12, 46,
987 /* 480 */ 47, 15, 136, 136, 136, 17, 20, 21, 22, 136,
988 /* 490 */ 136, 136, 67, 68, 136, 1, 2, 136, 4, 5,
989 /* 500 */ 136, 76, 136, 78, 79, 80, 12, 136, 104, 15,
990 /* 510 */ 4, 5, 6, 7, 136, 82, 136, 113, 114, 115,
991 /* 520 */ 136, 117, 89, 17, 91, 92, 93, 94, 95, 136,
992 /* 530 */ 1, 2, 38, 4, 5, 4, 5, 6, 7, 135,
993 /* 540 */ 136, 12, 136, 136, 15, 136, 136, 136, 82, 4,
994 /* 550 */ 5, 6, 7, 136, 136, 89, 25, 91, 92, 93,
995 /* 560 */ 94, 95, 136, 1, 2, 136, 4, 5, 136, 136,
996 /* 570 */ 25, 104, 136, 106, 12, 136, 82, 15, 111, 112,
997 /* 580 */ 113, 114, 115, 89, 136, 91, 92, 93, 94, 95,
998 /* 590 */ 1, 136, 136, 4, 5, 136, 136, 136, 136, 136,
999 /* 600 */ 136, 12, 135, 136, 15, 136, 104, 136, 106, 136,
1000 /* 610 */ 136, 82, 136, 111, 112, 113, 114, 115, 89, 136,
1001 /* 620 */ 91, 92, 93, 94, 95, 1, 136, 136, 4, 5,
1002 /* 630 */ 136, 136, 104, 136, 136, 136, 12, 135, 136, 15,
1003 /* 640 */ 136, 113, 114, 115, 82, 136, 136, 2, 120, 121,
1004 /* 650 */ 136, 89, 136, 91, 92, 93, 94, 95, 1, 136,
1005 /* 660 */ 136, 4, 5, 135, 104, 136, 136, 136, 136, 12,
1006 /* 670 */ 136, 82, 15, 113, 114, 115, 31, 32, 89, 136,
1007 /* 680 */ 91, 92, 93, 94, 95, 101, 102, 103, 136, 136,
1008 /* 690 */ 104, 107, 106, 48, 104, 135, 136, 111, 112, 113,
1009 /* 700 */ 114, 115, 118, 113, 114, 115, 82, 123, 136, 64,
1010 /* 710 */ 120, 121, 136, 89, 136, 91, 92, 93, 94, 95,
1011 /* 720 */ 136, 135, 136, 136, 136, 135, 104, 136, 106, 84,
1012 /* 730 */ 85, 86, 87, 111, 112, 113, 114, 115, 136, 82,
1013 /* 740 */ 100, 101, 102, 103, 136, 136, 89, 107, 91, 92,
1014 /* 750 */ 93, 94, 95, 136, 136, 136, 136, 135, 118, 104,
1015 /* 760 */ 136, 106, 122, 123, 136, 136, 111, 112, 113, 114,
1016 /* 770 */ 115, 136, 136, 136, 104, 136, 106, 136, 136, 136,
1017 /* 780 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1018 /* 790 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1019 /* 800 */ 115, 136, 104, 136, 106, 135, 136, 136, 136, 111,
1020 /* 810 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1021 /* 820 */ 135, 111, 112, 113, 114, 115, 104, 4, 5, 6,
1022 /* 830 */ 7, 136, 136, 135, 136, 113, 114, 115, 136, 104,
1023 /* 840 */ 17, 106, 120, 136, 136, 135, 111, 112, 113, 114,
1024 /* 850 */ 115, 104, 136, 106, 136, 136, 136, 135, 111, 112,
1025 /* 860 */ 113, 114, 115, 136, 104, 136, 106, 136, 136, 136,
1026 /* 870 */ 135, 111, 112, 113, 114, 115, 136, 136, 136, 104,
1027 /* 880 */ 136, 106, 135, 136, 136, 136, 111, 112, 113, 114,
1028 /* 890 */ 115, 104, 136, 106, 104, 135, 136, 136, 111, 112,
1029 /* 900 */ 113, 114, 115, 113, 114, 115, 136, 104, 136, 106,
1030 /* 910 */ 135, 136, 136, 136, 111, 112, 113, 114, 115, 104,
1031 /* 920 */ 136, 106, 135, 136, 136, 135, 111, 112, 113, 114,
1032 /* 930 */ 115, 104, 4, 5, 6, 7, 136, 136, 135, 136,
1033 /* 940 */ 113, 114, 115, 136, 104, 17, 106, 136, 136, 136,
1034 /* 950 */ 135, 111, 112, 113, 114, 115, 104, 136, 106, 136,
1035 /* 960 */ 136, 136, 135, 111, 112, 113, 114, 115, 136, 104,
1036 /* 970 */ 136, 106, 136, 136, 136, 135, 111, 112, 113, 114,
1037 /* 980 */ 115, 136, 136, 136, 104, 136, 106, 135, 136, 136,
1038 /* 990 */ 136, 111, 112, 113, 114, 115, 104, 136, 106, 104,
1039 /* 1000 */ 135, 136, 136, 111, 112, 113, 114, 115, 113, 114,
1040 /* 1010 */ 115, 136, 104, 136, 106, 135, 136, 2, 136, 111,
1041 /* 1020 */ 112, 113, 114, 115, 104, 136, 106, 135, 136, 136,
1042 /* 1030 */ 135, 111, 112, 113, 114, 115, 4, 5, 6, 7,
1043 /* 1040 */ 136, 136, 136, 135, 136, 136, 31, 32, 136, 104,
1044 /* 1050 */ 136, 136, 136, 136, 136, 135, 136, 25, 113, 114,
1045 /* 1060 */ 115, 104, 136, 136, 119, 120, 121, 136, 136, 136,
1046 /* 1070 */ 113, 114, 115, 136, 136, 136, 136, 120, 136, 64,
1047 /* 1080 */ 135, 136, 136, 136, 127, 136, 129, 100, 101, 102,
1048 /* 1090 */ 103, 136, 135, 136, 107, 136, 136, 136, 104, 84,
1049 /* 1100 */ 85, 86, 87, 104, 136, 118, 136, 113, 114, 115,
1050 /* 1110 */ 123, 117, 113, 114, 115, 104, 136, 4, 5, 6,
1051 /* 1120 */ 7, 136, 104, 136, 113, 114, 115, 104, 136, 135,
1052 /* 1130 */ 17, 113, 114, 115, 135, 136, 113, 114, 115, 104,
1053 /* 1140 */ 136, 136, 136, 136, 136, 136, 135, 136, 113, 114,
1054 /* 1150 */ 115, 104, 136, 135, 104, 136, 136, 136, 135, 136,
1055 /* 1160 */ 113, 114, 115, 113, 114, 115, 104, 136, 136, 104,
1056 /* 1170 */ 135, 136, 136, 136, 136, 113, 114, 115, 113, 114,
1057 /* 1180 */ 115, 136, 135, 136, 104, 135, 136, 136, 136, 136,
1058 /* 1190 */ 136, 136, 104, 113, 114, 115, 136, 135, 136, 104,
1059 /* 1200 */ 135, 113, 114, 115, 136, 136, 136, 104, 113, 114,
1060 /* 1210 */ 115, 136, 136, 136, 136, 135, 113, 114, 115, 136,
1061 /* 1220 */ 136, 136, 136, 135, 136, 136, 136, 136, 136, 136,
1062 /* 1230 */ 135, 104, 136, 136, 104, 136, 136, 104, 135, 136,
1063 /* 1240 */ 113, 114, 115, 113, 114, 115, 113, 114, 115, 136,
1064 /* 1250 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1065 /* 1260 */ 136, 136, 135, 104, 136, 135, 104, 136, 135, 104,
1066 /* 1270 */ 136, 136, 113, 114, 115, 113, 114, 115, 113, 114,
1067 /* 1280 */ 115, 104, 136, 136, 136, 136, 136, 136, 136, 136,
1068 /* 1290 */ 113, 114, 115, 136, 135, 136, 136, 135, 136, 136,
1069 /* 1300 */ 135, 136, 136, 136, 136, 136, 136, 136, 136, 136,
1070 /* 1310 */ 136, 136, 135, 100, 100, 100, 100, 100, 100, 100,
1071 /* 1320 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1072 /* 1330 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1073 /* 1340 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1074 /* 1350 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1075 /* 1360 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1076 /* 1370 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1077 /* 1380 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1078 /* 1390 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1079 /* 1400 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
1080 /* 1410 */ 100, 100, 100,
1081 };
1082 #define YY_SHIFT_COUNT (163)
1083 #define YY_SHIFT_MIN (0)
1084 #define YY_SHIFT_MAX (1113)
1085 static const unsigned short int yy_shift_ofst[] = {
1086 /* 0 */ 143, 127, 222, 287, 287, 287, 287, 287, 287, 287,
1087 /* 10 */ 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
1088 /* 20 */ 287, 287, 287, 287, 287, 287, 287, 244, 433, 266,
1089 /* 30 */ 244, 143, 494, 494, 0, 64, 143, 589, 266, 589,
1090 /* 40 */ 466, 466, 466, 529, 562, 266, 266, 266, 266, 266,
1091 /* 50 */ 266, 624, 266, 266, 657, 266, 266, 266, 266, 266,
1092 /* 60 */ 266, 266, 266, 266, 266, 179, 317, 317, 317, 317,
1093 /* 70 */ 317, 645, 318, 386, 425, 1015, 1015, 118, 47, 1313,
1094 /* 80 */ 1313, 1313, 1313, 114, 114, 200, 435, 129, 188, 234,
1095 /* 90 */ 360, 468, 531, 506, 545, 823, 1032, 928, 1113, 25,
1096 /* 100 */ 25, 25, 162, 25, 25, 25, 69, 25, 85, 128,
1097 /* 110 */ 92, 105, 120, 136, 100, 183, 183, 176, 220, 174,
1098 /* 120 */ 202, 275, 152, 207, 198, 219, 221, 208, 215, 217,
1099 /* 130 */ 236, 238, 213, 267, 265, 262, 218, 273, 216, 224,
1100 /* 140 */ 214, 225, 294, 295, 297, 272, 309, 324, 325, 249,
1101 /* 150 */ 253, 307, 249, 331, 332, 338, 337, 335, 340, 342,
1102 /* 160 */ 363, 293, 374, 373,
1103 };
1104 #define YY_REDUCE_COUNT (82)
1105 #define YY_REDUCE_MIN (-130)
1106 #define YY_REDUCE_MAX (1177)
1107 static const short yy_reduce_ofst[] = {
1108 /* 0 */ 640, -97, -33, 308, 467, 502, 586, 622, 655, 670,
1109 /* 10 */ 682, 698, 710, 735, 747, 760, 775, 787, 803, 815,
1110 /* 20 */ 840, 852, 865, 880, 892, 908, 920, 159, 945, 957,
1111 /* 30 */ 227, 987, 528, 590, -62, -62, 584, 404, 722, 994,
1112 /* 40 */ 560, 685, 790, 827, 895, 999, 1011, 1018, 1023, 1035,
1113 /* 50 */ 1047, 1050, 1062, 1065, 1080, 1088, 1095, 1103, 1127, 1130,
1114 /* 60 */ 1133, 1159, 1162, 1165, 1177, -82, -112, -102, -48, -38,
1115 /* 70 */ -24, -23, -130, -130, -130, -98, -87, -59, -101, -41,
1116 /* 80 */ 46, 52, -36,
1117 };
1118 static const YYACTIONTYPE yy_default[] = {
1119 /* 0 */ 449, 443, 443, 443, 443, 443, 443, 443, 443, 443,
1120 /* 10 */ 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
1121 /* 20 */ 443, 443, 443, 443, 443, 443, 443, 443, 473, 576,
@@ -1176,10 +1214,11 @@
1176 0, /* COLOR => nothing */
1177 0, /* THICKNESS => nothing */
1178 0, /* PRINT => nothing */
1179 0, /* STRING => nothing */
1180 0, /* COMMA => nothing */
 
1181 0, /* CLASSNAME => nothing */
1182 0, /* LB => nothing */
1183 0, /* RB => nothing */
1184 0, /* UP => nothing */
1185 0, /* DOWN => nothing */
@@ -1359,120 +1398,122 @@
1359 /* 21 */ "COLOR",
1360 /* 22 */ "THICKNESS",
1361 /* 23 */ "PRINT",
1362 /* 24 */ "STRING",
1363 /* 25 */ "COMMA",
1364 /* 26 */ "CLASSNAME",
1365 /* 27 */ "LB",
1366 /* 28 */ "RB",
1367 /* 29 */ "UP",
1368 /* 30 */ "DOWN",
1369 /* 31 */ "LEFT",
1370 /* 32 */ "RIGHT",
1371 /* 33 */ "CLOSE",
1372 /* 34 */ "CHOP",
1373 /* 35 */ "FROM",
1374 /* 36 */ "TO",
1375 /* 37 */ "THEN",
1376 /* 38 */ "HEADING",
1377 /* 39 */ "GO",
1378 /* 40 */ "AT",
1379 /* 41 */ "WITH",
1380 /* 42 */ "SAME",
1381 /* 43 */ "AS",
1382 /* 44 */ "FIT",
1383 /* 45 */ "BEHIND",
1384 /* 46 */ "UNTIL",
1385 /* 47 */ "EVEN",
1386 /* 48 */ "DOT_E",
1387 /* 49 */ "HEIGHT",
1388 /* 50 */ "WIDTH",
1389 /* 51 */ "RADIUS",
1390 /* 52 */ "DIAMETER",
1391 /* 53 */ "DOTTED",
1392 /* 54 */ "DASHED",
1393 /* 55 */ "CW",
1394 /* 56 */ "CCW",
1395 /* 57 */ "LARROW",
1396 /* 58 */ "RARROW",
1397 /* 59 */ "LRARROW",
1398 /* 60 */ "INVIS",
1399 /* 61 */ "THICK",
1400 /* 62 */ "THIN",
1401 /* 63 */ "SOLID",
1402 /* 64 */ "CENTER",
1403 /* 65 */ "LJUST",
1404 /* 66 */ "RJUST",
1405 /* 67 */ "ABOVE",
1406 /* 68 */ "BELOW",
1407 /* 69 */ "ITALIC",
1408 /* 70 */ "BOLD",
1409 /* 71 */ "MONO",
1410 /* 72 */ "ALIGNED",
1411 /* 73 */ "BIG",
1412 /* 74 */ "SMALL",
1413 /* 75 */ "AND",
1414 /* 76 */ "LT",
1415 /* 77 */ "GT",
1416 /* 78 */ "ON",
1417 /* 79 */ "WAY",
1418 /* 80 */ "BETWEEN",
1419 /* 81 */ "THE",
1420 /* 82 */ "NTH",
1421 /* 83 */ "VERTEX",
1422 /* 84 */ "TOP",
1423 /* 85 */ "BOTTOM",
1424 /* 86 */ "START",
1425 /* 87 */ "END",
1426 /* 88 */ "IN",
1427 /* 89 */ "THIS",
1428 /* 90 */ "DOT_U",
1429 /* 91 */ "LAST",
1430 /* 92 */ "NUMBER",
1431 /* 93 */ "FUNC1",
1432 /* 94 */ "FUNC2",
1433 /* 95 */ "DIST",
1434 /* 96 */ "DOT_XY",
1435 /* 97 */ "X",
1436 /* 98 */ "Y",
1437 /* 99 */ "DOT_L",
1438 /* 100 */ "statement_list",
1439 /* 101 */ "statement",
1440 /* 102 */ "unnamed_statement",
1441 /* 103 */ "basetype",
1442 /* 104 */ "expr",
1443 /* 105 */ "numproperty",
1444 /* 106 */ "edge",
1445 /* 107 */ "direction",
1446 /* 108 */ "dashproperty",
1447 /* 109 */ "colorproperty",
1448 /* 110 */ "locproperty",
1449 /* 111 */ "position",
1450 /* 112 */ "place",
1451 /* 113 */ "object",
1452 /* 114 */ "objectname",
1453 /* 115 */ "nth",
1454 /* 116 */ "textposition",
1455 /* 117 */ "rvalue",
1456 /* 118 */ "lvalue",
1457 /* 119 */ "even",
1458 /* 120 */ "relexpr",
1459 /* 121 */ "optrelexpr",
1460 /* 122 */ "document",
1461 /* 123 */ "print",
1462 /* 124 */ "prlist",
1463 /* 125 */ "pritem",
1464 /* 126 */ "prsep",
1465 /* 127 */ "attribute_list",
1466 /* 128 */ "savelist",
1467 /* 129 */ "alist",
1468 /* 130 */ "attribute",
1469 /* 131 */ "go",
1470 /* 132 */ "boolproperty",
1471 /* 133 */ "withclause",
1472 /* 134 */ "between",
1473 /* 135 */ "place2",
 
 
1474 };
1475 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
1476
1477 #ifndef NDEBUG
1478 /* For tracing reduce actions, the names of all rules are required.
@@ -1755,24 +1796,24 @@
1755 ** Note: during a reduce, the only symbols destroyed are those
1756 ** which appear on the RHS of the rule, but which are *not* used
1757 ** inside the C code.
1758 */
1759 /********* Begin destructor definitions ***************************************/
1760 case 100: /* statement_list */
1761 {
1762 #line 523 "pikchr.y"
1763 pik_elist_free(p,(yypminor->yy235));
1764 #line 1789 "pikchr.c"
1765 }
1766 break;
1767 case 101: /* statement */
1768 case 102: /* unnamed_statement */
1769 case 103: /* basetype */
1770 {
1771 #line 525 "pikchr.y"
1772 pik_elem_free(p,(yypminor->yy162));
1773 #line 1798 "pikchr.c"
1774 }
1775 break;
1776 /********* End destructor definitions *****************************************/
1777 default: break; /* If no destructor action specified: do nothing */
1778 }
@@ -2003,14 +2044,14 @@
2003 #endif
2004 while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
2005 /* Here code is inserted which will execute if the parser
2006 ** stack every overflows */
2007 /******** Begin %stack_overflow code ******************************************/
2008 #line 557 "pikchr.y"
2009
2010 pik_error(p, 0, "parser stack overflow");
2011 #line 2036 "pikchr.c"
2012 /******** End %stack_overflow code ********************************************/
2013 pik_parserARG_STORE /* Suppress warning about unused %extra_argument var */
2014 pik_parserCTX_STORE
2015 }
2016
@@ -2072,166 +2113,166 @@
2072 }
2073
2074 /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
2075 ** of that rule */
2076 static const YYCODETYPE yyRuleInfoLhs[] = {
2077 122, /* (0) document ::= statement_list */
2078 100, /* (1) statement_list ::= statement */
2079 100, /* (2) statement_list ::= statement_list EOL statement */
2080 101, /* (3) statement ::= */
2081 101, /* (4) statement ::= direction */
2082 101, /* (5) statement ::= lvalue ASSIGN rvalue */
2083 101, /* (6) statement ::= PLACENAME COLON unnamed_statement */
2084 101, /* (7) statement ::= PLACENAME COLON position */
2085 101, /* (8) statement ::= unnamed_statement */
2086 101, /* (9) statement ::= print prlist */
2087 101, /* (10) statement ::= ASSERT LP expr EQ expr RP */
2088 101, /* (11) statement ::= ASSERT LP position EQ position RP */
2089 101, /* (12) statement ::= DEFINE ID CODEBLOCK */
2090 117, /* (13) rvalue ::= PLACENAME */
2091 125, /* (14) pritem ::= FILL */
2092 125, /* (15) pritem ::= COLOR */
2093 125, /* (16) pritem ::= THICKNESS */
2094 125, /* (17) pritem ::= rvalue */
2095 125, /* (18) pritem ::= STRING */
2096 126, /* (19) prsep ::= COMMA */
2097 102, /* (20) unnamed_statement ::= basetype attribute_list */
2098 103, /* (21) basetype ::= CLASSNAME */
2099 103, /* (22) basetype ::= STRING textposition */
2100 103, /* (23) basetype ::= LB savelist statement_list RB */
2101 128, /* (24) savelist ::= */
2102 120, /* (25) relexpr ::= expr */
2103 120, /* (26) relexpr ::= expr PERCENT */
2104 121, /* (27) optrelexpr ::= */
2105 127, /* (28) attribute_list ::= relexpr alist */
2106 130, /* (29) attribute ::= numproperty relexpr */
2107 130, /* (30) attribute ::= dashproperty expr */
2108 130, /* (31) attribute ::= dashproperty */
2109 130, /* (32) attribute ::= colorproperty rvalue */
2110 130, /* (33) attribute ::= go direction optrelexpr */
2111 130, /* (34) attribute ::= go direction even position */
2112 130, /* (35) attribute ::= CLOSE */
2113 130, /* (36) attribute ::= CHOP */
2114 130, /* (37) attribute ::= FROM position */
2115 130, /* (38) attribute ::= TO position */
2116 130, /* (39) attribute ::= THEN */
2117 130, /* (40) attribute ::= THEN optrelexpr HEADING expr */
2118 130, /* (41) attribute ::= THEN optrelexpr EDGEPT */
2119 130, /* (42) attribute ::= GO optrelexpr HEADING expr */
2120 130, /* (43) attribute ::= GO optrelexpr EDGEPT */
2121 130, /* (44) attribute ::= AT position */
2122 130, /* (45) attribute ::= SAME */
2123 130, /* (46) attribute ::= SAME AS object */
2124 130, /* (47) attribute ::= STRING textposition */
2125 130, /* (48) attribute ::= FIT */
2126 130, /* (49) attribute ::= BEHIND object */
2127 133, /* (50) withclause ::= DOT_E edge AT position */
2128 133, /* (51) withclause ::= edge AT position */
2129 105, /* (52) numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2130 132, /* (53) boolproperty ::= CW */
2131 132, /* (54) boolproperty ::= CCW */
2132 132, /* (55) boolproperty ::= LARROW */
2133 132, /* (56) boolproperty ::= RARROW */
2134 132, /* (57) boolproperty ::= LRARROW */
2135 132, /* (58) boolproperty ::= INVIS */
2136 132, /* (59) boolproperty ::= THICK */
2137 132, /* (60) boolproperty ::= THIN */
2138 132, /* (61) boolproperty ::= SOLID */
2139 116, /* (62) textposition ::= */
2140 116, /* (63) textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2141 111, /* (64) position ::= expr COMMA expr */
2142 111, /* (65) position ::= place PLUS expr COMMA expr */
2143 111, /* (66) position ::= place MINUS expr COMMA expr */
2144 111, /* (67) position ::= place PLUS LP expr COMMA expr RP */
2145 111, /* (68) position ::= place MINUS LP expr COMMA expr RP */
2146 111, /* (69) position ::= LP position COMMA position RP */
2147 111, /* (70) position ::= LP position RP */
2148 111, /* (71) position ::= expr between position AND position */
2149 111, /* (72) position ::= expr LT position COMMA position GT */
2150 111, /* (73) position ::= expr ABOVE position */
2151 111, /* (74) position ::= expr BELOW position */
2152 111, /* (75) position ::= expr LEFT OF position */
2153 111, /* (76) position ::= expr RIGHT OF position */
2154 111, /* (77) position ::= expr ON HEADING EDGEPT OF position */
2155 111, /* (78) position ::= expr HEADING EDGEPT OF position */
2156 111, /* (79) position ::= expr EDGEPT OF position */
2157 111, /* (80) position ::= expr ON HEADING expr FROM position */
2158 111, /* (81) position ::= expr HEADING expr FROM position */
2159 112, /* (82) place ::= edge OF object */
2160 135, /* (83) place2 ::= object */
2161 135, /* (84) place2 ::= object DOT_E edge */
2162 135, /* (85) place2 ::= NTH VERTEX OF object */
2163 113, /* (86) object ::= nth */
2164 113, /* (87) object ::= nth OF|IN object */
2165 114, /* (88) objectname ::= THIS */
2166 114, /* (89) objectname ::= PLACENAME */
2167 114, /* (90) objectname ::= objectname DOT_U PLACENAME */
2168 115, /* (91) nth ::= NTH CLASSNAME */
2169 115, /* (92) nth ::= NTH LAST CLASSNAME */
2170 115, /* (93) nth ::= LAST CLASSNAME */
2171 115, /* (94) nth ::= LAST */
2172 115, /* (95) nth ::= NTH LB RB */
2173 115, /* (96) nth ::= NTH LAST LB RB */
2174 115, /* (97) nth ::= LAST LB RB */
2175 104, /* (98) expr ::= expr PLUS expr */
2176 104, /* (99) expr ::= expr MINUS expr */
2177 104, /* (100) expr ::= expr STAR expr */
2178 104, /* (101) expr ::= expr SLASH expr */
2179 104, /* (102) expr ::= MINUS expr */
2180 104, /* (103) expr ::= PLUS expr */
2181 104, /* (104) expr ::= LP expr RP */
2182 104, /* (105) expr ::= LP FILL|COLOR|THICKNESS RP */
2183 104, /* (106) expr ::= NUMBER */
2184 104, /* (107) expr ::= ID */
2185 104, /* (108) expr ::= FUNC1 LP expr RP */
2186 104, /* (109) expr ::= FUNC2 LP expr COMMA expr RP */
2187 104, /* (110) expr ::= DIST LP position COMMA position RP */
2188 104, /* (111) expr ::= place2 DOT_XY X */
2189 104, /* (112) expr ::= place2 DOT_XY Y */
2190 104, /* (113) expr ::= object DOT_L numproperty */
2191 104, /* (114) expr ::= object DOT_L dashproperty */
2192 104, /* (115) expr ::= object DOT_L colorproperty */
2193 118, /* (116) lvalue ::= ID */
2194 118, /* (117) lvalue ::= FILL */
2195 118, /* (118) lvalue ::= COLOR */
2196 118, /* (119) lvalue ::= THICKNESS */
2197 117, /* (120) rvalue ::= expr */
2198 123, /* (121) print ::= PRINT */
2199 124, /* (122) prlist ::= pritem */
2200 124, /* (123) prlist ::= prlist prsep pritem */
2201 107, /* (124) direction ::= UP */
2202 107, /* (125) direction ::= DOWN */
2203 107, /* (126) direction ::= LEFT */
2204 107, /* (127) direction ::= RIGHT */
2205 121, /* (128) optrelexpr ::= relexpr */
2206 127, /* (129) attribute_list ::= alist */
2207 129, /* (130) alist ::= */
2208 129, /* (131) alist ::= alist attribute */
2209 130, /* (132) attribute ::= boolproperty */
2210 130, /* (133) attribute ::= WITH withclause */
2211 131, /* (134) go ::= GO */
2212 131, /* (135) go ::= */
2213 119, /* (136) even ::= UNTIL EVEN WITH */
2214 119, /* (137) even ::= EVEN WITH */
2215 108, /* (138) dashproperty ::= DOTTED */
2216 108, /* (139) dashproperty ::= DASHED */
2217 109, /* (140) colorproperty ::= FILL */
2218 109, /* (141) colorproperty ::= COLOR */
2219 111, /* (142) position ::= place */
2220 134, /* (143) between ::= WAY BETWEEN */
2221 134, /* (144) between ::= BETWEEN */
2222 134, /* (145) between ::= OF THE WAY BETWEEN */
2223 112, /* (146) place ::= place2 */
2224 106, /* (147) edge ::= CENTER */
2225 106, /* (148) edge ::= EDGEPT */
2226 106, /* (149) edge ::= TOP */
2227 106, /* (150) edge ::= BOTTOM */
2228 106, /* (151) edge ::= START */
2229 106, /* (152) edge ::= END */
2230 106, /* (153) edge ::= RIGHT */
2231 106, /* (154) edge ::= LEFT */
2232 113, /* (155) object ::= objectname */
2233 };
2234
2235 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
2236 ** of symbols on the right-hand side of that rule. */
2237 static const signed char yyRuleInfoNRhs[] = {
@@ -2431,620 +2472,620 @@
2431 ** break;
2432 */
2433 /********** Begin reduce actions **********************************************/
2434 YYMINORTYPE yylhsminor;
2435 case 0: /* document ::= statement_list */
2436 #line 561 "pikchr.y"
2437 {pik_render(p,yymsp[0].minor.yy235);}
2438 #line 2463 "pikchr.c"
2439 break;
2440 case 1: /* statement_list ::= statement */
2441 #line 564 "pikchr.y"
2442 { yylhsminor.yy235 = pik_elist_append(p,0,yymsp[0].minor.yy162); }
2443 #line 2468 "pikchr.c"
2444 yymsp[0].minor.yy235 = yylhsminor.yy235;
2445 break;
2446 case 2: /* statement_list ::= statement_list EOL statement */
2447 #line 566 "pikchr.y"
2448 { yylhsminor.yy235 = pik_elist_append(p,yymsp[-2].minor.yy235,yymsp[0].minor.yy162); }
2449 #line 2474 "pikchr.c"
2450 yymsp[-2].minor.yy235 = yylhsminor.yy235;
2451 break;
2452 case 3: /* statement ::= */
2453 #line 569 "pikchr.y"
2454 { yymsp[1].minor.yy162 = 0; }
2455 #line 2480 "pikchr.c"
2456 break;
2457 case 4: /* statement ::= direction */
2458 #line 570 "pikchr.y"
2459 { pik_set_direction(p,yymsp[0].minor.yy0.eCode); yylhsminor.yy162=0; }
2460 #line 2485 "pikchr.c"
2461 yymsp[0].minor.yy162 = yylhsminor.yy162;
2462 break;
2463 case 5: /* statement ::= lvalue ASSIGN rvalue */
2464 #line 571 "pikchr.y"
2465 {pik_set_var(p,&yymsp[-2].minor.yy0,yymsp[0].minor.yy21,&yymsp[-1].minor.yy0); yylhsminor.yy162=0;}
2466 #line 2491 "pikchr.c"
2467 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2468 break;
2469 case 6: /* statement ::= PLACENAME COLON unnamed_statement */
2470 #line 573 "pikchr.y"
2471 { yylhsminor.yy162 = yymsp[0].minor.yy162; pik_elem_setname(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0); }
2472 #line 2497 "pikchr.c"
2473 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2474 break;
2475 case 7: /* statement ::= PLACENAME COLON position */
2476 #line 575 "pikchr.y"
2477 { yylhsminor.yy162 = pik_elem_new(p,0,0,0);
2478 if(yylhsminor.yy162){ yylhsminor.yy162->ptAt = yymsp[0].minor.yy63; pik_elem_setname(p,yylhsminor.yy162,&yymsp[-2].minor.yy0); }}
2479 #line 2504 "pikchr.c"
2480 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2481 break;
2482 case 8: /* statement ::= unnamed_statement */
2483 #line 577 "pikchr.y"
2484 {yylhsminor.yy162 = yymsp[0].minor.yy162;}
2485 #line 2510 "pikchr.c"
2486 yymsp[0].minor.yy162 = yylhsminor.yy162;
2487 break;
2488 case 9: /* statement ::= print prlist */
2489 #line 578 "pikchr.y"
2490 {pik_append(p,"<br>\n",5); yymsp[-1].minor.yy162=0;}
2491 #line 2516 "pikchr.c"
2492 break;
2493 case 10: /* statement ::= ASSERT LP expr EQ expr RP */
2494 #line 583 "pikchr.y"
2495 {yymsp[-5].minor.yy162=pik_assert(p,yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy21);}
2496 #line 2521 "pikchr.c"
2497 break;
2498 case 11: /* statement ::= ASSERT LP position EQ position RP */
2499 #line 585 "pikchr.y"
2500 {yymsp[-5].minor.yy162=pik_position_assert(p,&yymsp[-3].minor.yy63,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy63);}
2501 #line 2526 "pikchr.c"
2502 break;
2503 case 12: /* statement ::= DEFINE ID CODEBLOCK */
2504 #line 586 "pikchr.y"
2505 {yymsp[-2].minor.yy162=0; pik_add_macro(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
2506 #line 2531 "pikchr.c"
2507 break;
2508 case 13: /* rvalue ::= PLACENAME */
2509 #line 597 "pikchr.y"
2510 {yylhsminor.yy21 = pik_lookup_color(p,&yymsp[0].minor.yy0);}
2511 #line 2536 "pikchr.c"
2512 yymsp[0].minor.yy21 = yylhsminor.yy21;
2513 break;
2514 case 14: /* pritem ::= FILL */
2515 case 15: /* pritem ::= COLOR */ yytestcase(yyruleno==15);
2516 case 16: /* pritem ::= THICKNESS */ yytestcase(yyruleno==16);
2517 #line 602 "pikchr.y"
2518 {pik_append_num(p,"",pik_value(p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.n,0));}
2519 #line 2544 "pikchr.c"
2520 break;
2521 case 17: /* pritem ::= rvalue */
2522 #line 605 "pikchr.y"
2523 {pik_append_num(p,"",yymsp[0].minor.yy21);}
2524 #line 2549 "pikchr.c"
2525 break;
2526 case 18: /* pritem ::= STRING */
2527 #line 606 "pikchr.y"
2528 {pik_append_text(p,yymsp[0].minor.yy0.z+1,yymsp[0].minor.yy0.n-2,0);}
2529 #line 2554 "pikchr.c"
2530 break;
2531 case 19: /* prsep ::= COMMA */
2532 #line 607 "pikchr.y"
2533 {pik_append(p, " ", 1);}
2534 #line 2559 "pikchr.c"
2535 break;
2536 case 20: /* unnamed_statement ::= basetype attribute_list */
2537 #line 610 "pikchr.y"
2538 {yylhsminor.yy162 = yymsp[-1].minor.yy162; pik_after_adding_attributes(p,yylhsminor.yy162);}
2539 #line 2564 "pikchr.c"
2540 yymsp[-1].minor.yy162 = yylhsminor.yy162;
2541 break;
2542 case 21: /* basetype ::= CLASSNAME */
2543 #line 612 "pikchr.y"
2544 {yylhsminor.yy162 = pik_elem_new(p,&yymsp[0].minor.yy0,0,0); }
2545 #line 2570 "pikchr.c"
2546 yymsp[0].minor.yy162 = yylhsminor.yy162;
2547 break;
2548 case 22: /* basetype ::= STRING textposition */
2549 #line 614 "pikchr.y"
2550 {yymsp[-1].minor.yy0.eCode = yymsp[0].minor.yy188; yylhsminor.yy162 = pik_elem_new(p,0,&yymsp[-1].minor.yy0,0); }
2551 #line 2576 "pikchr.c"
2552 yymsp[-1].minor.yy162 = yylhsminor.yy162;
2553 break;
2554 case 23: /* basetype ::= LB savelist statement_list RB */
2555 #line 616 "pikchr.y"
2556 { 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; }
2557 #line 2582 "pikchr.c"
2558 break;
2559 case 24: /* savelist ::= */
2560 #line 621 "pikchr.y"
2561 {yymsp[1].minor.yy235 = p->list; p->list = 0;}
2562 #line 2587 "pikchr.c"
2563 break;
2564 case 25: /* relexpr ::= expr */
2565 #line 628 "pikchr.y"
2566 {yylhsminor.yy72.rAbs = yymsp[0].minor.yy21; yylhsminor.yy72.rRel = 0;}
2567 #line 2592 "pikchr.c"
2568 yymsp[0].minor.yy72 = yylhsminor.yy72;
2569 break;
2570 case 26: /* relexpr ::= expr PERCENT */
2571 #line 629 "pikchr.y"
2572 {yylhsminor.yy72.rAbs = 0; yylhsminor.yy72.rRel = yymsp[-1].minor.yy21/100;}
2573 #line 2598 "pikchr.c"
2574 yymsp[-1].minor.yy72 = yylhsminor.yy72;
2575 break;
2576 case 27: /* optrelexpr ::= */
2577 #line 631 "pikchr.y"
2578 {yymsp[1].minor.yy72.rAbs = 0; yymsp[1].minor.yy72.rRel = 1.0;}
2579 #line 2604 "pikchr.c"
2580 break;
2581 case 28: /* attribute_list ::= relexpr alist */
2582 #line 633 "pikchr.y"
2583 {pik_add_direction(p,0,&yymsp[-1].minor.yy72);}
2584 #line 2609 "pikchr.c"
2585 break;
2586 case 29: /* attribute ::= numproperty relexpr */
2587 #line 637 "pikchr.y"
2588 { pik_set_numprop(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72); }
2589 #line 2614 "pikchr.c"
2590 break;
2591 case 30: /* attribute ::= dashproperty expr */
2592 #line 638 "pikchr.y"
2593 { pik_set_dashed(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy21); }
2594 #line 2619 "pikchr.c"
2595 break;
2596 case 31: /* attribute ::= dashproperty */
2597 #line 639 "pikchr.y"
2598 { pik_set_dashed(p,&yymsp[0].minor.yy0,0); }
2599 #line 2624 "pikchr.c"
2600 break;
2601 case 32: /* attribute ::= colorproperty rvalue */
2602 #line 640 "pikchr.y"
2603 { pik_set_clrprop(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21); }
2604 #line 2629 "pikchr.c"
2605 break;
2606 case 33: /* attribute ::= go direction optrelexpr */
2607 #line 641 "pikchr.y"
2608 { pik_add_direction(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy72);}
2609 #line 2634 "pikchr.c"
2610 break;
2611 case 34: /* attribute ::= go direction even position */
2612 #line 642 "pikchr.y"
2613 {pik_evenwith(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63);}
2614 #line 2639 "pikchr.c"
2615 break;
2616 case 35: /* attribute ::= CLOSE */
2617 #line 643 "pikchr.y"
2618 { pik_close_path(p,&yymsp[0].minor.yy0); }
2619 #line 2644 "pikchr.c"
2620 break;
2621 case 36: /* attribute ::= CHOP */
2622 #line 644 "pikchr.y"
2623 { p->cur->bChop = 1; }
2624 #line 2649 "pikchr.c"
2625 break;
2626 case 37: /* attribute ::= FROM position */
2627 #line 645 "pikchr.y"
2628 { pik_set_from(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2629 #line 2654 "pikchr.c"
2630 break;
2631 case 38: /* attribute ::= TO position */
2632 #line 646 "pikchr.y"
2633 { pik_add_to(p,p->cur,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy63); }
2634 #line 2659 "pikchr.c"
2635 break;
2636 case 39: /* attribute ::= THEN */
2637 #line 647 "pikchr.y"
2638 { pik_then(p, &yymsp[0].minor.yy0, p->cur); }
2639 #line 2664 "pikchr.c"
2640 break;
2641 case 40: /* attribute ::= THEN optrelexpr HEADING expr */
2642 case 42: /* attribute ::= GO optrelexpr HEADING expr */ yytestcase(yyruleno==42);
2643 #line 649 "pikchr.y"
2644 {pik_move_hdg(p,&yymsp[-2].minor.yy72,&yymsp[-1].minor.yy0,yymsp[0].minor.yy21,0,&yymsp[-3].minor.yy0);}
2645 #line 2670 "pikchr.c"
2646 break;
2647 case 41: /* attribute ::= THEN optrelexpr EDGEPT */
2648 case 43: /* attribute ::= GO optrelexpr EDGEPT */ yytestcase(yyruleno==43);
2649 #line 650 "pikchr.y"
2650 {pik_move_hdg(p,&yymsp[-1].minor.yy72,0,0,&yymsp[0].minor.yy0,&yymsp[-2].minor.yy0);}
2651 #line 2676 "pikchr.c"
2652 break;
2653 case 44: /* attribute ::= AT position */
2654 #line 655 "pikchr.y"
2655 { pik_set_at(p,0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2656 #line 2681 "pikchr.c"
2657 break;
2658 case 45: /* attribute ::= SAME */
2659 #line 657 "pikchr.y"
2660 {pik_same(p,0,&yymsp[0].minor.yy0);}
2661 #line 2686 "pikchr.c"
2662 break;
2663 case 46: /* attribute ::= SAME AS object */
2664 #line 658 "pikchr.y"
2665 {pik_same(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2666 #line 2691 "pikchr.c"
2667 break;
2668 case 47: /* attribute ::= STRING textposition */
2669 #line 659 "pikchr.y"
2670 {pik_add_txt(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy188);}
2671 #line 2696 "pikchr.c"
2672 break;
2673 case 48: /* attribute ::= FIT */
2674 #line 660 "pikchr.y"
2675 {pik_size_to_fit(p,&yymsp[0].minor.yy0,3); }
2676 #line 2701 "pikchr.c"
2677 break;
2678 case 49: /* attribute ::= BEHIND object */
2679 #line 661 "pikchr.y"
2680 {pik_behind(p,yymsp[0].minor.yy162);}
2681 #line 2706 "pikchr.c"
2682 break;
2683 case 50: /* withclause ::= DOT_E edge AT position */
2684 case 51: /* withclause ::= edge AT position */ yytestcase(yyruleno==51);
2685 #line 669 "pikchr.y"
2686 { pik_set_at(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy63,&yymsp[-1].minor.yy0); }
2687 #line 2712 "pikchr.c"
2688 break;
2689 case 52: /* numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2690 #line 673 "pikchr.y"
2691 {yylhsminor.yy0 = yymsp[0].minor.yy0;}
2692 #line 2717 "pikchr.c"
2693 yymsp[0].minor.yy0 = yylhsminor.yy0;
2694 break;
2695 case 53: /* boolproperty ::= CW */
2696 #line 684 "pikchr.y"
2697 {p->cur->cw = 1;}
2698 #line 2723 "pikchr.c"
2699 break;
2700 case 54: /* boolproperty ::= CCW */
2701 #line 685 "pikchr.y"
2702 {p->cur->cw = 0;}
2703 #line 2728 "pikchr.c"
2704 break;
2705 case 55: /* boolproperty ::= LARROW */
2706 #line 686 "pikchr.y"
2707 {p->cur->larrow=1; p->cur->rarrow=0; }
2708 #line 2733 "pikchr.c"
2709 break;
2710 case 56: /* boolproperty ::= RARROW */
2711 #line 687 "pikchr.y"
2712 {p->cur->larrow=0; p->cur->rarrow=1; }
2713 #line 2738 "pikchr.c"
2714 break;
2715 case 57: /* boolproperty ::= LRARROW */
2716 #line 688 "pikchr.y"
2717 {p->cur->larrow=1; p->cur->rarrow=1; }
2718 #line 2743 "pikchr.c"
2719 break;
2720 case 58: /* boolproperty ::= INVIS */
2721 #line 689 "pikchr.y"
2722 {p->cur->sw = -0.00001;}
2723 #line 2748 "pikchr.c"
2724 break;
2725 case 59: /* boolproperty ::= THICK */
2726 #line 690 "pikchr.y"
2727 {p->cur->sw *= 1.5;}
2728 #line 2753 "pikchr.c"
2729 break;
2730 case 60: /* boolproperty ::= THIN */
2731 #line 691 "pikchr.y"
2732 {p->cur->sw *= 0.67;}
2733 #line 2758 "pikchr.c"
2734 break;
2735 case 61: /* boolproperty ::= SOLID */
2736 #line 692 "pikchr.y"
2737 {p->cur->sw = pik_value(p,"thickness",9,0);
2738 p->cur->dotted = p->cur->dashed = 0.0;}
2739 #line 2764 "pikchr.c"
2740 break;
2741 case 62: /* textposition ::= */
2742 #line 695 "pikchr.y"
2743 {yymsp[1].minor.yy188 = 0;}
2744 #line 2769 "pikchr.c"
2745 break;
2746 case 63: /* textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
2747 #line 698 "pikchr.y"
2748 {yylhsminor.yy188 = (short int)pik_text_position(yymsp[-1].minor.yy188,&yymsp[0].minor.yy0);}
2749 #line 2774 "pikchr.c"
2750 yymsp[-1].minor.yy188 = yylhsminor.yy188;
2751 break;
2752 case 64: /* position ::= expr COMMA expr */
2753 #line 701 "pikchr.y"
2754 {yylhsminor.yy63.x=yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[0].minor.yy21;}
2755 #line 2780 "pikchr.c"
2756 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2757 break;
2758 case 65: /* position ::= place PLUS expr COMMA expr */
2759 #line 703 "pikchr.y"
2760 {yylhsminor.yy63.x=yymsp[-4].minor.yy63.x+yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y+yymsp[0].minor.yy21;}
2761 #line 2786 "pikchr.c"
2762 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2763 break;
2764 case 66: /* position ::= place MINUS expr COMMA expr */
2765 #line 704 "pikchr.y"
2766 {yylhsminor.yy63.x=yymsp[-4].minor.yy63.x-yymsp[-2].minor.yy21; yylhsminor.yy63.y=yymsp[-4].minor.yy63.y-yymsp[0].minor.yy21;}
2767 #line 2792 "pikchr.c"
2768 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2769 break;
2770 case 67: /* position ::= place PLUS LP expr COMMA expr RP */
2771 #line 706 "pikchr.y"
2772 {yylhsminor.yy63.x=yymsp[-6].minor.yy63.x+yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y+yymsp[-1].minor.yy21;}
2773 #line 2798 "pikchr.c"
2774 yymsp[-6].minor.yy63 = yylhsminor.yy63;
2775 break;
2776 case 68: /* position ::= place MINUS LP expr COMMA expr RP */
2777 #line 708 "pikchr.y"
2778 {yylhsminor.yy63.x=yymsp[-6].minor.yy63.x-yymsp[-3].minor.yy21; yylhsminor.yy63.y=yymsp[-6].minor.yy63.y-yymsp[-1].minor.yy21;}
2779 #line 2804 "pikchr.c"
2780 yymsp[-6].minor.yy63 = yylhsminor.yy63;
2781 break;
2782 case 69: /* position ::= LP position COMMA position RP */
2783 #line 709 "pikchr.y"
2784 {yymsp[-4].minor.yy63.x=yymsp[-3].minor.yy63.x; yymsp[-4].minor.yy63.y=yymsp[-1].minor.yy63.y;}
2785 #line 2810 "pikchr.c"
2786 break;
2787 case 70: /* position ::= LP position RP */
2788 #line 710 "pikchr.y"
2789 {yymsp[-2].minor.yy63=yymsp[-1].minor.yy63;}
2790 #line 2815 "pikchr.c"
2791 break;
2792 case 71: /* position ::= expr between position AND position */
2793 #line 712 "pikchr.y"
2794 {yylhsminor.yy63 = pik_position_between(yymsp[-4].minor.yy21,yymsp[-2].minor.yy63,yymsp[0].minor.yy63);}
2795 #line 2820 "pikchr.c"
2796 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2797 break;
2798 case 72: /* position ::= expr LT position COMMA position GT */
2799 #line 714 "pikchr.y"
2800 {yylhsminor.yy63 = pik_position_between(yymsp[-5].minor.yy21,yymsp[-3].minor.yy63,yymsp[-1].minor.yy63);}
2801 #line 2826 "pikchr.c"
2802 yymsp[-5].minor.yy63 = yylhsminor.yy63;
2803 break;
2804 case 73: /* position ::= expr ABOVE position */
2805 #line 715 "pikchr.y"
2806 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y += yymsp[-2].minor.yy21;}
2807 #line 2832 "pikchr.c"
2808 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2809 break;
2810 case 74: /* position ::= expr BELOW position */
2811 #line 716 "pikchr.y"
2812 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.y -= yymsp[-2].minor.yy21;}
2813 #line 2838 "pikchr.c"
2814 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2815 break;
2816 case 75: /* position ::= expr LEFT OF position */
2817 #line 717 "pikchr.y"
2818 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x -= yymsp[-3].minor.yy21;}
2819 #line 2844 "pikchr.c"
2820 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2821 break;
2822 case 76: /* position ::= expr RIGHT OF position */
2823 #line 718 "pikchr.y"
2824 {yylhsminor.yy63=yymsp[0].minor.yy63; yylhsminor.yy63.x += yymsp[-3].minor.yy21;}
2825 #line 2850 "pikchr.c"
2826 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2827 break;
2828 case 77: /* position ::= expr ON HEADING EDGEPT OF position */
2829 #line 720 "pikchr.y"
2830 {yylhsminor.yy63 = pik_position_at_hdg(yymsp[-5].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2831 #line 2856 "pikchr.c"
2832 yymsp[-5].minor.yy63 = yylhsminor.yy63;
2833 break;
2834 case 78: /* position ::= expr HEADING EDGEPT OF position */
2835 #line 722 "pikchr.y"
2836 {yylhsminor.yy63 = pik_position_at_hdg(yymsp[-4].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2837 #line 2862 "pikchr.c"
2838 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2839 break;
2840 case 79: /* position ::= expr EDGEPT OF position */
2841 #line 724 "pikchr.y"
2842 {yylhsminor.yy63 = pik_position_at_hdg(yymsp[-3].minor.yy21,&yymsp[-2].minor.yy0,yymsp[0].minor.yy63);}
2843 #line 2868 "pikchr.c"
2844 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2845 break;
2846 case 80: /* position ::= expr ON HEADING expr FROM position */
2847 #line 726 "pikchr.y"
2848 {yylhsminor.yy63 = pik_position_at_angle(yymsp[-5].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2849 #line 2874 "pikchr.c"
2850 yymsp[-5].minor.yy63 = yylhsminor.yy63;
2851 break;
2852 case 81: /* position ::= expr HEADING expr FROM position */
2853 #line 728 "pikchr.y"
2854 {yylhsminor.yy63 = pik_position_at_angle(yymsp[-4].minor.yy21,yymsp[-2].minor.yy21,yymsp[0].minor.yy63);}
2855 #line 2880 "pikchr.c"
2856 yymsp[-4].minor.yy63 = yylhsminor.yy63;
2857 break;
2858 case 82: /* place ::= edge OF object */
2859 #line 740 "pikchr.y"
2860 {yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2861 #line 2886 "pikchr.c"
2862 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2863 break;
2864 case 83: /* place2 ::= object */
2865 #line 741 "pikchr.y"
2866 {yylhsminor.yy63 = pik_place_of_elem(p,yymsp[0].minor.yy162,0);}
2867 #line 2892 "pikchr.c"
2868 yymsp[0].minor.yy63 = yylhsminor.yy63;
2869 break;
2870 case 84: /* place2 ::= object DOT_E edge */
2871 #line 742 "pikchr.y"
2872 {yylhsminor.yy63 = pik_place_of_elem(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2873 #line 2898 "pikchr.c"
2874 yymsp[-2].minor.yy63 = yylhsminor.yy63;
2875 break;
2876 case 85: /* place2 ::= NTH VERTEX OF object */
2877 #line 743 "pikchr.y"
2878 {yylhsminor.yy63 = pik_nth_vertex(p,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,yymsp[0].minor.yy162);}
2879 #line 2904 "pikchr.c"
2880 yymsp[-3].minor.yy63 = yylhsminor.yy63;
2881 break;
2882 case 86: /* object ::= nth */
2883 #line 755 "pikchr.y"
2884 {yylhsminor.yy162 = pik_find_nth(p,0,&yymsp[0].minor.yy0);}
2885 #line 2910 "pikchr.c"
2886 yymsp[0].minor.yy162 = yylhsminor.yy162;
2887 break;
2888 case 87: /* object ::= nth OF|IN object */
2889 #line 756 "pikchr.y"
2890 {yylhsminor.yy162 = pik_find_nth(p,yymsp[0].minor.yy162,&yymsp[-2].minor.yy0);}
2891 #line 2916 "pikchr.c"
2892 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2893 break;
2894 case 88: /* objectname ::= THIS */
2895 #line 758 "pikchr.y"
2896 {yymsp[0].minor.yy162 = p->cur;}
2897 #line 2922 "pikchr.c"
2898 break;
2899 case 89: /* objectname ::= PLACENAME */
2900 #line 759 "pikchr.y"
2901 {yylhsminor.yy162 = pik_find_byname(p,0,&yymsp[0].minor.yy0);}
2902 #line 2927 "pikchr.c"
2903 yymsp[0].minor.yy162 = yylhsminor.yy162;
2904 break;
2905 case 90: /* objectname ::= objectname DOT_U PLACENAME */
2906 #line 761 "pikchr.y"
2907 {yylhsminor.yy162 = pik_find_byname(p,yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
2908 #line 2933 "pikchr.c"
2909 yymsp[-2].minor.yy162 = yylhsminor.yy162;
2910 break;
2911 case 91: /* nth ::= NTH CLASSNAME */
2912 #line 763 "pikchr.y"
2913 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-1].minor.yy0); }
2914 #line 2939 "pikchr.c"
2915 yymsp[-1].minor.yy0 = yylhsminor.yy0;
2916 break;
2917 case 92: /* nth ::= NTH LAST CLASSNAME */
2918 #line 764 "pikchr.y"
2919 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-2].minor.yy0); }
2920 #line 2945 "pikchr.c"
2921 yymsp[-2].minor.yy0 = yylhsminor.yy0;
2922 break;
2923 case 93: /* nth ::= LAST CLASSNAME */
2924 #line 765 "pikchr.y"
2925 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.eCode = -1;}
2926 #line 2951 "pikchr.c"
2927 break;
2928 case 94: /* nth ::= LAST */
2929 #line 766 "pikchr.y"
2930 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -1;}
2931 #line 2956 "pikchr.c"
2932 yymsp[0].minor.yy0 = yylhsminor.yy0;
2933 break;
2934 case 95: /* nth ::= NTH LB RB */
2935 #line 767 "pikchr.y"
2936 {yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-2].minor.yy0);}
2937 #line 2962 "pikchr.c"
2938 yymsp[-2].minor.yy0 = yylhsminor.yy0;
2939 break;
2940 case 96: /* nth ::= NTH LAST LB RB */
2941 #line 768 "pikchr.y"
2942 {yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-3].minor.yy0);}
2943 #line 2968 "pikchr.c"
2944 yymsp[-3].minor.yy0 = yylhsminor.yy0;
2945 break;
2946 case 97: /* nth ::= LAST LB RB */
2947 #line 769 "pikchr.y"
2948 {yymsp[-2].minor.yy0=yymsp[-1].minor.yy0; yymsp[-2].minor.yy0.eCode = -1; }
2949 #line 2974 "pikchr.c"
2950 break;
2951 case 98: /* expr ::= expr PLUS expr */
2952 #line 771 "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 99: /* expr ::= expr MINUS expr */
2958 #line 772 "pikchr.y"
2959 {yylhsminor.yy21=yymsp[-2].minor.yy21-yymsp[0].minor.yy21;}
2960 #line 2985 "pikchr.c"
2961 yymsp[-2].minor.yy21 = yylhsminor.yy21;
2962 break;
2963 case 100: /* expr ::= expr STAR expr */
2964 #line 773 "pikchr.y"
2965 {yylhsminor.yy21=yymsp[-2].minor.yy21*yymsp[0].minor.yy21;}
2966 #line 2991 "pikchr.c"
2967 yymsp[-2].minor.yy21 = yylhsminor.yy21;
2968 break;
2969 case 101: /* expr ::= expr SLASH expr */
2970 #line 774 "pikchr.y"
2971 {
2972 if( yymsp[0].minor.yy21==0.0 ){ pik_error(p, &yymsp[-1].minor.yy0, "division by zero"); yylhsminor.yy21 = 0.0; }
2973 else{ yylhsminor.yy21 = yymsp[-2].minor.yy21/yymsp[0].minor.yy21; }
2974 }
2975 #line 3000 "pikchr.c"
2976 yymsp[-2].minor.yy21 = yylhsminor.yy21;
2977 break;
2978 case 102: /* expr ::= MINUS expr */
2979 #line 778 "pikchr.y"
2980 {yymsp[-1].minor.yy21=-yymsp[0].minor.yy21;}
2981 #line 3006 "pikchr.c"
2982 break;
2983 case 103: /* expr ::= PLUS expr */
2984 #line 779 "pikchr.y"
2985 {yymsp[-1].minor.yy21=yymsp[0].minor.yy21;}
2986 #line 3011 "pikchr.c"
2987 break;
2988 case 104: /* expr ::= LP expr RP */
2989 #line 780 "pikchr.y"
2990 {yymsp[-2].minor.yy21=yymsp[-1].minor.yy21;}
2991 #line 3016 "pikchr.c"
2992 break;
2993 case 105: /* expr ::= LP FILL|COLOR|THICKNESS RP */
2994 #line 781 "pikchr.y"
2995 {yymsp[-2].minor.yy21=pik_get_var(p,&yymsp[-1].minor.yy0);}
2996 #line 3021 "pikchr.c"
2997 break;
2998 case 106: /* expr ::= NUMBER */
2999 #line 782 "pikchr.y"
3000 {yylhsminor.yy21=pik_atof(&yymsp[0].minor.yy0);}
3001 #line 3026 "pikchr.c"
3002 yymsp[0].minor.yy21 = yylhsminor.yy21;
3003 break;
3004 case 107: /* expr ::= ID */
3005 #line 783 "pikchr.y"
3006 {yylhsminor.yy21=pik_get_var(p,&yymsp[0].minor.yy0);}
3007 #line 3032 "pikchr.c"
3008 yymsp[0].minor.yy21 = yylhsminor.yy21;
3009 break;
3010 case 108: /* expr ::= FUNC1 LP expr RP */
3011 #line 784 "pikchr.y"
3012 {yylhsminor.yy21 = pik_func(p,&yymsp[-3].minor.yy0,yymsp[-1].minor.yy21,0.0);}
3013 #line 3038 "pikchr.c"
3014 yymsp[-3].minor.yy21 = yylhsminor.yy21;
3015 break;
3016 case 109: /* expr ::= FUNC2 LP expr COMMA expr RP */
3017 #line 785 "pikchr.y"
3018 {yylhsminor.yy21 = pik_func(p,&yymsp[-5].minor.yy0,yymsp[-3].minor.yy21,yymsp[-1].minor.yy21);}
3019 #line 3044 "pikchr.c"
3020 yymsp[-5].minor.yy21 = yylhsminor.yy21;
3021 break;
3022 case 110: /* expr ::= DIST LP position COMMA position RP */
3023 #line 786 "pikchr.y"
3024 {yymsp[-5].minor.yy21 = pik_dist(&yymsp[-3].minor.yy63,&yymsp[-1].minor.yy63);}
3025 #line 3050 "pikchr.c"
3026 break;
3027 case 111: /* expr ::= place2 DOT_XY X */
3028 #line 787 "pikchr.y"
3029 {yylhsminor.yy21 = yymsp[-2].minor.yy63.x;}
3030 #line 3055 "pikchr.c"
3031 yymsp[-2].minor.yy21 = yylhsminor.yy21;
3032 break;
3033 case 112: /* expr ::= place2 DOT_XY Y */
3034 #line 788 "pikchr.y"
3035 {yylhsminor.yy21 = yymsp[-2].minor.yy63.y;}
3036 #line 3061 "pikchr.c"
3037 yymsp[-2].minor.yy21 = yylhsminor.yy21;
3038 break;
3039 case 113: /* expr ::= object DOT_L numproperty */
3040 case 114: /* expr ::= object DOT_L dashproperty */ yytestcase(yyruleno==114);
3041 case 115: /* expr ::= object DOT_L colorproperty */ yytestcase(yyruleno==115);
3042 #line 789 "pikchr.y"
3043 {yylhsminor.yy21=pik_property_of(yymsp[-2].minor.yy162,&yymsp[0].minor.yy0);}
3044 #line 3069 "pikchr.c"
3045 yymsp[-2].minor.yy21 = yylhsminor.yy21;
3046 break;
3047 default:
3048 /* (116) lvalue ::= ID */ yytestcase(yyruleno==116);
3049 /* (117) lvalue ::= FILL */ yytestcase(yyruleno==117);
3050 /* (118) lvalue ::= COLOR */ yytestcase(yyruleno==118);
@@ -3142,19 +3183,19 @@
3142 ){
3143 pik_parserARG_FETCH
3144 pik_parserCTX_FETCH
3145 #define TOKEN yyminor
3146 /************ Begin %syntax_error code ****************************************/
3147 #line 549 "pikchr.y"
3148
3149 if( TOKEN.z && TOKEN.z[0] ){
3150 pik_error(p, &TOKEN, "syntax error");
3151 }else{
3152 pik_error(p, 0, "syntax error");
3153 }
3154 UNUSED_PARAMETER(yymajor);
3155 #line 3180 "pikchr.c"
3156 /************ End %syntax_error code ******************************************/
3157 pik_parserARG_STORE /* Suppress warning about unused %extra_argument variable */
3158 pik_parserCTX_STORE
3159 }
3160
@@ -3419,11 +3460,11 @@
3419 #else
3420 (void)iToken;
3421 return 0;
3422 #endif
3423 }
3424 #line 794 "pikchr.y"
3425
3426
3427
3428 /* Chart of the 148 official CSS color names with their
3429 ** corresponding RGB values thru Color Module Level 4:
@@ -4350,11 +4391,11 @@
4350 static PPoint textOffset(Pik *p, PObj *pObj, int cp){
4351 /* Automatically slim-down the width and height of text
4352 ** statements so that the bounding box tightly encloses the text,
4353 ** then get boxOffset() to do the offset computation.
4354 */
4355 pik_size_to_fit(p, &pObj->errTok,3);
4356 return boxOffset(p, pObj, cp);
4357 }
4358 static void textRender(Pik *p, PObj *pObj){
4359 pik_append_txt(p, pObj, 0);
4360 }
@@ -6359,16 +6400,15 @@
6359 **
6360 ** 1: Fit horizontally only
6361 ** 2: Fit vertically only
6362 ** 3: Fit both ways
6363 */
6364 static void pik_size_to_fit(Pik *p, PToken *pFit, int eWhich){
6365 PObj *pObj;
6366 PNum w, h;
6367 PBox bbox;
6368 if( p->nErr ) return;
6369 pObj = p->cur;
6370
6371 if( pObj->nTxt==0 ){
6372 pik_error(0, pFit, "no text to fit to");
6373 return;
6374 }
@@ -6908,20 +6948,20 @@
6908 */
6909 if( pObj->h<=0.0 ){
6910 if( pObj->nTxt==0 ){
6911 pObj->h = 0.0;
6912 }else if( pObj->w<=0.0 ){
6913 pik_size_to_fit(p, &pObj->errTok, 3);
6914 }else{
6915 pik_size_to_fit(p, &pObj->errTok, 2);
6916 }
6917 }
6918 if( pObj->w<=0.0 ){
6919 if( pObj->nTxt==0 ){
6920 pObj->w = 0.0;
6921 }else{
6922 pik_size_to_fit(p, &pObj->errTok, 1);
6923 }
6924 }
6925 ofst = pik_elem_offset(p, pObj, pObj->eWith);
6926 dx = (pObj->with.x - ofst.x) - pObj->ptAt.x;
6927 dy = (pObj->with.y - ofst.y) - pObj->ptAt.y;
@@ -7247,11 +7287,12 @@
7247 pik_append_num(p, " width=\"", p->wSVG);
7248 pik_append_num(p, "\" height=\"", p->hSVG);
7249 pik_append(p, "\"", 1);
7250 }
7251 pik_append_dis(p, " viewBox=\"0 0 ",w,"");
7252 pik_append_dis(p, " ",h,"\">\n");
 
7253 pik_elist_render(p, pList);
7254 pik_append(p,"</svg>\n", -1);
7255 }else{
7256 p->wSVG = -1;
7257 p->hSVG = -1;
@@ -7331,10 +7372,11 @@
7331 { "n", 1, T_EDGEPT, 0, CP_N },
7332 { "ne", 2, T_EDGEPT, 0, CP_NE },
7333 { "north", 5, T_EDGEPT, 0, CP_N },
7334 { "nw", 2, T_EDGEPT, 0, CP_NW },
7335 { "of", 2, T_OF, 0, 0 },
 
7336 { "previous", 8, T_LAST, 0, 0, },
7337 { "print", 5, T_PRINT, 0, 0 },
7338 { "rad", 3, T_RADIUS, 0, 0 },
7339 { "radius", 6, T_RADIUS, 0, 0 },
7340 { "right", 5, T_RIGHT, DIR_RIGHT, CP_E },
@@ -7914,15 +7956,30 @@
7914 #endif
7915 token.n = (unsigned short)(sz & 0xffff);
7916 if( p->nToken++ > PIKCHR_TOKEN_LIMIT ){
7917 pik_error(p, &token, "script is too complex");
7918 break;
 
 
 
 
 
7919 }
7920 pik_parser(pParser, token.eType, token);
7921 }
7922 }
7923 }
 
 
 
 
 
 
 
 
 
 
7924
7925 /*
7926 ** Parse the PIKCHR script contained in zText[]. Return a rendering. Or
7927 ** if an error is encountered, return the error text. The error message
7928 ** is HTML formatted. So regardless of what happens, the return text
@@ -8142,10 +8199,14 @@
8142 exit(1);
8143 }
8144 bSvgOnly = 1;
8145 mFlags |= PIKCHR_PLAINTEXT_ERRORS;
8146 }else
 
 
 
 
8147 {
8148 fprintf(stderr,"unknown option: \"%s\"\n", argv[i]);
8149 usage(argv[0]);
8150 }
8151 continue;
@@ -8254,6 +8315,6 @@
8254
8255
8256 #endif /* PIKCHR_TCL */
8257
8258
8259 #line 8284 "pikchr.c"
8260
--- 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 "052f07296e76ab2312caf2a4bf6237e574b3e533c7a36ee8f34db833baa3efb4"
31 #define MANIFEST_VERSION "[052f07296e]"
32 #define MANIFEST_DATE "2025-03-05 10:54:16"
33 #define MANIFEST_YEAR "2025"
34 #define MANIFEST_ISODATE "20250305105416"
35 #define MANIFEST_NUMERIC_DATE 20250305
36 #define MANIFEST_NUMERIC_TIME 105416
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 **
@@ -486,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);
@@ -504,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
@@ -534,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.
@@ -672,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
@@ -705,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.
@@ -798,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,
@@ -1176,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 */
@@ -1359,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",
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",
1515 };
1516 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
1517
1518 #ifndef NDEBUG
1519 /* For tracing reduce actions, the names of all rules are required.
@@ -1755,24 +1796,24 @@
1796 ** Note: during a reduce, the only symbols destroyed are those
1797 ** which appear on the RHS of the rule, but which are *not* used
1798 ** inside the C code.
1799 */
1800 /********* Begin destructor definitions ***************************************/
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"
1815 }
1816 break;
1817 /********* End destructor definitions *****************************************/
1818 default: break; /* If no destructor action specified: do nothing */
1819 }
@@ -2003,14 +2044,14 @@
2044 #endif
2045 while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
2046 /* Here code is inserted which will execute if the parser
2047 ** stack every overflows */
2048 /******** Begin %stack_overflow code ******************************************/
2049 #line 559 "pikchr.y"
2050
2051 pik_error(p, 0, "parser stack overflow");
2052 #line 2052 "pikchr.c"
2053 /******** End %stack_overflow code ********************************************/
2054 pik_parserARG_STORE /* Suppress warning about unused %extra_argument var */
2055 pik_parserCTX_STORE
2056 }
2057
@@ -2072,166 +2113,166 @@
2113 }
2114
2115 /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
2116 ** of that rule */
2117 static const YYCODETYPE yyRuleInfoLhs[] = {
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 */
2274 };
2275
2276 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
2277 ** of symbols on the right-hand side of that rule. */
2278 static const signed char yyRuleInfoNRhs[] = {
@@ -2431,620 +2472,620 @@
2472 ** break;
2473 */
2474 /********** Begin reduce actions **********************************************/
2475 YYMINORTYPE yylhsminor;
2476 case 0: /* document ::= statement_list */
2477 #line 563 "pikchr.y"
2478 {pik_render(p,yymsp[0].minor.yy23);}
2479 #line 2479 "pikchr.c"
2480 break;
2481 case 1: /* statement_list ::= statement */
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;
2486 break;
2487 case 2: /* statement_list ::= statement_list EOL statement */
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;
2492 break;
2493 case 3: /* statement ::= */
2494 #line 571 "pikchr.y"
2495 { yymsp[1].minor.yy54 = 0; }
2496 #line 2496 "pikchr.c"
2497 break;
2498 case 4: /* statement ::= direction */
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;
2503 break;
2504 case 5: /* statement ::= lvalue ASSIGN rvalue */
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;
2509 break;
2510 case 6: /* statement ::= PLACENAME COLON unnamed_statement */
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;
2515 break;
2516 case 7: /* statement ::= PLACENAME COLON position */
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;
2522 break;
2523 case 8: /* statement ::= unnamed_statement */
2524 #line 579 "pikchr.y"
2525 {yylhsminor.yy54 = yymsp[0].minor.yy54;}
2526 #line 2526 "pikchr.c"
2527 yymsp[0].minor.yy54 = yylhsminor.yy54;
2528 break;
2529 case 9: /* statement ::= print prlist */
2530 #line 580 "pikchr.y"
2531 {pik_append(p,"<br>\n",5); yymsp[-1].minor.yy54=0;}
2532 #line 2532 "pikchr.c"
2533 break;
2534 case 10: /* statement ::= ASSERT LP expr EQ expr RP */
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"
2538 break;
2539 case 11: /* statement ::= ASSERT LP position EQ position RP */
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"
2543 break;
2544 case 12: /* statement ::= DEFINE ID CODEBLOCK */
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"
2548 break;
2549 case 13: /* rvalue ::= PLACENAME */
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;
2554 break;
2555 case 14: /* pritem ::= FILL */
2556 case 15: /* pritem ::= COLOR */ yytestcase(yyruleno==15);
2557 case 16: /* pritem ::= THICKNESS */ yytestcase(yyruleno==16);
2558 #line 604 "pikchr.y"
2559 {pik_append_num(p,"",pik_value(p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.n,0));}
2560 #line 2560 "pikchr.c"
2561 break;
2562 case 17: /* pritem ::= rvalue */
2563 #line 607 "pikchr.y"
2564 {pik_append_num(p,"",yymsp[0].minor.yy129);}
2565 #line 2565 "pikchr.c"
2566 break;
2567 case 18: /* pritem ::= STRING */
2568 #line 608 "pikchr.y"
2569 {pik_append_text(p,yymsp[0].minor.yy0.z+1,yymsp[0].minor.yy0.n-2,0);}
2570 #line 2570 "pikchr.c"
2571 break;
2572 case 19: /* prsep ::= COMMA */
2573 #line 609 "pikchr.y"
2574 {pik_append(p, " ", 1);}
2575 #line 2575 "pikchr.c"
2576 break;
2577 case 20: /* unnamed_statement ::= basetype attribute_list */
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;
2582 break;
2583 case 21: /* basetype ::= CLASSNAME */
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;
2588 break;
2589 case 22: /* basetype ::= STRING textposition */
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;
2594 break;
2595 case 23: /* basetype ::= LB savelist statement_list RB */
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"
2599 break;
2600 case 24: /* savelist ::= */
2601 #line 625 "pikchr.y"
2602 {yymsp[1].minor.yy23 = p->list; p->list = 0;}
2603 #line 2603 "pikchr.c"
2604 break;
2605 case 25: /* relexpr ::= expr */
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;
2610 break;
2611 case 26: /* relexpr ::= expr PERCENT */
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;
2616 break;
2617 case 27: /* optrelexpr ::= */
2618 #line 635 "pikchr.y"
2619 {yymsp[1].minor.yy28.rAbs = 0; yymsp[1].minor.yy28.rRel = 1.0;}
2620 #line 2620 "pikchr.c"
2621 break;
2622 case 28: /* attribute_list ::= relexpr alist */
2623 #line 637 "pikchr.y"
2624 {pik_add_direction(p,0,&yymsp[-1].minor.yy28);}
2625 #line 2625 "pikchr.c"
2626 break;
2627 case 29: /* attribute ::= numproperty relexpr */
2628 #line 641 "pikchr.y"
2629 { pik_set_numprop(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy28); }
2630 #line 2630 "pikchr.c"
2631 break;
2632 case 30: /* attribute ::= dashproperty expr */
2633 #line 642 "pikchr.y"
2634 { pik_set_dashed(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy129); }
2635 #line 2635 "pikchr.c"
2636 break;
2637 case 31: /* attribute ::= dashproperty */
2638 #line 643 "pikchr.y"
2639 { pik_set_dashed(p,&yymsp[0].minor.yy0,0); }
2640 #line 2640 "pikchr.c"
2641 break;
2642 case 32: /* attribute ::= colorproperty rvalue */
2643 #line 644 "pikchr.y"
2644 { pik_set_clrprop(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy129); }
2645 #line 2645 "pikchr.c"
2646 break;
2647 case 33: /* attribute ::= go direction optrelexpr */
2648 #line 645 "pikchr.y"
2649 { pik_add_direction(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy28);}
2650 #line 2650 "pikchr.c"
2651 break;
2652 case 34: /* attribute ::= go direction even position */
2653 #line 646 "pikchr.y"
2654 {pik_evenwith(p,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy187);}
2655 #line 2655 "pikchr.c"
2656 break;
2657 case 35: /* attribute ::= CLOSE */
2658 #line 647 "pikchr.y"
2659 { pik_close_path(p,&yymsp[0].minor.yy0); }
2660 #line 2660 "pikchr.c"
2661 break;
2662 case 36: /* attribute ::= CHOP */
2663 #line 648 "pikchr.y"
2664 { p->cur->bChop = 1; }
2665 #line 2665 "pikchr.c"
2666 break;
2667 case 37: /* attribute ::= FROM position */
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"
2671 break;
2672 case 38: /* attribute ::= TO position */
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"
2676 break;
2677 case 39: /* attribute ::= THEN */
2678 #line 651 "pikchr.y"
2679 { pik_then(p, &yymsp[0].minor.yy0, p->cur); }
2680 #line 2680 "pikchr.c"
2681 break;
2682 case 40: /* attribute ::= THEN optrelexpr HEADING expr */
2683 case 42: /* attribute ::= GO optrelexpr HEADING expr */ yytestcase(yyruleno==42);
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"
2687 break;
2688 case 41: /* attribute ::= THEN optrelexpr EDGEPT */
2689 case 43: /* attribute ::= GO optrelexpr EDGEPT */ yytestcase(yyruleno==43);
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"
2693 break;
2694 case 44: /* attribute ::= AT position */
2695 #line 659 "pikchr.y"
2696 { pik_set_at(p,0,&yymsp[0].minor.yy187,&yymsp[-1].minor.yy0); }
2697 #line 2697 "pikchr.c"
2698 break;
2699 case 45: /* attribute ::= SAME */
2700 #line 661 "pikchr.y"
2701 {pik_same(p,0,&yymsp[0].minor.yy0);}
2702 #line 2702 "pikchr.c"
2703 break;
2704 case 46: /* attribute ::= SAME AS object */
2705 #line 662 "pikchr.y"
2706 {pik_same(p,yymsp[0].minor.yy54,&yymsp[-2].minor.yy0);}
2707 #line 2707 "pikchr.c"
2708 break;
2709 case 47: /* attribute ::= STRING textposition */
2710 #line 663 "pikchr.y"
2711 {pik_add_txt(p,&yymsp[-1].minor.yy0,yymsp[0].minor.yy272);}
2712 #line 2712 "pikchr.c"
2713 break;
2714 case 48: /* attribute ::= FIT */
2715 #line 664 "pikchr.y"
2716 {pik_size_to_fit(p,0,&yymsp[0].minor.yy0,3); }
2717 #line 2717 "pikchr.c"
2718 break;
2719 case 49: /* attribute ::= BEHIND object */
2720 #line 665 "pikchr.y"
2721 {pik_behind(p,yymsp[0].minor.yy54);}
2722 #line 2722 "pikchr.c"
2723 break;
2724 case 50: /* withclause ::= DOT_E edge AT position */
2725 case 51: /* withclause ::= edge AT position */ yytestcase(yyruleno==51);
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"
2729 break;
2730 case 52: /* numproperty ::= HEIGHT|WIDTH|RADIUS|DIAMETER|THICKNESS */
2731 #line 677 "pikchr.y"
2732 {yylhsminor.yy0 = yymsp[0].minor.yy0;}
2733 #line 2733 "pikchr.c"
2734 yymsp[0].minor.yy0 = yylhsminor.yy0;
2735 break;
2736 case 53: /* boolproperty ::= CW */
2737 #line 688 "pikchr.y"
2738 {p->cur->cw = 1;}
2739 #line 2739 "pikchr.c"
2740 break;
2741 case 54: /* boolproperty ::= CCW */
2742 #line 689 "pikchr.y"
2743 {p->cur->cw = 0;}
2744 #line 2744 "pikchr.c"
2745 break;
2746 case 55: /* boolproperty ::= LARROW */
2747 #line 690 "pikchr.y"
2748 {p->cur->larrow=1; p->cur->rarrow=0; }
2749 #line 2749 "pikchr.c"
2750 break;
2751 case 56: /* boolproperty ::= RARROW */
2752 #line 691 "pikchr.y"
2753 {p->cur->larrow=0; p->cur->rarrow=1; }
2754 #line 2754 "pikchr.c"
2755 break;
2756 case 57: /* boolproperty ::= LRARROW */
2757 #line 692 "pikchr.y"
2758 {p->cur->larrow=1; p->cur->rarrow=1; }
2759 #line 2759 "pikchr.c"
2760 break;
2761 case 58: /* boolproperty ::= INVIS */
2762 #line 693 "pikchr.y"
2763 {p->cur->sw = -0.00001;}
2764 #line 2764 "pikchr.c"
2765 break;
2766 case 59: /* boolproperty ::= THICK */
2767 #line 694 "pikchr.y"
2768 {p->cur->sw *= 1.5;}
2769 #line 2769 "pikchr.c"
2770 break;
2771 case 60: /* boolproperty ::= THIN */
2772 #line 695 "pikchr.y"
2773 {p->cur->sw *= 0.67;}
2774 #line 2774 "pikchr.c"
2775 break;
2776 case 61: /* boolproperty ::= SOLID */
2777 #line 696 "pikchr.y"
2778 {p->cur->sw = pik_value(p,"thickness",9,0);
2779 p->cur->dotted = p->cur->dashed = 0.0;}
2780 #line 2780 "pikchr.c"
2781 break;
2782 case 62: /* textposition ::= */
2783 #line 699 "pikchr.y"
2784 {yymsp[1].minor.yy272 = 0;}
2785 #line 2785 "pikchr.c"
2786 break;
2787 case 63: /* textposition ::= textposition CENTER|LJUST|RJUST|ABOVE|BELOW|ITALIC|BOLD|MONO|ALIGNED|BIG|SMALL */
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;
2792 break;
2793 case 64: /* position ::= expr COMMA expr */
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;
2798 break;
2799 case 65: /* position ::= place PLUS expr COMMA expr */
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;
2804 break;
2805 case 66: /* position ::= place MINUS expr COMMA expr */
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;
2810 break;
2811 case 67: /* position ::= place PLUS LP expr COMMA expr RP */
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;
2816 break;
2817 case 68: /* position ::= place MINUS LP expr COMMA expr RP */
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;
2822 break;
2823 case 69: /* position ::= LP position COMMA position RP */
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"
2827 break;
2828 case 70: /* position ::= LP position RP */
2829 #line 714 "pikchr.y"
2830 {yymsp[-2].minor.yy187=yymsp[-1].minor.yy187;}
2831 #line 2831 "pikchr.c"
2832 break;
2833 case 71: /* position ::= expr between position AND position */
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;
2838 break;
2839 case 72: /* position ::= expr LT position COMMA position GT */
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;
2844 break;
2845 case 73: /* position ::= expr ABOVE position */
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;
2850 break;
2851 case 74: /* position ::= expr BELOW position */
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;
2856 break;
2857 case 75: /* position ::= expr LEFT OF position */
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;
2862 break;
2863 case 76: /* position ::= expr RIGHT OF position */
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;
2868 break;
2869 case 77: /* position ::= expr ON HEADING EDGEPT OF position */
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;
2874 break;
2875 case 78: /* position ::= expr HEADING EDGEPT OF position */
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;
2880 break;
2881 case 79: /* position ::= expr EDGEPT OF position */
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;
2886 break;
2887 case 80: /* position ::= expr ON HEADING expr FROM position */
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;
2892 break;
2893 case 81: /* position ::= expr HEADING expr FROM position */
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;
2898 break;
2899 case 82: /* place ::= edge OF object */
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;
2904 break;
2905 case 83: /* place2 ::= object */
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;
2910 break;
2911 case 84: /* place2 ::= object DOT_E edge */
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;
2916 break;
2917 case 85: /* place2 ::= NTH VERTEX OF object */
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;
2922 break;
2923 case 86: /* object ::= nth */
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;
2928 break;
2929 case 87: /* object ::= nth OF|IN object */
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;
2934 break;
2935 case 88: /* objectname ::= THIS */
2936 #line 762 "pikchr.y"
2937 {yymsp[0].minor.yy54 = p->cur;}
2938 #line 2938 "pikchr.c"
2939 break;
2940 case 89: /* objectname ::= PLACENAME */
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;
2945 break;
2946 case 90: /* objectname ::= objectname DOT_U PLACENAME */
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;
2951 break;
2952 case 91: /* nth ::= NTH CLASSNAME */
2953 #line 767 "pikchr.y"
2954 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-1].minor.yy0); }
2955 #line 2955 "pikchr.c"
2956 yymsp[-1].minor.yy0 = yylhsminor.yy0;
2957 break;
2958 case 92: /* nth ::= NTH LAST CLASSNAME */
2959 #line 768 "pikchr.y"
2960 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-2].minor.yy0); }
2961 #line 2961 "pikchr.c"
2962 yymsp[-2].minor.yy0 = yylhsminor.yy0;
2963 break;
2964 case 93: /* nth ::= LAST CLASSNAME */
2965 #line 769 "pikchr.y"
2966 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.eCode = -1;}
2967 #line 2967 "pikchr.c"
2968 break;
2969 case 94: /* nth ::= LAST */
2970 #line 770 "pikchr.y"
2971 {yylhsminor.yy0=yymsp[0].minor.yy0; yylhsminor.yy0.eCode = -1;}
2972 #line 2972 "pikchr.c"
2973 yymsp[0].minor.yy0 = yylhsminor.yy0;
2974 break;
2975 case 95: /* nth ::= NTH LB RB */
2976 #line 771 "pikchr.y"
2977 {yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = pik_nth_value(p,&yymsp[-2].minor.yy0);}
2978 #line 2978 "pikchr.c"
2979 yymsp[-2].minor.yy0 = yylhsminor.yy0;
2980 break;
2981 case 96: /* nth ::= NTH LAST LB RB */
2982 #line 772 "pikchr.y"
2983 {yylhsminor.yy0=yymsp[-1].minor.yy0; yylhsminor.yy0.eCode = -pik_nth_value(p,&yymsp[-3].minor.yy0);}
2984 #line 2984 "pikchr.c"
2985 yymsp[-3].minor.yy0 = yylhsminor.yy0;
2986 break;
2987 case 97: /* nth ::= LAST LB RB */
2988 #line 773 "pikchr.y"
2989 {yymsp[-2].minor.yy0=yymsp[-1].minor.yy0; yymsp[-2].minor.yy0.eCode = -1; }
2990 #line 2990 "pikchr.c"
2991 break;
2992 case 98: /* expr ::= expr PLUS expr */
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;
2997 break;
2998 case 99: /* expr ::= expr MINUS expr */
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;
3003 break;
3004 case 100: /* expr ::= expr STAR expr */
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;
3009 break;
3010 case 101: /* expr ::= expr SLASH expr */
3011 #line 778 "pikchr.y"
3012 {
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; }
3015 }
3016 #line 3016 "pikchr.c"
3017 yymsp[-2].minor.yy129 = yylhsminor.yy129;
3018 break;
3019 case 102: /* expr ::= MINUS expr */
3020 #line 782 "pikchr.y"
3021 {yymsp[-1].minor.yy129=-yymsp[0].minor.yy129;}
3022 #line 3022 "pikchr.c"
3023 break;
3024 case 103: /* expr ::= PLUS expr */
3025 #line 783 "pikchr.y"
3026 {yymsp[-1].minor.yy129=yymsp[0].minor.yy129;}
3027 #line 3027 "pikchr.c"
3028 break;
3029 case 104: /* expr ::= LP expr RP */
3030 #line 784 "pikchr.y"
3031 {yymsp[-2].minor.yy129=yymsp[-1].minor.yy129;}
3032 #line 3032 "pikchr.c"
3033 break;
3034 case 105: /* expr ::= LP FILL|COLOR|THICKNESS RP */
3035 #line 785 "pikchr.y"
3036 {yymsp[-2].minor.yy129=pik_get_var(p,&yymsp[-1].minor.yy0);}
3037 #line 3037 "pikchr.c"
3038 break;
3039 case 106: /* expr ::= NUMBER */
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;
3044 break;
3045 case 107: /* expr ::= ID */
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;
3050 break;
3051 case 108: /* expr ::= FUNC1 LP expr RP */
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;
3056 break;
3057 case 109: /* expr ::= FUNC2 LP expr COMMA expr RP */
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;
3062 break;
3063 case 110: /* expr ::= DIST LP position COMMA position RP */
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"
3067 break;
3068 case 111: /* expr ::= place2 DOT_XY X */
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;
3073 break;
3074 case 112: /* expr ::= place2 DOT_XY Y */
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;
3079 break;
3080 case 113: /* expr ::= object DOT_L numproperty */
3081 case 114: /* expr ::= object DOT_L dashproperty */ yytestcase(yyruleno==114);
3082 case 115: /* expr ::= object DOT_L colorproperty */ yytestcase(yyruleno==115);
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;
3087 break;
3088 default:
3089 /* (116) lvalue ::= ID */ yytestcase(yyruleno==116);
3090 /* (117) lvalue ::= FILL */ yytestcase(yyruleno==117);
3091 /* (118) lvalue ::= COLOR */ yytestcase(yyruleno==118);
@@ -3142,19 +3183,19 @@
3183 ){
3184 pik_parserARG_FETCH
3185 pik_parserCTX_FETCH
3186 #define TOKEN yyminor
3187 /************ Begin %syntax_error code ****************************************/
3188 #line 551 "pikchr.y"
3189
3190 if( TOKEN.z && TOKEN.z[0] ){
3191 pik_error(p, &TOKEN, "syntax error");
3192 }else{
3193 pik_error(p, 0, "syntax error");
3194 }
3195 UNUSED_PARAMETER(yymajor);
3196 #line 3196 "pikchr.c"
3197 /************ End %syntax_error code ******************************************/
3198 pik_parserARG_STORE /* Suppress warning about unused %extra_argument variable */
3199 pik_parserCTX_STORE
3200 }
3201
@@ -3419,11 +3460,11 @@
3460 #else
3461 (void)iToken;
3462 return 0;
3463 #endif
3464 }
3465 #line 798 "pikchr.y"
3466
3467
3468
3469 /* Chart of the 148 official CSS color names with their
3470 ** corresponding RGB values thru Color Module Level 4:
@@ -4350,11 +4391,11 @@
4391 static PPoint textOffset(Pik *p, PObj *pObj, int cp){
4392 /* Automatically slim-down the width and height of text
4393 ** statements so that the bounding box tightly encloses the text,
4394 ** then get boxOffset() to do the offset computation.
4395 */
4396 pik_size_to_fit(p, pObj, &pObj->errTok,3);
4397 return boxOffset(p, pObj, cp);
4398 }
4399 static void textRender(Pik *p, PObj *pObj){
4400 pik_append_txt(p, pObj, 0);
4401 }
@@ -6359,16 +6400,15 @@
6400 **
6401 ** 1: Fit horizontally only
6402 ** 2: Fit vertically only
6403 ** 3: Fit both ways
6404 */
6405 static void pik_size_to_fit(Pik *p, PObj *pObj, PToken *pFit, int eWhich){
 
6406 PNum w, h;
6407 PBox bbox;
6408 if( p->nErr ) return;
6409 if( pObj==0 ) pObj = p->cur;
6410
6411 if( pObj->nTxt==0 ){
6412 pik_error(0, pFit, "no text to fit to");
6413 return;
6414 }
@@ -6908,20 +6948,20 @@
6948 */
6949 if( pObj->h<=0.0 ){
6950 if( pObj->nTxt==0 ){
6951 pObj->h = 0.0;
6952 }else if( pObj->w<=0.0 ){
6953 pik_size_to_fit(p, pObj, &pObj->errTok, 3);
6954 }else{
6955 pik_size_to_fit(p, pObj, &pObj->errTok, 2);
6956 }
6957 }
6958 if( pObj->w<=0.0 ){
6959 if( pObj->nTxt==0 ){
6960 pObj->w = 0.0;
6961 }else{
6962 pik_size_to_fit(p, pObj, &pObj->errTok, 1);
6963 }
6964 }
6965 ofst = pik_elem_offset(p, pObj, pObj->eWith);
6966 dx = (pObj->with.x - ofst.x) - pObj->ptAt.x;
6967 dy = (pObj->with.y - ofst.y) - pObj->ptAt.y;
@@ -7247,11 +7287,12 @@
7287 pik_append_num(p, " width=\"", p->wSVG);
7288 pik_append_num(p, "\" height=\"", p->hSVG);
7289 pik_append(p, "\"", 1);
7290 }
7291 pik_append_dis(p, " viewBox=\"0 0 ",w,"");
7292 pik_append_dis(p, " ",h,"\"");
7293 pik_append(p, " data-pikchr-date=\"" MANIFEST_ISODATE "\">\n", -1);
7294 pik_elist_render(p, pList);
7295 pik_append(p,"</svg>\n", -1);
7296 }else{
7297 p->wSVG = -1;
7298 p->hSVG = -1;
@@ -7331,10 +7372,11 @@
7372 { "n", 1, T_EDGEPT, 0, CP_N },
7373 { "ne", 2, T_EDGEPT, 0, CP_NE },
7374 { "north", 5, T_EDGEPT, 0, CP_N },
7375 { "nw", 2, T_EDGEPT, 0, CP_NW },
7376 { "of", 2, T_OF, 0, 0 },
7377 { "pikchr_date",11, T_ISODATE, 0, 0, },
7378 { "previous", 8, T_LAST, 0, 0, },
7379 { "print", 5, T_PRINT, 0, 0 },
7380 { "rad", 3, T_RADIUS, 0, 0 },
7381 { "radius", 6, T_RADIUS, 0, 0 },
7382 { "right", 5, T_RIGHT, DIR_RIGHT, CP_E },
@@ -7914,15 +7956,30 @@
7956 #endif
7957 token.n = (unsigned short)(sz & 0xffff);
7958 if( p->nToken++ > PIKCHR_TOKEN_LIMIT ){
7959 pik_error(p, &token, "script is too complex");
7960 break;
7961 }
7962 if( token.eType==T_ISODATE ){
7963 token.z = "\"" MANIFEST_ISODATE "\"";
7964 token.n = sizeof(MANIFEST_ISODATE)+1;
7965 token.eType = T_STRING;
7966 }
7967 pik_parser(pParser, token.eType, token);
7968 }
7969 }
7970 }
7971
7972 /*
7973 ** Return the version name.
7974 */
7975 const char *pikchr_version(void)
7976 /* Emscripten workaround, else it chokes on the inlined version */;
7977
7978 const char *pikchr_version(void){
7979 return RELEASE_VERSION " " MANIFEST_ISODATE;
7980 }
7981
7982 /*
7983 ** Parse the PIKCHR script contained in zText[]. Return a rendering. Or
7984 ** if an error is encountered, return the error text. The error message
7985 ** is HTML formatted. So regardless of what happens, the return text
@@ -8142,10 +8199,14 @@
8199 exit(1);
8200 }
8201 bSvgOnly = 1;
8202 mFlags |= PIKCHR_PLAINTEXT_ERRORS;
8203 }else
8204 if( strcmp(z,"version")==0 || strcmp(z,"v")==0 ){
8205 printf("pikchr %s\n", pikchr_version());
8206 return 0;
8207 }else
8208 {
8209 fprintf(stderr,"unknown option: \"%s\"\n", argv[i]);
8210 usage(argv[0]);
8211 }
8212 continue;
@@ -8254,6 +8315,6 @@
8315
8316
8317 #endif /* PIKCHR_TCL */
8318
8319
8320 #line 8320 "pikchr.c"
8321
+170 -130
--- extsrc/pikchr.js
+++ extsrc/pikchr.js
@@ -1,10 +1,11 @@
1
+
12
var initPikchrModule = (() => {
23
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
34
45
return (
5
-async function(moduleArg = {}) {
6
+function(moduleArg = {}) {
67
var moduleRtn;
78
89
// include: shell.js
910
// The Module object: Our interface to the outside world. We import
1011
// and export values on it. There are various ways Module can be used:
@@ -88,25 +89,25 @@
8889
// If scriptDirectory contains a query (starting with ?) or a fragment (starting with #),
8990
// they are removed because they could contain a slash.
9091
if (scriptDirectory.startsWith("blob:")) {
9192
scriptDirectory = "";
9293
} else {
93
- scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
94
+ scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
9495
}
9596
{
9697
// include: web_or_worker_shell_read.js
97
- readAsync = async url => {
98
- var response = await fetch(url, {
99
- credentials: "same-origin"
100
- });
98
+ readAsync = url => fetch(url, {
99
+ credentials: "same-origin"
100
+ }).then(response => {
101101
if (response.ok) {
102102
return response.arrayBuffer();
103103
}
104
- throw new Error(response.status + " : " + response.url);
105
- };
104
+ return Promise.reject(new Error(response.status + " : " + response.url));
105
+ });
106106
}
107
-} else {}
107
+} else // end include: web_or_worker_shell_read.js
108
+{}
108109
109110
var out = Module["print"] || console.log.bind(console);
110111
111112
var err = Module["printErr"] || console.error.bind(console);
112113
@@ -152,25 +153,13 @@
152153
// NOTE: This is also used as the process return code code in shell environments
153154
// but only when noExitRuntime is false.
154155
var EXITSTATUS;
155156
156157
// Memory management
157
-var /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /* BigInt64Array type is not correctly defined in closure
158
-/** not-@type {!BigInt64Array} */ HEAP64, /* BigUint64Array type is not correctly defined in closure
159
-/** not-t@type {!BigUint64Array} */ HEAPU64, /** @type {!Float64Array} */ HEAPF64;
160
-
161
-var runtimeInitialized = false;
158
+var /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /** @type {!Float64Array} */ HEAPF64;
162159
163160
// include: runtime_shared.js
164
-// include: runtime_stack_check.js
165
-// end include: runtime_stack_check.js
166
-// include: runtime_exceptions.js
167
-// end include: runtime_exceptions.js
168
-// include: runtime_debug.js
169
-// end include: runtime_debug.js
170
-// include: memoryprofiler.js
171
-// end include: memoryprofiler.js
172161
function updateMemoryViews() {
173162
var b = wasmMemory.buffer;
174163
Module["HEAP8"] = HEAP8 = new Int8Array(b);
175164
Module["HEAP16"] = HEAP16 = new Int16Array(b);
176165
Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
@@ -177,48 +166,77 @@
177166
Module["HEAPU16"] = HEAPU16 = new Uint16Array(b);
178167
Module["HEAP32"] = HEAP32 = new Int32Array(b);
179168
Module["HEAPU32"] = HEAPU32 = new Uint32Array(b);
180169
Module["HEAPF32"] = HEAPF32 = new Float32Array(b);
181170
Module["HEAPF64"] = HEAPF64 = new Float64Array(b);
182
- Module["HEAP64"] = HEAP64 = new BigInt64Array(b);
183
- Module["HEAPU64"] = HEAPU64 = new BigUint64Array(b);
184171
}
185172
186173
// end include: runtime_shared.js
174
+// include: runtime_stack_check.js
175
+// end include: runtime_stack_check.js
176
+var __ATPRERUN__ = [];
177
+
178
+// functions called before the runtime is initialized
179
+var __ATINIT__ = [];
180
+
181
+// functions called during shutdown
182
+var __ATPOSTRUN__ = [];
183
+
184
+// functions called after the main() is called
185
+var runtimeInitialized = false;
186
+
187187
function preRun() {
188
- if (Module["preRun"]) {
189
- if (typeof Module["preRun"] == "function") Module["preRun"] = [ Module["preRun"] ];
190
- while (Module["preRun"].length) {
191
- addOnPreRun(Module["preRun"].shift());
192
- }
188
+ var preRuns = Module["preRun"];
189
+ if (preRuns) {
190
+ if (typeof preRuns == "function") preRuns = [ preRuns ];
191
+ preRuns.forEach(addOnPreRun);
193192
}
194
- callRuntimeCallbacks(onPreRuns);
193
+ callRuntimeCallbacks(__ATPRERUN__);
195194
}
196195
197196
function initRuntime() {
198197
runtimeInitialized = true;
199
- wasmExports["e"]();
198
+ callRuntimeCallbacks(__ATINIT__);
200199
}
201200
202201
function postRun() {
203
- if (Module["postRun"]) {
204
- if (typeof Module["postRun"] == "function") Module["postRun"] = [ Module["postRun"] ];
205
- while (Module["postRun"].length) {
206
- addOnPostRun(Module["postRun"].shift());
207
- }
202
+ var postRuns = Module["postRun"];
203
+ if (postRuns) {
204
+ if (typeof postRuns == "function") postRuns = [ postRuns ];
205
+ postRuns.forEach(addOnPostRun);
208206
}
209
- callRuntimeCallbacks(onPostRuns);
207
+ callRuntimeCallbacks(__ATPOSTRUN__);
208
+}
209
+
210
+function addOnPreRun(cb) {
211
+ __ATPRERUN__.unshift(cb);
212
+}
213
+
214
+function addOnInit(cb) {
215
+ __ATINIT__.unshift(cb);
216
+}
217
+
218
+function addOnPostRun(cb) {
219
+ __ATPOSTRUN__.unshift(cb);
210220
}
211221
222
+// include: runtime_math.js
223
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
224
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
225
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
226
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
227
+// end include: runtime_math.js
212228
// A counter of dependencies for calling run(). If we need to
213229
// do asynchronous work before running, increment this and
214230
// decrement it. Incrementing must happen in a place like
215231
// Module.preRun (used by emcc to add file preloading).
216232
// Note that you can add dependencies in preRun, even though
217233
// it happens right before run - run will be postponed until
218234
// the dependencies are met.
219235
var runDependencies = 0;
236
+
237
+var runDependencyWatcher = null;
220238
221239
var dependenciesFulfilled = null;
222240
223241
function addRunDependency(id) {
224242
runDependencies++;
@@ -227,10 +245,14 @@
227245
228246
function removeRunDependency(id) {
229247
runDependencies--;
230248
Module["monitorRunDependencies"]?.(runDependencies);
231249
if (runDependencies == 0) {
250
+ if (runDependencyWatcher !== null) {
251
+ clearInterval(runDependencyWatcher);
252
+ runDependencyWatcher = null;
253
+ }
232254
if (dependenciesFulfilled) {
233255
var callback = dependenciesFulfilled;
234256
dependenciesFulfilled = null;
235257
callback();
236258
}
@@ -263,15 +285,33 @@
263285
// in code paths apart from instantiation where an exception is expected
264286
// to be thrown when abort is called.
265287
throw e;
266288
}
267289
268
-var wasmBinaryFile;
290
+// include: memoryprofiler.js
291
+// end include: memoryprofiler.js
292
+// include: URIUtils.js
293
+// Prefix of data URIs emitted by SINGLE_FILE and related options.
294
+var dataURIPrefix = "data:application/octet-stream;base64,";
269295
296
+/**
297
+ * Indicates whether filename is a base64 data URI.
298
+ * @noinline
299
+ */ var isDataURI = filename => filename.startsWith(dataURIPrefix);
300
+
301
+// end include: URIUtils.js
302
+// include: runtime_exceptions.js
303
+// end include: runtime_exceptions.js
270304
function findWasmBinary() {
271
- return locateFile("pikchr.wasm");
305
+ var f = "pikchr-v7583078860.wasm";
306
+ if (!isDataURI(f)) {
307
+ return locateFile(f);
308
+ }
309
+ return f;
272310
}
311
+
312
+var wasmBinaryFile;
273313
274314
function getBinarySync(file) {
275315
if (file == wasmBinaryFile && wasmBinary) {
276316
return new Uint8Array(wasmBinary);
277317
}
@@ -279,50 +319,48 @@
279319
return readBinary(file);
280320
}
281321
throw "both async and sync fetching of the wasm failed";
282322
}
283323
284
-async function getWasmBinary(binaryFile) {
324
+function getBinaryPromise(binaryFile) {
285325
// If we don't have the binary yet, load it asynchronously using readAsync.
286326
if (!wasmBinary) {
287327
// Fetch the binary using readAsync
288
- try {
289
- var response = await readAsync(binaryFile);
290
- return new Uint8Array(response);
291
- } catch {}
328
+ return readAsync(binaryFile).then(response => new Uint8Array(/** @type{!ArrayBuffer} */ (response)), // Fall back to getBinarySync if readAsync fails
329
+ () => getBinarySync(binaryFile));
292330
}
293331
// Otherwise, getBinarySync should be able to get it synchronously
294
- return getBinarySync(binaryFile);
332
+ return Promise.resolve().then(() => getBinarySync(binaryFile));
295333
}
296334
297
-async function instantiateArrayBuffer(binaryFile, imports) {
298
- try {
299
- var binary = await getWasmBinary(binaryFile);
300
- var instance = await WebAssembly.instantiate(binary, imports);
301
- return instance;
302
- } catch (reason) {
335
+function instantiateArrayBuffer(binaryFile, imports, receiver) {
336
+ return getBinaryPromise(binaryFile).then(binary => WebAssembly.instantiate(binary, imports)).then(receiver, reason => {
303337
err(`failed to asynchronously prepare wasm: ${reason}`);
304338
abort(reason);
305
- }
339
+ });
306340
}
307341
308
-async function instantiateAsync(binary, binaryFile, imports) {
309
- if (!binary && typeof WebAssembly.instantiateStreaming == "function") {
310
- try {
311
- var response = fetch(binaryFile, {
312
- credentials: "same-origin"
342
+function instantiateAsync(binary, binaryFile, imports, callback) {
343
+ if (!binary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(binaryFile) && typeof fetch == "function") {
344
+ return fetch(binaryFile, {
345
+ credentials: "same-origin"
346
+ }).then(response => {
347
+ // Suppress closure warning here since the upstream definition for
348
+ // instantiateStreaming only allows Promise<Repsponse> rather than
349
+ // an actual Response.
350
+ // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure is fixed.
351
+ /** @suppress {checkTypes} */ var result = WebAssembly.instantiateStreaming(response, imports);
352
+ return result.then(callback, function(reason) {
353
+ // We expect the most common failure cause to be a bad MIME type for the binary,
354
+ // in which case falling back to ArrayBuffer instantiation should work.
355
+ err(`wasm streaming compile failed: ${reason}`);
356
+ err("falling back to ArrayBuffer instantiation");
357
+ return instantiateArrayBuffer(binaryFile, imports, callback);
313358
});
314
- var instantiationResult = await WebAssembly.instantiateStreaming(response, imports);
315
- return instantiationResult;
316
- } catch (reason) {
317
- // We expect the most common failure cause to be a bad MIME type for the binary,
318
- // in which case falling back to ArrayBuffer instantiation should work.
319
- err(`wasm streaming compile failed: ${reason}`);
320
- err("falling back to ArrayBuffer instantiation");
321
- }
322
- }
323
- return instantiateArrayBuffer(binaryFile, imports);
359
+ });
360
+ }
361
+ return instantiateArrayBuffer(binaryFile, imports, callback);
324362
}
325363
326364
function getWasmImports() {
327365
// prepare imports
328366
return {
@@ -330,18 +368,20 @@
330368
};
331369
}
332370
333371
// Create the wasm instance.
334372
// Receives the wasm imports, returns the exports.
335
-async function createWasm() {
373
+function createWasm() {
374
+ var info = getWasmImports();
336375
// Load the wasm module and create an instance of using native support in the JS engine.
337376
// handle a generated wasm instance, receiving its exports and
338377
// performing other necessary setup
339378
/** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) {
340379
wasmExports = instance.exports;
341380
wasmMemory = wasmExports["d"];
342381
updateMemoryViews();
382
+ addOnInit(wasmExports["e"]);
343383
removeRunDependency("wasm-instantiate");
344384
return wasmExports;
345385
}
346386
// wait for the pthread pool (if any)
347387
addRunDependency("wasm-instantiate");
@@ -349,64 +389,48 @@
349389
function receiveInstantiationResult(result) {
350390
// 'result' is a ResultObject object which has both the module and instance.
351391
// receiveInstance() will swap in the exports (to Module.asm) so they can be called
352392
// TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
353393
// When the regression is fixed, can restore the above PTHREADS-enabled path.
354
- return receiveInstance(result["instance"]);
394
+ receiveInstance(result["instance"]);
355395
}
356
- var info = getWasmImports();
357396
// User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
358397
// to manually instantiate the Wasm module themselves. This allows pages to
359398
// run the instantiation parallel to any other async startup actions they are
360399
// performing.
361400
// Also pthreads and wasm workers initialize the wasm instance through this
362401
// path.
363402
if (Module["instantiateWasm"]) {
364
- return new Promise((resolve, reject) => {
365
- Module["instantiateWasm"](info, (mod, inst) => {
366
- receiveInstance(mod, inst);
367
- resolve(mod.exports);
368
- });
369
- });
403
+ try {
404
+ return Module["instantiateWasm"](info, receiveInstance);
405
+ } catch (e) {
406
+ err(`Module.instantiateWasm callback failed with error: ${e}`);
407
+ // If instantiation fails, reject the module ready promise.
408
+ readyPromiseReject(e);
409
+ }
370410
}
371411
wasmBinaryFile ??= findWasmBinary();
372
- try {
373
- var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info);
374
- var exports = receiveInstantiationResult(result);
375
- return exports;
376
- } catch (e) {
377
- // If instantiation fails, reject the module ready promise.
378
- readyPromiseReject(e);
379
- return Promise.reject(e);
380
- }
412
+ // If instantiation fails, reject the module ready promise.
413
+ instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch(readyPromiseReject);
414
+ return {};
381415
}
382416
417
+// include: runtime_debug.js
418
+// end include: runtime_debug.js
383419
// === Body ===
384420
// end include: preamble.js
385
-class ExitStatus {
386
- name="ExitStatus";
387
- constructor(status) {
388
- this.message = `Program terminated with exit(${status})`;
389
- this.status = status;
390
- }
421
+/** @constructor */ function ExitStatus(status) {
422
+ this.name = "ExitStatus";
423
+ this.message = `Program terminated with exit(${status})`;
424
+ this.status = status;
391425
}
392426
393427
var callRuntimeCallbacks = callbacks => {
394
- while (callbacks.length > 0) {
395
- // Pass the module as the first argument.
396
- callbacks.shift()(Module);
397
- }
428
+ // Pass the module as the first argument.
429
+ callbacks.forEach(f => f(Module));
398430
};
399431
400
-var onPostRuns = [];
401
-
402
-var addOnPostRun = cb => onPostRuns.unshift(cb);
403
-
404
-var onPreRuns = [];
405
-
406
-var addOnPreRun = cb => onPreRuns.unshift(cb);
407
-
408432
/**
409433
* @param {number} ptr
410434
* @param {string} type
411435
*/ function getValue(ptr, type = "i8") {
412436
if (type.endsWith("*")) type = "*";
@@ -422,11 +446,11 @@
422446
423447
case "i32":
424448
return HEAP32[((ptr) >> 2)];
425449
426450
case "i64":
427
- return HEAP64[((ptr) >> 3)];
451
+ abort("to do getValue(i64) use WASM_BIGINT");
428452
429453
case "float":
430454
return HEAPF32[((ptr) >> 2)];
431455
432456
case "double":
@@ -464,12 +488,11 @@
464488
case "i32":
465489
HEAP32[((ptr) >> 2)] = value;
466490
break;
467491
468492
case "i64":
469
- HEAP64[((ptr) >> 3)] = BigInt(value);
470
- break;
493
+ abort("to do setValue(i64) use WASM_BIGINT");
471494
472495
case "float":
473496
HEAPF32[((ptr) >> 2)] = value;
474497
break;
475498
@@ -560,11 +583,13 @@
560583
* frequent uses of UTF8ToString() with and without maxBytesToRead may throw
561584
* JS JIT optimizations off, so it is worth to consider consistently using one
562585
* @return {string}
563586
*/ var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
564587
565
-var ___assert_fail = (condition, filename, line, func) => abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [ filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function" ]);
588
+var ___assert_fail = (condition, filename, line, func) => {
589
+ abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [ filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function" ]);
590
+};
566591
567592
var abortOnCannotGrowMemory = requestedSize => {
568593
abort("OOM");
569594
};
570595
@@ -756,51 +781,69 @@
756781
/** @export */ a: ___assert_fail,
757782
/** @export */ b: _emscripten_resize_heap,
758783
/** @export */ c: _exit
759784
};
760785
761
-var wasmExports = await createWasm();
762
-
763
-var ___wasm_call_ctors = wasmExports["e"];
764
-
765
-var _pikchr = Module["_pikchr"] = wasmExports["g"];
766
-
767
-var __emscripten_stack_restore = wasmExports["h"];
768
-
769
-var __emscripten_stack_alloc = wasmExports["i"];
770
-
771
-var _emscripten_stack_get_current = wasmExports["j"];
786
+var wasmExports = createWasm();
787
+
788
+var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports["e"])();
789
+
790
+var _pikchr_version = Module["_pikchr_version"] = () => (_pikchr_version = Module["_pikchr_version"] = wasmExports["g"])();
791
+
792
+var _pikchr = Module["_pikchr"] = (a0, a1, a2, a3, a4) => (_pikchr = Module["_pikchr"] = wasmExports["h"])(a0, a1, a2, a3, a4);
793
+
794
+var __emscripten_stack_restore = a0 => (__emscripten_stack_restore = wasmExports["i"])(a0);
795
+
796
+var __emscripten_stack_alloc = a0 => (__emscripten_stack_alloc = wasmExports["j"])(a0);
797
+
798
+var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports["k"])();
772799
773800
// include: postamble.js
774801
// === Auto-generated postamble setup entry stuff ===
775802
Module["stackSave"] = stackSave;
776803
777804
Module["stackRestore"] = stackRestore;
778805
779806
Module["stackAlloc"] = stackAlloc;
780807
808
+Module["ccall"] = ccall;
809
+
781810
Module["cwrap"] = cwrap;
782811
783812
Module["setValue"] = setValue;
784813
785814
Module["getValue"] = getValue;
786815
816
+var calledRun;
817
+
818
+var calledPrerun;
819
+
820
+dependenciesFulfilled = function runCaller() {
821
+ // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
822
+ if (!calledRun) run();
823
+ if (!calledRun) dependenciesFulfilled = runCaller;
824
+};
825
+
826
+// try this again later, after new deps are fulfilled
787827
function run() {
788828
if (runDependencies > 0) {
789
- dependenciesFulfilled = run;
790829
return;
791830
}
792
- preRun();
793
- // a preRun added a dependency, run will be called later
794
- if (runDependencies > 0) {
795
- dependenciesFulfilled = run;
796
- return;
831
+ if (!calledPrerun) {
832
+ calledPrerun = 1;
833
+ preRun();
834
+ // a preRun added a dependency, run will be called later
835
+ if (runDependencies > 0) {
836
+ return;
837
+ }
797838
}
798839
function doRun() {
799840
// run may have just been called through dependencies being fulfilled just in this very frame,
800841
// or while the async setStatus time below was happening
801
- Module["calledRun"] = true;
842
+ if (calledRun) return;
843
+ calledRun = 1;
844
+ Module["calledRun"] = 1;
802845
if (ABORT) return;
803846
initRuntime();
804847
readyPromiseResolve(Module);
805848
Module["onRuntimeInitialized"]?.();
806849
postRun();
@@ -836,12 +879,9 @@
836879
837880
return moduleRtn;
838881
}
839882
);
840883
})();
841
-if (typeof exports === 'object' && typeof module === 'object') {
884
+if (typeof exports === 'object' && typeof module === 'object')
842885
module.exports = initPikchrModule;
843
- // This default export looks redundant, but it allows TS to import this
844
- // commonjs style module.
845
- module.exports.default = initPikchrModule;
846
-} else if (typeof define === 'function' && define['amd'])
886
+else if (typeof define === 'function' && define['amd'])
847887
define([], () => initPikchrModule);
848888
--- extsrc/pikchr.js
+++ extsrc/pikchr.js
@@ -1,10 +1,11 @@
 
1 var initPikchrModule = (() => {
2 var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
3
4 return (
5 async function(moduleArg = {}) {
6 var moduleRtn;
7
8 // include: shell.js
9 // The Module object: Our interface to the outside world. We import
10 // and export values on it. There are various ways Module can be used:
@@ -88,25 +89,25 @@
88 // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #),
89 // they are removed because they could contain a slash.
90 if (scriptDirectory.startsWith("blob:")) {
91 scriptDirectory = "";
92 } else {
93 scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
94 }
95 {
96 // include: web_or_worker_shell_read.js
97 readAsync = async url => {
98 var response = await fetch(url, {
99 credentials: "same-origin"
100 });
101 if (response.ok) {
102 return response.arrayBuffer();
103 }
104 throw new Error(response.status + " : " + response.url);
105 };
106 }
107 } else {}
 
108
109 var out = Module["print"] || console.log.bind(console);
110
111 var err = Module["printErr"] || console.error.bind(console);
112
@@ -152,25 +153,13 @@
152 // NOTE: This is also used as the process return code code in shell environments
153 // but only when noExitRuntime is false.
154 var EXITSTATUS;
155
156 // Memory management
157 var /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /* BigInt64Array type is not correctly defined in closure
158 /** not-@type {!BigInt64Array} */ HEAP64, /* BigUint64Array type is not correctly defined in closure
159 /** not-t@type {!BigUint64Array} */ HEAPU64, /** @type {!Float64Array} */ HEAPF64;
160
161 var runtimeInitialized = false;
162
163 // include: runtime_shared.js
164 // include: runtime_stack_check.js
165 // end include: runtime_stack_check.js
166 // include: runtime_exceptions.js
167 // end include: runtime_exceptions.js
168 // include: runtime_debug.js
169 // end include: runtime_debug.js
170 // include: memoryprofiler.js
171 // end include: memoryprofiler.js
172 function updateMemoryViews() {
173 var b = wasmMemory.buffer;
174 Module["HEAP8"] = HEAP8 = new Int8Array(b);
175 Module["HEAP16"] = HEAP16 = new Int16Array(b);
176 Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
@@ -177,48 +166,77 @@
177 Module["HEAPU16"] = HEAPU16 = new Uint16Array(b);
178 Module["HEAP32"] = HEAP32 = new Int32Array(b);
179 Module["HEAPU32"] = HEAPU32 = new Uint32Array(b);
180 Module["HEAPF32"] = HEAPF32 = new Float32Array(b);
181 Module["HEAPF64"] = HEAPF64 = new Float64Array(b);
182 Module["HEAP64"] = HEAP64 = new BigInt64Array(b);
183 Module["HEAPU64"] = HEAPU64 = new BigUint64Array(b);
184 }
185
186 // end include: runtime_shared.js
 
 
 
 
 
 
 
 
 
 
 
 
 
187 function preRun() {
188 if (Module["preRun"]) {
189 if (typeof Module["preRun"] == "function") Module["preRun"] = [ Module["preRun"] ];
190 while (Module["preRun"].length) {
191 addOnPreRun(Module["preRun"].shift());
192 }
193 }
194 callRuntimeCallbacks(onPreRuns);
195 }
196
197 function initRuntime() {
198 runtimeInitialized = true;
199 wasmExports["e"]();
200 }
201
202 function postRun() {
203 if (Module["postRun"]) {
204 if (typeof Module["postRun"] == "function") Module["postRun"] = [ Module["postRun"] ];
205 while (Module["postRun"].length) {
206 addOnPostRun(Module["postRun"].shift());
207 }
208 }
209 callRuntimeCallbacks(onPostRuns);
 
 
 
 
 
 
 
 
 
 
 
 
210 }
211
 
 
 
 
 
 
212 // A counter of dependencies for calling run(). If we need to
213 // do asynchronous work before running, increment this and
214 // decrement it. Incrementing must happen in a place like
215 // Module.preRun (used by emcc to add file preloading).
216 // Note that you can add dependencies in preRun, even though
217 // it happens right before run - run will be postponed until
218 // the dependencies are met.
219 var runDependencies = 0;
 
 
220
221 var dependenciesFulfilled = null;
222
223 function addRunDependency(id) {
224 runDependencies++;
@@ -227,10 +245,14 @@
227
228 function removeRunDependency(id) {
229 runDependencies--;
230 Module["monitorRunDependencies"]?.(runDependencies);
231 if (runDependencies == 0) {
 
 
 
 
232 if (dependenciesFulfilled) {
233 var callback = dependenciesFulfilled;
234 dependenciesFulfilled = null;
235 callback();
236 }
@@ -263,15 +285,33 @@
263 // in code paths apart from instantiation where an exception is expected
264 // to be thrown when abort is called.
265 throw e;
266 }
267
268 var wasmBinaryFile;
 
 
 
 
269
 
 
 
 
 
 
 
 
270 function findWasmBinary() {
271 return locateFile("pikchr.wasm");
 
 
 
 
272 }
 
 
273
274 function getBinarySync(file) {
275 if (file == wasmBinaryFile && wasmBinary) {
276 return new Uint8Array(wasmBinary);
277 }
@@ -279,50 +319,48 @@
279 return readBinary(file);
280 }
281 throw "both async and sync fetching of the wasm failed";
282 }
283
284 async function getWasmBinary(binaryFile) {
285 // If we don't have the binary yet, load it asynchronously using readAsync.
286 if (!wasmBinary) {
287 // Fetch the binary using readAsync
288 try {
289 var response = await readAsync(binaryFile);
290 return new Uint8Array(response);
291 } catch {}
292 }
293 // Otherwise, getBinarySync should be able to get it synchronously
294 return getBinarySync(binaryFile);
295 }
296
297 async function instantiateArrayBuffer(binaryFile, imports) {
298 try {
299 var binary = await getWasmBinary(binaryFile);
300 var instance = await WebAssembly.instantiate(binary, imports);
301 return instance;
302 } catch (reason) {
303 err(`failed to asynchronously prepare wasm: ${reason}`);
304 abort(reason);
305 }
306 }
307
308 async function instantiateAsync(binary, binaryFile, imports) {
309 if (!binary && typeof WebAssembly.instantiateStreaming == "function") {
310 try {
311 var response = fetch(binaryFile, {
312 credentials: "same-origin"
 
 
 
 
 
 
 
 
 
 
 
313 });
314 var instantiationResult = await WebAssembly.instantiateStreaming(response, imports);
315 return instantiationResult;
316 } catch (reason) {
317 // We expect the most common failure cause to be a bad MIME type for the binary,
318 // in which case falling back to ArrayBuffer instantiation should work.
319 err(`wasm streaming compile failed: ${reason}`);
320 err("falling back to ArrayBuffer instantiation");
321 }
322 }
323 return instantiateArrayBuffer(binaryFile, imports);
324 }
325
326 function getWasmImports() {
327 // prepare imports
328 return {
@@ -330,18 +368,20 @@
330 };
331 }
332
333 // Create the wasm instance.
334 // Receives the wasm imports, returns the exports.
335 async function createWasm() {
 
336 // Load the wasm module and create an instance of using native support in the JS engine.
337 // handle a generated wasm instance, receiving its exports and
338 // performing other necessary setup
339 /** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) {
340 wasmExports = instance.exports;
341 wasmMemory = wasmExports["d"];
342 updateMemoryViews();
 
343 removeRunDependency("wasm-instantiate");
344 return wasmExports;
345 }
346 // wait for the pthread pool (if any)
347 addRunDependency("wasm-instantiate");
@@ -349,64 +389,48 @@
349 function receiveInstantiationResult(result) {
350 // 'result' is a ResultObject object which has both the module and instance.
351 // receiveInstance() will swap in the exports (to Module.asm) so they can be called
352 // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
353 // When the regression is fixed, can restore the above PTHREADS-enabled path.
354 return receiveInstance(result["instance"]);
355 }
356 var info = getWasmImports();
357 // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
358 // to manually instantiate the Wasm module themselves. This allows pages to
359 // run the instantiation parallel to any other async startup actions they are
360 // performing.
361 // Also pthreads and wasm workers initialize the wasm instance through this
362 // path.
363 if (Module["instantiateWasm"]) {
364 return new Promise((resolve, reject) => {
365 Module["instantiateWasm"](info, (mod, inst) => {
366 receiveInstance(mod, inst);
367 resolve(mod.exports);
368 });
369 });
 
370 }
371 wasmBinaryFile ??= findWasmBinary();
372 try {
373 var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info);
374 var exports = receiveInstantiationResult(result);
375 return exports;
376 } catch (e) {
377 // If instantiation fails, reject the module ready promise.
378 readyPromiseReject(e);
379 return Promise.reject(e);
380 }
381 }
382
 
 
383 // === Body ===
384 // end include: preamble.js
385 class ExitStatus {
386 name="ExitStatus";
387 constructor(status) {
388 this.message = `Program terminated with exit(${status})`;
389 this.status = status;
390 }
391 }
392
393 var callRuntimeCallbacks = callbacks => {
394 while (callbacks.length > 0) {
395 // Pass the module as the first argument.
396 callbacks.shift()(Module);
397 }
398 };
399
400 var onPostRuns = [];
401
402 var addOnPostRun = cb => onPostRuns.unshift(cb);
403
404 var onPreRuns = [];
405
406 var addOnPreRun = cb => onPreRuns.unshift(cb);
407
408 /**
409 * @param {number} ptr
410 * @param {string} type
411 */ function getValue(ptr, type = "i8") {
412 if (type.endsWith("*")) type = "*";
@@ -422,11 +446,11 @@
422
423 case "i32":
424 return HEAP32[((ptr) >> 2)];
425
426 case "i64":
427 return HEAP64[((ptr) >> 3)];
428
429 case "float":
430 return HEAPF32[((ptr) >> 2)];
431
432 case "double":
@@ -464,12 +488,11 @@
464 case "i32":
465 HEAP32[((ptr) >> 2)] = value;
466 break;
467
468 case "i64":
469 HEAP64[((ptr) >> 3)] = BigInt(value);
470 break;
471
472 case "float":
473 HEAPF32[((ptr) >> 2)] = value;
474 break;
475
@@ -560,11 +583,13 @@
560 * frequent uses of UTF8ToString() with and without maxBytesToRead may throw
561 * JS JIT optimizations off, so it is worth to consider consistently using one
562 * @return {string}
563 */ var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
564
565 var ___assert_fail = (condition, filename, line, func) => abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [ filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function" ]);
 
 
566
567 var abortOnCannotGrowMemory = requestedSize => {
568 abort("OOM");
569 };
570
@@ -756,51 +781,69 @@
756 /** @export */ a: ___assert_fail,
757 /** @export */ b: _emscripten_resize_heap,
758 /** @export */ c: _exit
759 };
760
761 var wasmExports = await createWasm();
762
763 var ___wasm_call_ctors = wasmExports["e"];
764
765 var _pikchr = Module["_pikchr"] = wasmExports["g"];
766
767 var __emscripten_stack_restore = wasmExports["h"];
768
769 var __emscripten_stack_alloc = wasmExports["i"];
770
771 var _emscripten_stack_get_current = wasmExports["j"];
 
 
772
773 // include: postamble.js
774 // === Auto-generated postamble setup entry stuff ===
775 Module["stackSave"] = stackSave;
776
777 Module["stackRestore"] = stackRestore;
778
779 Module["stackAlloc"] = stackAlloc;
780
 
 
781 Module["cwrap"] = cwrap;
782
783 Module["setValue"] = setValue;
784
785 Module["getValue"] = getValue;
786
 
 
 
 
 
 
 
 
 
 
 
787 function run() {
788 if (runDependencies > 0) {
789 dependenciesFulfilled = run;
790 return;
791 }
792 preRun();
793 // a preRun added a dependency, run will be called later
794 if (runDependencies > 0) {
795 dependenciesFulfilled = run;
796 return;
 
 
797 }
798 function doRun() {
799 // run may have just been called through dependencies being fulfilled just in this very frame,
800 // or while the async setStatus time below was happening
801 Module["calledRun"] = true;
 
 
802 if (ABORT) return;
803 initRuntime();
804 readyPromiseResolve(Module);
805 Module["onRuntimeInitialized"]?.();
806 postRun();
@@ -836,12 +879,9 @@
836
837 return moduleRtn;
838 }
839 );
840 })();
841 if (typeof exports === 'object' && typeof module === 'object') {
842 module.exports = initPikchrModule;
843 // This default export looks redundant, but it allows TS to import this
844 // commonjs style module.
845 module.exports.default = initPikchrModule;
846 } else if (typeof define === 'function' && define['amd'])
847 define([], () => initPikchrModule);
848
--- extsrc/pikchr.js
+++ extsrc/pikchr.js
@@ -1,10 +1,11 @@
1
2 var initPikchrModule = (() => {
3 var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
4
5 return (
6 function(moduleArg = {}) {
7 var moduleRtn;
8
9 // include: shell.js
10 // The Module object: Our interface to the outside world. We import
11 // and export values on it. There are various ways Module can be used:
@@ -88,25 +89,25 @@
89 // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #),
90 // they are removed because they could contain a slash.
91 if (scriptDirectory.startsWith("blob:")) {
92 scriptDirectory = "";
93 } else {
94 scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
95 }
96 {
97 // include: web_or_worker_shell_read.js
98 readAsync = url => fetch(url, {
99 credentials: "same-origin"
100 }).then(response => {
 
101 if (response.ok) {
102 return response.arrayBuffer();
103 }
104 return Promise.reject(new Error(response.status + " : " + response.url));
105 });
106 }
107 } else // end include: web_or_worker_shell_read.js
108 {}
109
110 var out = Module["print"] || console.log.bind(console);
111
112 var err = Module["printErr"] || console.error.bind(console);
113
@@ -152,25 +153,13 @@
153 // NOTE: This is also used as the process return code code in shell environments
154 // but only when noExitRuntime is false.
155 var EXITSTATUS;
156
157 // Memory management
158 var /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /** @type {!Float64Array} */ HEAPF64;
 
 
 
 
159
160 // include: runtime_shared.js
 
 
 
 
 
 
 
 
161 function updateMemoryViews() {
162 var b = wasmMemory.buffer;
163 Module["HEAP8"] = HEAP8 = new Int8Array(b);
164 Module["HEAP16"] = HEAP16 = new Int16Array(b);
165 Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
@@ -177,48 +166,77 @@
166 Module["HEAPU16"] = HEAPU16 = new Uint16Array(b);
167 Module["HEAP32"] = HEAP32 = new Int32Array(b);
168 Module["HEAPU32"] = HEAPU32 = new Uint32Array(b);
169 Module["HEAPF32"] = HEAPF32 = new Float32Array(b);
170 Module["HEAPF64"] = HEAPF64 = new Float64Array(b);
 
 
171 }
172
173 // end include: runtime_shared.js
174 // include: runtime_stack_check.js
175 // end include: runtime_stack_check.js
176 var __ATPRERUN__ = [];
177
178 // functions called before the runtime is initialized
179 var __ATINIT__ = [];
180
181 // functions called during shutdown
182 var __ATPOSTRUN__ = [];
183
184 // functions called after the main() is called
185 var runtimeInitialized = false;
186
187 function preRun() {
188 var preRuns = Module["preRun"];
189 if (preRuns) {
190 if (typeof preRuns == "function") preRuns = [ preRuns ];
191 preRuns.forEach(addOnPreRun);
 
192 }
193 callRuntimeCallbacks(__ATPRERUN__);
194 }
195
196 function initRuntime() {
197 runtimeInitialized = true;
198 callRuntimeCallbacks(__ATINIT__);
199 }
200
201 function postRun() {
202 var postRuns = Module["postRun"];
203 if (postRuns) {
204 if (typeof postRuns == "function") postRuns = [ postRuns ];
205 postRuns.forEach(addOnPostRun);
 
206 }
207 callRuntimeCallbacks(__ATPOSTRUN__);
208 }
209
210 function addOnPreRun(cb) {
211 __ATPRERUN__.unshift(cb);
212 }
213
214 function addOnInit(cb) {
215 __ATINIT__.unshift(cb);
216 }
217
218 function addOnPostRun(cb) {
219 __ATPOSTRUN__.unshift(cb);
220 }
221
222 // include: runtime_math.js
223 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
224 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
225 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
226 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
227 // end include: runtime_math.js
228 // A counter of dependencies for calling run(). If we need to
229 // do asynchronous work before running, increment this and
230 // decrement it. Incrementing must happen in a place like
231 // Module.preRun (used by emcc to add file preloading).
232 // Note that you can add dependencies in preRun, even though
233 // it happens right before run - run will be postponed until
234 // the dependencies are met.
235 var runDependencies = 0;
236
237 var runDependencyWatcher = null;
238
239 var dependenciesFulfilled = null;
240
241 function addRunDependency(id) {
242 runDependencies++;
@@ -227,10 +245,14 @@
245
246 function removeRunDependency(id) {
247 runDependencies--;
248 Module["monitorRunDependencies"]?.(runDependencies);
249 if (runDependencies == 0) {
250 if (runDependencyWatcher !== null) {
251 clearInterval(runDependencyWatcher);
252 runDependencyWatcher = null;
253 }
254 if (dependenciesFulfilled) {
255 var callback = dependenciesFulfilled;
256 dependenciesFulfilled = null;
257 callback();
258 }
@@ -263,15 +285,33 @@
285 // in code paths apart from instantiation where an exception is expected
286 // to be thrown when abort is called.
287 throw e;
288 }
289
290 // include: memoryprofiler.js
291 // end include: memoryprofiler.js
292 // include: URIUtils.js
293 // Prefix of data URIs emitted by SINGLE_FILE and related options.
294 var dataURIPrefix = "data:application/octet-stream;base64,";
295
296 /**
297 * Indicates whether filename is a base64 data URI.
298 * @noinline
299 */ var isDataURI = filename => filename.startsWith(dataURIPrefix);
300
301 // end include: URIUtils.js
302 // include: runtime_exceptions.js
303 // end include: runtime_exceptions.js
304 function findWasmBinary() {
305 var f = "pikchr-v7583078860.wasm";
306 if (!isDataURI(f)) {
307 return locateFile(f);
308 }
309 return f;
310 }
311
312 var wasmBinaryFile;
313
314 function getBinarySync(file) {
315 if (file == wasmBinaryFile && wasmBinary) {
316 return new Uint8Array(wasmBinary);
317 }
@@ -279,50 +319,48 @@
319 return readBinary(file);
320 }
321 throw "both async and sync fetching of the wasm failed";
322 }
323
324 function getBinaryPromise(binaryFile) {
325 // If we don't have the binary yet, load it asynchronously using readAsync.
326 if (!wasmBinary) {
327 // Fetch the binary using readAsync
328 return readAsync(binaryFile).then(response => new Uint8Array(/** @type{!ArrayBuffer} */ (response)), // Fall back to getBinarySync if readAsync fails
329 () => getBinarySync(binaryFile));
 
 
330 }
331 // Otherwise, getBinarySync should be able to get it synchronously
332 return Promise.resolve().then(() => getBinarySync(binaryFile));
333 }
334
335 function instantiateArrayBuffer(binaryFile, imports, receiver) {
336 return getBinaryPromise(binaryFile).then(binary => WebAssembly.instantiate(binary, imports)).then(receiver, reason => {
 
 
 
 
337 err(`failed to asynchronously prepare wasm: ${reason}`);
338 abort(reason);
339 });
340 }
341
342 function instantiateAsync(binary, binaryFile, imports, callback) {
343 if (!binary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(binaryFile) && typeof fetch == "function") {
344 return fetch(binaryFile, {
345 credentials: "same-origin"
346 }).then(response => {
347 // Suppress closure warning here since the upstream definition for
348 // instantiateStreaming only allows Promise<Repsponse> rather than
349 // an actual Response.
350 // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure is fixed.
351 /** @suppress {checkTypes} */ var result = WebAssembly.instantiateStreaming(response, imports);
352 return result.then(callback, function(reason) {
353 // We expect the most common failure cause to be a bad MIME type for the binary,
354 // in which case falling back to ArrayBuffer instantiation should work.
355 err(`wasm streaming compile failed: ${reason}`);
356 err("falling back to ArrayBuffer instantiation");
357 return instantiateArrayBuffer(binaryFile, imports, callback);
358 });
359 });
360 }
361 return instantiateArrayBuffer(binaryFile, imports, callback);
 
 
 
 
 
 
 
362 }
363
364 function getWasmImports() {
365 // prepare imports
366 return {
@@ -330,18 +368,20 @@
368 };
369 }
370
371 // Create the wasm instance.
372 // Receives the wasm imports, returns the exports.
373 function createWasm() {
374 var info = getWasmImports();
375 // Load the wasm module and create an instance of using native support in the JS engine.
376 // handle a generated wasm instance, receiving its exports and
377 // performing other necessary setup
378 /** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) {
379 wasmExports = instance.exports;
380 wasmMemory = wasmExports["d"];
381 updateMemoryViews();
382 addOnInit(wasmExports["e"]);
383 removeRunDependency("wasm-instantiate");
384 return wasmExports;
385 }
386 // wait for the pthread pool (if any)
387 addRunDependency("wasm-instantiate");
@@ -349,64 +389,48 @@
389 function receiveInstantiationResult(result) {
390 // 'result' is a ResultObject object which has both the module and instance.
391 // receiveInstance() will swap in the exports (to Module.asm) so they can be called
392 // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
393 // When the regression is fixed, can restore the above PTHREADS-enabled path.
394 receiveInstance(result["instance"]);
395 }
 
396 // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
397 // to manually instantiate the Wasm module themselves. This allows pages to
398 // run the instantiation parallel to any other async startup actions they are
399 // performing.
400 // Also pthreads and wasm workers initialize the wasm instance through this
401 // path.
402 if (Module["instantiateWasm"]) {
403 try {
404 return Module["instantiateWasm"](info, receiveInstance);
405 } catch (e) {
406 err(`Module.instantiateWasm callback failed with error: ${e}`);
407 // If instantiation fails, reject the module ready promise.
408 readyPromiseReject(e);
409 }
410 }
411 wasmBinaryFile ??= findWasmBinary();
412 // If instantiation fails, reject the module ready promise.
413 instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch(readyPromiseReject);
414 return {};
 
 
 
 
 
 
415 }
416
417 // include: runtime_debug.js
418 // end include: runtime_debug.js
419 // === Body ===
420 // end include: preamble.js
421 /** @constructor */ function ExitStatus(status) {
422 this.name = "ExitStatus";
423 this.message = `Program terminated with exit(${status})`;
424 this.status = status;
 
 
425 }
426
427 var callRuntimeCallbacks = callbacks => {
428 // Pass the module as the first argument.
429 callbacks.forEach(f => f(Module));
 
 
430 };
431
 
 
 
 
 
 
 
 
432 /**
433 * @param {number} ptr
434 * @param {string} type
435 */ function getValue(ptr, type = "i8") {
436 if (type.endsWith("*")) type = "*";
@@ -422,11 +446,11 @@
446
447 case "i32":
448 return HEAP32[((ptr) >> 2)];
449
450 case "i64":
451 abort("to do getValue(i64) use WASM_BIGINT");
452
453 case "float":
454 return HEAPF32[((ptr) >> 2)];
455
456 case "double":
@@ -464,12 +488,11 @@
488 case "i32":
489 HEAP32[((ptr) >> 2)] = value;
490 break;
491
492 case "i64":
493 abort("to do setValue(i64) use WASM_BIGINT");
 
494
495 case "float":
496 HEAPF32[((ptr) >> 2)] = value;
497 break;
498
@@ -560,11 +583,13 @@
583 * frequent uses of UTF8ToString() with and without maxBytesToRead may throw
584 * JS JIT optimizations off, so it is worth to consider consistently using one
585 * @return {string}
586 */ var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
587
588 var ___assert_fail = (condition, filename, line, func) => {
589 abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [ filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function" ]);
590 };
591
592 var abortOnCannotGrowMemory = requestedSize => {
593 abort("OOM");
594 };
595
@@ -756,51 +781,69 @@
781 /** @export */ a: ___assert_fail,
782 /** @export */ b: _emscripten_resize_heap,
783 /** @export */ c: _exit
784 };
785
786 var wasmExports = createWasm();
787
788 var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports["e"])();
789
790 var _pikchr_version = Module["_pikchr_version"] = () => (_pikchr_version = Module["_pikchr_version"] = wasmExports["g"])();
791
792 var _pikchr = Module["_pikchr"] = (a0, a1, a2, a3, a4) => (_pikchr = Module["_pikchr"] = wasmExports["h"])(a0, a1, a2, a3, a4);
793
794 var __emscripten_stack_restore = a0 => (__emscripten_stack_restore = wasmExports["i"])(a0);
795
796 var __emscripten_stack_alloc = a0 => (__emscripten_stack_alloc = wasmExports["j"])(a0);
797
798 var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports["k"])();
799
800 // include: postamble.js
801 // === Auto-generated postamble setup entry stuff ===
802 Module["stackSave"] = stackSave;
803
804 Module["stackRestore"] = stackRestore;
805
806 Module["stackAlloc"] = stackAlloc;
807
808 Module["ccall"] = ccall;
809
810 Module["cwrap"] = cwrap;
811
812 Module["setValue"] = setValue;
813
814 Module["getValue"] = getValue;
815
816 var calledRun;
817
818 var calledPrerun;
819
820 dependenciesFulfilled = function runCaller() {
821 // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
822 if (!calledRun) run();
823 if (!calledRun) dependenciesFulfilled = runCaller;
824 };
825
826 // try this again later, after new deps are fulfilled
827 function run() {
828 if (runDependencies > 0) {
 
829 return;
830 }
831 if (!calledPrerun) {
832 calledPrerun = 1;
833 preRun();
834 // a preRun added a dependency, run will be called later
835 if (runDependencies > 0) {
836 return;
837 }
838 }
839 function doRun() {
840 // run may have just been called through dependencies being fulfilled just in this very frame,
841 // or while the async setStatus time below was happening
842 if (calledRun) return;
843 calledRun = 1;
844 Module["calledRun"] = 1;
845 if (ABORT) return;
846 initRuntime();
847 readyPromiseResolve(Module);
848 Module["onRuntimeInitialized"]?.();
849 postRun();
@@ -836,12 +879,9 @@
879
880 return moduleRtn;
881 }
882 );
883 })();
884 if (typeof exports === 'object' && typeof module === 'object')
885 module.exports = initPikchrModule;
886 else if (typeof define === 'function' && define['amd'])
 
 
 
887 define([], () => initPikchrModule);
888
--- extsrc/pikchr.wasm
+++ extsrc/pikchr.wasm
cannot compute difference between binary files
11
--- extsrc/pikchr.wasm
+++ extsrc/pikchr.wasm
0 annot compute difference between binary files
1
--- extsrc/pikchr.wasm
+++ extsrc/pikchr.wasm
0 annot compute difference between binary files
1
+81 -37
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -234,10 +234,12 @@
234234
235235
/* ctype macros that work with signed characters */
236236
#define IsSpace(X) isspace((unsigned char)X)
237237
#define IsDigit(X) isdigit((unsigned char)X)
238238
#define ToLower(X) (char)tolower((unsigned char)X)
239
+#define IsAlnum(X) isalnum((unsigned char)X)
240
+#define IsAlpha(X) isalpha((unsigned char)X)
239241
240242
#if defined(_WIN32) || defined(WIN32)
241243
#if SQLITE_OS_WINRT
242244
#include <intrin.h>
243245
#endif
@@ -1506,13 +1508,13 @@
15061508
** Return '"' if quoting is required. Return 0 if no quoting is required.
15071509
*/
15081510
static char quoteChar(const char *zName){
15091511
int i;
15101512
if( zName==0 ) return '"';
1511
- if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"';
1513
+ if( !IsAlpha(zName[0]) && zName[0]!='_' ) return '"';
15121514
for(i=0; zName[i]; i++){
1513
- if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"';
1515
+ if( !IsAlnum(zName[i]) && zName[i]!='_' ) return '"';
15141516
}
15151517
return sqlite3_keyword_check(zName, i) ? '"' : 0;
15161518
}
15171519
15181520
/*
@@ -2425,11 +2427,11 @@
24252427
** content in cases where the content starts
24262428
** with a digit.
24272429
**
24282430
** typeof(Y)='blob' The hash is taken over prefix "Bnnn:" followed
24292431
** by the binary content of the blob. The "nnn"
2430
-** in the prefix is the mimimum-length decimal
2432
+** in the prefix is the minimum-length decimal
24312433
** representation of the byte-length of the blob.
24322434
**
24332435
** According to the rules above, all of the following SELECT statements
24342436
** should return TRUE:
24352437
**
@@ -3646,11 +3648,11 @@
36463648
**
36473649
** UINT works like BINARY for text, except that embedded strings
36483650
** of digits compare in numeric order.
36493651
**
36503652
** * Leading zeros are handled properly, in the sense that
3651
-** they do not mess of the maginitude comparison of embedded
3653
+** they do not mess of the magnitude comparison of embedded
36523654
** strings of digits. "x00123y" is equal to "x123y".
36533655
**
36543656
** * Only unsigned integers are recognized. Plus and minus
36553657
** signs are ignored. Decimal points and exponential notation
36563658
** are ignored.
@@ -3752,10 +3754,13 @@
37523754
** warnings. */
37533755
#ifndef UNUSED_PARAMETER
37543756
# define UNUSED_PARAMETER(X) (void)(X)
37553757
#endif
37563758
3759
+#ifndef IsSpace
3760
+#define IsSpace(X) isspace((unsigned char)X)
3761
+#endif
37573762
37583763
/* A decimal object */
37593764
typedef struct Decimal Decimal;
37603765
struct Decimal {
37613766
char sign; /* 0 for positive, 1 for negative */
@@ -3801,11 +3806,11 @@
38013806
p->isNull = 0;
38023807
p->nDigit = 0;
38033808
p->nFrac = 0;
38043809
p->a = sqlite3_malloc64( n+1 );
38053810
if( p->a==0 ) goto new_from_text_failed;
3806
- for(i=0; isspace(zIn[i]); i++){}
3811
+ for(i=0; IsSpace(zIn[i]); i++){}
38073812
if( zIn[i]=='-' ){
38083813
p->sign = 1;
38093814
i++;
38103815
}else if( zIn[i]=='+' ){
38113816
i++;
@@ -4456,11 +4461,11 @@
44564461
}
44574462
decimal_free(pA);
44584463
decimal_free(pB);
44594464
}
44604465
4461
-/* Aggregate funcion: decimal_sum(X)
4466
+/* Aggregate function: decimal_sum(X)
44624467
**
44634468
** Works like sum() except that it uses decimal arithmetic for unlimited
44644469
** precision.
44654470
*/
44664471
static void decimalSumStep(
@@ -4817,11 +4822,11 @@
48174822
}
48184823
48194824
/*
48204825
** Generate an error for a percentile function.
48214826
**
4822
-** The error format string must have exactly one occurrance of "%%s()"
4827
+** The error format string must have exactly one occurrence of "%%s()"
48234828
** (with two '%' characters). That substring will be replaced by the name
48244829
** of the function.
48254830
*/
48264831
static void percentError(sqlite3_context *pCtx, const char *zFormat, ...){
48274832
PercentileFunc *pFunc = (PercentileFunc*)sqlite3_user_data(pCtx);
@@ -5957,11 +5962,11 @@
59575962
** number format:
59585963
**
59595964
** WITH c(name,bin) AS (VALUES
59605965
** ('minimum positive value', x'0000000000000001'),
59615966
** ('maximum subnormal value', x'000fffffffffffff'),
5962
-** ('mininum positive nornal value', x'0010000000000000'),
5967
+** ('minimum positive normal value', x'0010000000000000'),
59635968
** ('maximum value', x'7fefffffffffffff'))
59645969
** SELECT c.name, decimal_mul(ieee754_mantissa(c.bin),pow2.v)
59655970
** FROM pow2, c WHERE pow2.x=ieee754_exponent(c.bin);
59665971
**
59675972
*/
@@ -6344,11 +6349,11 @@
63446349
* 2 for UBSAN's satisfaction (and hypothetical 1's complement ALUs.) */
63456350
smBase += (mxI64/2) * smStep;
63466351
smBase += (mxI64 - mxI64/2) * smStep;
63476352
}
63486353
/* Under UBSAN (or on 1's complement machines), must do this last term
6349
- * in steps to avoid the dreaded (and harmless) signed multiply overlow. */
6354
+ * in steps to avoid the dreaded (and harmless) signed multiply overflow. */
63506355
if( ix>=2 ){
63516356
sqlite3_int64 ix2 = (sqlite3_int64)ix/2;
63526357
smBase += ix2*smStep;
63536358
ix -= ix2;
63546359
}
@@ -9024,10 +9029,15 @@
90249029
#include <assert.h>
90259030
#include <string.h>
90269031
#include <ctype.h>
90279032
90289033
#ifndef SQLITE_OMIT_VIRTUALTABLE
9034
+
9035
+#ifndef IsAlnum
9036
+#define IsAlnum(X) isalnum((unsigned char)X)
9037
+#endif
9038
+
90299039
90309040
/* completion_vtab is a subclass of sqlite3_vtab which will
90319041
** serve as the underlying representation of a completion virtual table
90329042
*/
90339043
typedef struct completion_vtab completion_vtab;
@@ -9361,11 +9371,11 @@
93619371
if( pCur->zLine==0 ) return SQLITE_NOMEM;
93629372
}
93639373
}
93649374
if( pCur->zLine!=0 && pCur->zPrefix==0 ){
93659375
int i = pCur->nLine;
9366
- while( i>0 && (isalnum(pCur->zLine[i-1]) || pCur->zLine[i-1]=='_') ){
9376
+ while( i>0 && (IsAlnum(pCur->zLine[i-1]) || pCur->zLine[i-1]=='_') ){
93679377
i--;
93689378
}
93699379
pCur->nPrefix = pCur->nLine - i;
93709380
if( pCur->nPrefix>0 ){
93719381
pCur->zPrefix = sqlite3_mprintf("%.*s", pCur->nPrefix, pCur->zLine + i);
@@ -14768,11 +14778,11 @@
1476814778
/* Register the auth callback with dbv */
1476914779
if( rc==SQLITE_OK ){
1477014780
sqlite3_set_authorizer(pNew->dbv, idxAuthCallback, (void*)pNew);
1477114781
}
1477214782
14773
- /* If an error has occurred, free the new object and reutrn NULL. Otherwise,
14783
+ /* If an error has occurred, free the new object and return NULL. Otherwise,
1477414784
** return the new sqlite3expert handle. */
1477514785
if( rc!=SQLITE_OK ){
1477614786
sqlite3_expert_destroy(pNew);
1477714787
pNew = 0;
1477814788
}
@@ -16290,11 +16300,11 @@
1629016300
**
1629116301
** PRAGMA vfstrace('+all');
1629216302
**
1629316303
** Individual APIs can be enabled or disabled by name, with or without
1629416304
** the initial "x" character. For example, to set up for tracing lock
16295
-** primatives only:
16305
+** primitives only:
1629616306
**
1629716307
** PRAGMA vfstrace('-all, +Lock,Unlock,ShmLock');
1629816308
**
1629916309
** The argument to the vfstrace pragma ignores capitalization and any
1630016310
** characters other than alphabetics, '+', and '-'.
@@ -21241,41 +21251,57 @@
2124121251
** function is called.
2124221252
*/
2124321253
static void recoverStep(sqlite3_recover *p){
2124421254
assert( p && p->errCode==SQLITE_OK );
2124521255
switch( p->eState ){
21246
- case RECOVER_STATE_INIT:
21256
+ case RECOVER_STATE_INIT: {
21257
+ int bUseWrapper = 1;
2124721258
/* This is the very first call to sqlite3_recover_step() on this object.
2124821259
*/
2124921260
recoverSqlCallback(p, "BEGIN");
2125021261
recoverSqlCallback(p, "PRAGMA writable_schema = on");
21262
+ recoverSqlCallback(p, "PRAGMA foreign_keys = off");
2125121263
2125221264
recoverEnterMutex();
21253
- recoverInstallWrapper(p);
2125421265
2125521266
/* Open the output database. And register required virtual tables and
2125621267
** user functions with the new handle. */
2125721268
recoverOpenOutput(p);
2125821269
21259
- /* Open transactions on both the input and output databases. */
21260
- sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
21261
- recoverExec(p, p->dbIn, "PRAGMA writable_schema = on");
21262
- recoverExec(p, p->dbIn, "BEGIN");
21263
- if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1;
21264
- recoverExec(p, p->dbIn, "SELECT 1 FROM sqlite_schema");
21265
- recoverTransferSettings(p);
21266
- recoverOpenRecovery(p);
21267
- recoverCacheSchema(p);
21268
-
21269
- recoverUninstallWrapper(p);
21270
+ /* Attempt to open a transaction and read page 1 of the input database.
21271
+ ** Two attempts may be made - one with a wrapper installed to ensure
21272
+ ** that the database header is sane, and then if that attempt returns
21273
+ ** SQLITE_NOTADB, then again with no wrapper. The second attempt is
21274
+ ** required for encrypted databases. */
21275
+ if( p->errCode==SQLITE_OK ){
21276
+ do{
21277
+ p->errCode = SQLITE_OK;
21278
+ if( bUseWrapper ) recoverInstallWrapper(p);
21279
+
21280
+ /* Open a transaction on the input database. */
21281
+ sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
21282
+ recoverExec(p, p->dbIn, "PRAGMA writable_schema = on");
21283
+ recoverExec(p, p->dbIn, "BEGIN");
21284
+ if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1;
21285
+ recoverExec(p, p->dbIn, "SELECT 1 FROM sqlite_schema");
21286
+ recoverTransferSettings(p);
21287
+ recoverOpenRecovery(p);
21288
+ recoverCacheSchema(p);
21289
+
21290
+ if( bUseWrapper ) recoverUninstallWrapper(p);
21291
+ }while( p->errCode==SQLITE_NOTADB
21292
+ && (bUseWrapper--)
21293
+ && SQLITE_OK==sqlite3_exec(p->dbIn, "ROLLBACK", 0, 0, 0)
21294
+ );
21295
+ }
21296
+
2127021297
recoverLeaveMutex();
21271
-
2127221298
recoverExec(p, p->dbOut, "BEGIN");
21273
-
2127421299
recoverWriteSchema1(p);
2127521300
p->eState = RECOVER_STATE_WRITING;
2127621301
break;
21302
+ }
2127721303
2127821304
case RECOVER_STATE_WRITING: {
2127921305
if( p->w1.pTbls==0 ){
2128021306
recoverWriteDataInit(p);
2128121307
}
@@ -21711,17 +21737,18 @@
2171121737
#define SHELL_PROGRESS_RESET 0x02 /* Reset the count when the progress
2171221738
** callback limit is reached, and for each
2171321739
** top-level SQL statement */
2171421740
#define SHELL_PROGRESS_ONCE 0x04 /* Cancel the --limit after firing once */
2171521741
21716
-/* Allowed values for ShellState.eEscMode
21742
+/* Allowed values for ShellState.eEscMode. The default value should
21743
+** be 0, so to change the default, reorder the names.
2171721744
*/
21718
-#define SHELL_ESC_SYMBOL 0 /* Substitute U+2400 graphics */
21719
-#define SHELL_ESC_ASCII 1 /* Substitute ^Y for X where Y=X+0x40 */
21745
+#define SHELL_ESC_ASCII 0 /* Substitute ^Y for X where Y=X+0x40 */
21746
+#define SHELL_ESC_SYMBOL 1 /* Substitute U+2400 graphics */
2172021747
#define SHELL_ESC_OFF 2 /* Send characters verbatim */
2172121748
21722
-static const char *shell_EscModeNames[] = { "symbol", "ascii", "off" };
21749
+static const char *shell_EscModeNames[] = { "ascii", "symbol", "off" };
2172321750
2172421751
/*
2172521752
** These are the allowed shellFlgs values
2172621753
*/
2172721754
#define SHFLG_Pagecache 0x00000001 /* The --pagecache option is used */
@@ -22902,18 +22929,22 @@
2290222929
int j;
2290322930
int nParen = 0;
2290422931
char cEnd = 0;
2290522932
char c;
2290622933
int nLine = 0;
22934
+ int isIndex;
22935
+ int isWhere = 0;
2290722936
assert( nArg==1 );
2290822937
if( azArg[0]==0 ) break;
2290922938
if( sqlite3_strlike("CREATE VIEW%", azArg[0], 0)==0
2291022939
|| sqlite3_strlike("CREATE TRIG%", azArg[0], 0)==0
2291122940
){
2291222941
sqlite3_fprintf(p->out, "%s;\n", azArg[0]);
2291322942
break;
2291422943
}
22944
+ isIndex = sqlite3_strlike("CREATE INDEX%", azArg[0], 0)==0
22945
+ || sqlite3_strlike("CREATE UNIQUE INDEX%", azArg[0], 0)==0;
2291522946
z = sqlite3_mprintf("%s", azArg[0]);
2291622947
shell_check_oom(z);
2291722948
j = 0;
2291822949
for(i=0; IsSpace(z[i]); i++){}
2291922950
for(; (c = z[i])!=0; i++){
@@ -22939,18 +22970,30 @@
2293922970
cEnd = '\n';
2294022971
}else if( c=='(' ){
2294122972
nParen++;
2294222973
}else if( c==')' ){
2294322974
nParen--;
22944
- if( nLine>0 && nParen==0 && j>0 ){
22975
+ if( nLine>0 && nParen==0 && j>0 && !isWhere ){
2294522976
printSchemaLineN(p->out, z, j, "\n");
2294622977
j = 0;
2294722978
}
22979
+ }else if( (c=='w' || c=='W')
22980
+ && nParen==0 && isIndex
22981
+ && sqlite3_strnicmp("WHERE",&z[i],5)==0
22982
+ && !IsAlnum(z[i+5]) && z[i+5]!='_' ){
22983
+ isWhere = 1;
22984
+ }else if( isWhere && (c=='A' || c=='a')
22985
+ && nParen==0
22986
+ && sqlite3_strnicmp("AND",&z[i],3)==0
22987
+ && !IsAlnum(z[i+3]) && z[i+3]!='_' ){
22988
+ printSchemaLineN(p->out, z, j, "\n ");
22989
+ j = 0;
2294822990
}
2294922991
z[j++] = c;
2295022992
if( nParen==1 && cEnd==0
2295122993
&& (c=='(' || c=='\n' || (c==',' && !wsToEol(z+i+1)))
22994
+ && !isWhere
2295222995
){
2295322996
if( c=='\n' ) j--;
2295422997
printSchemaLineN(p->out, z, j, "\n ");
2295522998
j = 0;
2295622999
nLine++;
@@ -24150,15 +24193,15 @@
2415024193
i++;
2415124194
}
2415224195
if( n>=mxWidth && bWordWrap ){
2415324196
/* Perhaps try to back up to a better place to break the line */
2415424197
for(k=i; k>i/2; k--){
24155
- if( isspace(z[k-1]) ) break;
24198
+ if( IsSpace(z[k-1]) ) break;
2415624199
}
2415724200
if( k<=i/2 ){
2415824201
for(k=i; k>i/2; k--){
24159
- if( isalnum(z[k-1])!=isalnum(z[k]) && (z[k]&0xc0)!=0x80 ) break;
24202
+ if( IsAlnum(z[k-1])!=IsAlnum(z[k]) && (z[k]&0xc0)!=0x80 ) break;
2416024203
}
2416124204
}
2416224205
if( k<=i/2 ){
2416324206
k = i;
2416424207
}else{
@@ -26088,11 +26131,11 @@
2608826131
#if HAVE_LINENOISE==2
2608926132
UNUSED_PARAMETER(pUserData);
2609026133
#endif
2609126134
if( nLine>(i64)sizeof(zBuf)-30 ) return;
2609226135
if( zLine[0]=='.' || zLine[0]=='#') return;
26093
- for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
26136
+ for(i=nLine-1; i>=0 && (IsAlnum(zLine[i]) || zLine[i]=='_'); i--){}
2609426137
if( i==nLine-1 ) return;
2609526138
iStart = i+1;
2609626139
memcpy(zBuf, zLine, iStart);
2609726140
zSql = sqlite3_mprintf("SELECT DISTINCT candidate COLLATE nocase"
2609826141
" FROM completion(%Q,%Q) ORDER BY 1",
@@ -28328,10 +28371,11 @@
2832828371
sqlite3_recover_config(p, 789, (void*)zRecoveryDb); /* Debug use only */
2832928372
sqlite3_recover_config(p, SQLITE_RECOVER_LOST_AND_FOUND, (void*)zLAF);
2833028373
sqlite3_recover_config(p, SQLITE_RECOVER_ROWIDS, (void*)&bRowids);
2833128374
sqlite3_recover_config(p, SQLITE_RECOVER_FREELIST_CORRUPT,(void*)&bFreelist);
2833228375
28376
+ sqlite3_fprintf(pState->out, ".dbconfig defensive off\n");
2833328377
sqlite3_recover_run(p);
2833428378
if( sqlite3_recover_errcode(p)!=SQLITE_OK ){
2833528379
const char *zErr = sqlite3_recover_errmsg(p);
2833628380
int errCode = sqlite3_recover_errcode(p);
2833728381
sqlite3_fprintf(stderr,"sql error: %s (%d)\n", zErr, errCode);
@@ -32419,11 +32463,11 @@
3241932463
/*
3242032464
** The CLI needs a working sqlite3_complete() to work properly. So error
3242132465
** out of the build if compiling with SQLITE_OMIT_COMPLETE.
3242232466
*/
3242332467
#ifdef SQLITE_OMIT_COMPLETE
32424
-# error the CLI application is imcompatable with SQLITE_OMIT_COMPLETE.
32468
+# error the CLI application is incompatable with SQLITE_OMIT_COMPLETE.
3242532469
#endif
3242632470
3242732471
/*
3242832472
** Return true if zSql is a complete SQL statement. Return false if it
3242932473
** ends in the middle of a string literal or C-style comment.
@@ -32598,11 +32642,11 @@
3259832642
UNUSED_PARAMETER(in);
3259932643
UNUSED_PARAMETER(isContinuation);
3260032644
if(!z || !*z){
3260132645
return 0;
3260232646
}
32603
- while(*z && isspace(*z)) ++z;
32647
+ while(*z && IsSpace(*z)) ++z;
3260432648
zBegin = z;
3260532649
for(; *z && '\n'!=*z; ++nZ, ++z){}
3260632650
if(nZ>0 && '\r'==zBegin[nZ-1]){
3260732651
--nZ;
3260832652
}
3260932653
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -234,10 +234,12 @@
234
235 /* ctype macros that work with signed characters */
236 #define IsSpace(X) isspace((unsigned char)X)
237 #define IsDigit(X) isdigit((unsigned char)X)
238 #define ToLower(X) (char)tolower((unsigned char)X)
 
 
239
240 #if defined(_WIN32) || defined(WIN32)
241 #if SQLITE_OS_WINRT
242 #include <intrin.h>
243 #endif
@@ -1506,13 +1508,13 @@
1506 ** Return '"' if quoting is required. Return 0 if no quoting is required.
1507 */
1508 static char quoteChar(const char *zName){
1509 int i;
1510 if( zName==0 ) return '"';
1511 if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"';
1512 for(i=0; zName[i]; i++){
1513 if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"';
1514 }
1515 return sqlite3_keyword_check(zName, i) ? '"' : 0;
1516 }
1517
1518 /*
@@ -2425,11 +2427,11 @@
2425 ** content in cases where the content starts
2426 ** with a digit.
2427 **
2428 ** typeof(Y)='blob' The hash is taken over prefix "Bnnn:" followed
2429 ** by the binary content of the blob. The "nnn"
2430 ** in the prefix is the mimimum-length decimal
2431 ** representation of the byte-length of the blob.
2432 **
2433 ** According to the rules above, all of the following SELECT statements
2434 ** should return TRUE:
2435 **
@@ -3646,11 +3648,11 @@
3646 **
3647 ** UINT works like BINARY for text, except that embedded strings
3648 ** of digits compare in numeric order.
3649 **
3650 ** * Leading zeros are handled properly, in the sense that
3651 ** they do not mess of the maginitude comparison of embedded
3652 ** strings of digits. "x00123y" is equal to "x123y".
3653 **
3654 ** * Only unsigned integers are recognized. Plus and minus
3655 ** signs are ignored. Decimal points and exponential notation
3656 ** are ignored.
@@ -3752,10 +3754,13 @@
3752 ** warnings. */
3753 #ifndef UNUSED_PARAMETER
3754 # define UNUSED_PARAMETER(X) (void)(X)
3755 #endif
3756
 
 
 
3757
3758 /* A decimal object */
3759 typedef struct Decimal Decimal;
3760 struct Decimal {
3761 char sign; /* 0 for positive, 1 for negative */
@@ -3801,11 +3806,11 @@
3801 p->isNull = 0;
3802 p->nDigit = 0;
3803 p->nFrac = 0;
3804 p->a = sqlite3_malloc64( n+1 );
3805 if( p->a==0 ) goto new_from_text_failed;
3806 for(i=0; isspace(zIn[i]); i++){}
3807 if( zIn[i]=='-' ){
3808 p->sign = 1;
3809 i++;
3810 }else if( zIn[i]=='+' ){
3811 i++;
@@ -4456,11 +4461,11 @@
4456 }
4457 decimal_free(pA);
4458 decimal_free(pB);
4459 }
4460
4461 /* Aggregate funcion: decimal_sum(X)
4462 **
4463 ** Works like sum() except that it uses decimal arithmetic for unlimited
4464 ** precision.
4465 */
4466 static void decimalSumStep(
@@ -4817,11 +4822,11 @@
4817 }
4818
4819 /*
4820 ** Generate an error for a percentile function.
4821 **
4822 ** The error format string must have exactly one occurrance of "%%s()"
4823 ** (with two '%' characters). That substring will be replaced by the name
4824 ** of the function.
4825 */
4826 static void percentError(sqlite3_context *pCtx, const char *zFormat, ...){
4827 PercentileFunc *pFunc = (PercentileFunc*)sqlite3_user_data(pCtx);
@@ -5957,11 +5962,11 @@
5957 ** number format:
5958 **
5959 ** WITH c(name,bin) AS (VALUES
5960 ** ('minimum positive value', x'0000000000000001'),
5961 ** ('maximum subnormal value', x'000fffffffffffff'),
5962 ** ('mininum positive nornal value', x'0010000000000000'),
5963 ** ('maximum value', x'7fefffffffffffff'))
5964 ** SELECT c.name, decimal_mul(ieee754_mantissa(c.bin),pow2.v)
5965 ** FROM pow2, c WHERE pow2.x=ieee754_exponent(c.bin);
5966 **
5967 */
@@ -6344,11 +6349,11 @@
6344 * 2 for UBSAN's satisfaction (and hypothetical 1's complement ALUs.) */
6345 smBase += (mxI64/2) * smStep;
6346 smBase += (mxI64 - mxI64/2) * smStep;
6347 }
6348 /* Under UBSAN (or on 1's complement machines), must do this last term
6349 * in steps to avoid the dreaded (and harmless) signed multiply overlow. */
6350 if( ix>=2 ){
6351 sqlite3_int64 ix2 = (sqlite3_int64)ix/2;
6352 smBase += ix2*smStep;
6353 ix -= ix2;
6354 }
@@ -9024,10 +9029,15 @@
9024 #include <assert.h>
9025 #include <string.h>
9026 #include <ctype.h>
9027
9028 #ifndef SQLITE_OMIT_VIRTUALTABLE
 
 
 
 
 
9029
9030 /* completion_vtab is a subclass of sqlite3_vtab which will
9031 ** serve as the underlying representation of a completion virtual table
9032 */
9033 typedef struct completion_vtab completion_vtab;
@@ -9361,11 +9371,11 @@
9361 if( pCur->zLine==0 ) return SQLITE_NOMEM;
9362 }
9363 }
9364 if( pCur->zLine!=0 && pCur->zPrefix==0 ){
9365 int i = pCur->nLine;
9366 while( i>0 && (isalnum(pCur->zLine[i-1]) || pCur->zLine[i-1]=='_') ){
9367 i--;
9368 }
9369 pCur->nPrefix = pCur->nLine - i;
9370 if( pCur->nPrefix>0 ){
9371 pCur->zPrefix = sqlite3_mprintf("%.*s", pCur->nPrefix, pCur->zLine + i);
@@ -14768,11 +14778,11 @@
14768 /* Register the auth callback with dbv */
14769 if( rc==SQLITE_OK ){
14770 sqlite3_set_authorizer(pNew->dbv, idxAuthCallback, (void*)pNew);
14771 }
14772
14773 /* If an error has occurred, free the new object and reutrn NULL. Otherwise,
14774 ** return the new sqlite3expert handle. */
14775 if( rc!=SQLITE_OK ){
14776 sqlite3_expert_destroy(pNew);
14777 pNew = 0;
14778 }
@@ -16290,11 +16300,11 @@
16290 **
16291 ** PRAGMA vfstrace('+all');
16292 **
16293 ** Individual APIs can be enabled or disabled by name, with or without
16294 ** the initial "x" character. For example, to set up for tracing lock
16295 ** primatives only:
16296 **
16297 ** PRAGMA vfstrace('-all, +Lock,Unlock,ShmLock');
16298 **
16299 ** The argument to the vfstrace pragma ignores capitalization and any
16300 ** characters other than alphabetics, '+', and '-'.
@@ -21241,41 +21251,57 @@
21241 ** function is called.
21242 */
21243 static void recoverStep(sqlite3_recover *p){
21244 assert( p && p->errCode==SQLITE_OK );
21245 switch( p->eState ){
21246 case RECOVER_STATE_INIT:
 
21247 /* This is the very first call to sqlite3_recover_step() on this object.
21248 */
21249 recoverSqlCallback(p, "BEGIN");
21250 recoverSqlCallback(p, "PRAGMA writable_schema = on");
 
21251
21252 recoverEnterMutex();
21253 recoverInstallWrapper(p);
21254
21255 /* Open the output database. And register required virtual tables and
21256 ** user functions with the new handle. */
21257 recoverOpenOutput(p);
21258
21259 /* Open transactions on both the input and output databases. */
21260 sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
21261 recoverExec(p, p->dbIn, "PRAGMA writable_schema = on");
21262 recoverExec(p, p->dbIn, "BEGIN");
21263 if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1;
21264 recoverExec(p, p->dbIn, "SELECT 1 FROM sqlite_schema");
21265 recoverTransferSettings(p);
21266 recoverOpenRecovery(p);
21267 recoverCacheSchema(p);
21268
21269 recoverUninstallWrapper(p);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21270 recoverLeaveMutex();
21271
21272 recoverExec(p, p->dbOut, "BEGIN");
21273
21274 recoverWriteSchema1(p);
21275 p->eState = RECOVER_STATE_WRITING;
21276 break;
 
21277
21278 case RECOVER_STATE_WRITING: {
21279 if( p->w1.pTbls==0 ){
21280 recoverWriteDataInit(p);
21281 }
@@ -21711,17 +21737,18 @@
21711 #define SHELL_PROGRESS_RESET 0x02 /* Reset the count when the progress
21712 ** callback limit is reached, and for each
21713 ** top-level SQL statement */
21714 #define SHELL_PROGRESS_ONCE 0x04 /* Cancel the --limit after firing once */
21715
21716 /* Allowed values for ShellState.eEscMode
 
21717 */
21718 #define SHELL_ESC_SYMBOL 0 /* Substitute U+2400 graphics */
21719 #define SHELL_ESC_ASCII 1 /* Substitute ^Y for X where Y=X+0x40 */
21720 #define SHELL_ESC_OFF 2 /* Send characters verbatim */
21721
21722 static const char *shell_EscModeNames[] = { "symbol", "ascii", "off" };
21723
21724 /*
21725 ** These are the allowed shellFlgs values
21726 */
21727 #define SHFLG_Pagecache 0x00000001 /* The --pagecache option is used */
@@ -22902,18 +22929,22 @@
22902 int j;
22903 int nParen = 0;
22904 char cEnd = 0;
22905 char c;
22906 int nLine = 0;
 
 
22907 assert( nArg==1 );
22908 if( azArg[0]==0 ) break;
22909 if( sqlite3_strlike("CREATE VIEW%", azArg[0], 0)==0
22910 || sqlite3_strlike("CREATE TRIG%", azArg[0], 0)==0
22911 ){
22912 sqlite3_fprintf(p->out, "%s;\n", azArg[0]);
22913 break;
22914 }
 
 
22915 z = sqlite3_mprintf("%s", azArg[0]);
22916 shell_check_oom(z);
22917 j = 0;
22918 for(i=0; IsSpace(z[i]); i++){}
22919 for(; (c = z[i])!=0; i++){
@@ -22939,18 +22970,30 @@
22939 cEnd = '\n';
22940 }else if( c=='(' ){
22941 nParen++;
22942 }else if( c==')' ){
22943 nParen--;
22944 if( nLine>0 && nParen==0 && j>0 ){
22945 printSchemaLineN(p->out, z, j, "\n");
22946 j = 0;
22947 }
 
 
 
 
 
 
 
 
 
 
 
22948 }
22949 z[j++] = c;
22950 if( nParen==1 && cEnd==0
22951 && (c=='(' || c=='\n' || (c==',' && !wsToEol(z+i+1)))
 
22952 ){
22953 if( c=='\n' ) j--;
22954 printSchemaLineN(p->out, z, j, "\n ");
22955 j = 0;
22956 nLine++;
@@ -24150,15 +24193,15 @@
24150 i++;
24151 }
24152 if( n>=mxWidth && bWordWrap ){
24153 /* Perhaps try to back up to a better place to break the line */
24154 for(k=i; k>i/2; k--){
24155 if( isspace(z[k-1]) ) break;
24156 }
24157 if( k<=i/2 ){
24158 for(k=i; k>i/2; k--){
24159 if( isalnum(z[k-1])!=isalnum(z[k]) && (z[k]&0xc0)!=0x80 ) break;
24160 }
24161 }
24162 if( k<=i/2 ){
24163 k = i;
24164 }else{
@@ -26088,11 +26131,11 @@
26088 #if HAVE_LINENOISE==2
26089 UNUSED_PARAMETER(pUserData);
26090 #endif
26091 if( nLine>(i64)sizeof(zBuf)-30 ) return;
26092 if( zLine[0]=='.' || zLine[0]=='#') return;
26093 for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
26094 if( i==nLine-1 ) return;
26095 iStart = i+1;
26096 memcpy(zBuf, zLine, iStart);
26097 zSql = sqlite3_mprintf("SELECT DISTINCT candidate COLLATE nocase"
26098 " FROM completion(%Q,%Q) ORDER BY 1",
@@ -28328,10 +28371,11 @@
28328 sqlite3_recover_config(p, 789, (void*)zRecoveryDb); /* Debug use only */
28329 sqlite3_recover_config(p, SQLITE_RECOVER_LOST_AND_FOUND, (void*)zLAF);
28330 sqlite3_recover_config(p, SQLITE_RECOVER_ROWIDS, (void*)&bRowids);
28331 sqlite3_recover_config(p, SQLITE_RECOVER_FREELIST_CORRUPT,(void*)&bFreelist);
28332
 
28333 sqlite3_recover_run(p);
28334 if( sqlite3_recover_errcode(p)!=SQLITE_OK ){
28335 const char *zErr = sqlite3_recover_errmsg(p);
28336 int errCode = sqlite3_recover_errcode(p);
28337 sqlite3_fprintf(stderr,"sql error: %s (%d)\n", zErr, errCode);
@@ -32419,11 +32463,11 @@
32419 /*
32420 ** The CLI needs a working sqlite3_complete() to work properly. So error
32421 ** out of the build if compiling with SQLITE_OMIT_COMPLETE.
32422 */
32423 #ifdef SQLITE_OMIT_COMPLETE
32424 # error the CLI application is imcompatable with SQLITE_OMIT_COMPLETE.
32425 #endif
32426
32427 /*
32428 ** Return true if zSql is a complete SQL statement. Return false if it
32429 ** ends in the middle of a string literal or C-style comment.
@@ -32598,11 +32642,11 @@
32598 UNUSED_PARAMETER(in);
32599 UNUSED_PARAMETER(isContinuation);
32600 if(!z || !*z){
32601 return 0;
32602 }
32603 while(*z && isspace(*z)) ++z;
32604 zBegin = z;
32605 for(; *z && '\n'!=*z; ++nZ, ++z){}
32606 if(nZ>0 && '\r'==zBegin[nZ-1]){
32607 --nZ;
32608 }
32609
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -234,10 +234,12 @@
234
235 /* ctype macros that work with signed characters */
236 #define IsSpace(X) isspace((unsigned char)X)
237 #define IsDigit(X) isdigit((unsigned char)X)
238 #define ToLower(X) (char)tolower((unsigned char)X)
239 #define IsAlnum(X) isalnum((unsigned char)X)
240 #define IsAlpha(X) isalpha((unsigned char)X)
241
242 #if defined(_WIN32) || defined(WIN32)
243 #if SQLITE_OS_WINRT
244 #include <intrin.h>
245 #endif
@@ -1506,13 +1508,13 @@
1508 ** Return '"' if quoting is required. Return 0 if no quoting is required.
1509 */
1510 static char quoteChar(const char *zName){
1511 int i;
1512 if( zName==0 ) return '"';
1513 if( !IsAlpha(zName[0]) && zName[0]!='_' ) return '"';
1514 for(i=0; zName[i]; i++){
1515 if( !IsAlnum(zName[i]) && zName[i]!='_' ) return '"';
1516 }
1517 return sqlite3_keyword_check(zName, i) ? '"' : 0;
1518 }
1519
1520 /*
@@ -2425,11 +2427,11 @@
2427 ** content in cases where the content starts
2428 ** with a digit.
2429 **
2430 ** typeof(Y)='blob' The hash is taken over prefix "Bnnn:" followed
2431 ** by the binary content of the blob. The "nnn"
2432 ** in the prefix is the minimum-length decimal
2433 ** representation of the byte-length of the blob.
2434 **
2435 ** According to the rules above, all of the following SELECT statements
2436 ** should return TRUE:
2437 **
@@ -3646,11 +3648,11 @@
3648 **
3649 ** UINT works like BINARY for text, except that embedded strings
3650 ** of digits compare in numeric order.
3651 **
3652 ** * Leading zeros are handled properly, in the sense that
3653 ** they do not mess of the magnitude comparison of embedded
3654 ** strings of digits. "x00123y" is equal to "x123y".
3655 **
3656 ** * Only unsigned integers are recognized. Plus and minus
3657 ** signs are ignored. Decimal points and exponential notation
3658 ** are ignored.
@@ -3752,10 +3754,13 @@
3754 ** warnings. */
3755 #ifndef UNUSED_PARAMETER
3756 # define UNUSED_PARAMETER(X) (void)(X)
3757 #endif
3758
3759 #ifndef IsSpace
3760 #define IsSpace(X) isspace((unsigned char)X)
3761 #endif
3762
3763 /* A decimal object */
3764 typedef struct Decimal Decimal;
3765 struct Decimal {
3766 char sign; /* 0 for positive, 1 for negative */
@@ -3801,11 +3806,11 @@
3806 p->isNull = 0;
3807 p->nDigit = 0;
3808 p->nFrac = 0;
3809 p->a = sqlite3_malloc64( n+1 );
3810 if( p->a==0 ) goto new_from_text_failed;
3811 for(i=0; IsSpace(zIn[i]); i++){}
3812 if( zIn[i]=='-' ){
3813 p->sign = 1;
3814 i++;
3815 }else if( zIn[i]=='+' ){
3816 i++;
@@ -4456,11 +4461,11 @@
4461 }
4462 decimal_free(pA);
4463 decimal_free(pB);
4464 }
4465
4466 /* Aggregate function: decimal_sum(X)
4467 **
4468 ** Works like sum() except that it uses decimal arithmetic for unlimited
4469 ** precision.
4470 */
4471 static void decimalSumStep(
@@ -4817,11 +4822,11 @@
4822 }
4823
4824 /*
4825 ** Generate an error for a percentile function.
4826 **
4827 ** The error format string must have exactly one occurrence of "%%s()"
4828 ** (with two '%' characters). That substring will be replaced by the name
4829 ** of the function.
4830 */
4831 static void percentError(sqlite3_context *pCtx, const char *zFormat, ...){
4832 PercentileFunc *pFunc = (PercentileFunc*)sqlite3_user_data(pCtx);
@@ -5957,11 +5962,11 @@
5962 ** number format:
5963 **
5964 ** WITH c(name,bin) AS (VALUES
5965 ** ('minimum positive value', x'0000000000000001'),
5966 ** ('maximum subnormal value', x'000fffffffffffff'),
5967 ** ('minimum positive normal value', x'0010000000000000'),
5968 ** ('maximum value', x'7fefffffffffffff'))
5969 ** SELECT c.name, decimal_mul(ieee754_mantissa(c.bin),pow2.v)
5970 ** FROM pow2, c WHERE pow2.x=ieee754_exponent(c.bin);
5971 **
5972 */
@@ -6344,11 +6349,11 @@
6349 * 2 for UBSAN's satisfaction (and hypothetical 1's complement ALUs.) */
6350 smBase += (mxI64/2) * smStep;
6351 smBase += (mxI64 - mxI64/2) * smStep;
6352 }
6353 /* Under UBSAN (or on 1's complement machines), must do this last term
6354 * in steps to avoid the dreaded (and harmless) signed multiply overflow. */
6355 if( ix>=2 ){
6356 sqlite3_int64 ix2 = (sqlite3_int64)ix/2;
6357 smBase += ix2*smStep;
6358 ix -= ix2;
6359 }
@@ -9024,10 +9029,15 @@
9029 #include <assert.h>
9030 #include <string.h>
9031 #include <ctype.h>
9032
9033 #ifndef SQLITE_OMIT_VIRTUALTABLE
9034
9035 #ifndef IsAlnum
9036 #define IsAlnum(X) isalnum((unsigned char)X)
9037 #endif
9038
9039
9040 /* completion_vtab is a subclass of sqlite3_vtab which will
9041 ** serve as the underlying representation of a completion virtual table
9042 */
9043 typedef struct completion_vtab completion_vtab;
@@ -9361,11 +9371,11 @@
9371 if( pCur->zLine==0 ) return SQLITE_NOMEM;
9372 }
9373 }
9374 if( pCur->zLine!=0 && pCur->zPrefix==0 ){
9375 int i = pCur->nLine;
9376 while( i>0 && (IsAlnum(pCur->zLine[i-1]) || pCur->zLine[i-1]=='_') ){
9377 i--;
9378 }
9379 pCur->nPrefix = pCur->nLine - i;
9380 if( pCur->nPrefix>0 ){
9381 pCur->zPrefix = sqlite3_mprintf("%.*s", pCur->nPrefix, pCur->zLine + i);
@@ -14768,11 +14778,11 @@
14778 /* Register the auth callback with dbv */
14779 if( rc==SQLITE_OK ){
14780 sqlite3_set_authorizer(pNew->dbv, idxAuthCallback, (void*)pNew);
14781 }
14782
14783 /* If an error has occurred, free the new object and return NULL. Otherwise,
14784 ** return the new sqlite3expert handle. */
14785 if( rc!=SQLITE_OK ){
14786 sqlite3_expert_destroy(pNew);
14787 pNew = 0;
14788 }
@@ -16290,11 +16300,11 @@
16300 **
16301 ** PRAGMA vfstrace('+all');
16302 **
16303 ** Individual APIs can be enabled or disabled by name, with or without
16304 ** the initial "x" character. For example, to set up for tracing lock
16305 ** primitives only:
16306 **
16307 ** PRAGMA vfstrace('-all, +Lock,Unlock,ShmLock');
16308 **
16309 ** The argument to the vfstrace pragma ignores capitalization and any
16310 ** characters other than alphabetics, '+', and '-'.
@@ -21241,41 +21251,57 @@
21251 ** function is called.
21252 */
21253 static void recoverStep(sqlite3_recover *p){
21254 assert( p && p->errCode==SQLITE_OK );
21255 switch( p->eState ){
21256 case RECOVER_STATE_INIT: {
21257 int bUseWrapper = 1;
21258 /* This is the very first call to sqlite3_recover_step() on this object.
21259 */
21260 recoverSqlCallback(p, "BEGIN");
21261 recoverSqlCallback(p, "PRAGMA writable_schema = on");
21262 recoverSqlCallback(p, "PRAGMA foreign_keys = off");
21263
21264 recoverEnterMutex();
 
21265
21266 /* Open the output database. And register required virtual tables and
21267 ** user functions with the new handle. */
21268 recoverOpenOutput(p);
21269
21270 /* Attempt to open a transaction and read page 1 of the input database.
21271 ** Two attempts may be made - one with a wrapper installed to ensure
21272 ** that the database header is sane, and then if that attempt returns
21273 ** SQLITE_NOTADB, then again with no wrapper. The second attempt is
21274 ** required for encrypted databases. */
21275 if( p->errCode==SQLITE_OK ){
21276 do{
21277 p->errCode = SQLITE_OK;
21278 if( bUseWrapper ) recoverInstallWrapper(p);
21279
21280 /* Open a transaction on the input database. */
21281 sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
21282 recoverExec(p, p->dbIn, "PRAGMA writable_schema = on");
21283 recoverExec(p, p->dbIn, "BEGIN");
21284 if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1;
21285 recoverExec(p, p->dbIn, "SELECT 1 FROM sqlite_schema");
21286 recoverTransferSettings(p);
21287 recoverOpenRecovery(p);
21288 recoverCacheSchema(p);
21289
21290 if( bUseWrapper ) recoverUninstallWrapper(p);
21291 }while( p->errCode==SQLITE_NOTADB
21292 && (bUseWrapper--)
21293 && SQLITE_OK==sqlite3_exec(p->dbIn, "ROLLBACK", 0, 0, 0)
21294 );
21295 }
21296
21297 recoverLeaveMutex();
 
21298 recoverExec(p, p->dbOut, "BEGIN");
 
21299 recoverWriteSchema1(p);
21300 p->eState = RECOVER_STATE_WRITING;
21301 break;
21302 }
21303
21304 case RECOVER_STATE_WRITING: {
21305 if( p->w1.pTbls==0 ){
21306 recoverWriteDataInit(p);
21307 }
@@ -21711,17 +21737,18 @@
21737 #define SHELL_PROGRESS_RESET 0x02 /* Reset the count when the progress
21738 ** callback limit is reached, and for each
21739 ** top-level SQL statement */
21740 #define SHELL_PROGRESS_ONCE 0x04 /* Cancel the --limit after firing once */
21741
21742 /* Allowed values for ShellState.eEscMode. The default value should
21743 ** be 0, so to change the default, reorder the names.
21744 */
21745 #define SHELL_ESC_ASCII 0 /* Substitute ^Y for X where Y=X+0x40 */
21746 #define SHELL_ESC_SYMBOL 1 /* Substitute U+2400 graphics */
21747 #define SHELL_ESC_OFF 2 /* Send characters verbatim */
21748
21749 static const char *shell_EscModeNames[] = { "ascii", "symbol", "off" };
21750
21751 /*
21752 ** These are the allowed shellFlgs values
21753 */
21754 #define SHFLG_Pagecache 0x00000001 /* The --pagecache option is used */
@@ -22902,18 +22929,22 @@
22929 int j;
22930 int nParen = 0;
22931 char cEnd = 0;
22932 char c;
22933 int nLine = 0;
22934 int isIndex;
22935 int isWhere = 0;
22936 assert( nArg==1 );
22937 if( azArg[0]==0 ) break;
22938 if( sqlite3_strlike("CREATE VIEW%", azArg[0], 0)==0
22939 || sqlite3_strlike("CREATE TRIG%", azArg[0], 0)==0
22940 ){
22941 sqlite3_fprintf(p->out, "%s;\n", azArg[0]);
22942 break;
22943 }
22944 isIndex = sqlite3_strlike("CREATE INDEX%", azArg[0], 0)==0
22945 || sqlite3_strlike("CREATE UNIQUE INDEX%", azArg[0], 0)==0;
22946 z = sqlite3_mprintf("%s", azArg[0]);
22947 shell_check_oom(z);
22948 j = 0;
22949 for(i=0; IsSpace(z[i]); i++){}
22950 for(; (c = z[i])!=0; i++){
@@ -22939,18 +22970,30 @@
22970 cEnd = '\n';
22971 }else if( c=='(' ){
22972 nParen++;
22973 }else if( c==')' ){
22974 nParen--;
22975 if( nLine>0 && nParen==0 && j>0 && !isWhere ){
22976 printSchemaLineN(p->out, z, j, "\n");
22977 j = 0;
22978 }
22979 }else if( (c=='w' || c=='W')
22980 && nParen==0 && isIndex
22981 && sqlite3_strnicmp("WHERE",&z[i],5)==0
22982 && !IsAlnum(z[i+5]) && z[i+5]!='_' ){
22983 isWhere = 1;
22984 }else if( isWhere && (c=='A' || c=='a')
22985 && nParen==0
22986 && sqlite3_strnicmp("AND",&z[i],3)==0
22987 && !IsAlnum(z[i+3]) && z[i+3]!='_' ){
22988 printSchemaLineN(p->out, z, j, "\n ");
22989 j = 0;
22990 }
22991 z[j++] = c;
22992 if( nParen==1 && cEnd==0
22993 && (c=='(' || c=='\n' || (c==',' && !wsToEol(z+i+1)))
22994 && !isWhere
22995 ){
22996 if( c=='\n' ) j--;
22997 printSchemaLineN(p->out, z, j, "\n ");
22998 j = 0;
22999 nLine++;
@@ -24150,15 +24193,15 @@
24193 i++;
24194 }
24195 if( n>=mxWidth && bWordWrap ){
24196 /* Perhaps try to back up to a better place to break the line */
24197 for(k=i; k>i/2; k--){
24198 if( IsSpace(z[k-1]) ) break;
24199 }
24200 if( k<=i/2 ){
24201 for(k=i; k>i/2; k--){
24202 if( IsAlnum(z[k-1])!=IsAlnum(z[k]) && (z[k]&0xc0)!=0x80 ) break;
24203 }
24204 }
24205 if( k<=i/2 ){
24206 k = i;
24207 }else{
@@ -26088,11 +26131,11 @@
26131 #if HAVE_LINENOISE==2
26132 UNUSED_PARAMETER(pUserData);
26133 #endif
26134 if( nLine>(i64)sizeof(zBuf)-30 ) return;
26135 if( zLine[0]=='.' || zLine[0]=='#') return;
26136 for(i=nLine-1; i>=0 && (IsAlnum(zLine[i]) || zLine[i]=='_'); i--){}
26137 if( i==nLine-1 ) return;
26138 iStart = i+1;
26139 memcpy(zBuf, zLine, iStart);
26140 zSql = sqlite3_mprintf("SELECT DISTINCT candidate COLLATE nocase"
26141 " FROM completion(%Q,%Q) ORDER BY 1",
@@ -28328,10 +28371,11 @@
28371 sqlite3_recover_config(p, 789, (void*)zRecoveryDb); /* Debug use only */
28372 sqlite3_recover_config(p, SQLITE_RECOVER_LOST_AND_FOUND, (void*)zLAF);
28373 sqlite3_recover_config(p, SQLITE_RECOVER_ROWIDS, (void*)&bRowids);
28374 sqlite3_recover_config(p, SQLITE_RECOVER_FREELIST_CORRUPT,(void*)&bFreelist);
28375
28376 sqlite3_fprintf(pState->out, ".dbconfig defensive off\n");
28377 sqlite3_recover_run(p);
28378 if( sqlite3_recover_errcode(p)!=SQLITE_OK ){
28379 const char *zErr = sqlite3_recover_errmsg(p);
28380 int errCode = sqlite3_recover_errcode(p);
28381 sqlite3_fprintf(stderr,"sql error: %s (%d)\n", zErr, errCode);
@@ -32419,11 +32463,11 @@
32463 /*
32464 ** The CLI needs a working sqlite3_complete() to work properly. So error
32465 ** out of the build if compiling with SQLITE_OMIT_COMPLETE.
32466 */
32467 #ifdef SQLITE_OMIT_COMPLETE
32468 # error the CLI application is incompatable with SQLITE_OMIT_COMPLETE.
32469 #endif
32470
32471 /*
32472 ** Return true if zSql is a complete SQL statement. Return false if it
32473 ** ends in the middle of a string literal or C-style comment.
@@ -32598,11 +32642,11 @@
32642 UNUSED_PARAMETER(in);
32643 UNUSED_PARAMETER(isContinuation);
32644 if(!z || !*z){
32645 return 0;
32646 }
32647 while(*z && IsSpace(*z)) ++z;
32648 zBegin = z;
32649 for(; *z && '\n'!=*z; ++nZ, ++z){}
32650 if(nZ>0 && '\r'==zBegin[nZ-1]){
32651 --nZ;
32652 }
32653
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -356,13 +356,14 @@
356356
.content pre, table.numbered-lines > tbody > tr {
357357
hyphens: none;
358358
line-height: 1.25;
359359
}
360360
361
-.content ul:not(.browser) li {
361
+.content ul:not(.browser) > li {
362362
list-style-type: disc;
363363
}
364
+
364365
div.filetree ul li.dir,
365366
div.filetree ul li.subdir,
366367
div.filetree ul li.file{
367368
list-style-type: none;
368369
}
369370
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -356,13 +356,14 @@
356 .content pre, table.numbered-lines > tbody > tr {
357 hyphens: none;
358 line-height: 1.25;
359 }
360
361 .content ul:not(.browser) li {
362 list-style-type: disc;
363 }
 
364 div.filetree ul li.dir,
365 div.filetree ul li.subdir,
366 div.filetree ul li.file{
367 list-style-type: none;
368 }
369
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -356,13 +356,14 @@
356 .content pre, table.numbered-lines > tbody > tr {
357 hyphens: none;
358 line-height: 1.25;
359 }
360
361 .content ul:not(.browser) > li {
362 list-style-type: disc;
363 }
364
365 div.filetree ul li.dir,
366 div.filetree ul li.subdir,
367 div.filetree ul li.file{
368 list-style-type: none;
369 }
370
+4 -4
--- src/bisect.c
+++ src/bisect.c
@@ -37,13 +37,13 @@
3737
void bisect_path(void){
3838
PathNode *p;
3939
bisect.bad = db_lget_int("bisect-bad", 0);
4040
bisect.good = db_lget_int("bisect-good", 0);
4141
if( bisect.good>0 && bisect.bad==0 ){
42
- path_shortest(bisect.good, bisect.good, 0, 0, 0);
42
+ path_shortest(bisect.good, bisect.good, 0, 0, 0, 0);
4343
}else if( bisect.bad>0 && bisect.good==0 ){
44
- path_shortest(bisect.bad, bisect.bad, 0, 0, 0);
44
+ path_shortest(bisect.bad, bisect.bad, 0, 0, 0, 0);
4545
}else if( bisect.bad==0 && bisect.good==0 ){
4646
fossil_fatal("neither \"good\" nor \"bad\" versions have been identified");
4747
}else{
4848
Bag skip;
4949
int bDirect = bisect_option("direct-only");
@@ -55,11 +55,11 @@
5555
if( blob_str(&id)[0]=='s' ){
5656
bag_insert(&skip, atoi(blob_str(&id)+1));
5757
}
5858
}
5959
blob_reset(&log);
60
- p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip);
60
+ p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip, 0);
6161
bag_clear(&skip);
6262
if( p==0 ){
6363
char *zBad = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.bad);
6464
char *zGood = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.good);
6565
fossil_fatal("no path from good ([%S]) to bad ([%S]) or back",
@@ -292,11 +292,11 @@
292292
if( iCurrent>0 ){
293293
bisect_log_append(&ins, ++cnt, "CURRENT", iCurrent);
294294
}
295295
if( bDetail && lastGood>0 && lastBad>0 ){
296296
PathNode *p;
297
- p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0);
297
+ p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0, 0);
298298
while( p ){
299299
bisect_log_append(&ins, ++cnt, 0, p->rid);
300300
p = p->u.pTo;
301301
}
302302
path_reset();
303303
--- src/bisect.c
+++ src/bisect.c
@@ -37,13 +37,13 @@
37 void bisect_path(void){
38 PathNode *p;
39 bisect.bad = db_lget_int("bisect-bad", 0);
40 bisect.good = db_lget_int("bisect-good", 0);
41 if( bisect.good>0 && bisect.bad==0 ){
42 path_shortest(bisect.good, bisect.good, 0, 0, 0);
43 }else if( bisect.bad>0 && bisect.good==0 ){
44 path_shortest(bisect.bad, bisect.bad, 0, 0, 0);
45 }else if( bisect.bad==0 && bisect.good==0 ){
46 fossil_fatal("neither \"good\" nor \"bad\" versions have been identified");
47 }else{
48 Bag skip;
49 int bDirect = bisect_option("direct-only");
@@ -55,11 +55,11 @@
55 if( blob_str(&id)[0]=='s' ){
56 bag_insert(&skip, atoi(blob_str(&id)+1));
57 }
58 }
59 blob_reset(&log);
60 p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip);
61 bag_clear(&skip);
62 if( p==0 ){
63 char *zBad = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.bad);
64 char *zGood = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.good);
65 fossil_fatal("no path from good ([%S]) to bad ([%S]) or back",
@@ -292,11 +292,11 @@
292 if( iCurrent>0 ){
293 bisect_log_append(&ins, ++cnt, "CURRENT", iCurrent);
294 }
295 if( bDetail && lastGood>0 && lastBad>0 ){
296 PathNode *p;
297 p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0);
298 while( p ){
299 bisect_log_append(&ins, ++cnt, 0, p->rid);
300 p = p->u.pTo;
301 }
302 path_reset();
303
--- src/bisect.c
+++ src/bisect.c
@@ -37,13 +37,13 @@
37 void bisect_path(void){
38 PathNode *p;
39 bisect.bad = db_lget_int("bisect-bad", 0);
40 bisect.good = db_lget_int("bisect-good", 0);
41 if( bisect.good>0 && bisect.bad==0 ){
42 path_shortest(bisect.good, bisect.good, 0, 0, 0, 0);
43 }else if( bisect.bad>0 && bisect.good==0 ){
44 path_shortest(bisect.bad, bisect.bad, 0, 0, 0, 0);
45 }else if( bisect.bad==0 && bisect.good==0 ){
46 fossil_fatal("neither \"good\" nor \"bad\" versions have been identified");
47 }else{
48 Bag skip;
49 int bDirect = bisect_option("direct-only");
@@ -55,11 +55,11 @@
55 if( blob_str(&id)[0]=='s' ){
56 bag_insert(&skip, atoi(blob_str(&id)+1));
57 }
58 }
59 blob_reset(&log);
60 p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip, 0);
61 bag_clear(&skip);
62 if( p==0 ){
63 char *zBad = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.bad);
64 char *zGood = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.good);
65 fossil_fatal("no path from good ([%S]) to bad ([%S]) or back",
@@ -292,11 +292,11 @@
292 if( iCurrent>0 ){
293 bisect_log_append(&ins, ++cnt, "CURRENT", iCurrent);
294 }
295 if( bDetail && lastGood>0 && lastBad>0 ){
296 PathNode *p;
297 p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0, 0);
298 while( p ){
299 bisect_log_append(&ins, ++cnt, 0, p->rid);
300 p = p->u.pTo;
301 }
302 path_reset();
303
--- src/builtin.c
+++ src/builtin.c
@@ -52,17 +52,33 @@
5252
return -1;
5353
}
5454
5555
/*
5656
** Return a pointer to built-in content
57
+**
58
+** If the filename contains "-vNNNNNNNN" just before the final file
59
+** suffix, where each N is a random digit, then omit that part of the
60
+** filename before doing the lookup. The extra -vNNNNNNNN was added
61
+** to defeat overly aggressive caching by web browsers. There must be
62
+** at least 8 digits in NNNNNNNN but more than 8 are allowed.
5763
*/
5864
const unsigned char *builtin_file(const char *zFilename, int *piSize){
5965
int i = builtin_file_index(zFilename);
6066
if( i>=0 ){
6167
if( piSize ) *piSize = aBuiltinFiles[i].nByte;
6268
return aBuiltinFiles[i].pData;
6369
}else{
70
+ char *zV = strstr(zFilename, "-v");
71
+ if( zV!=0 ){
72
+ for(i=0; fossil_isdigit(zV[i+2]); i++){}
73
+ if( i>=8 && zV[i+2]=='.' ){
74
+ char *zNew = mprintf("%.*s%s", (int)(zV-zFilename), zFilename, zV+i+2);
75
+ const unsigned char *pRes = builtin_file(zNew, piSize);
76
+ fossil_free(zNew);
77
+ return pRes;
78
+ }
79
+ }
6480
if( piSize ) *piSize = 0;
6581
return 0;
6682
}
6783
}
6884
const char *builtin_text(const char *zFilename){
6985
--- src/builtin.c
+++ src/builtin.c
@@ -52,17 +52,33 @@
52 return -1;
53 }
54
55 /*
56 ** Return a pointer to built-in content
 
 
 
 
 
 
57 */
58 const unsigned char *builtin_file(const char *zFilename, int *piSize){
59 int i = builtin_file_index(zFilename);
60 if( i>=0 ){
61 if( piSize ) *piSize = aBuiltinFiles[i].nByte;
62 return aBuiltinFiles[i].pData;
63 }else{
 
 
 
 
 
 
 
 
 
 
64 if( piSize ) *piSize = 0;
65 return 0;
66 }
67 }
68 const char *builtin_text(const char *zFilename){
69
--- src/builtin.c
+++ src/builtin.c
@@ -52,17 +52,33 @@
52 return -1;
53 }
54
55 /*
56 ** Return a pointer to built-in content
57 **
58 ** If the filename contains "-vNNNNNNNN" just before the final file
59 ** suffix, where each N is a random digit, then omit that part of the
60 ** filename before doing the lookup. The extra -vNNNNNNNN was added
61 ** to defeat overly aggressive caching by web browsers. There must be
62 ** at least 8 digits in NNNNNNNN but more than 8 are allowed.
63 */
64 const unsigned char *builtin_file(const char *zFilename, int *piSize){
65 int i = builtin_file_index(zFilename);
66 if( i>=0 ){
67 if( piSize ) *piSize = aBuiltinFiles[i].nByte;
68 return aBuiltinFiles[i].pData;
69 }else{
70 char *zV = strstr(zFilename, "-v");
71 if( zV!=0 ){
72 for(i=0; fossil_isdigit(zV[i+2]); i++){}
73 if( i>=8 && zV[i+2]=='.' ){
74 char *zNew = mprintf("%.*s%s", (int)(zV-zFilename), zFilename, zV+i+2);
75 const unsigned char *pRes = builtin_file(zNew, piSize);
76 fossil_free(zNew);
77 return pRes;
78 }
79 }
80 if( piSize ) *piSize = 0;
81 return 0;
82 }
83 }
84 const char *builtin_text(const char *zFilename){
85
--- src/checkin.c
+++ src/checkin.c
@@ -2376,10 +2376,11 @@
23762376
** --no-verify Do not run before-commit hooks
23772377
** --nosign Do not attempt to sign this commit with gpg
23782378
** --nosync Do not auto-sync prior to committing
23792379
** --override-lock Allow a check-in even though parent is locked
23802380
** --private Do not sync changes and their descendants
2381
+** --proxy PROXY Use PROXY as http proxy during sync operation
23812382
** --tag TAG-NAME Assign given tag TAG-NAME to the check-in
23822383
** --trace Debug tracing
23832384
** --user-override USER USER to use instead of the current default
23842385
**
23852386
** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
23862387
--- src/checkin.c
+++ src/checkin.c
@@ -2376,10 +2376,11 @@
2376 ** --no-verify Do not run before-commit hooks
2377 ** --nosign Do not attempt to sign this commit with gpg
2378 ** --nosync Do not auto-sync prior to committing
2379 ** --override-lock Allow a check-in even though parent is locked
2380 ** --private Do not sync changes and their descendants
 
2381 ** --tag TAG-NAME Assign given tag TAG-NAME to the check-in
2382 ** --trace Debug tracing
2383 ** --user-override USER USER to use instead of the current default
2384 **
2385 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
2386
--- src/checkin.c
+++ src/checkin.c
@@ -2376,10 +2376,11 @@
2376 ** --no-verify Do not run before-commit hooks
2377 ** --nosign Do not attempt to sign this commit with gpg
2378 ** --nosync Do not auto-sync prior to committing
2379 ** --override-lock Allow a check-in even though parent is locked
2380 ** --private Do not sync changes and their descendants
2381 ** --proxy PROXY Use PROXY as http proxy during sync operation
2382 ** --tag TAG-NAME Assign given tag TAG-NAME to the check-in
2383 ** --trace Debug tracing
2384 ** --user-override USER USER to use instead of the current default
2385 **
2386 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
2387
--- src/clone.c
+++ src/clone.c
@@ -129,10 +129,11 @@
129129
** check-out
130130
** --nocompress Omit extra delta compression
131131
** --no-open Clone only. Do not open a check-out.
132132
** --once Don't remember the URI.
133133
** --private Also clone private branches
134
+** --proxy PROXY Use the specified HTTP proxy
134135
** --save-http-password Remember the HTTP password without asking
135136
** -c|--ssh-command SSH Use SSH as the "ssh" command
136137
** --ssl-identity FILENAME Use the SSL identity if requested by the server
137138
** --transport-command CMD Use CMD to move messages to the server and back
138139
** -u|--unversioned Also sync unversioned content
139140
--- src/clone.c
+++ src/clone.c
@@ -129,10 +129,11 @@
129 ** check-out
130 ** --nocompress Omit extra delta compression
131 ** --no-open Clone only. Do not open a check-out.
132 ** --once Don't remember the URI.
133 ** --private Also clone private branches
 
134 ** --save-http-password Remember the HTTP password without asking
135 ** -c|--ssh-command SSH Use SSH as the "ssh" command
136 ** --ssl-identity FILENAME Use the SSL identity if requested by the server
137 ** --transport-command CMD Use CMD to move messages to the server and back
138 ** -u|--unversioned Also sync unversioned content
139
--- src/clone.c
+++ src/clone.c
@@ -129,10 +129,11 @@
129 ** check-out
130 ** --nocompress Omit extra delta compression
131 ** --no-open Clone only. Do not open a check-out.
132 ** --once Don't remember the URI.
133 ** --private Also clone private branches
134 ** --proxy PROXY Use the specified HTTP proxy
135 ** --save-http-password Remember the HTTP password without asking
136 ** -c|--ssh-command SSH Use SSH as the "ssh" command
137 ** --ssl-identity FILENAME Use the SSL identity if requested by the server
138 ** --transport-command CMD Use CMD to move messages to the server and back
139 ** -u|--unversioned Also sync unversioned content
140
+135 -91
--- src/comformat.c
+++ src/comformat.c
@@ -21,18 +21,22 @@
2121
#include "config.h"
2222
#include "comformat.h"
2323
#include <assert.h>
2424
2525
#if INTERFACE
26
-#define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags = non-legacy. */
27
-#define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */
26
+#define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags */
27
+#define COMMENT_PRINT_CANONICAL ((u32)0x00000001) /* Use canonical algorithm */
28
+#define COMMENT_PRINT_DEFAULT COMMENT_PRINT_CANONICAL /* Default */
29
+#define COMMENT_PRINT_UNSET (-1) /* Not initialized */
30
+
31
+/* The canonical comment printing algorithm is recommended. We make
32
+** no promise of on-going support for any of the following flags:
33
+*/
2834
#define COMMENT_PRINT_TRIM_CRLF ((u32)0x00000002) /* Trim leading CR/LF. */
2935
#define COMMENT_PRINT_TRIM_SPACE ((u32)0x00000004) /* Trim leading/trailing. */
3036
#define COMMENT_PRINT_WORD_BREAK ((u32)0x00000008) /* Break lines on words. */
3137
#define COMMENT_PRINT_ORIG_BREAK ((u32)0x00000010) /* Break before original. */
32
-#define COMMENT_PRINT_DEFAULT (COMMENT_PRINT_LEGACY) /* Defaults. */
33
-#define COMMENT_PRINT_UNSET (-1) /* Not initialized. */
3438
#endif
3539
3640
/********* Code copied from SQLite src/shell.c.in on 2024-09-30 **********/
3741
/* Lookup table to estimate the number of columns consumed by a Unicode
3842
** character.
@@ -483,21 +487,29 @@
483487
*pzLine = zLine + index;
484488
}
485489
}
486490
487491
/*
488
-** This is the legacy comment printing algorithm. It is being retained
489
-** for backward compatibility.
492
+** This is the canonical comment printing algorithm. This is the algorithm
493
+** that is recommended and that is used unless the administrator has made
494
+** special arrangements to use a customized algorithm.
490495
**
491496
** Given a comment string, format that string for printing on a TTY.
492
-** Assume that the output cursors is indent spaces from the left margin
497
+** Assume that the output cursor is indent spaces from the left margin
493498
** and that a single line can contain no more than 'width' characters.
494499
** Indent all subsequent lines by 'indent'.
495500
**
501
+** Formatting features:
502
+**
503
+** * Leading whitespace is removed.
504
+** * Internal whitespace sequences are changed into a single space (0x20)
505
+** character.
506
+** * Lines are broken at a space, or at a hyphen ("-") whenever possible.
507
+**
496508
** Returns the number of new lines emitted.
497509
*/
498
-static int comment_print_legacy(
510
+static int comment_print_canonical(
499511
const char *zText, /* The comment text to be printed. */
500512
int indent, /* Number of spaces to indent each non-initial line. */
501513
int width /* Maximum number of characters per line. */
502514
){
503515
int maxChars = width - indent;
@@ -582,13 +594,18 @@
582594
** This is the comment printing function. The comment printing algorithm
583595
** contained within it attempts to preserve the formatting present within
584596
** the comment string itself while honoring line width limitations. There
585597
** are several flags that modify the default behavior of this function:
586598
**
587
-** COMMENT_PRINT_LEGACY: Forces use of the legacy comment printing
588
-** algorithm. For backward compatibility,
589
-** this is the default.
599
+** COMMENT_PRINT_CANONICAL: Use the canonical printing algorithm:
600
+** * Omit leading and trailing whitespace
601
+** * Collapse internal whitespace into a
602
+** single space (0x20) character.
603
+** * Attempt to break lines at whitespace
604
+** or hyphens.
605
+** This is the recommended algorithm and is
606
+** used in most cases.
590607
**
591608
** COMMENT_PRINT_TRIM_CRLF: Trims leading and trailing carriage-returns
592609
** and line-feeds where they do not materially
593610
** impact pre-existing formatting (i.e. at the
594611
** start of the comment string -AND- right
@@ -631,56 +648,61 @@
631648
int indent, /* Spaces to indent each non-initial line. */
632649
int width, /* Maximum number of characters per line. */
633650
int flags /* Zero or more "COMMENT_PRINT_*" flags. */
634651
){
635652
int maxChars = width - indent;
636
- int legacy = flags & COMMENT_PRINT_LEGACY;
637
- int trimCrLf = flags & COMMENT_PRINT_TRIM_CRLF;
638
- int trimSpace = flags & COMMENT_PRINT_TRIM_SPACE;
639
- int wordBreak = flags & COMMENT_PRINT_WORD_BREAK;
640
- int origBreak = flags & COMMENT_PRINT_ORIG_BREAK;
641
- int lineCnt = 0;
642
- const char *zLine;
643
-
644
- if( legacy ){
645
- return comment_print_legacy(zText, indent, width);
646
- }
647
- if( width<0 ){
648
- comment_set_maxchars(indent, &maxChars);
649
- }
650
- if( zText==0 ) zText = "(NULL)";
651
- if( maxChars<=0 ){
652
- maxChars = strlen(zText);
653
- }
654
- if( trimSpace ){
655
- while( fossil_isspace(zText[0]) ){ zText++; }
656
- }
657
- if( zText[0]==0 ){
658
- fossil_print("\n");
659
- lineCnt++;
660
- return lineCnt;
661
- }
662
- zLine = zText;
663
- for(;;){
664
- comment_print_line(zOrigText, zLine, indent, zLine>zText ? indent : 0,
665
- maxChars, trimCrLf, trimSpace, wordBreak, origBreak,
666
- &lineCnt, &zLine);
667
- if( zLine==0 ) break;
668
- while( fossil_isspace(zLine[0]) ) zLine++;
669
- if( zLine[0]==0 ) break;
670
- }
671
- return lineCnt;
653
+
654
+ if( flags & COMMENT_PRINT_CANONICAL ){
655
+ /* Use the canonical algorithm. This is what happens in almost
656
+ ** all cases. */
657
+ return comment_print_canonical(zText, indent, width);
658
+ }else{
659
+ /* The remaining is a more complex formatting algorithm that is very
660
+ ** seldom used and is considered deprecated.
661
+ */
662
+ int trimCrLf = flags & COMMENT_PRINT_TRIM_CRLF;
663
+ int trimSpace = flags & COMMENT_PRINT_TRIM_SPACE;
664
+ int wordBreak = flags & COMMENT_PRINT_WORD_BREAK;
665
+ int origBreak = flags & COMMENT_PRINT_ORIG_BREAK;
666
+ int lineCnt = 0;
667
+ const char *zLine;
668
+
669
+ if( width<0 ){
670
+ comment_set_maxchars(indent, &maxChars);
671
+ }
672
+ if( zText==0 ) zText = "(NULL)";
673
+ if( maxChars<=0 ){
674
+ maxChars = strlen(zText);
675
+ }
676
+ if( trimSpace ){
677
+ while( fossil_isspace(zText[0]) ){ zText++; }
678
+ }
679
+ if( zText[0]==0 ){
680
+ fossil_print("\n");
681
+ lineCnt++;
682
+ return lineCnt;
683
+ }
684
+ zLine = zText;
685
+ for(;;){
686
+ comment_print_line(zOrigText, zLine, indent, zLine>zText ? indent : 0,
687
+ maxChars, trimCrLf, trimSpace, wordBreak, origBreak,
688
+ &lineCnt, &zLine);
689
+ if( zLine==0 ) break;
690
+ while( fossil_isspace(zLine[0]) ) zLine++;
691
+ if( zLine[0]==0 ) break;
692
+ }
693
+ return lineCnt;
694
+ }
672695
}
673696
674697
/*
675698
** Return the "COMMENT_PRINT_*" flags specified by the following sources,
676699
** evaluated in the following cascading order:
677700
**
678
-** 1. The global --comfmtflags (alias --comment-format) command-line option.
679
-** 2. The local (per-repository) "comment-format" setting.
680
-** 3. The global (all-repositories) "comment-format" setting.
681
-** 4. The default value COMMENT_PRINT_DEFAULT.
701
+** 1. The local (per-repository) "comment-format" setting.
702
+** 2. The global (all-repositories) "comment-format" setting.
703
+** 3. The default value COMMENT_PRINT_DEFAULT.
682704
*/
683705
int get_comment_format(){
684706
int comFmtFlags;
685707
686708
/* We must cache this result, else running the timeline can end up
@@ -707,54 +729,70 @@
707729
708730
/*
709731
**
710732
** COMMAND: test-comment-format
711733
**
712
-** Usage: %fossil test-comment-format ?OPTIONS? PREFIX TEXT ?ORIGTEXT?
734
+** Usage: %fossil test-comment-format [OPTIONS] TEXT [PREFIX] [ORIGTEXT]
713735
**
714736
** Test comment formatting and printing. Use for testing only.
715737
**
738
+** The default (canonical) formatting algorithm is:
739
+**
740
+** * Omit leading/trailing whitespace
741
+** * Collapse internal whitespace into a single space character.
742
+** * Attempt to break lines at whitespace or at a hyphen.
743
+**
744
+** Use --whitespace, --origbreak, --trimcrlf, --trimspace,
745
+** and/or --wordbreak to disable the canonical processing and do
746
+** the special processing specified by those other options.
747
+**
716748
** Options:
717
-** --file The comment text is really just a file name to
718
-** read it from
719
-** --decode Decode the text using the same method used when
720
-** handling the value of a C-card from a manifest.
721
-** --legacy Use the legacy comment printing algorithm
722
-** --trimcrlf Enable trimming of leading/trailing CR/LF
723
-** --trimspace Enable trimming of leading/trailing spaces
724
-** --wordbreak Attempt to break lines on word boundaries
725
-** --origbreak Attempt to break when the original comment text
726
-** is detected
727
-** --indent Number of spaces to indent (default (-1) is to
728
-** auto-detect). Zero means no indent.
729
-** -W|--width NUM Width of lines (default (-1) is to auto-detect).
730
-** Zero means no limit.
749
+** --decode Decode the text using the same method used when
750
+** handling the value of a C-card from a manifest.
751
+** --file FILE Omit the TEXT argument and read the comment text
752
+** from FILE.
753
+** --indent Number of spaces to indent (default (-1) is to
754
+** auto-detect). Zero means no indent.
755
+** --orig FILE Take the value for the ORIGTEXT argumetn from FILE.
756
+** --origbreak Attempt to break when the original comment text
757
+** is detected.
758
+** --trimcrlf Enable trimming of leading/trailing CR/LF.
759
+** --trimspace Enable trimming of leading/trailing spaces.
760
+** --whitespace Keep all internal whitespace.
761
+** --wordbreak Attempt to break lines on word boundaries.
762
+** -W|--width NUM Width of lines (default (-1) is to auto-detect).
763
+** Zero means no limit.
731764
*/
732765
void test_comment_format(void){
733766
const char *zWidth;
734767
const char *zIndent;
735
- const char *zPrefix;
736
- char *zText;
737
- char *zOrigText;
768
+ const char *zPrefix = 0;
769
+ char *zText = 0;
770
+ char *zOrigText = 0;
738771
int indent, width;
739
- int fromFile = find_option("file", 0, 0)!=0;
772
+ int i;
773
+ const char *fromFile = find_option("file", 0, 1);
740774
int decode = find_option("decode", 0, 0)!=0;
741
- int flags = COMMENT_PRINT_NONE;
742
- if( find_option("legacy", 0, 0) ){
743
- flags |= COMMENT_PRINT_LEGACY;
775
+ int flags = COMMENT_PRINT_CANONICAL;
776
+ const char *fromOrig = find_option("orig", 0, 1);
777
+ if( find_option("whitespace",0,0) ){
778
+ flags = 0;
744779
}
745780
if( find_option("trimcrlf", 0, 0) ){
746
- flags |= COMMENT_PRINT_TRIM_CRLF;
781
+ flags = COMMENT_PRINT_TRIM_CRLF;
747782
}
748783
if( find_option("trimspace", 0, 0) ){
749784
flags |= COMMENT_PRINT_TRIM_SPACE;
785
+ flags &= COMMENT_PRINT_CANONICAL;
750786
}
751787
if( find_option("wordbreak", 0, 0) ){
752788
flags |= COMMENT_PRINT_WORD_BREAK;
789
+ flags &= COMMENT_PRINT_CANONICAL;
753790
}
754791
if( find_option("origbreak", 0, 0) ){
755792
flags |= COMMENT_PRINT_ORIG_BREAK;
793
+ flags &= COMMENT_PRINT_CANONICAL;
756794
}
757795
zWidth = find_option("width","W",1);
758796
if( zWidth ){
759797
width = atoi(zWidth);
760798
}else{
@@ -765,45 +803,51 @@
765803
indent = atoi(zIndent);
766804
}else{
767805
indent = -1; /* automatic */
768806
}
769807
verify_all_options();
770
- if( g.argc!=4 && g.argc!=5 ){
771
- usage("?OPTIONS? PREFIX TEXT ?ORIGTEXT?");
772
- }
773
- zPrefix = g.argv[2];
774
- zText = g.argv[3];
775
- if( g.argc==5 ){
776
- zOrigText = g.argv[4];
777
- }else{
778
- zOrigText = 0;
779
- }
808
+ zPrefix = zText = zOrigText = 0;
780809
if( fromFile ){
781810
Blob fileData;
782
- blob_read_from_file(&fileData, zText, ExtFILE);
811
+ blob_read_from_file(&fileData, fromFile, ExtFILE);
783812
zText = mprintf("%s", blob_str(&fileData));
784813
blob_reset(&fileData);
785
- if( zOrigText ){
786
- blob_read_from_file(&fileData, zOrigText, ExtFILE);
787
- zOrigText = mprintf("%s", blob_str(&fileData));
788
- blob_reset(&fileData);
814
+ }
815
+ if( fromOrig ){
816
+ Blob fileData;
817
+ blob_read_from_file(&fileData, fromOrig, ExtFILE);
818
+ zOrigText = mprintf("%s", blob_str(&fileData));
819
+ blob_reset(&fileData);
820
+ }
821
+ for(i=2; i<g.argc; i++){
822
+ if( zText==0 ){
823
+ zText = g.argv[i];
824
+ continue;
825
+ }
826
+ if( zPrefix==0 ){
827
+ zPrefix = g.argv[i];
828
+ continue;
829
+ }
830
+ if( zOrigText==0 ){
831
+ zOrigText = g.argv[i];
832
+ continue;
789833
}
834
+ usage("[OPTIONS] TEXT [PREFIX] [ORIGTEXT]");
790835
}
791836
if( decode ){
792837
zText = mprintf(fromFile?"%z":"%s" /*works-like:"%s"*/, zText);
793838
defossilize(zText);
794839
if( zOrigText ){
795840
zOrigText = mprintf(fromFile?"%z":"%s" /*works-like:"%s"*/, zOrigText);
796841
defossilize(zOrigText);
797842
}
798843
}
844
+ if( zPrefix==0 ) zPrefix = "00:00:00 ";
799845
if( indent<0 ){
800846
indent = strlen(zPrefix);
801847
}
802848
if( zPrefix && *zPrefix ){
803849
fossil_print("%s", zPrefix);
804850
}
805851
fossil_print("(%d lines output)\n",
806852
comment_print(zText, zOrigText, indent, width, flags));
807
- if( zOrigText && zOrigText!=g.argv[4] ) fossil_free(zOrigText);
808
- if( zText && zText!=g.argv[3] ) fossil_free(zText);
809853
}
810854
--- src/comformat.c
+++ src/comformat.c
@@ -21,18 +21,22 @@
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
24
25 #if INTERFACE
26 #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags = non-legacy. */
27 #define COMMENT_PRINT_LEGACY ((u32)0x00000001) /* Use legacy algorithm. */
 
 
 
 
 
 
28 #define COMMENT_PRINT_TRIM_CRLF ((u32)0x00000002) /* Trim leading CR/LF. */
29 #define COMMENT_PRINT_TRIM_SPACE ((u32)0x00000004) /* Trim leading/trailing. */
30 #define COMMENT_PRINT_WORD_BREAK ((u32)0x00000008) /* Break lines on words. */
31 #define COMMENT_PRINT_ORIG_BREAK ((u32)0x00000010) /* Break before original. */
32 #define COMMENT_PRINT_DEFAULT (COMMENT_PRINT_LEGACY) /* Defaults. */
33 #define COMMENT_PRINT_UNSET (-1) /* Not initialized. */
34 #endif
35
36 /********* Code copied from SQLite src/shell.c.in on 2024-09-30 **********/
37 /* Lookup table to estimate the number of columns consumed by a Unicode
38 ** character.
@@ -483,21 +487,29 @@
483 *pzLine = zLine + index;
484 }
485 }
486
487 /*
488 ** This is the legacy comment printing algorithm. It is being retained
489 ** for backward compatibility.
 
490 **
491 ** Given a comment string, format that string for printing on a TTY.
492 ** Assume that the output cursors is indent spaces from the left margin
493 ** and that a single line can contain no more than 'width' characters.
494 ** Indent all subsequent lines by 'indent'.
495 **
 
 
 
 
 
 
 
496 ** Returns the number of new lines emitted.
497 */
498 static int comment_print_legacy(
499 const char *zText, /* The comment text to be printed. */
500 int indent, /* Number of spaces to indent each non-initial line. */
501 int width /* Maximum number of characters per line. */
502 ){
503 int maxChars = width - indent;
@@ -582,13 +594,18 @@
582 ** This is the comment printing function. The comment printing algorithm
583 ** contained within it attempts to preserve the formatting present within
584 ** the comment string itself while honoring line width limitations. There
585 ** are several flags that modify the default behavior of this function:
586 **
587 ** COMMENT_PRINT_LEGACY: Forces use of the legacy comment printing
588 ** algorithm. For backward compatibility,
589 ** this is the default.
 
 
 
 
 
590 **
591 ** COMMENT_PRINT_TRIM_CRLF: Trims leading and trailing carriage-returns
592 ** and line-feeds where they do not materially
593 ** impact pre-existing formatting (i.e. at the
594 ** start of the comment string -AND- right
@@ -631,56 +648,61 @@
631 int indent, /* Spaces to indent each non-initial line. */
632 int width, /* Maximum number of characters per line. */
633 int flags /* Zero or more "COMMENT_PRINT_*" flags. */
634 ){
635 int maxChars = width - indent;
636 int legacy = flags & COMMENT_PRINT_LEGACY;
637 int trimCrLf = flags & COMMENT_PRINT_TRIM_CRLF;
638 int trimSpace = flags & COMMENT_PRINT_TRIM_SPACE;
639 int wordBreak = flags & COMMENT_PRINT_WORD_BREAK;
640 int origBreak = flags & COMMENT_PRINT_ORIG_BREAK;
641 int lineCnt = 0;
642 const char *zLine;
643
644 if( legacy ){
645 return comment_print_legacy(zText, indent, width);
646 }
647 if( width<0 ){
648 comment_set_maxchars(indent, &maxChars);
649 }
650 if( zText==0 ) zText = "(NULL)";
651 if( maxChars<=0 ){
652 maxChars = strlen(zText);
653 }
654 if( trimSpace ){
655 while( fossil_isspace(zText[0]) ){ zText++; }
656 }
657 if( zText[0]==0 ){
658 fossil_print("\n");
659 lineCnt++;
660 return lineCnt;
661 }
662 zLine = zText;
663 for(;;){
664 comment_print_line(zOrigText, zLine, indent, zLine>zText ? indent : 0,
665 maxChars, trimCrLf, trimSpace, wordBreak, origBreak,
666 &lineCnt, &zLine);
667 if( zLine==0 ) break;
668 while( fossil_isspace(zLine[0]) ) zLine++;
669 if( zLine[0]==0 ) break;
670 }
671 return lineCnt;
 
 
 
 
 
 
672 }
673
674 /*
675 ** Return the "COMMENT_PRINT_*" flags specified by the following sources,
676 ** evaluated in the following cascading order:
677 **
678 ** 1. The global --comfmtflags (alias --comment-format) command-line option.
679 ** 2. The local (per-repository) "comment-format" setting.
680 ** 3. The global (all-repositories) "comment-format" setting.
681 ** 4. The default value COMMENT_PRINT_DEFAULT.
682 */
683 int get_comment_format(){
684 int comFmtFlags;
685
686 /* We must cache this result, else running the timeline can end up
@@ -707,54 +729,70 @@
707
708 /*
709 **
710 ** COMMAND: test-comment-format
711 **
712 ** Usage: %fossil test-comment-format ?OPTIONS? PREFIX TEXT ?ORIGTEXT?
713 **
714 ** Test comment formatting and printing. Use for testing only.
715 **
 
 
 
 
 
 
 
 
 
 
716 ** Options:
717 ** --file The comment text is really just a file name to
718 ** read it from
719 ** --decode Decode the text using the same method used when
720 ** handling the value of a C-card from a manifest.
721 ** --legacy Use the legacy comment printing algorithm
722 ** --trimcrlf Enable trimming of leading/trailing CR/LF
723 ** --trimspace Enable trimming of leading/trailing spaces
724 ** --wordbreak Attempt to break lines on word boundaries
725 ** --origbreak Attempt to break when the original comment text
726 ** is detected
727 ** --indent Number of spaces to indent (default (-1) is to
728 ** auto-detect). Zero means no indent.
729 ** -W|--width NUM Width of lines (default (-1) is to auto-detect).
730 ** Zero means no limit.
 
731 */
732 void test_comment_format(void){
733 const char *zWidth;
734 const char *zIndent;
735 const char *zPrefix;
736 char *zText;
737 char *zOrigText;
738 int indent, width;
739 int fromFile = find_option("file", 0, 0)!=0;
 
740 int decode = find_option("decode", 0, 0)!=0;
741 int flags = COMMENT_PRINT_NONE;
742 if( find_option("legacy", 0, 0) ){
743 flags |= COMMENT_PRINT_LEGACY;
 
744 }
745 if( find_option("trimcrlf", 0, 0) ){
746 flags |= COMMENT_PRINT_TRIM_CRLF;
747 }
748 if( find_option("trimspace", 0, 0) ){
749 flags |= COMMENT_PRINT_TRIM_SPACE;
 
750 }
751 if( find_option("wordbreak", 0, 0) ){
752 flags |= COMMENT_PRINT_WORD_BREAK;
 
753 }
754 if( find_option("origbreak", 0, 0) ){
755 flags |= COMMENT_PRINT_ORIG_BREAK;
 
756 }
757 zWidth = find_option("width","W",1);
758 if( zWidth ){
759 width = atoi(zWidth);
760 }else{
@@ -765,45 +803,51 @@
765 indent = atoi(zIndent);
766 }else{
767 indent = -1; /* automatic */
768 }
769 verify_all_options();
770 if( g.argc!=4 && g.argc!=5 ){
771 usage("?OPTIONS? PREFIX TEXT ?ORIGTEXT?");
772 }
773 zPrefix = g.argv[2];
774 zText = g.argv[3];
775 if( g.argc==5 ){
776 zOrigText = g.argv[4];
777 }else{
778 zOrigText = 0;
779 }
780 if( fromFile ){
781 Blob fileData;
782 blob_read_from_file(&fileData, zText, ExtFILE);
783 zText = mprintf("%s", blob_str(&fileData));
784 blob_reset(&fileData);
785 if( zOrigText ){
786 blob_read_from_file(&fileData, zOrigText, ExtFILE);
787 zOrigText = mprintf("%s", blob_str(&fileData));
788 blob_reset(&fileData);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
789 }
 
790 }
791 if( decode ){
792 zText = mprintf(fromFile?"%z":"%s" /*works-like:"%s"*/, zText);
793 defossilize(zText);
794 if( zOrigText ){
795 zOrigText = mprintf(fromFile?"%z":"%s" /*works-like:"%s"*/, zOrigText);
796 defossilize(zOrigText);
797 }
798 }
 
799 if( indent<0 ){
800 indent = strlen(zPrefix);
801 }
802 if( zPrefix && *zPrefix ){
803 fossil_print("%s", zPrefix);
804 }
805 fossil_print("(%d lines output)\n",
806 comment_print(zText, zOrigText, indent, width, flags));
807 if( zOrigText && zOrigText!=g.argv[4] ) fossil_free(zOrigText);
808 if( zText && zText!=g.argv[3] ) fossil_free(zText);
809 }
810
--- src/comformat.c
+++ src/comformat.c
@@ -21,18 +21,22 @@
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
24
25 #if INTERFACE
26 #define COMMENT_PRINT_NONE ((u32)0x00000000) /* No flags */
27 #define COMMENT_PRINT_CANONICAL ((u32)0x00000001) /* Use canonical algorithm */
28 #define COMMENT_PRINT_DEFAULT COMMENT_PRINT_CANONICAL /* Default */
29 #define COMMENT_PRINT_UNSET (-1) /* Not initialized */
30
31 /* The canonical comment printing algorithm is recommended. We make
32 ** no promise of on-going support for any of the following flags:
33 */
34 #define COMMENT_PRINT_TRIM_CRLF ((u32)0x00000002) /* Trim leading CR/LF. */
35 #define COMMENT_PRINT_TRIM_SPACE ((u32)0x00000004) /* Trim leading/trailing. */
36 #define COMMENT_PRINT_WORD_BREAK ((u32)0x00000008) /* Break lines on words. */
37 #define COMMENT_PRINT_ORIG_BREAK ((u32)0x00000010) /* Break before original. */
 
 
38 #endif
39
40 /********* Code copied from SQLite src/shell.c.in on 2024-09-30 **********/
41 /* Lookup table to estimate the number of columns consumed by a Unicode
42 ** character.
@@ -483,21 +487,29 @@
487 *pzLine = zLine + index;
488 }
489 }
490
491 /*
492 ** This is the canonical comment printing algorithm. This is the algorithm
493 ** that is recommended and that is used unless the administrator has made
494 ** special arrangements to use a customized algorithm.
495 **
496 ** Given a comment string, format that string for printing on a TTY.
497 ** Assume that the output cursor is indent spaces from the left margin
498 ** and that a single line can contain no more than 'width' characters.
499 ** Indent all subsequent lines by 'indent'.
500 **
501 ** Formatting features:
502 **
503 ** * Leading whitespace is removed.
504 ** * Internal whitespace sequences are changed into a single space (0x20)
505 ** character.
506 ** * Lines are broken at a space, or at a hyphen ("-") whenever possible.
507 **
508 ** Returns the number of new lines emitted.
509 */
510 static int comment_print_canonical(
511 const char *zText, /* The comment text to be printed. */
512 int indent, /* Number of spaces to indent each non-initial line. */
513 int width /* Maximum number of characters per line. */
514 ){
515 int maxChars = width - indent;
@@ -582,13 +594,18 @@
594 ** This is the comment printing function. The comment printing algorithm
595 ** contained within it attempts to preserve the formatting present within
596 ** the comment string itself while honoring line width limitations. There
597 ** are several flags that modify the default behavior of this function:
598 **
599 ** COMMENT_PRINT_CANONICAL: Use the canonical printing algorithm:
600 ** * Omit leading and trailing whitespace
601 ** * Collapse internal whitespace into a
602 ** single space (0x20) character.
603 ** * Attempt to break lines at whitespace
604 ** or hyphens.
605 ** This is the recommended algorithm and is
606 ** used in most cases.
607 **
608 ** COMMENT_PRINT_TRIM_CRLF: Trims leading and trailing carriage-returns
609 ** and line-feeds where they do not materially
610 ** impact pre-existing formatting (i.e. at the
611 ** start of the comment string -AND- right
@@ -631,56 +648,61 @@
648 int indent, /* Spaces to indent each non-initial line. */
649 int width, /* Maximum number of characters per line. */
650 int flags /* Zero or more "COMMENT_PRINT_*" flags. */
651 ){
652 int maxChars = width - indent;
653
654 if( flags & COMMENT_PRINT_CANONICAL ){
655 /* Use the canonical algorithm. This is what happens in almost
656 ** all cases. */
657 return comment_print_canonical(zText, indent, width);
658 }else{
659 /* The remaining is a more complex formatting algorithm that is very
660 ** seldom used and is considered deprecated.
661 */
662 int trimCrLf = flags & COMMENT_PRINT_TRIM_CRLF;
663 int trimSpace = flags & COMMENT_PRINT_TRIM_SPACE;
664 int wordBreak = flags & COMMENT_PRINT_WORD_BREAK;
665 int origBreak = flags & COMMENT_PRINT_ORIG_BREAK;
666 int lineCnt = 0;
667 const char *zLine;
668
669 if( width<0 ){
670 comment_set_maxchars(indent, &maxChars);
671 }
672 if( zText==0 ) zText = "(NULL)";
673 if( maxChars<=0 ){
674 maxChars = strlen(zText);
675 }
676 if( trimSpace ){
677 while( fossil_isspace(zText[0]) ){ zText++; }
678 }
679 if( zText[0]==0 ){
680 fossil_print("\n");
681 lineCnt++;
682 return lineCnt;
683 }
684 zLine = zText;
685 for(;;){
686 comment_print_line(zOrigText, zLine, indent, zLine>zText ? indent : 0,
687 maxChars, trimCrLf, trimSpace, wordBreak, origBreak,
688 &lineCnt, &zLine);
689 if( zLine==0 ) break;
690 while( fossil_isspace(zLine[0]) ) zLine++;
691 if( zLine[0]==0 ) break;
692 }
693 return lineCnt;
694 }
695 }
696
697 /*
698 ** Return the "COMMENT_PRINT_*" flags specified by the following sources,
699 ** evaluated in the following cascading order:
700 **
701 ** 1. The local (per-repository) "comment-format" setting.
702 ** 2. The global (all-repositories) "comment-format" setting.
703 ** 3. The default value COMMENT_PRINT_DEFAULT.
 
704 */
705 int get_comment_format(){
706 int comFmtFlags;
707
708 /* We must cache this result, else running the timeline can end up
@@ -707,54 +729,70 @@
729
730 /*
731 **
732 ** COMMAND: test-comment-format
733 **
734 ** Usage: %fossil test-comment-format [OPTIONS] TEXT [PREFIX] [ORIGTEXT]
735 **
736 ** Test comment formatting and printing. Use for testing only.
737 **
738 ** The default (canonical) formatting algorithm is:
739 **
740 ** * Omit leading/trailing whitespace
741 ** * Collapse internal whitespace into a single space character.
742 ** * Attempt to break lines at whitespace or at a hyphen.
743 **
744 ** Use --whitespace, --origbreak, --trimcrlf, --trimspace,
745 ** and/or --wordbreak to disable the canonical processing and do
746 ** the special processing specified by those other options.
747 **
748 ** Options:
749 ** --decode Decode the text using the same method used when
750 ** handling the value of a C-card from a manifest.
751 ** --file FILE Omit the TEXT argument and read the comment text
752 ** from FILE.
753 ** --indent Number of spaces to indent (default (-1) is to
754 ** auto-detect). Zero means no indent.
755 ** --orig FILE Take the value for the ORIGTEXT argumetn from FILE.
756 ** --origbreak Attempt to break when the original comment text
757 ** is detected.
758 ** --trimcrlf Enable trimming of leading/trailing CR/LF.
759 ** --trimspace Enable trimming of leading/trailing spaces.
760 ** --whitespace Keep all internal whitespace.
761 ** --wordbreak Attempt to break lines on word boundaries.
762 ** -W|--width NUM Width of lines (default (-1) is to auto-detect).
763 ** Zero means no limit.
764 */
765 void test_comment_format(void){
766 const char *zWidth;
767 const char *zIndent;
768 const char *zPrefix = 0;
769 char *zText = 0;
770 char *zOrigText = 0;
771 int indent, width;
772 int i;
773 const char *fromFile = find_option("file", 0, 1);
774 int decode = find_option("decode", 0, 0)!=0;
775 int flags = COMMENT_PRINT_CANONICAL;
776 const char *fromOrig = find_option("orig", 0, 1);
777 if( find_option("whitespace",0,0) ){
778 flags = 0;
779 }
780 if( find_option("trimcrlf", 0, 0) ){
781 flags = COMMENT_PRINT_TRIM_CRLF;
782 }
783 if( find_option("trimspace", 0, 0) ){
784 flags |= COMMENT_PRINT_TRIM_SPACE;
785 flags &= COMMENT_PRINT_CANONICAL;
786 }
787 if( find_option("wordbreak", 0, 0) ){
788 flags |= COMMENT_PRINT_WORD_BREAK;
789 flags &= COMMENT_PRINT_CANONICAL;
790 }
791 if( find_option("origbreak", 0, 0) ){
792 flags |= COMMENT_PRINT_ORIG_BREAK;
793 flags &= COMMENT_PRINT_CANONICAL;
794 }
795 zWidth = find_option("width","W",1);
796 if( zWidth ){
797 width = atoi(zWidth);
798 }else{
@@ -765,45 +803,51 @@
803 indent = atoi(zIndent);
804 }else{
805 indent = -1; /* automatic */
806 }
807 verify_all_options();
808 zPrefix = zText = zOrigText = 0;
 
 
 
 
 
 
 
 
 
809 if( fromFile ){
810 Blob fileData;
811 blob_read_from_file(&fileData, fromFile, ExtFILE);
812 zText = mprintf("%s", blob_str(&fileData));
813 blob_reset(&fileData);
814 }
815 if( fromOrig ){
816 Blob fileData;
817 blob_read_from_file(&fileData, fromOrig, ExtFILE);
818 zOrigText = mprintf("%s", blob_str(&fileData));
819 blob_reset(&fileData);
820 }
821 for(i=2; i<g.argc; i++){
822 if( zText==0 ){
823 zText = g.argv[i];
824 continue;
825 }
826 if( zPrefix==0 ){
827 zPrefix = g.argv[i];
828 continue;
829 }
830 if( zOrigText==0 ){
831 zOrigText = g.argv[i];
832 continue;
833 }
834 usage("[OPTIONS] TEXT [PREFIX] [ORIGTEXT]");
835 }
836 if( decode ){
837 zText = mprintf(fromFile?"%z":"%s" /*works-like:"%s"*/, zText);
838 defossilize(zText);
839 if( zOrigText ){
840 zOrigText = mprintf(fromFile?"%z":"%s" /*works-like:"%s"*/, zOrigText);
841 defossilize(zOrigText);
842 }
843 }
844 if( zPrefix==0 ) zPrefix = "00:00:00 ";
845 if( indent<0 ){
846 indent = strlen(zPrefix);
847 }
848 if( zPrefix && *zPrefix ){
849 fossil_print("%s", zPrefix);
850 }
851 fossil_print("(%d lines output)\n",
852 comment_print(zText, zOrigText, indent, width, flags));
 
 
853 }
854
--- src/configure.c
+++ src/configure.c
@@ -817,10 +817,12 @@
817817
**
818818
** Synchronize configuration changes in the local repository with
819819
** the remote repository at URL.
820820
**
821821
** Options:
822
+** --proxy PROXY Use PROXY as http proxy during sync operation
823
+** (used by pull, push and sync subcommands)
822824
** -R|--repository REPO Affect repository REPO with changes
823825
**
824826
** See also: [[settings]], [[unset]]
825827
*/
826828
void configuration_cmd(void){
827829
--- src/configure.c
+++ src/configure.c
@@ -817,10 +817,12 @@
817 **
818 ** Synchronize configuration changes in the local repository with
819 ** the remote repository at URL.
820 **
821 ** Options:
 
 
822 ** -R|--repository REPO Affect repository REPO with changes
823 **
824 ** See also: [[settings]], [[unset]]
825 */
826 void configuration_cmd(void){
827
--- src/configure.c
+++ src/configure.c
@@ -817,10 +817,12 @@
817 **
818 ** Synchronize configuration changes in the local repository with
819 ** the remote repository at URL.
820 **
821 ** Options:
822 ** --proxy PROXY Use PROXY as http proxy during sync operation
823 ** (used by pull, push and sync subcommands)
824 ** -R|--repository REPO Affect repository REPO with changes
825 **
826 ** See also: [[settings]], [[unset]]
827 */
828 void configuration_cmd(void){
829
+9 -11
--- src/db.c
+++ src/db.c
@@ -4181,10 +4181,11 @@
41814181
** --force-missing Force opening a repository with missing content
41824182
** -k|--keep Only modify the manifest file(s)
41834183
** --nested Allow opening a repository inside an opened check-out
41844184
** --nosync Do not auto-sync the repository prior to opening even
41854185
** if the autosync setting is on.
4186
+** --proxy PROXY Use PROXY as http proxy during sync operation
41864187
** --repodir DIR If REPOSITORY is a URI that will be cloned, store
41874188
** the clone in DIR rather than in "."
41884189
** --setmtime Set timestamps of all files to match their SCM-side
41894190
** times (the timestamp of the last check-in which modified
41904191
** them).
@@ -4640,30 +4641,27 @@
46404641
** When enabled, fossil will attempt to sign all commits
46414642
** with gpg or ssh. When disabled, commits will be unsigned.
46424643
*/
46434644
/*
46444645
** SETTING: comment-format width=16 default=1
4645
-** Set the default options for printing timeline comments to the console.
4646
-**
4647
-** The global --comfmtflags command-line option (or alias --comment-format)
4648
-** overrides this setting.
4646
+** Set the algorithm for printing timeline comments to the console.
46494647
**
46504648
** Possible values are:
4651
-** 1 Activate the legacy comment printing format (default).
4649
+** 1 Use the original comment printing algorithm:
4650
+** * Leading and trialing whitespace is removed
4651
+** * Internal whitespace is converted into a single space (0x20)
4652
+** * Line breaks occurs at whitespace or hyphens if possible
4653
+** This is the recommended value and the default.
46524654
**
46534655
** Or a bitwise combination of the following flags:
4654
-** 0 Activate the newer (non-legacy) comment printing format.
46554656
** 2 Trim leading and trailing CR and LF characters.
46564657
** 4 Trim leading and trailing white space characters.
46574658
** 8 Attempt to break lines on word boundaries.
46584659
** 16 Break lines before the original comment embedded in other text.
46594660
**
4660
-** Note: To preserve line breaks, activate the newer (non-legacy) comment
4661
-** printing format (i.e. set to "0", or a combination not including "1").
4662
-**
4663
-** Note: The options for timeline comments displayed on the web UI can be
4664
-** configured through the /setup_timeline web page.
4661
+** Note: To preserve line breaks and/or other whitespace within comment text,
4662
+** make this setting some integer value that omits the "1" bit.
46654663
*/
46664664
/*
46674665
** SETTING: crlf-glob width=40 versionable block-text
46684666
** The VALUE of this setting is a list of GLOB patterns matching files
46694667
** in which it is allowed to have CR, CR+LF or mixed line endings,
46704668
--- src/db.c
+++ src/db.c
@@ -4181,10 +4181,11 @@
4181 ** --force-missing Force opening a repository with missing content
4182 ** -k|--keep Only modify the manifest file(s)
4183 ** --nested Allow opening a repository inside an opened check-out
4184 ** --nosync Do not auto-sync the repository prior to opening even
4185 ** if the autosync setting is on.
 
4186 ** --repodir DIR If REPOSITORY is a URI that will be cloned, store
4187 ** the clone in DIR rather than in "."
4188 ** --setmtime Set timestamps of all files to match their SCM-side
4189 ** times (the timestamp of the last check-in which modified
4190 ** them).
@@ -4640,30 +4641,27 @@
4640 ** When enabled, fossil will attempt to sign all commits
4641 ** with gpg or ssh. When disabled, commits will be unsigned.
4642 */
4643 /*
4644 ** SETTING: comment-format width=16 default=1
4645 ** Set the default options for printing timeline comments to the console.
4646 **
4647 ** The global --comfmtflags command-line option (or alias --comment-format)
4648 ** overrides this setting.
4649 **
4650 ** Possible values are:
4651 ** 1 Activate the legacy comment printing format (default).
 
 
 
 
4652 **
4653 ** Or a bitwise combination of the following flags:
4654 ** 0 Activate the newer (non-legacy) comment printing format.
4655 ** 2 Trim leading and trailing CR and LF characters.
4656 ** 4 Trim leading and trailing white space characters.
4657 ** 8 Attempt to break lines on word boundaries.
4658 ** 16 Break lines before the original comment embedded in other text.
4659 **
4660 ** Note: To preserve line breaks, activate the newer (non-legacy) comment
4661 ** printing format (i.e. set to "0", or a combination not including "1").
4662 **
4663 ** Note: The options for timeline comments displayed on the web UI can be
4664 ** configured through the /setup_timeline web page.
4665 */
4666 /*
4667 ** SETTING: crlf-glob width=40 versionable block-text
4668 ** The VALUE of this setting is a list of GLOB patterns matching files
4669 ** in which it is allowed to have CR, CR+LF or mixed line endings,
4670
--- src/db.c
+++ src/db.c
@@ -4181,10 +4181,11 @@
4181 ** --force-missing Force opening a repository with missing content
4182 ** -k|--keep Only modify the manifest file(s)
4183 ** --nested Allow opening a repository inside an opened check-out
4184 ** --nosync Do not auto-sync the repository prior to opening even
4185 ** if the autosync setting is on.
4186 ** --proxy PROXY Use PROXY as http proxy during sync operation
4187 ** --repodir DIR If REPOSITORY is a URI that will be cloned, store
4188 ** the clone in DIR rather than in "."
4189 ** --setmtime Set timestamps of all files to match their SCM-side
4190 ** times (the timestamp of the last check-in which modified
4191 ** them).
@@ -4640,30 +4641,27 @@
4641 ** When enabled, fossil will attempt to sign all commits
4642 ** with gpg or ssh. When disabled, commits will be unsigned.
4643 */
4644 /*
4645 ** SETTING: comment-format width=16 default=1
4646 ** Set the algorithm for printing timeline comments to the console.
 
 
 
4647 **
4648 ** Possible values are:
4649 ** 1 Use the original comment printing algorithm:
4650 ** * Leading and trialing whitespace is removed
4651 ** * Internal whitespace is converted into a single space (0x20)
4652 ** * Line breaks occurs at whitespace or hyphens if possible
4653 ** This is the recommended value and the default.
4654 **
4655 ** Or a bitwise combination of the following flags:
 
4656 ** 2 Trim leading and trailing CR and LF characters.
4657 ** 4 Trim leading and trailing white space characters.
4658 ** 8 Attempt to break lines on word boundaries.
4659 ** 16 Break lines before the original comment embedded in other text.
4660 **
4661 ** Note: To preserve line breaks and/or other whitespace within comment text,
4662 ** make this setting some integer value that omits the "1" bit.
 
 
 
4663 */
4664 /*
4665 ** SETTING: crlf-glob width=40 versionable block-text
4666 ** The VALUE of this setting is a list of GLOB patterns matching files
4667 ** in which it is allowed to have CR, CR+LF or mixed line endings,
4668
--- src/descendants.c
+++ src/descendants.c
@@ -156,10 +156,27 @@
156156
" AND tagxref.tagtype>0)",
157157
TAG_CLOSED
158158
);
159159
}
160160
}
161
+
162
+/*
163
+** If RID refers to a check-in, return the mtime of that check-in - the
164
+** julian day number of when the check-in occurred.
165
+*/
166
+double mtime_of_rid(int rid, double mtime){
167
+ static Stmt q;
168
+ db_static_prepare(&q,"SELECT mtime FROM event WHERE objid=:rid");
169
+ db_bind_int(&q, ":rid", rid);
170
+ if( db_step(&q)==SQLITE_ROW ){
171
+ mtime = db_column_double(&q,0);
172
+ }
173
+ db_reset(&q);
174
+ return mtime;
175
+}
176
+
177
+
161178
162179
/*
163180
** Load the record ID rid and up to |N|-1 closest ancestors into
164181
** the "ok" table. If N is zero, no limit. If ridBackTo is not zero
165182
** then stop the search upon reaching the ancestor with rid==ridBackTo.
@@ -197,13 +214,11 @@
197214
** (3) Cherrypick merge parents.
198215
** (4) All ancestores of 1 and 2 but not of 3.
199216
*/
200217
double rLimitMtime = 0.0;
201218
if( ridBackTo ){
202
- rLimitMtime = db_double(0.0,
203
- "SELECT mtime FROM event WHERE objid=%d",
204
- ridBackTo);
219
+ rLimitMtime = mtime_of_rid(ridBackTo, 0.0);
205220
}
206221
db_multi_exec(
207222
"WITH RECURSIVE\n"
208223
" parent(pid,cid,isCP) AS (\n"
209224
" SELECT plink.pid, plink.cid, 0 AS xisCP FROM plink\n"
210225
--- src/descendants.c
+++ src/descendants.c
@@ -156,10 +156,27 @@
156 " AND tagxref.tagtype>0)",
157 TAG_CLOSED
158 );
159 }
160 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
162 /*
163 ** Load the record ID rid and up to |N|-1 closest ancestors into
164 ** the "ok" table. If N is zero, no limit. If ridBackTo is not zero
165 ** then stop the search upon reaching the ancestor with rid==ridBackTo.
@@ -197,13 +214,11 @@
197 ** (3) Cherrypick merge parents.
198 ** (4) All ancestores of 1 and 2 but not of 3.
199 */
200 double rLimitMtime = 0.0;
201 if( ridBackTo ){
202 rLimitMtime = db_double(0.0,
203 "SELECT mtime FROM event WHERE objid=%d",
204 ridBackTo);
205 }
206 db_multi_exec(
207 "WITH RECURSIVE\n"
208 " parent(pid,cid,isCP) AS (\n"
209 " SELECT plink.pid, plink.cid, 0 AS xisCP FROM plink\n"
210
--- src/descendants.c
+++ src/descendants.c
@@ -156,10 +156,27 @@
156 " AND tagxref.tagtype>0)",
157 TAG_CLOSED
158 );
159 }
160 }
161
162 /*
163 ** If RID refers to a check-in, return the mtime of that check-in - the
164 ** julian day number of when the check-in occurred.
165 */
166 double mtime_of_rid(int rid, double mtime){
167 static Stmt q;
168 db_static_prepare(&q,"SELECT mtime FROM event WHERE objid=:rid");
169 db_bind_int(&q, ":rid", rid);
170 if( db_step(&q)==SQLITE_ROW ){
171 mtime = db_column_double(&q,0);
172 }
173 db_reset(&q);
174 return mtime;
175 }
176
177
178
179 /*
180 ** Load the record ID rid and up to |N|-1 closest ancestors into
181 ** the "ok" table. If N is zero, no limit. If ridBackTo is not zero
182 ** then stop the search upon reaching the ancestor with rid==ridBackTo.
@@ -197,13 +214,11 @@
214 ** (3) Cherrypick merge parents.
215 ** (4) All ancestores of 1 and 2 but not of 3.
216 */
217 double rLimitMtime = 0.0;
218 if( ridBackTo ){
219 rLimitMtime = mtime_of_rid(ridBackTo, 0.0);
 
 
220 }
221 db_multi_exec(
222 "WITH RECURSIVE\n"
223 " parent(pid,cid,isCP) AS (\n"
224 " SELECT plink.pid, plink.cid, 0 AS xisCP FROM plink\n"
225
+14 -11
--- src/dispatch.c
+++ src/dispatch.c
@@ -838,30 +838,35 @@
838838
if( zCmd && *zCmd ){
839839
int rc;
840840
const CmdOrPage *pCmd = 0;
841841
842842
style_set_current_feature("tkt");
843
- style_header("Help: %s", zCmd);
844
-
845
- style_submenu_element("Command-List", "%R/help");
843
+ style_submenu_element("Topic-List", "%R/help");
846844
if( search_restrict(SRCH_HELP)!=0 ){
847845
style_submenu_element("Search","%R/search?y=h");
848846
}
849847
rc = dispatch_name_search(zCmd, CMDFLAG_ANY|CMDFLAG_PREFIX, &pCmd);
850
- if( *zCmd=='/' ){
848
+ if( pCmd ){
849
+ style_header("Help: %s", pCmd->zName);
850
+ }else{
851
+ style_header("Help");
852
+ }
853
+ if( pCmd==0 ){
854
+ /* No <h1> line in this case */
855
+ }else if( *zCmd=='/' ){
851856
/* Some of the webpages require query parameters in order to work.
852857
** @ <h1>The "<a href='%R%s(zCmd)'>%s(zCmd)</a>" page:</h1> */
853
- @ <h1>The "%h(zCmd)" page:</h1>
858
+ @ <h1>The "%h(pCmd->zName)" page:</h1>
854859
}else if( rc==0 && (pCmd->eCmdFlags & CMDFLAG_SETTING)!=0 ){
855860
@ <h1>The "%h(pCmd->zName)" setting:</h1>
856861
}else{
857
- @ <h1>The "%h(zCmd)" command:</h1>
862
+ @ <h1>The "%h(pCmd->zName)" command:</h1>
858863
}
859
- if( rc==1 ){
860
- @ unknown command: %h(zCmd)
864
+ if( rc==1 || (rc==2 && zCmd[0]=='/') ){
865
+ @ Unknown topic: "%h(zCmd)"
861866
}else if( rc==2 ){
862
- @ ambiguous command prefix: %h(zCmd)
867
+ @ Ambiguous prefix: "%h(zCmd)"
863868
}else{
864869
if( pCmd->zHelp[0]==0 ){
865870
@ No help available for "%h(pCmd->zName)"
866871
}else if( P("plaintext") ){
867872
Blob txt;
@@ -1357,12 +1362,10 @@
13571362
@
13581363
@ --args FILENAME Read additional arguments and options from FILENAME
13591364
@ --case-sensitive BOOL Set case sensitivity for file names
13601365
@ --cgitrace Active CGI tracing
13611366
@ --chdir PATH Change to PATH before performing any operations
1362
-@ --comfmtflags VALUE Set comment formatting flags to VALUE
1363
-@ --comment-format VALUE Alias for --comfmtflags
13641367
@ --errorlog FILENAME Log errors to FILENAME
13651368
@ --help Show help on the command rather than running it
13661369
@ --httptrace Trace outbound HTTP requests
13671370
@ --localtime Display times using the local timezone
13681371
@ --nocgi Do not act as CGI
13691372
--- src/dispatch.c
+++ src/dispatch.c
@@ -838,30 +838,35 @@
838 if( zCmd && *zCmd ){
839 int rc;
840 const CmdOrPage *pCmd = 0;
841
842 style_set_current_feature("tkt");
843 style_header("Help: %s", zCmd);
844
845 style_submenu_element("Command-List", "%R/help");
846 if( search_restrict(SRCH_HELP)!=0 ){
847 style_submenu_element("Search","%R/search?y=h");
848 }
849 rc = dispatch_name_search(zCmd, CMDFLAG_ANY|CMDFLAG_PREFIX, &pCmd);
850 if( *zCmd=='/' ){
 
 
 
 
 
 
 
851 /* Some of the webpages require query parameters in order to work.
852 ** @ <h1>The "<a href='%R%s(zCmd)'>%s(zCmd)</a>" page:</h1> */
853 @ <h1>The "%h(zCmd)" page:</h1>
854 }else if( rc==0 && (pCmd->eCmdFlags & CMDFLAG_SETTING)!=0 ){
855 @ <h1>The "%h(pCmd->zName)" setting:</h1>
856 }else{
857 @ <h1>The "%h(zCmd)" command:</h1>
858 }
859 if( rc==1 ){
860 @ unknown command: %h(zCmd)
861 }else if( rc==2 ){
862 @ ambiguous command prefix: %h(zCmd)
863 }else{
864 if( pCmd->zHelp[0]==0 ){
865 @ No help available for "%h(pCmd->zName)"
866 }else if( P("plaintext") ){
867 Blob txt;
@@ -1357,12 +1362,10 @@
1357 @
1358 @ --args FILENAME Read additional arguments and options from FILENAME
1359 @ --case-sensitive BOOL Set case sensitivity for file names
1360 @ --cgitrace Active CGI tracing
1361 @ --chdir PATH Change to PATH before performing any operations
1362 @ --comfmtflags VALUE Set comment formatting flags to VALUE
1363 @ --comment-format VALUE Alias for --comfmtflags
1364 @ --errorlog FILENAME Log errors to FILENAME
1365 @ --help Show help on the command rather than running it
1366 @ --httptrace Trace outbound HTTP requests
1367 @ --localtime Display times using the local timezone
1368 @ --nocgi Do not act as CGI
1369
--- src/dispatch.c
+++ src/dispatch.c
@@ -838,30 +838,35 @@
838 if( zCmd && *zCmd ){
839 int rc;
840 const CmdOrPage *pCmd = 0;
841
842 style_set_current_feature("tkt");
843 style_submenu_element("Topic-List", "%R/help");
 
 
844 if( search_restrict(SRCH_HELP)!=0 ){
845 style_submenu_element("Search","%R/search?y=h");
846 }
847 rc = dispatch_name_search(zCmd, CMDFLAG_ANY|CMDFLAG_PREFIX, &pCmd);
848 if( pCmd ){
849 style_header("Help: %s", pCmd->zName);
850 }else{
851 style_header("Help");
852 }
853 if( pCmd==0 ){
854 /* No <h1> line in this case */
855 }else if( *zCmd=='/' ){
856 /* Some of the webpages require query parameters in order to work.
857 ** @ <h1>The "<a href='%R%s(zCmd)'>%s(zCmd)</a>" page:</h1> */
858 @ <h1>The "%h(pCmd->zName)" page:</h1>
859 }else if( rc==0 && (pCmd->eCmdFlags & CMDFLAG_SETTING)!=0 ){
860 @ <h1>The "%h(pCmd->zName)" setting:</h1>
861 }else{
862 @ <h1>The "%h(pCmd->zName)" command:</h1>
863 }
864 if( rc==1 || (rc==2 && zCmd[0]=='/') ){
865 @ Unknown topic: "%h(zCmd)"
866 }else if( rc==2 ){
867 @ Ambiguous prefix: "%h(zCmd)"
868 }else{
869 if( pCmd->zHelp[0]==0 ){
870 @ No help available for "%h(pCmd->zName)"
871 }else if( P("plaintext") ){
872 Blob txt;
@@ -1357,12 +1362,10 @@
1362 @
1363 @ --args FILENAME Read additional arguments and options from FILENAME
1364 @ --case-sensitive BOOL Set case sensitivity for file names
1365 @ --cgitrace Active CGI tracing
1366 @ --chdir PATH Change to PATH before performing any operations
 
 
1367 @ --errorlog FILENAME Log errors to FILENAME
1368 @ --help Show help on the command rather than running it
1369 @ --httptrace Trace outbound HTTP requests
1370 @ --localtime Display times using the local timezone
1371 @ --nocgi Do not act as CGI
1372
+1
--- src/doc.c
+++ src/doc.c
@@ -807,10 +807,11 @@
807807
}else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
808808
Blob tail = BLOB_INITIALIZER;
809809
markdown_to_html(pBody, &title, &tail);
810810
if( !isPopup ){
811811
if( blob_size(&title)>0 ){
812
+ markdown_dehtmlize_blob(&title);
812813
style_header("%s", blob_str(&title));
813814
}else{
814815
style_header("%s", zDefaultTitle);
815816
}
816817
}
817818
--- src/doc.c
+++ src/doc.c
@@ -807,10 +807,11 @@
807 }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
808 Blob tail = BLOB_INITIALIZER;
809 markdown_to_html(pBody, &title, &tail);
810 if( !isPopup ){
811 if( blob_size(&title)>0 ){
 
812 style_header("%s", blob_str(&title));
813 }else{
814 style_header("%s", zDefaultTitle);
815 }
816 }
817
--- src/doc.c
+++ src/doc.c
@@ -807,10 +807,11 @@
807 }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
808 Blob tail = BLOB_INITIALIZER;
809 markdown_to_html(pBody, &title, &tail);
810 if( !isPopup ){
811 if( blob_size(&title)>0 ){
812 markdown_dehtmlize_blob(&title);
813 style_header("%s", blob_str(&title));
814 }else{
815 style_header("%s", zDefaultTitle);
816 }
817 }
818
--- src/fossil.page.pikchrshowasm.js
+++ src/fossil.page.pikchrshowasm.js
@@ -120,11 +120,16 @@
120120
}
121121
});
122122
delete PS._config;
123123
}
124124
125
- PS.worker = new Worker('builtin/extsrc/pikchr-worker.js');
125
+ /* Randomize the name of the worker script so that it is never cached.
126
+ ** The Fossil /builtin method will automatically remove the "-v000000000"
127
+ ** part of the filename, resolving it to just "pikchr-worker.js". */
128
+ PS.worker = new Worker('builtin/extsrc/pikchr-worker-v'+
129
+ (Math.floor(Math.random()*10000000000) + 1000000000)+
130
+ '.js');
126131
PS.worker.onmessage = (ev)=>PS.runMsgHandlers(ev.data);
127132
PS.addMsgHandler('stdout', console.log.bind(console));
128133
PS.addMsgHandler('stderr', console.error.bind(console));
129134
130135
/** Handles status updates from the Module object. */
@@ -172,21 +177,21 @@
172177
PS.renderModeLabels[PS.renderModes[PS.renderModes.selectedIndex]];
173178
174179
/**
175180
The 'pikchr-ready' event is fired (with no payload) when the
176181
wasm module has finished loading. */
177
- PS.addMsgHandler('pikchr-ready', function(){
182
+ PS.addMsgHandler('pikchr-ready', function(event){
178183
PS.clearMsgHandlers('pikchr-ready');
179
- F.page.onPikchrshowLoaded();
184
+ F.page.onPikchrshowLoaded(event.data);
180185
});
181186
182187
/**
183188
Performs all app initialization which must wait until after the
184189
worker module is loaded. This function removes itself when it's
185190
called.
186191
*/
187
- F.page.onPikchrshowLoaded = function(){
192
+ F.page.onPikchrshowLoaded = function(pikchrVersion){
188193
delete this.onPikchrshowLoaded;
189194
// Unhide all elements which start out hidden
190195
EAll('.initially-hidden').forEach((e)=>e.classList.remove('initially-hidden'));
191196
const taInput = E('#input');
192197
const btnClearIn = E('#btn-clear');
@@ -439,10 +444,13 @@
439444
if( src && (new URL(self.location.href).searchParams).has('fromSession') ){
440445
taInput.value = src;
441446
window.sessionStorage.removeItem('pikchr-xfer');
442447
}
443448
}
449
+ D.append(E('fieldset.options > div'),
450
+ D.append(D.addClass(D.span(), 'labeled-input'),
451
+ 'pikchr v. '+pikchrVersion));
444452
445453
PS.e.btnRender.click();
446454
447455
/** Debounce handler for auto-rendering while typing. */
448456
const debounceAutoRender = F.debounce(function f(){
449457
--- src/fossil.page.pikchrshowasm.js
+++ src/fossil.page.pikchrshowasm.js
@@ -120,11 +120,16 @@
120 }
121 });
122 delete PS._config;
123 }
124
125 PS.worker = new Worker('builtin/extsrc/pikchr-worker.js');
 
 
 
 
 
126 PS.worker.onmessage = (ev)=>PS.runMsgHandlers(ev.data);
127 PS.addMsgHandler('stdout', console.log.bind(console));
128 PS.addMsgHandler('stderr', console.error.bind(console));
129
130 /** Handles status updates from the Module object. */
@@ -172,21 +177,21 @@
172 PS.renderModeLabels[PS.renderModes[PS.renderModes.selectedIndex]];
173
174 /**
175 The 'pikchr-ready' event is fired (with no payload) when the
176 wasm module has finished loading. */
177 PS.addMsgHandler('pikchr-ready', function(){
178 PS.clearMsgHandlers('pikchr-ready');
179 F.page.onPikchrshowLoaded();
180 });
181
182 /**
183 Performs all app initialization which must wait until after the
184 worker module is loaded. This function removes itself when it's
185 called.
186 */
187 F.page.onPikchrshowLoaded = function(){
188 delete this.onPikchrshowLoaded;
189 // Unhide all elements which start out hidden
190 EAll('.initially-hidden').forEach((e)=>e.classList.remove('initially-hidden'));
191 const taInput = E('#input');
192 const btnClearIn = E('#btn-clear');
@@ -439,10 +444,13 @@
439 if( src && (new URL(self.location.href).searchParams).has('fromSession') ){
440 taInput.value = src;
441 window.sessionStorage.removeItem('pikchr-xfer');
442 }
443 }
 
 
 
444
445 PS.e.btnRender.click();
446
447 /** Debounce handler for auto-rendering while typing. */
448 const debounceAutoRender = F.debounce(function f(){
449
--- src/fossil.page.pikchrshowasm.js
+++ src/fossil.page.pikchrshowasm.js
@@ -120,11 +120,16 @@
120 }
121 });
122 delete PS._config;
123 }
124
125 /* Randomize the name of the worker script so that it is never cached.
126 ** The Fossil /builtin method will automatically remove the "-v000000000"
127 ** part of the filename, resolving it to just "pikchr-worker.js". */
128 PS.worker = new Worker('builtin/extsrc/pikchr-worker-v'+
129 (Math.floor(Math.random()*10000000000) + 1000000000)+
130 '.js');
131 PS.worker.onmessage = (ev)=>PS.runMsgHandlers(ev.data);
132 PS.addMsgHandler('stdout', console.log.bind(console));
133 PS.addMsgHandler('stderr', console.error.bind(console));
134
135 /** Handles status updates from the Module object. */
@@ -172,21 +177,21 @@
177 PS.renderModeLabels[PS.renderModes[PS.renderModes.selectedIndex]];
178
179 /**
180 The 'pikchr-ready' event is fired (with no payload) when the
181 wasm module has finished loading. */
182 PS.addMsgHandler('pikchr-ready', function(event){
183 PS.clearMsgHandlers('pikchr-ready');
184 F.page.onPikchrshowLoaded(event.data);
185 });
186
187 /**
188 Performs all app initialization which must wait until after the
189 worker module is loaded. This function removes itself when it's
190 called.
191 */
192 F.page.onPikchrshowLoaded = function(pikchrVersion){
193 delete this.onPikchrshowLoaded;
194 // Unhide all elements which start out hidden
195 EAll('.initially-hidden').forEach((e)=>e.classList.remove('initially-hidden'));
196 const taInput = E('#input');
197 const btnClearIn = E('#btn-clear');
@@ -439,10 +444,13 @@
444 if( src && (new URL(self.location.href).searchParams).has('fromSession') ){
445 taInput.value = src;
446 window.sessionStorage.removeItem('pikchr-xfer');
447 }
448 }
449 D.append(E('fieldset.options > div'),
450 D.append(D.addClass(D.span(), 'labeled-input'),
451 'pikchr v. '+pikchrVersion));
452
453 PS.e.btnRender.click();
454
455 /** Debounce handler for auto-rendering while typing. */
456 const debounceAutoRender = F.debounce(function f(){
457
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -14,11 +14,11 @@
1414
cache), in the form of an "winfo" object:
1515
1616
{
1717
name: string,
1818
mimetype: mimetype string,
19
- type: "normal" | "tag" | "checkin" | "branch" | "sandbox",
19
+ type: "normal" | "tag" | "checkin" | "branch" | "ticket" | "sandbox",
2020
version: UUID string or null for a sandbox page or new page,
2121
parent: parent UUID string or null if no parent,
2222
isEmpty: true if page has no content (is "deleted").
2323
content: string, optional in most contexts
2424
}
@@ -192,11 +192,11 @@
192192
name: winfo.name
193193
});
194194
record.mimetype = winfo.mimetype;
195195
record.type = winfo.type;
196196
record.parent = winfo.parent;
197
- record.version = winfo.version;
197
+ record.version = winfo.version;
198198
record.stashTime = new Date().getTime();
199199
record.isEmpty = !!winfo.isEmpty;
200200
record.attachments = winfo.attachments;
201201
this.storeIndex();
202202
if(arguments.length>1){
@@ -207,11 +207,11 @@
207207
return this;
208208
},
209209
/**
210210
Returns the stashed content, if any, for the given winfo
211211
object.
212
- */
212
+ */
213213
stashedContent: function(winfo){
214214
return F.storage.get(this.contentKey(this.indexKey(winfo)));
215215
},
216216
/** Returns true if we have stashed content for the given winfo
217217
record or page name. */
@@ -270,11 +270,11 @@
270270
if(n) this._fireStashEvent();
271271
}
272272
};
273273
$stash.prune.defaultMaxCount = P.config.defaultMaxStashSize || 10;
274274
P.$stash = $stash /* we have to expose this for the new-page case :/ */;
275
-
275
+
276276
/**
277277
Internal workaround to select the current preview mode
278278
and fire a change event if the value actually changes
279279
or if forceEvent is truthy.
280280
*/
@@ -536,10 +536,11 @@
536536
name = name.trim();
537537
if(!this.validatePageName(name)) return false;
538538
var wtype = 'normal';
539539
if(0===name.indexOf('checkin/')) wtype = 'checkin';
540540
else if(0===name.indexOf('branch/')) wtype = 'branch';
541
+ else if(0===name.indexOf('ticket/')) wtype = 'ticket';
541542
else if(0===name.indexOf('tag/')) wtype = 'tag';
542543
/* ^^^ note that we're not validating that, e.g., checkin/XYZ
543544
has a full artifact ID after "checkin/". */
544545
const winfo = {
545546
name: name, type: wtype, mimetype: 'text/x-markdown',
@@ -573,11 +574,11 @@
573574
574575
/** Set up filter checkboxes for the various types
575576
of wiki pages... */
576577
const fsFilter = D.addClass(D.fieldset("Page types"),"page-types-list"),
577578
fsFilterBody = D.div(),
578
- filters = ['normal', 'branch/...', 'tag/...', 'checkin/...']
579
+ filters = ['normal', 'branch/...', 'tag/...', 'checkin/...', 'ticket/...']
579580
;
580581
D.append(fsFilter, fsFilterBody);
581582
D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch');
582583
583584
// Add filters by page type...
@@ -1045,11 +1046,11 @@
10451046
P.e.btnSave.addEventListener('click', ()=>doSave(), false);
10461047
P.e.btnSaveClose.addEventListener('click', ()=>doSave(true), false);
10471048
}
10481049
10491050
P.e.taEditor.addEventListener('change', ()=>P.notifyOfChange(), false);
1050
-
1051
+
10511052
P.selectMimetype(false, true);
10521053
P.e.selectMimetype.addEventListener(
10531054
'change',
10541055
function(e){
10551056
if(P.winfo && P.winfo.mimetype !== e.target.value){
@@ -1058,11 +1059,11 @@
10581059
P.stashContentChange(true);
10591060
}
10601061
},
10611062
false
10621063
);
1063
-
1064
+
10641065
const selectFontSize = E('select[name=editor_font_size]');
10651066
if(selectFontSize){
10661067
selectFontSize.addEventListener(
10671068
"change",function(e){
10681069
const ed = P.e.taEditor;
@@ -1590,11 +1591,11 @@
15901591
responseType: 'json',
15911592
onload: callee.onload
15921593
});
15931594
return this;
15941595
};
1595
-
1596
+
15961597
/**
15971598
Updates P.winfo for certain state and stashes P.winfo, with the
15981599
current content fetched via P.wikiContent().
15991600
16001601
If passed truthy AND the stash already has stashed content for
16011602
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -14,11 +14,11 @@
14 cache), in the form of an "winfo" object:
15
16 {
17 name: string,
18 mimetype: mimetype string,
19 type: "normal" | "tag" | "checkin" | "branch" | "sandbox",
20 version: UUID string or null for a sandbox page or new page,
21 parent: parent UUID string or null if no parent,
22 isEmpty: true if page has no content (is "deleted").
23 content: string, optional in most contexts
24 }
@@ -192,11 +192,11 @@
192 name: winfo.name
193 });
194 record.mimetype = winfo.mimetype;
195 record.type = winfo.type;
196 record.parent = winfo.parent;
197 record.version = winfo.version;
198 record.stashTime = new Date().getTime();
199 record.isEmpty = !!winfo.isEmpty;
200 record.attachments = winfo.attachments;
201 this.storeIndex();
202 if(arguments.length>1){
@@ -207,11 +207,11 @@
207 return this;
208 },
209 /**
210 Returns the stashed content, if any, for the given winfo
211 object.
212 */
213 stashedContent: function(winfo){
214 return F.storage.get(this.contentKey(this.indexKey(winfo)));
215 },
216 /** Returns true if we have stashed content for the given winfo
217 record or page name. */
@@ -270,11 +270,11 @@
270 if(n) this._fireStashEvent();
271 }
272 };
273 $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize || 10;
274 P.$stash = $stash /* we have to expose this for the new-page case :/ */;
275
276 /**
277 Internal workaround to select the current preview mode
278 and fire a change event if the value actually changes
279 or if forceEvent is truthy.
280 */
@@ -536,10 +536,11 @@
536 name = name.trim();
537 if(!this.validatePageName(name)) return false;
538 var wtype = 'normal';
539 if(0===name.indexOf('checkin/')) wtype = 'checkin';
540 else if(0===name.indexOf('branch/')) wtype = 'branch';
 
541 else if(0===name.indexOf('tag/')) wtype = 'tag';
542 /* ^^^ note that we're not validating that, e.g., checkin/XYZ
543 has a full artifact ID after "checkin/". */
544 const winfo = {
545 name: name, type: wtype, mimetype: 'text/x-markdown',
@@ -573,11 +574,11 @@
573
574 /** Set up filter checkboxes for the various types
575 of wiki pages... */
576 const fsFilter = D.addClass(D.fieldset("Page types"),"page-types-list"),
577 fsFilterBody = D.div(),
578 filters = ['normal', 'branch/...', 'tag/...', 'checkin/...']
579 ;
580 D.append(fsFilter, fsFilterBody);
581 D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch');
582
583 // Add filters by page type...
@@ -1045,11 +1046,11 @@
1045 P.e.btnSave.addEventListener('click', ()=>doSave(), false);
1046 P.e.btnSaveClose.addEventListener('click', ()=>doSave(true), false);
1047 }
1048
1049 P.e.taEditor.addEventListener('change', ()=>P.notifyOfChange(), false);
1050
1051 P.selectMimetype(false, true);
1052 P.e.selectMimetype.addEventListener(
1053 'change',
1054 function(e){
1055 if(P.winfo && P.winfo.mimetype !== e.target.value){
@@ -1058,11 +1059,11 @@
1058 P.stashContentChange(true);
1059 }
1060 },
1061 false
1062 );
1063
1064 const selectFontSize = E('select[name=editor_font_size]');
1065 if(selectFontSize){
1066 selectFontSize.addEventListener(
1067 "change",function(e){
1068 const ed = P.e.taEditor;
@@ -1590,11 +1591,11 @@
1590 responseType: 'json',
1591 onload: callee.onload
1592 });
1593 return this;
1594 };
1595
1596 /**
1597 Updates P.winfo for certain state and stashes P.winfo, with the
1598 current content fetched via P.wikiContent().
1599
1600 If passed truthy AND the stash already has stashed content for
1601
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -14,11 +14,11 @@
14 cache), in the form of an "winfo" object:
15
16 {
17 name: string,
18 mimetype: mimetype string,
19 type: "normal" | "tag" | "checkin" | "branch" | "ticket" | "sandbox",
20 version: UUID string or null for a sandbox page or new page,
21 parent: parent UUID string or null if no parent,
22 isEmpty: true if page has no content (is "deleted").
23 content: string, optional in most contexts
24 }
@@ -192,11 +192,11 @@
192 name: winfo.name
193 });
194 record.mimetype = winfo.mimetype;
195 record.type = winfo.type;
196 record.parent = winfo.parent;
197 record.version = winfo.version;
198 record.stashTime = new Date().getTime();
199 record.isEmpty = !!winfo.isEmpty;
200 record.attachments = winfo.attachments;
201 this.storeIndex();
202 if(arguments.length>1){
@@ -207,11 +207,11 @@
207 return this;
208 },
209 /**
210 Returns the stashed content, if any, for the given winfo
211 object.
212 */
213 stashedContent: function(winfo){
214 return F.storage.get(this.contentKey(this.indexKey(winfo)));
215 },
216 /** Returns true if we have stashed content for the given winfo
217 record or page name. */
@@ -270,11 +270,11 @@
270 if(n) this._fireStashEvent();
271 }
272 };
273 $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize || 10;
274 P.$stash = $stash /* we have to expose this for the new-page case :/ */;
275
276 /**
277 Internal workaround to select the current preview mode
278 and fire a change event if the value actually changes
279 or if forceEvent is truthy.
280 */
@@ -536,10 +536,11 @@
536 name = name.trim();
537 if(!this.validatePageName(name)) return false;
538 var wtype = 'normal';
539 if(0===name.indexOf('checkin/')) wtype = 'checkin';
540 else if(0===name.indexOf('branch/')) wtype = 'branch';
541 else if(0===name.indexOf('ticket/')) wtype = 'ticket';
542 else if(0===name.indexOf('tag/')) wtype = 'tag';
543 /* ^^^ note that we're not validating that, e.g., checkin/XYZ
544 has a full artifact ID after "checkin/". */
545 const winfo = {
546 name: name, type: wtype, mimetype: 'text/x-markdown',
@@ -573,11 +574,11 @@
574
575 /** Set up filter checkboxes for the various types
576 of wiki pages... */
577 const fsFilter = D.addClass(D.fieldset("Page types"),"page-types-list"),
578 fsFilterBody = D.div(),
579 filters = ['normal', 'branch/...', 'tag/...', 'checkin/...', 'ticket/...']
580 ;
581 D.append(fsFilter, fsFilterBody);
582 D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch');
583
584 // Add filters by page type...
@@ -1045,11 +1046,11 @@
1046 P.e.btnSave.addEventListener('click', ()=>doSave(), false);
1047 P.e.btnSaveClose.addEventListener('click', ()=>doSave(true), false);
1048 }
1049
1050 P.e.taEditor.addEventListener('change', ()=>P.notifyOfChange(), false);
1051
1052 P.selectMimetype(false, true);
1053 P.e.selectMimetype.addEventListener(
1054 'change',
1055 function(e){
1056 if(P.winfo && P.winfo.mimetype !== e.target.value){
@@ -1058,11 +1059,11 @@
1059 P.stashContentChange(true);
1060 }
1061 },
1062 false
1063 );
1064
1065 const selectFontSize = E('select[name=editor_font_size]');
1066 if(selectFontSize){
1067 selectFontSize.addEventListener(
1068 "change",function(e){
1069 const ed = P.e.taEditor;
@@ -1590,11 +1591,11 @@
1591 responseType: 'json',
1592 onload: callee.onload
1593 });
1594 return this;
1595 };
1596
1597 /**
1598 Updates P.winfo for certain state and stashes P.winfo, with the
1599 current content fetched via P.wikiContent().
1600
1601 If passed truthy AND the stash already has stashed content for
1602
+11 -10
--- src/main.c
+++ src/main.c
@@ -639,14 +639,15 @@
639639
fossil_warning("%s", blob_str(&msg));
640640
blob_reset(&msg);
641641
}
642642
643643
/*
644
-** This function attempts to find command line options known to contain
645
-** bitwise flags and initializes the associated global variables. After
646
-** this function executes, all global variables (i.e. in the "g" struct)
647
-** containing option-settable bitwise flag fields must be initialized.
644
+** Initialize the g.comFmtFlags global variable.
645
+**
646
+** Global command-line options --comfmtflags or --comment-format can be
647
+** used for this. However, those command-line options are undocumented
648
+** and deprecated. They are here for backwards compatibility only.
648649
*/
649650
static void fossil_init_flags_from_options(void){
650651
const char *zValue = find_option("comfmtflags", 0, 1);
651652
if( zValue==0 ){
652653
zValue = find_option("comment-format", 0, 1);
@@ -725,14 +726,14 @@
725726
fossil_limit_memory(1);
726727
727728
/* When updating the minimum SQLite version, change the number here,
728729
** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take
729730
** care that both places agree! */
730
- if( sqlite3_libversion_number()<3046000
731
- || strncmp(sqlite3_sourceid(),"2024-08-16",10)<0
731
+ if( sqlite3_libversion_number()<3049000
732
+ || strncmp(sqlite3_sourceid(),"2025-02-06",10)<0
732733
){
733
- fossil_panic("Unsuitable SQLite version %s, must be at least 3.43.0",
734
+ fossil_panic("Unsuitable SQLite version %s, must be at least 3.49.0",
734735
sqlite3_libversion());
735736
}
736737
737738
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
738739
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
@@ -2398,11 +2399,11 @@
23982399
** The lines are processed in the order they are read, which is most
23992400
** significant for "errorlog:", which should be set before "repository:"
24002401
** so that any warnings from the database when opening the repository
24012402
** go to that log file.
24022403
**
2403
-** See also: [[http]], [[server]], [[winsrv]]
2404
+** See also: [[http]], [[server]], [[winsrv]] [Windows only]
24042405
*/
24052406
void cmd_cgi(void){
24062407
const char *zNotFound = 0;
24072408
char **azRedirect = 0; /* List of repositories to redirect to */
24082409
int nRedirect = 0; /* Number of entries in azRedirect */
@@ -2857,11 +2858,11 @@
28572858
** to force use of the current local skin config.
28582859
** --th-trace Trace TH1 execution (for debugging purposes)
28592860
** --usepidkey Use saved encryption key from parent process. This is
28602861
** only necessary when using SEE on Windows or Linux.
28612862
**
2862
-** See also: [[cgi]], [[server]], [[winsrv]]
2863
+** See also: [[cgi]], [[server]], [[winsrv]] [Windows only]
28632864
*/
28642865
void cmd_http(void){
28652866
const char *zIpAddr = 0;
28662867
const char *zNotFound;
28672868
const char *zHost;
@@ -3239,11 +3240,11 @@
32393240
** user and group.
32403241
** --th-trace Trace TH1 execution (for debugging purposes)
32413242
** --usepidkey Use saved encryption key from parent process. This is
32423243
** only necessary when using SEE on Windows or Linux.
32433244
**
3244
-** See also: [[cgi]], [[http]], [[winsrv]]
3245
+** See also: [[cgi]], [[http]], [[winsrv]] [Windows only]
32453246
*/
32463247
void cmd_webserver(void){
32473248
int iPort, mxPort; /* Range of TCP ports allowed */
32483249
const char *zPort; /* Value of the --port option */
32493250
const char *zBrowser; /* Name of web browser program */
32503251
--- src/main.c
+++ src/main.c
@@ -639,14 +639,15 @@
639 fossil_warning("%s", blob_str(&msg));
640 blob_reset(&msg);
641 }
642
643 /*
644 ** This function attempts to find command line options known to contain
645 ** bitwise flags and initializes the associated global variables. After
646 ** this function executes, all global variables (i.e. in the "g" struct)
647 ** containing option-settable bitwise flag fields must be initialized.
 
648 */
649 static void fossil_init_flags_from_options(void){
650 const char *zValue = find_option("comfmtflags", 0, 1);
651 if( zValue==0 ){
652 zValue = find_option("comment-format", 0, 1);
@@ -725,14 +726,14 @@
725 fossil_limit_memory(1);
726
727 /* When updating the minimum SQLite version, change the number here,
728 ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take
729 ** care that both places agree! */
730 if( sqlite3_libversion_number()<3046000
731 || strncmp(sqlite3_sourceid(),"2024-08-16",10)<0
732 ){
733 fossil_panic("Unsuitable SQLite version %s, must be at least 3.43.0",
734 sqlite3_libversion());
735 }
736
737 sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
738 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
@@ -2398,11 +2399,11 @@
2398 ** The lines are processed in the order they are read, which is most
2399 ** significant for "errorlog:", which should be set before "repository:"
2400 ** so that any warnings from the database when opening the repository
2401 ** go to that log file.
2402 **
2403 ** See also: [[http]], [[server]], [[winsrv]]
2404 */
2405 void cmd_cgi(void){
2406 const char *zNotFound = 0;
2407 char **azRedirect = 0; /* List of repositories to redirect to */
2408 int nRedirect = 0; /* Number of entries in azRedirect */
@@ -2857,11 +2858,11 @@
2857 ** to force use of the current local skin config.
2858 ** --th-trace Trace TH1 execution (for debugging purposes)
2859 ** --usepidkey Use saved encryption key from parent process. This is
2860 ** only necessary when using SEE on Windows or Linux.
2861 **
2862 ** See also: [[cgi]], [[server]], [[winsrv]]
2863 */
2864 void cmd_http(void){
2865 const char *zIpAddr = 0;
2866 const char *zNotFound;
2867 const char *zHost;
@@ -3239,11 +3240,11 @@
3239 ** user and group.
3240 ** --th-trace Trace TH1 execution (for debugging purposes)
3241 ** --usepidkey Use saved encryption key from parent process. This is
3242 ** only necessary when using SEE on Windows or Linux.
3243 **
3244 ** See also: [[cgi]], [[http]], [[winsrv]]
3245 */
3246 void cmd_webserver(void){
3247 int iPort, mxPort; /* Range of TCP ports allowed */
3248 const char *zPort; /* Value of the --port option */
3249 const char *zBrowser; /* Name of web browser program */
3250
--- src/main.c
+++ src/main.c
@@ -639,14 +639,15 @@
639 fossil_warning("%s", blob_str(&msg));
640 blob_reset(&msg);
641 }
642
643 /*
644 ** Initialize the g.comFmtFlags global variable.
645 **
646 ** Global command-line options --comfmtflags or --comment-format can be
647 ** used for this. However, those command-line options are undocumented
648 ** and deprecated. They are here for backwards compatibility only.
649 */
650 static void fossil_init_flags_from_options(void){
651 const char *zValue = find_option("comfmtflags", 0, 1);
652 if( zValue==0 ){
653 zValue = find_option("comment-format", 0, 1);
@@ -725,14 +726,14 @@
726 fossil_limit_memory(1);
727
728 /* When updating the minimum SQLite version, change the number here,
729 ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take
730 ** care that both places agree! */
731 if( sqlite3_libversion_number()<3049000
732 || strncmp(sqlite3_sourceid(),"2025-02-06",10)<0
733 ){
734 fossil_panic("Unsuitable SQLite version %s, must be at least 3.49.0",
735 sqlite3_libversion());
736 }
737
738 sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
739 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
@@ -2398,11 +2399,11 @@
2399 ** The lines are processed in the order they are read, which is most
2400 ** significant for "errorlog:", which should be set before "repository:"
2401 ** so that any warnings from the database when opening the repository
2402 ** go to that log file.
2403 **
2404 ** See also: [[http]], [[server]], [[winsrv]] [Windows only]
2405 */
2406 void cmd_cgi(void){
2407 const char *zNotFound = 0;
2408 char **azRedirect = 0; /* List of repositories to redirect to */
2409 int nRedirect = 0; /* Number of entries in azRedirect */
@@ -2857,11 +2858,11 @@
2858 ** to force use of the current local skin config.
2859 ** --th-trace Trace TH1 execution (for debugging purposes)
2860 ** --usepidkey Use saved encryption key from parent process. This is
2861 ** only necessary when using SEE on Windows or Linux.
2862 **
2863 ** See also: [[cgi]], [[server]], [[winsrv]] [Windows only]
2864 */
2865 void cmd_http(void){
2866 const char *zIpAddr = 0;
2867 const char *zNotFound;
2868 const char *zHost;
@@ -3239,11 +3240,11 @@
3240 ** user and group.
3241 ** --th-trace Trace TH1 execution (for debugging purposes)
3242 ** --usepidkey Use saved encryption key from parent process. This is
3243 ** only necessary when using SEE on Windows or Linux.
3244 **
3245 ** See also: [[cgi]], [[http]], [[winsrv]] [Windows only]
3246 */
3247 void cmd_webserver(void){
3248 int iPort, mxPort; /* Range of TCP ports allowed */
3249 const char *zPort; /* Value of the --port option */
3250 const char *zBrowser; /* Name of web browser program */
3251
+4 -3
--- src/main.mk
+++ src/main.mk
@@ -2134,18 +2134,19 @@
21342134
$(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
21352135
21362136
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c
21372137
$(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
21382138
2139
-$(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c
2139
+$(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
21402140
$(EMCC_WRAPPER) -o $@ $(EMCC_OPT) --no-entry \
2141
- -sEXPORTED_RUNTIME_METHODS=cwrap,setValue,getValue,stackSave,stackAlloc,stackRestore \
2142
- -sEXPORTED_FUNCTIONS=_pikchr $(SRCDIR_extsrc)/pikchr.c \
2141
+ -sEXPORTED_RUNTIME_METHODS=cwrap,ccall,setValue,getValue,stackSave,stackAlloc,stackRestore \
2142
+ -sEXPORTED_FUNCTIONS=_pikchr,_pikchr_version $(SRCDIR_extsrc)/pikchr.c \
21432143
-sENVIRONMENT=web \
21442144
-sMODULARIZE \
21452145
-sEXPORT_NAME=initPikchrModule \
21462146
--minify 0
2147
+ $(TCLSH) $(TOPDIR)/tools/randomize-js-names.tcl $(SRCDIR_extsrc)
21472148
@chmod -x $(SRCDIR_extsrc)/pikchr.wasm
21482149
wasm: $(SRCDIR_extsrc)/pikchr.js
21492150
21502151
#
21512152
# compile_commands.json support...
21522153
--- src/main.mk
+++ src/main.mk
@@ -2134,18 +2134,19 @@
2134 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
2135
2136 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c
2137 $(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
2138
2139 $(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c
2140 $(EMCC_WRAPPER) -o $@ $(EMCC_OPT) --no-entry \
2141 -sEXPORTED_RUNTIME_METHODS=cwrap,setValue,getValue,stackSave,stackAlloc,stackRestore \
2142 -sEXPORTED_FUNCTIONS=_pikchr $(SRCDIR_extsrc)/pikchr.c \
2143 -sENVIRONMENT=web \
2144 -sMODULARIZE \
2145 -sEXPORT_NAME=initPikchrModule \
2146 --minify 0
 
2147 @chmod -x $(SRCDIR_extsrc)/pikchr.wasm
2148 wasm: $(SRCDIR_extsrc)/pikchr.js
2149
2150 #
2151 # compile_commands.json support...
2152
--- src/main.mk
+++ src/main.mk
@@ -2134,18 +2134,19 @@
2134 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
2135
2136 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c
2137 $(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
2138
2139 $(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
2140 $(EMCC_WRAPPER) -o $@ $(EMCC_OPT) --no-entry \
2141 -sEXPORTED_RUNTIME_METHODS=cwrap,ccall,setValue,getValue,stackSave,stackAlloc,stackRestore \
2142 -sEXPORTED_FUNCTIONS=_pikchr,_pikchr_version $(SRCDIR_extsrc)/pikchr.c \
2143 -sENVIRONMENT=web \
2144 -sMODULARIZE \
2145 -sEXPORT_NAME=initPikchrModule \
2146 --minify 0
2147 $(TCLSH) $(TOPDIR)/tools/randomize-js-names.tcl $(SRCDIR_extsrc)
2148 @chmod -x $(SRCDIR_extsrc)/pikchr.wasm
2149 wasm: $(SRCDIR_extsrc)/pikchr.js
2150
2151 #
2152 # compile_commands.json support...
2153
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -911,5 +911,62 @@
911911
html_renderer.opaque = &context;
912912
if( output_title ) blob_reset(output_title);
913913
blob_reset(output_body);
914914
markdown(output_body, input_markdown, &html_renderer);
915915
}
916
+
917
+/*
918
+** Undo HTML escapes in Blob p. In other words convert:
919
+**
920
+** &amp; -> &
921
+** &lt; -> <
922
+** &gt; -> >
923
+** &quot; -> "
924
+** &#NNN; -> ascii character NNN
925
+*/
926
+void markdown_dehtmlize_blob(Blob *p){
927
+ char *z;
928
+ unsigned int j, k;
929
+
930
+ z = p->aData;
931
+ for(j=k=0; j<p->nUsed; j++){
932
+ char c = z[j];
933
+ if( c=='&' ){
934
+ if( z[j+1]=='#' && fossil_isdigit(z[j+2]) ){
935
+ int n = 3;
936
+ int x = z[j+2] - '0';
937
+ if( fossil_isdigit(z[j+3]) ){
938
+ x = x*10 + z[j+3] - '0';
939
+ n++;
940
+ if( fossil_isdigit(z[j+4]) ){
941
+ x = x*10 + z[j+4] - '0';
942
+ n++;
943
+ }
944
+ }
945
+ if( z[j+n]==';' ){
946
+ z[k++] = (char)x;
947
+ j += n;
948
+ }else{
949
+ z[k++] = c;
950
+ }
951
+ }else if( memcmp(&z[j],"&lt;",4)==0 ){
952
+ z[k++] = '<';
953
+ j += 3;
954
+ }else if( memcmp(&z[j],"&gt;",4)==0 ){
955
+ z[k++] = '>';
956
+ j += 3;
957
+ }else if( memcmp(&z[j],"&quot;",6)==0 ){
958
+ z[k++] = '"';
959
+ j += 5;
960
+ }else if( memcmp(&z[j],"&amp;",5)==0 ){
961
+ z[k++] = '&';
962
+ j += 4;
963
+ }else{
964
+ z[k++] = c;
965
+ }
966
+ }else{
967
+ z[k++] = c;
968
+ }
969
+ }
970
+ z[k] = 0;
971
+ p->nUsed = k;
972
+}
916973
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -911,5 +911,62 @@
911 html_renderer.opaque = &context;
912 if( output_title ) blob_reset(output_title);
913 blob_reset(output_body);
914 markdown(output_body, input_markdown, &html_renderer);
915 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
916
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -911,5 +911,62 @@
911 html_renderer.opaque = &context;
912 if( output_title ) blob_reset(output_title);
913 blob_reset(output_body);
914 markdown(output_body, input_markdown, &html_renderer);
915 }
916
917 /*
918 ** Undo HTML escapes in Blob p. In other words convert:
919 **
920 ** &amp; -> &
921 ** &lt; -> <
922 ** &gt; -> >
923 ** &quot; -> "
924 ** &#NNN; -> ascii character NNN
925 */
926 void markdown_dehtmlize_blob(Blob *p){
927 char *z;
928 unsigned int j, k;
929
930 z = p->aData;
931 for(j=k=0; j<p->nUsed; j++){
932 char c = z[j];
933 if( c=='&' ){
934 if( z[j+1]=='#' && fossil_isdigit(z[j+2]) ){
935 int n = 3;
936 int x = z[j+2] - '0';
937 if( fossil_isdigit(z[j+3]) ){
938 x = x*10 + z[j+3] - '0';
939 n++;
940 if( fossil_isdigit(z[j+4]) ){
941 x = x*10 + z[j+4] - '0';
942 n++;
943 }
944 }
945 if( z[j+n]==';' ){
946 z[k++] = (char)x;
947 j += n;
948 }else{
949 z[k++] = c;
950 }
951 }else if( memcmp(&z[j],"&lt;",4)==0 ){
952 z[k++] = '<';
953 j += 3;
954 }else if( memcmp(&z[j],"&gt;",4)==0 ){
955 z[k++] = '>';
956 j += 3;
957 }else if( memcmp(&z[j],"&quot;",6)==0 ){
958 z[k++] = '"';
959 j += 5;
960 }else if( memcmp(&z[j],"&amp;",5)==0 ){
961 z[k++] = '&';
962 j += 4;
963 }else{
964 z[k++] = c;
965 }
966 }else{
967 z[k++] = c;
968 }
969 }
970 z[k] = 0;
971 p->nUsed = k;
972 }
973
+1 -1
--- src/name.c
+++ src/name.c
@@ -231,11 +231,11 @@
231231
** This is a tricky query to do efficiently.
232232
** If the tag is very common (ex: "trunk") then
233233
** we want to use the query identified below as Q1 - which searches
234234
** the most recent EVENT table entries for the most recent with the tag.
235235
** But if the tag is relatively scarce (anything other than "trunk", basically)
236
-** then we want to do the indexed search show below as Q2.
236
+** then we want to do the indexed search shown below as Q2.
237237
*/
238238
static int most_recent_event_with_tag(const char *zTag, const char *zType){
239239
return db_int(0,
240240
"SELECT objid FROM ("
241241
/* Q1: Begin by looking for the tag in the 30 most recent events */
242242
--- src/name.c
+++ src/name.c
@@ -231,11 +231,11 @@
231 ** This is a tricky query to do efficiently.
232 ** If the tag is very common (ex: "trunk") then
233 ** we want to use the query identified below as Q1 - which searches
234 ** the most recent EVENT table entries for the most recent with the tag.
235 ** But if the tag is relatively scarce (anything other than "trunk", basically)
236 ** then we want to do the indexed search show below as Q2.
237 */
238 static int most_recent_event_with_tag(const char *zTag, const char *zType){
239 return db_int(0,
240 "SELECT objid FROM ("
241 /* Q1: Begin by looking for the tag in the 30 most recent events */
242
--- src/name.c
+++ src/name.c
@@ -231,11 +231,11 @@
231 ** This is a tricky query to do efficiently.
232 ** If the tag is very common (ex: "trunk") then
233 ** we want to use the query identified below as Q1 - which searches
234 ** the most recent EVENT table entries for the most recent with the tag.
235 ** But if the tag is relatively scarce (anything other than "trunk", basically)
236 ** then we want to do the indexed search shown below as Q2.
237 */
238 static int most_recent_event_with_tag(const char *zTag, const char *zType){
239 return db_int(0,
240 "SELECT objid FROM ("
241 /* Q1: Begin by looking for the tag in the 30 most recent events */
242
+157 -97
--- src/path.c
+++ src/path.c
@@ -18,40 +18,45 @@
1818
** directed acyclic graph (DAG) of check-ins.
1919
*/
2020
#include "config.h"
2121
#include "path.h"
2222
#include <assert.h>
23
+#include <math.h>
2324
2425
#if INTERFACE
2526
/* Nodes for the paths through the DAG.
2627
*/
2728
struct PathNode {
2829
int rid; /* ID for this node */
2930
u8 fromIsParent; /* True if pFrom is the parent of rid */
3031
u8 isPrim; /* True if primary side of common ancestor */
3132
u8 isHidden; /* Abbreviate output in "fossil bisect ls" */
33
+ char *zBranch; /* Branch name for this node. Might be NULL */
34
+ double mtime; /* Date/time of this check-in */
3235
PathNode *pFrom; /* Node we came from */
3336
union {
34
- PathNode *pPeer; /* List of nodes of the same generation */
37
+ double rCost; /* Cost of getting to this node from pStart */
3538
PathNode *pTo; /* Next on path from beginning to end */
3639
} u;
37
- PathNode *pAll; /* List of all nodes */
40
+ PathNode *pAll; /* List of all nodes */
3841
};
3942
#endif
4043
4144
/*
4245
** Local variables for this module
4346
*/
4447
static struct {
45
- PathNode *pCurrent; /* Current generation of nodes */
48
+ PQueue pending; /* Nodes pending review for inclusion in the graph */
4649
PathNode *pAll; /* All nodes */
47
- Bag seen; /* Nodes seen before */
4850
int nStep; /* Number of steps from first to last */
4951
int nNotHidden; /* Number of steps not counting hidden nodes */
52
+ int brCost; /* Extra cost for moving to a different branch */
53
+ int revCost; /* Extra cost for changing directions */
5054
PathNode *pStart; /* Earliest node */
5155
PathNode *pEnd; /* Most recent */
5256
} path;
57
+static int path_debug = 0; /* Flag to enable debugging */
5358
5459
/*
5560
** Return the first (last) element of the computed path.
5661
*/
5762
PathNode *path_first(void){ return path.pStart; }
@@ -66,25 +71,71 @@
6671
** Return the number of non-hidden steps in the computed path.
6772
*/
6873
int path_length_not_hidden(void){ return path.nNotHidden; }
6974
7075
/*
71
-** Create a new node
76
+** Used for debugging only.
77
+**
78
+** Given a RID, return the ISO date/time string and branch for the
79
+** corresponding check-in. Memory is held locally and is overwritten
80
+** with each call.
81
+*/
82
+char *path_rid_desc(int rid){
83
+ static Stmt q;
84
+ static char *zDesc = 0;
85
+ db_static_prepare(&q,
86
+ "SELECT concat(strftime('%%Y%%m%%d%%H%%M',event.mtime),'/',value)"
87
+ " FROM event, tagxref"
88
+ " WHERE event.objid=:rid"
89
+ " AND tagxref.rid=:rid"
90
+ " AND tagxref.tagid=%d"
91
+ " AND tagxref.tagtype>0",
92
+ TAG_BRANCH
93
+ );
94
+ fossil_free(zDesc);
95
+ db_bind_int(&q, ":rid", rid);
96
+ if( db_step(&q)==SQLITE_ROW ){
97
+ zDesc = fossil_strdup(db_column_text(&q,0));
98
+ }
99
+ db_reset(&q);
100
+ return zDesc ? zDesc : "???";
101
+}
102
+
103
+/*
104
+** Create a new node and insert it into the path.pending queue.
72105
*/
73106
static PathNode *path_new_node(int rid, PathNode *pFrom, int isParent){
74107
PathNode *p;
75108
76109
p = fossil_malloc( sizeof(*p) );
77110
memset(p, 0, sizeof(*p));
111
+ p->pAll = path.pAll;
112
+ path.pAll = p;
78113
p->rid = rid;
79114
p->fromIsParent = isParent;
80115
p->pFrom = pFrom;
81
- p->u.pPeer = path.pCurrent;
82
- path.pCurrent = p;
83
- p->pAll = path.pAll;
84
- path.pAll = p;
85
- bag_insert(&path.seen, rid);
116
+ p->u.rCost = pFrom ? pFrom->u.rCost : 0.0;
117
+ if( path.brCost ){
118
+ p->zBranch = branch_of_rid(rid);
119
+ p->mtime = mtime_of_rid(rid, 0.0);
120
+ if( pFrom ){
121
+ p->u.rCost += fabs(pFrom->mtime - p->mtime);
122
+ if( fossil_strcmp(p->zBranch, pFrom->zBranch)!=0 ){
123
+ p->u.rCost += path.brCost;
124
+ }
125
+ }
126
+ }else{
127
+ /* When brCost==0, we try to minimize the number of nodes
128
+ ** along the path. The cost is just the number of nodes back
129
+ ** to the start. We do not need to know the branch name nor
130
+ ** the mtime */
131
+ p->u.rCost += 1.0;
132
+ }
133
+ if( path_debug ){
134
+ fossil_print("PUSH %-50s cost = %g\n", path_rid_desc(p->rid), p->u.rCost);
135
+ }
136
+ pqueuex_insert_ptr(&path.pending, (void*)p, p->u.rCost);
86137
return p;
87138
}
88139
89140
/*
90141
** Reset memory used by the shortest path algorithm.
@@ -92,13 +143,14 @@
92143
void path_reset(void){
93144
PathNode *p;
94145
while( path.pAll ){
95146
p = path.pAll;
96147
path.pAll = p->pAll;
148
+ fossil_free(p->zBranch);
97149
fossil_free(p);
98150
}
99
- bag_clear(&path.seen);
151
+ pqueuex_clear(&path.pending);
100152
memset(&path, 0, sizeof(path));
101153
}
102154
103155
/*
104156
** Construct the path from path.pStart to path.pEnd in the u.pTo fields.
@@ -128,17 +180,19 @@
128180
PathNode *path_shortest(
129181
int iFrom, /* Path starts here */
130182
int iTo, /* Path ends here */
131183
int directOnly, /* No merge links if true */
132184
int oneWayOnly, /* Parent->child only if true */
133
- Bag *pHidden /* Hidden nodes */
185
+ Bag *pHidden, /* Hidden nodes */
186
+ int branchCost /* Add extra cost to changing branches */
134187
){
135188
Stmt s;
136
- PathNode *pPrev;
189
+ Bag seen;
137190
PathNode *p;
138191
139192
path_reset();
193
+ path.brCost = branchCost;
140194
path.pStart = path_new_node(iFrom, 0, 0);
141195
if( iTo==iFrom ){
142196
path.pEnd = path.pStart;
143197
return path.pStart;
144198
}
@@ -152,44 +206,46 @@
152206
);
153207
}else if( directOnly ){
154208
db_prepare(&s,
155209
"SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim "
156210
"UNION ALL "
157
- "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim"
211
+ "SELECT pid, 0 FROM plink WHERE :back AND cid=:pid AND isprim"
158212
);
159213
}else{
160214
db_prepare(&s,
161215
"SELECT cid, 1 FROM plink WHERE pid=:pid "
162216
"UNION ALL "
163
- "SELECT pid, 0 FROM plink WHERE cid=:pid"
217
+ "SELECT pid, 0 FROM plink WHERE :back AND cid=:pid"
164218
);
165219
}
166
- while( path.pCurrent ){
167
- path.nStep++;
168
- pPrev = path.pCurrent;
169
- path.pCurrent = 0;
170
- while( pPrev ){
171
- db_bind_int(&s, ":pid", pPrev->rid);
172
- while( db_step(&s)==SQLITE_ROW ){
173
- int cid = db_column_int(&s, 0);
174
- int isParent = db_column_int(&s, 1);
175
- if( bag_find(&path.seen, cid) ) continue;
176
- p = path_new_node(cid, pPrev, isParent);
177
- if( pHidden && bag_find(pHidden,cid) ) p->isHidden = 1;
178
- if( cid==iTo ){
179
- db_finalize(&s);
180
- path.pEnd = p;
181
- path_reverse_path();
182
- for(p=path.pStart->u.pTo; p; p=p->u.pTo ){
183
- if( !p->isHidden ) path.nNotHidden++;
184
- }
185
- return path.pStart;
186
- }
187
- }
188
- db_reset(&s);
189
- pPrev = pPrev->u.pPeer;
190
- }
220
+ bag_init(&seen);
221
+ while( (p = pqueuex_extract_ptr(&path.pending))!=0 ){
222
+ if( path_debug ){
223
+ printf("PULL %s %g\n", path_rid_desc(p->rid), p->u.rCost);
224
+ }
225
+ if( p->rid==iTo ){
226
+ db_finalize(&s);
227
+ path.pEnd = p;
228
+ path_reverse_path();
229
+ for(p=path.pStart->u.pTo; p; p=p->u.pTo ){
230
+ if( !p->isHidden ) path.nNotHidden++;
231
+ }
232
+ return path.pStart;
233
+ }
234
+ if( bag_find(&seen, p->rid) ) continue;
235
+ bag_insert(&seen, p->rid);
236
+ db_bind_int(&s, ":pid", p->rid);
237
+ if( !oneWayOnly ) db_bind_int(&s, ":back", !p->fromIsParent);
238
+ while( db_step(&s)==SQLITE_ROW ){
239
+ int cid = db_column_int(&s, 0);
240
+ int isParent = db_column_int(&s, 1);
241
+ PathNode *pNew;
242
+ if( bag_find(&seen, cid) ) continue;
243
+ pNew = path_new_node(cid, p, isParent);
244
+ if( pHidden && bag_find(pHidden,cid) ) pNew->isHidden = 1;
245
+ }
246
+ db_reset(&s);
191247
}
192248
db_finalize(&s);
193249
path_reset();
194250
return 0;
195251
}
@@ -215,10 +271,22 @@
215271
PathNode *p;
216272
p = path.pStart;
217273
if( p ) p = p->u.pTo;
218274
return p;
219275
}
276
+
277
+/*
278
+** Return the branch for a path node.
279