/ Check-in [d58a5de09b]
DEMO | DOWNLOAD | DEPLOY | SEARCH
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Release "2.8.33". Fix issue [f8d3a82011]: NUL bytes not encodable. Now supports strings with \u0000 and \0.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d58a5de09bfe7faddd9e9df090916d428ef96f6e
User & Date: pmacdona 2019-05-24 00:33:45
References
2019-05-24
00:35 Closed ticket [f8d3a82011]: NUL bytes not encodable plus 4 other changes artifact: 1e0b210342 user: pmacdona
Context
2019-05-30
17:22
Refactor from jsiweb.js check-in: 733d68576a user: pmacdona tags: trunk
2019-05-24
00:33
Release "2.8.33". Fix issue [f8d3a82011]: NUL bytes not encodable. Now supports strings with \u0000 and \0. check-in: d58a5de09b user: pmacdona tags: trunk
2019-05-23
14:24
Release "2.8.32". Fix embedded nulls in format() and elsewhere. check-in: 53d32b6f33 user: pmacdona tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/jsi.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
....
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
....
7390
7391
7392
7393
7394
7395
7396
7397

7398
7399
7400
7401
7402
7403
7404
....
7789
7790
7791
7792
7793
7794
7795
7796

7797
7798
7799
7800
7801
7802
7803
....
8158
8159
8160
8161
8162
8163
8164

8165
8166
8167
8168
8169
8170
8171
....
8872
8873
8874
8875
8876
8877
8878

8879
8880
8881
8882
8883
8884
8885
.....
15382
15383
15384
15385
15386
15387
15388

15389
15390
15391
15392
15393
15394
15395
.....
15579
15580
15581
15582
15583
15584
15585




15586
15587
15588
15589
15590
15591
15592
.....
15803
15804
15805
15806
15807
15808
15809



15810
15811
15812
15813
15814
15815
15816
15817
.....
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059

16060
16061
16062
16063
16064
16065
16066
.....
16080
16081
16082
16083
16084
16085
16086

16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
.....
16127
16128
16129
16130
16131
16132
16133

16134









16135
16136
16137
16138







16139
16140
16141
16142
16143
16144
16145
16146
.....
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
.....
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
.....
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
.....
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144

18145
18146
18147
18148
18149
18150
18151
.....
18152
18153
18154
18155
18156
18157
18158


18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
.....
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
.....
19069
19070
19071
19072
19073
19074
19075







19076
19077
19078
19079
19080
19081
19082
.....
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
.....
19718
19719
19720
19721
19722
19723
19724


19725
19726
19727
19728
19729
19730
19731
.....
19806
19807
19808
19809
19810
19811
19812









19813
19814
19815
19816
19817
19818
19819
19820

19821
19822
19823
19824
19825
19826
19827
.....
19887
19888
19889
19890
19891
19892
19893


19894
19895
19896
19897
19898
19899
19900
.....
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
.....
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
.....
38185
38186
38187
38188
38189
38190
38191
38192
38193
38194
38195
38196
38197
38198
38199
38200
38201
38202
.....
46187
46188
46189
46190
46191
46192
46193
46194
46195
46196
46197
46198
46199
46200
46201
.....
48075
48076
48077
48078
48079
48080
48081

48082
48083
48084
48085
48086
48087
48088
48089

48090
48091
48092
48093
48094
48095
48096
.....
63911
63912
63913
63914
63915
63916
63917
63918
63919
63920
63921
63922
63923
63924
63925
63926
.....
63996
63997
63998
63999
64000
64001
64002
64003

64004
64005
64006
64007
64008
64009
64010
.....
64274
64275
64276
64277
64278
64279
64280
64281
64282
64283
64284
64285
64286
64287
64288
64289
64290
64291
64292
64293
64294
64295
64296
64297
64298
64299
.....
64339
64340
64341
64342
64343
64344
64345
64346
64347
64348
64349
64350
64351
64352
64353
64354
64355
64356
64357
64358
64359
64360
64361
64362
64363
64364
64365
64366
64367
64368
64369
64370
64371
64372
64373
64374
64375
64376
64377
64378
64379
64380
64381
64382
64383
.....
64388
64389
64390
64391
64392
64393
64394
64395
64396
64397
64398
64399
64400
64401
64402
64403
64404
.....
64413
64414
64415
64416
64417
64418
64419
64420
64421
64422
64423
64424
64425
64426
64427
64428
64429
64430
64431
64432
64433
64434
64435
64436
64437
64438
64439
64440
64441
64442
64443
64444
64445
64446
64447
64448
64449
64450
64451
64452
64453
64454
64455
64456
64457
64458
64459
64460
64461
64462
64463
64464
64465
64466
64467
64468
64469
64470
64471
64472
64473
64474
64475
64476
64477
64478
64479
64480
64481
64482
64483
64484
64485
64486
64487
64488
64489
64490
64491
64492
64493
64494
64495
64496
64497
64498
64499
64500
64501
64502
64503
64504
64505
64506
64507
64508
64509
64510
64511
64512
64513
64514
64515
64516
64517
64518
64519
64520
64521
64522
64523
64524
64525
64526
64527
64528
64529
64530
64531
64532
64533
64534
64535
64536
64537
64538
64539
64540
64541
64542
64543
64544
64545
64546
64547
64548
64549
64550
64551
64552
64553
64554
64555
64556
64557
64558
64559
64560
64561
64562
64563
64564
64565
64566
64567
64568
64569
64570
64571
64572
64573
64574
64575
64576
64577
64578
64579
64580
64581
64582
64583
64584
64585
64586
64587
64588
64589
64590
64591
64592
64593
64594
64595
64596
64597
64598
64599


64600
64601
64602
64603
64604
64605
64606
64607
64608

64609
64610
64611
64612
64613
64614
64615
64616
64617
64618
64619
64620
64621
64622
64623
64624
64625
64626
64627
64628
64629
64630
64631













64632
64633
64634
64635
64636
64637
64638


64639
64640
64641
64642
64643
64644
64645
64646
64647

64648
64649
64650
64651
64652
64653
64654
64655
64656
64657
64658
64659
64660
64661
64662
64663
64664
64665
64666
64667
64668
64669
64670
64671
64672
64673
64674
64675
64676
64677
64678
64679
64680
64681
64682
64683
64684
64685
64686
64687
64688
64689
64690
64691
64692
64693
64694
64695
64696
64697
64698
64699
64700
64701
64702
64703
64704
64705
64706
64707
64708
64709
64710
64711
64712
64713
64714
64715
64716
64717
64718
64719
64720
64721
64722
64723
64724
64725
64726
64727
64728
64729
64730
64731
64732
64733
64734
64735
64736
64737
64738
64739
64740
64741
64742
64743
64744
64745
64746
64747
64748
64749
64750
64751
64752
64753
64754
64755
64756
64757
64758
64759
64760
64761
64762
64763
64764
64765
64766
64767
64768
64769
64770
64771
64772
64773
64774
64775
64776
64777
64778
64779
64780
64781
64782
64783
64784
64785
64786
64787
64788
64789
64790
64791
64792
64793
64794
64795
64796
64797
64798
64799
64800
64801
64802
64803
64804
64805
64806
64807
64808
64809
64810
64811
64812
64813
64814
64815
64816
64817
64818
64819
64820
64821
64822
64823
64824
64825
64826
64827
64828
64829
64830
64831
64832
64833
64834
64835
64836
64837
64838
64839
64840
64841
64842
64843
64844
64845
64846
64847



64848
64849
64850
64851
64852
64853
64854
64855
64856
64857
64858
64859
64860
64861
64862
64863
64864
64865
64866
64867
64868
64869
64870
64871
64872
64873
64874
64875
64876
64877
64878
64879
64880
64881
64882
64883
64884
64885
64886
64887
64888
64889
64890
64891
64892
64893
64894
64895
64896
64897
64898
64899
64900
64901
64902
64903
64904
64905
64906
64907
64908
64909
64910
64911
64912
64913
64914
64915
64916
64917
64918
64919
64920
64921
64922
64923
64924
64925
64926
64927
64928
64929
64930
64931
64932
64933
64934
64935
64936
64937
64938
64939
64940
64941
64942
64943
64944
64945
64946
64947
64948
64949
64950
64951
64952
64953
64954
64955
64956
64957
64958
64959
64960
64961
64962
64963
64964
64965
64966
64967
64968
64969
64970
64971
64972








64973
64974
64975
64976
64977
64978
64979
64980
64981
64982
64983
64984
64985
64986
64987
64988
64989
64990
64991
64992
64993
64994
64995
64996
64997
64998
64999
65000
65001
65002
65003
65004
65005
65006
65007
65008
65009
65010
65011
65012
65013
65014
65015
65016

65017
65018
65019
65020
65021
65022
65023
65024
65025
65026
65027
65028
65029
65030
65031
65032
65033
65034

65035
65036
65037
65038
65039
65040
65041
65042
65043
65044
65045
65046

65047
65048
65049
65050

65051
65052
65053
65054
65055
65056
65057
65058
65059
65060
65061
65062
65063
65064
65065

65066

65067
65068
65069
65070
65071

65072
65073
65074
65075
65076
65077
65078
.....
65079
65080
65081
65082
65083
65084
65085
65086
65087
65088
65089
65090
65091
65092
65093
65094
65095
65096
65097
65098
65099
65100
65101
65102
65103
65104
65105
.....
65106
65107
65108
65109
65110
65111
65112
65113
65114
65115
65116
65117
65118
65119
65120
65121
65122
65123
65124
65125
65126
65127
65128
65129
65130
65131
65132
.....
65708
65709
65710
65711
65712
65713
65714
65715
65716
65717
65718
65719
65720
65721
65722
65723
65724
65725
65726
65727
























65728
65729
65730
65731
65732
65733
65734
65735
65736
65737
65738
65739
65740
65741
65742
65743
65744
65745
65746
65747
65748
65749
65750
65751
65752
65753
65754
65755
65756
65757
65758
65759
65760
65761
65762
65763
65764
65765
65766
65767
65768
65769
65770
.....
66103
66104
66105
66106
66107
66108
66109
66110
66111
66112
66113
66114
66115
66116
66117
66118
66119
66120
66121
.....
66152
66153
66154
66155
66156
66157
66158
66159
66160
66161
66162
66163
66164
66165
66166
66167
66168
66169
66170
66171
66172
66173
66174
66175
66176
66177
66178
66179
66180
66181
66182
66183
66184
66185
66186
66187
66188
66189
66190
66191
.....
66198
66199
66200
66201
66202
66203
66204
66205
66206
66207
66208
66209
66210
66211
66212
66213
66214
66215
66216
66217
66218
66219
66220
66221
66222
66223
66224
66225
.....
66259
66260
66261
66262
66263
66264
66265
66266
66267
66268
66269
66270
66271
66272
66273
.....
66312
66313
66314
66315
66316
66317
66318
66319
66320
66321
66322
66323
66324
66325
66326
.....
66332
66333
66334
66335
66336
66337
66338
66339
66340
66341
66342
66343
66344
66345
66346
.....
66350
66351
66352
66353
66354
66355
66356
66357
66358
66359
66360
66361
66362
66363
66364
66365
66366
66367
66368
66369
66370
66371
66372
66373
66374
66375
66376
66377
66378
66379
66380
66381
.....
66414
66415
66416
66417
66418
66419
66420
66421
66422
66423
66424
66425
66426
66427
66428
66429
66430
66431
66432
66433
66434
66435
66436
66437
66438
66439
66440
66441
66442
66443
66444
66445
.....
66454
66455
66456
66457
66458
66459
66460
66461
66462
66463
66464
66465
66466
66467
66468
.....
66501
66502
66503
66504
66505
66506
66507
66508
66509
66510
66511
66512
66513
66514
66515
66516
66517
66518
66519
66520
66521
66522
66523
66524
66525
.....
66534
66535
66536
66537
66538
66539
66540
66541
66542
66543
66544
66545
66546
66547
66548
66549
66550
66551
66552
66553
66554
66555
66556
.....
66647
66648
66649
66650
66651
66652
66653
66654
66655
66656
66657
66658
66659
66660
66661
66662
66663
66664
66665
66666
66667
66668
66669
66670
66671
66672
66673
66674
66675
66676
66677
66678
66679
66680
66681
66682
66683
66684
66685
66686
66687
66688
66689
66690
66691
66692
66693
66694
66695
66696
66697
66698
66699
66700
66701
66702
66703
66704
66705
66706
66707
66708
66709
66710
66711
66712
66713
66714
66715
66716
66717
66718
66719
66720
66721
66722
66723
66724
66725
66726
66727
66728
66729
66730
66731
66732
66733




66734
66735
66736
66737
66738
66739
66740
66741
66742
66743
66744
66745
66746
66747
66748
66749
66750
66751
66752
66753
66754
66755
66756
66757
66758
66759
66760
66761
66762
66763
66764
66765
66766
66767
66768
66769
66770
66771
66772
66773
66774
66775
66776
66777
66778
66779
66780
66781
66782
66783
66784
66785
66786
66787
66788
66789
66790
66791
66792
66793
66794
66795
66796
66797
66798
66799
66800
66801
66802
66803
66804
66805
66806
66807
66808
66809
66810
66811
66812
66813
66814
66815
66816
66817
66818
66819
66820
66821
66822
66823
66824
66825
66826
66827
66828
66829
66830
66831
66832
66833
66834
66835
66836
66837
66838
66839
66840
66841
66842
66843
66844
66845
66846
66847
66848
66849
66850
66851
66852
66853
66854
66855
66856
66857
66858
66859
66860
66861
66862
66863
66864
66865
66866
66867
66868
66869
66870
66871
66872
66873
66874
66875
66876
66877
66878
66879
66880
66881
66882
66883
66884
66885
66886
66887
66888
66889
66890
66891
66892
66893
66894
66895
66896
66897
66898
66899
66900
66901
66902
66903
66904
66905
66906
66907
66908
66909
66910
66911
66912
66913
66914
66915
66916
66917
66918
66919
66920
66921
66922
66923
66924
66925
66926
66927
66928
66929
66930
66931
66932
66933
66934
66935
66936
66937
66938
66939
66940
66941
66942
66943
66944
66945
66946
66947
66948
66949
66950
66951
66952
66953
66954
66955
66956
66957
66958
66959
66960
66961
66962
66963
66964
66965
66966
66967
66968
66969
66970
66971
66972
66973
66974
66975
66976
66977
66978
66979
66980
66981
66982
66983
66984
66985
66986
66987
66988
66989
66990
66991
66992
66993
66994
66995
66996
66997
66998
66999
67000
67001
67002
67003
67004
67005
67006
67007
67008
67009
67010
67011
67012
67013
67014
67015
67016
67017
67018
67019
67020
67021
67022
67023
67024
67025
67026
67027
67028
67029
67030
67031
67032
67033
67034
67035
67036
67037
67038
67039
67040
67041
67042
67043
67044
67045
67046
67047
67048
67049
67050
67051
67052
67053
67054
67055
67056
67057
67058
67059
67060
67061
67062
67063
67064
67065
67066
67067
67068
67069
67070
.....
67084
67085
67086
67087
67088
67089
67090
67091
67092
67093
67094
67095
67096
67097
67098
67099
67100
67101
67102
67103
67104
67105
67106
67107
67108
67109
67110
67111
67112
67113
67114
67115
67116
67117
67118
67119
67120
67121
67122
67123
67124
67125
67126
67127
67128
67129
67130
67131
67132
67133
67134
67135
67136
67137
67138
67139
67140
67141
67142
67143
67144
67145
67146
67147
67148
67149
67150
67151
67152
67153
67154
67155
67156
67157
67158
67159
67160
67161
67162
67163
67164
67165
67166
67167
67168
67169
67170
67171
67172
67173
67174
67175
67176
67177
67178
67179
67180
67181
67182
67183
67184
67185
67186
67187
67188
67189
67190
67191
67192




67193
67194
67195
67196
67197
67198
67199
67200
67201
67202
67203
67204
67205
67206
67207
67208




67209
67210
67211
67212
67213
67214
67215
67216
67217
67218
67219
67220
67221
67222
67223
67224
67225
67226
67227
67228
67229
67230
67231
67232
67233
67234
67235
67236
67237
67238
67239
.....
69490
69491
69492
69493
69494
69495
69496
69497

69498












69499
69500
69501
69502
69503
69504
69505
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 32

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif

................................................................................
#endif

/* Token type.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
  enum yytokentype
  {
    STRING = 258,
    IDENTIFIER = 259,
    IF = 260,
    ELSE = 261,
    FOR = 262,
    IN = 263,
    WHILE = 264,
    DO = 265,
    CONTINUE = 266,
................................................................................
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED

union YYSTYPE
{

    Jsi_OpCodes *opcodes;
    Jsi_Value *value;
    const char *str;

    Jsi_Regex* regex;
    Jsi_Number *num;
    Jsi_ScopeStrs *scopes;
    int inum;
    struct jsi_CaseExprStat* caseitem;
    struct jsi_CaseList* caselist;

................................................................................
/* stack change */
/* 0  nothing change */
/* +1 push */
/* -1 pop */
typedef enum {      /* SC   type of data    comment                             */
    OP_NOP,         /* 0 */
    OP_PUSHNUM,     /* +1   *double         number                              */
    OP_PUSHSTR,     /* +1   *char        string                              */

    OP_PUSHVAR,     /* +1   *FastVar        variable name                       */
    OP_PUSHUND,     /* +1   -               undefined                           */
    OP_PUSHNULL,    /* +1   -               null                                */
    OP_PUSHBOO,     /* +1   int             bool                                */
    OP_PUSHFUN,     /* +1   *Jsi_Func           function                            */
    OP_PUSHREG,     /* +1   *regex_t        regex                               */
    OP_PUSHARG,     /* +1   -               push arguments(cur scope)           */
................................................................................

    int _context_id;            /* used in FastVar-locating */
    Jsi_Value *last_exception;
    Jsi_Interp *interp;
    Jsi_HashEntry *hPtr;
    Jsi_Hash *argsTbl;
    Jsi_Hash *fastVarTbl;

    int argType;                // Used during parsing to aggregate type.
    Jsi_ScopeStrs *args;        // Last push.
} jsi_Pstate;


Jsi_ScopeStrs *jsi_ScopeStrsNew(void);
void jsi_ScopeStrsPush(Jsi_Interp *interp, Jsi_ScopeStrs *ss, const char *string, int argType);
................................................................................
extern const char *jsi_ObjectTypeName(Jsi_Interp *interp, Jsi_otype otyp);
extern const char *jsi_ValueTypeName(Jsi_Interp *interp, Jsi_Value *val);
extern const char *jsi_TypeName(Jsi_Interp *interp, Jsi_ttype otyp);
extern Jsi_RC jsi_ObjectToStringCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);
extern Jsi_RC jsi_HasOwnPropertyCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);


extern const char *jsi_GetHomeDir(Jsi_Interp *interp);
extern Jsi_RC jsi_RegExpValueNew(Jsi_Interp *interp, const char *regtxt, Jsi_Value *ret);
extern void jsi_DumpOptionSpecs(Jsi_Interp *interp, Jsi_Obj *nobj, Jsi_OptionSpec* spec);
extern Jsi_Func *jsi_FuncMake(jsi_Pstate *pstate, Jsi_ScopeStrs *args, Jsi_OpCodes *ops, jsi_Pline *line, const char *name);
extern Jsi_Func *jsi_FuncNew(Jsi_Interp *interp);
extern void jsi_FreeOpcodes(Jsi_OpCodes *ops);
................................................................................
 *    corrent stack elems poped(for in always has 2 elem, while switch has 1)
 */

static const char *jsi_op_names[OP_LASTOP] = {
    "NOP",
    "PUSHNUM",
    "PUSHSTR",

    "PUSHVAR",
    "PUSHUND",
    "PUSHNULL",
    "PUSHBOO",
    "PUSHFUN",
    "PUSHREG",
    "PUSHARG",
................................................................................
static Jsi_OpCodes *code_push_bool(int v) { JSI_NEW_CODES(0,OP_PUSHBOO, v); }
static Jsi_OpCodes *code_push_num(Jsi_Number *v) { JSI_NEW_CODES(1,OP_PUSHNUM, v); }
static Jsi_OpCodes *code_push_string(jsi_Pstate *p, jsi_Pline *line, const char *str) {
    if (*str == 'c' && !Jsi_Strcmp(str,"callee"))
        p->interp->hasCallee = 1;
    JSI_NEW_CODESLN(0,OP_PUSHSTR, str);
}





static Jsi_OpCodes *code_push_index(jsi_Pstate *p, jsi_Pline *line, const char *varname, int local)
{
    jsi_FastVar *n = (typeof(n))Jsi_Calloc(1, sizeof(*n));
    n->sig = JSI_SIG_FASTVAR;
    n->ps = p;
    n->context_id = -1;
................................................................................
        op->op == OP_POP || op->op == OP_ASSIGN ||
        op->op == OP_RET || op->op == OP_NEWFCALL ||
        op->op == OP_DELETE || op->op == OP_CHTHIS ||
        op->op == OP_OBJECT || op->op == OP_ARRAY ||
        op->op == OP_SHF ||
        op->op == OP_INC || op->op == OP_DEC) snprintf(bp, bsiz, "%" PRId64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_PUSHNUM) Jsi_NumberDtoA(interp, *((Jsi_Number *)op->data), bp, bsiz, 0);



    else if (op->op == OP_PUSHSTR || op->op == OP_LOCAL ||
             op->op == OP_SCATCH) snprintf(bp, bsiz, "\"%s\"", op->data ? (char*)op->data:"(NoCatch)");
    else if (op->op == OP_PUSHVAR) snprintf(bp, bsiz, "var: \"%s\"", ((jsi_FastVar *)op->data)->varname);
    else if (op->op == OP_PUSHFUN) snprintf(bp, bsiz, "func: 0x%" PRIx64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_JTRUE || op->op == OP_JFALSE ||
             op->op == OP_JTRUE_NP || op->op == OP_JFALSE_NP ||
             op->op == OP_JMP) snprintf(bp, bsiz, "{%" PRIu64 "}\t#%" PRIu64 "", (Jsi_Wide)(uintptr_t)op->data, (Jsi_Wide)((uintptr_t)currentip + (uintptr_t)op->data));
    else if (op->op == OP_JMPPOP) {
................................................................................
    Jsi_Interp *interp = lex->pstate->interp;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->lexkeyTbl, word);
    if (hPtr)
        return (uintptr_t)Jsi_HashValueGet(hPtr);
    return 0;
}

static char *jsi_do_string(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    lex->inStr = 1;
    int n, c = lexer_getchar(lex);
    int endchar = c;

    
    int bufi = 0, bsiz, done = 0;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
    
    while (!done) {
        if (bufi >= (bsiz-5)) {
            int nsiz = bsiz+=JSI_BUFSIZ;
................................................................................
            n = lexer_getchar(lex);
            switch(n) {
                case 'b': buf[bufi++] = '\b'; break;
                case 'f': buf[bufi++] = '\f'; break;
                case 'n': buf[bufi++] = '\n'; break;
                case 'r': buf[bufi++] = '\r'; break;
                case 't': buf[bufi++] = '\t'; break;

                case 'u': {
                    char ibuf[5];
                    int ui;
                    for (ui=0; ui<4; ui++)
                        ibuf[ui] = lexer_getchar(lex);
                    ibuf[4] = 0;
                    ui = Jsi_UtfDecode(ibuf, buf+bufi);
                    if (ui>0) {
                        if (!buf[bufi]) {
                            Jsi_LogError("unsupported code literal utf null (u0000)");
                            buf[bufi++] = 0;
                            goto done;
                        }
                        bufi+=ui;
                    } else {
                        Jsi_LogError("Unexpected utf encoding.");
                        buf[bufi++] = 0;
                        goto done;
                    }
                    break;
................................................................................
        }
        if (c == endchar) {
            bufi --;
            break;
        }
    }
    buf[bufi] = 0;

    ret = (char*)Jsi_KeyAdd(lex->pstate->interp, buf);









done:
    if (buf != unibuf)
        Jsi_Free(buf);
    lex->inStr = 0;







    return ret;
}

static char *jsi_do_regex(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    int n, bufi = 0, bsiz;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
................................................................................
        }
        Jsi_Number *db = (Jsi_Number *)Jsi_Malloc(sizeof(Jsi_Number));
        *db = fval;
        yylvalp->num = db;
        return FNUMBER;
    } else if (c == '"' || c == '\'') {
        lexer_ungetc(c, lex);
        yylvalp->str = jsi_do_string(lex);
        if (!yylvalp->str)
            return 0;
        LOCATION_END(yyllocp, lex);
        return STRING;
    } else if (isalpha(c) || c == '_' || c == '$') {
        lexer_ungetc(c, lex);
        while (wi < 1020) {
            c = lexer_getchar(lex);
................................................................................
            word[wi++] = c;
        }
        lexer_ungetc(c, lex);
        
        word[wi] = 0;
        int r = jsi_iskey(word, lex);
        if (r) return r;
        yylvalp->str = (char*)Jsi_KeyAdd(interp,word); /*Jsi_Strdup(word);*/
        LOCATION_END(yyllocp, lex);
        return IDENTIFIER;
    } else if (c == '/') {
        int d = lexer_getchar(lex);
        if (d == '/') {
            while ((d = lexer_getchar(lex)) != '\r' && d != '\n' && d != 0);
            return COMMENT;
................................................................................
done:
    if (lenPtr) *lenPtr = Jsi_Strlen(ntxt);
    return ntxt;
}

Jsi_Number Jsi_ValueToNumberInt(Jsi_Interp *interp, Jsi_Value *v, int isInt)
{
    char *endPtr = NULL;
    Jsi_Number a = 0;
    switch(v->vt) {
        case JSI_VT_BOOL:
            a = (Jsi_Number)(v->d.val ? 1.0: 0);
            break;
        case JSI_VT_NULL:
            a = 0;
................................................................................
                case JSI_OT_BOOL:
                    a = (Jsi_Number)(obj->d.val ? 1.0: 0);
                    break;
                case JSI_OT_NUMBER:
                    a = obj->d.num;
                    break;
                case JSI_OT_STRING:
                    if (!isInt)
                        a = strtod(obj->d.s.str, &endPtr);
                    else
                        a = (Jsi_Number)strtol(obj->d.s.str, &endPtr, 0);
                    if (endPtr && *endPtr) {
                        a = interp->NaNValue->d.num;
                    }

                    break;
                default:
                    a = 0;
                break;
            }
            break;
        }
................................................................................
        case JSI_VT_UNDEF:
            a = Jsi_NumberNaN();
            break;
        case JSI_VT_NUMBER:
            a = v->d.num;
            break;
        case JSI_VT_STRING:


            if (!isInt) {
                a = strtod(v->d.s.str, &endPtr);
                if (endPtr && *endPtr) {
                    a = interp->NaNValue->d.num;
                }
            } else {
                a = (Jsi_Number)strtol(v->d.s.str, &endPtr, 0);
                if (!isdigit(v->d.s.str[0]))
                    a = interp->NaNValue->d.num;
            }
            break;
        default:
            Jsi_LogBug("Convert a unknown type: 0x%x to number", v->vt);
            break;
    }
................................................................................
                    res.d.s = obj->d.s;
                    obj->d.s.str = NULL;
                } else if (obj->d.s.len >= 0) 
                {
                    Assert(obj->refcnt>=1);
                    obj->refcnt--;
                    int bytes = obj->d.s.len;
                    unsigned char *uptr = (unsigned char*)Jsi_Malloc(bytes+1);
                    memcpy(uptr, obj->d.s.str, bytes);
                    uptr[bytes] = 0;
                    Jsi_ValueMakeBlob(interp, &rPtr, uptr, bytes);
                } else
                    Jsi_ValueMakeStringDup(interp, &rPtr, obj->d.s.str);
            }
            break;
        case JSI_OT_FUNCTION: {
            Jsi_DString dStr;
            Jsi_DSInit(&dStr);
................................................................................
    Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_STRING);
    Jsi_ValueMakeObject(interp, &v, obj);
    obj->d.s.str = (char*)s;
    obj->d.s.len = len;
    obj->isBlob = 1;
    return v;
}









Jsi_Value* Jsi_ValueMakeString(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
    return Jsi_ValueMakeBlob(interp, vPtr, (unsigned char *)s, Jsi_Strlen(s));
}

Jsi_Value* Jsi_ValueMakeStringKey(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
................................................................................
    if (v->vt == JSI_VT_OBJECT) {
        return v->d.obj;
    }
    return NULL;
}

int Jsi_ValueStrlen(Jsi_Value* v) {
    if (v->vt == JSI_VT_OBJECT && v->d.obj->ot == JSI_OT_STRING && v->d.obj->isBlob)
        return v->d.obj->d.s.len;
    Jsi_String *s = jsi_ValueString(v);
    if (s == 0 || s->str == 0)
        return 0;
#if JSI__UTF8
    return (int)Jsi_NumUtfChars(s->str, -1);
#else
    if (s->len>=0) return s->len;
    return (int)Jsi_NumUtfChars(s->str, -1);
#endif
}

char *Jsi_ValueString(Jsi_Interp *interp, Jsi_Value* v, int *lenPtr)
{
    if (!v) return NULL;
    Jsi_String *s = jsi_ValueString(v);
................................................................................
    int atyp = pstate->argType;
    if (defValue) {
        int vt = defValue->vt;
        if (vt == JSI_VT_NULL)
            vt = JSI_TT_NULL;
        else if (vt == JSI_VT_UNDEF && defValue->d.num==1)
            vt = JSI_TT_VOID;


        else
            vt = (1<<defValue->vt);
        atyp |= vt;
    }
    jsi_ScopeStrsPush(interp, a, name, atyp);
    pstate->argType = 0;
    a->args[a->count-1].defValue = defValue;
................................................................................
        //printf("FV FREE: %p (%d/%d)\n", fv, v->refCnt, v->vt == JSI_VT_OBJECT?v->d.obj->refcnt:-99);
        //Jsi_DecrRefCount(interp, v);
    }
    return JSI_OK;
}
#endif










jsi_Pstate *jsi_PstateNew(Jsi_Interp *interp)
{
    jsi_Pstate *ps = (jsi_Pstate *)Jsi_Calloc(1,sizeof(*ps));
    SIGINIT(ps,PARSER);
    ps->lexer = (jsi_Lexer*)Jsi_Calloc(1,sizeof(*ps->lexer));
    ps->lexer->pstate = ps;
    ps->interp = interp;
    ps->fastVarTbl = Jsi_HashNew(interp, JSI_KEYS_ONEWORD, NULL /*fastVarFree*/);

    return ps;
}

const char *jsi_PstateGetFilename(jsi_Pstate *ps)
{
    Jsi_Interp *interp = ps->interp;
    return interp->curFile;
................................................................................
        jsi_FreeOpcodes(ps->opcodes);
    if (ps->hPtr)
        Jsi_HashEntryDelete(ps->hPtr);
    if (ps->argsTbl)
        Jsi_HashDelete(ps->argsTbl);
    if (ps->fastVarTbl)
        Jsi_HashDelete(ps->fastVarTbl);


    if (ps->last_exception)
        Jsi_DecrRefCount(ps->interp, ps->last_exception);
    _JSI_MEMCLEAR(ps);
    Jsi_Free(ps);
}

#endif
................................................................................
}

/* Clean-copy value to interp: convert to JSON and back if required. */
Jsi_RC Jsi_CleanValue(Jsi_Interp *interp, Jsi_Interp *tointerp, Jsi_Value *val, Jsi_Value **ret)
{
    Jsi_RC rc = JSI_OK;
    const char *cp;
    unsigned char *dp;
    int len, iskey;
    Jsi_Obj *obj;
    switch (val->vt) {
        case JSI_VT_UNDEF: Jsi_ValueMakeUndef(interp, ret); return rc;
        case JSI_VT_NULL: Jsi_ValueMakeNull(tointerp, ret); return rc;
        case JSI_VT_BOOL: Jsi_ValueMakeBool(tointerp, ret, val->d.val); return rc;
        case JSI_VT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, val->d.num); return rc;
................................................................................
            cp = val->d.s.str;
            len = val->d.s.len;
makestr:
            if (iskey) {
                Jsi_ValueMakeStringKey(interp, ret, cp);
                return rc;
            }
            if (len<0) len = Jsi_Strlen(cp);
            dp = (unsigned char*)Jsi_Malloc(len+1);
            memcpy(dp, cp, len);
            dp[len] = 0;
            Jsi_ValueMakeBlob(tointerp, ret, dp, len);
            return rc;
        case JSI_VT_OBJECT:
            obj = val->d.obj;
            switch (obj->ot) {
                case JSI_OT_BOOL: Jsi_ValueMakeBool(tointerp, ret, obj->d.val); return rc;
                case JSI_OT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, obj->d.num); return rc;
                case JSI_OT_STRING:
................................................................................
    Jsi_CryptoHash(zbuf, cp, n, edata.type, edata.hashcash, edata.noHex, &olen);
        
done:
    Jsi_DSFree(&dStr);
    if (hasopts)
        Jsi_OptionsFree(interp, HashOptions, &edata, 0);
    if (rc == JSI_OK) {
        char *z = (char*)Jsi_Malloc(olen+1);
        memcpy(z, zbuf, olen);
        z[olen] = 0;
        Jsi_ValueMakeBlob(interp, ret, (uchar*)z, olen);
    }
    return rc;

}


#ifndef JSI_OMIT_ENCRYPT
................................................................................
    if ((c & 0xf0) == 0xe0) return 3;
    if ((c & 0xf8) == 0xf0) return 4;
    return -1;
#endif
}

uint Jsi_NumUtfChars(const char *s, int length) {
    if (!s) return 0;
#if !JSI__UTF8
    uint len = Jsi_Strlen(s);
    if (length<0) return len;
    if (len>length) return length;
    return len;
#else
    uint i = 0;
................................................................................
#endif

typedef struct db_ObjCmd {
  int activeCnt;  /* Count of active objects. */ 
  int newCnt;  /* Total number of new. */ 
} db_ObjCmd;


static db_ObjCmd dbObjCmd = {};

static Jsi_OptionSpec db_ObjCmd_Specs[] =
{
    JSI_OPT(INT,   db_ObjCmd, activeCnt, .help="Number of active objects"),
    JSI_OPT(INT,   db_ObjCmd, newCnt,    .help="Number of new calls"),
    JSI_OPT_END(db_ObjCmd, .help="Options for Sqlite module")
};


/*
** New SQL functions can be created as JSI scripts.  Each such function
** is described by an instance of the following structure.
*/
typedef struct SqlFunc SqlFunc;
struct SqlFunc {
................................................................................
#endif

/* Token type.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
  enum yytokentype
  {
    STRING = 258,
    IDENTIFIER = 259,
    IF = 260,
    ELSE = 261,
    FOR = 262,
    IN = 263,
    WHILE = 264,
    DO = 265,
    CONTINUE = 266,
................................................................................
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED

union YYSTYPE
{

    Jsi_OpCodes *opcodes;
    Jsi_Value *value;
    const char *str;

    Jsi_Regex* regex;
    Jsi_Number *num;
    Jsi_ScopeStrs *scopes;
    int inum;
    struct jsi_CaseExprStat* caseitem;
    struct jsi_CaseList* caselist;

................................................................................
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  105
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   2339

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  101
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  45
/* YYNRULES -- Number of rules.  */
#define YYNRULES  211
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  417

/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
   by yylex, with out-of-bounds checking.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   331

#define YYTRANSLATE(YYX)                                                \
................................................................................
      91,    95
};

#if YYDEBUG
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_uint16 yyrline[] =
{
       0,   120,   120,   121,   124,   127,   132,   133,   138,   139,
     140,   144,   145,   146,   147,   148,   149,   150,   151,   155,
     156,   157,   158,   159,   160,   164,   173,   184,   193,   194,
     195,   196,   199,   200,   203,   204,   210,   211,   215,   221,
     222,   275,   276,   280,   281,   282,   283,   287,   294,   301,
     311,   312,   316,   325,   337,   347,   351,   360,   361,   365,
     376,   396,   420,   421,   422,   428,   429,   432,   433,   437,
     447,   457,   461,   466,   470,   477,   478,   481,   486,   494,
     495,   496,   497,   498,   499,   500,   501,   502,   503,   504,
     505,   506,   509,   517,   520,   525,   526,   527,   528,   529,
     530,   531,   532,   535,   536,   537,   538,   539,   540,   541,
     542,   545,   546,   550,   551,   552,   556,   557,   558,   559,
     560,   561,   562,   563,   564,   565,   566,   567,   568,   569,
     570,   574,   578,   582,   586,   590,   591,   595,   599,   600,
     601,   602,   603,   604,   605,   606,   607,   608,   609,   610,
     611,   612,   613,   614,   615,   616,   617,   618,   619,   620,
     621,   622,   623,   624,   625,   626,   628,   629,   632,   633,
     634,   640,   648,   653,   658,   663,   667,   671,   680,   686,
     691,   719,   725,   726,   727,   732,   739,   740,   744,   745,
     752,   753,   754,   755,   756,   757,   758,   759,   760,   764,
     768,   769,   770,   778,   779,   780,   781,   782,   783,   784,
     788,   789
};
#endif

#if YYDEBUG || YYERROR_VERBOSE || 1
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "STRING", "IDENTIFIER", "IF", "ELSE",
  "FOR", "IN", "WHILE", "DO", "CONTINUE", "SWITCH", "CASE", "DEFAULT",
  "BREAK", "FUNC", "RETURN", "LOCAL", "OF", "NEW", "DELETE", "TRY",
  "CATCH", "FINALLY", "THROW", "WITH", "UNDEF", "_TRUE", "_FALSE", "_THIS",
  "ARGUMENTS", "FNUMBER", "REGEXP", "TYPESTRING", "TYPENUMBER", "TYPENULL",
  "TYPEOBJECT", "TYPEBOOLEAN", "TYPEUSEROBJ", "TYPEITEROBJ", "TYPEREGEXP",
  "TYPEANY", "TYPEARRAY", "ELLIPSIS", "__DEBUG", "MIN_PRI", "','",
  "ARGCOMMA", "'='", "ADDAS", "MNSAS", "MULAS", "MODAS", "LSHFAS",
................................................................................
  "'.'", "'['", "'('", "MAX_PRI", "';'", "'{'", "'}'", "')'", "']'",
  "$accept", "file", "statements", "statement", "commonstatement",
  "func_statement", "func_prefix", "iterstatement", "identifier_opt",
  "label_opt", "statement_or_empty", "with_statement", "switch_statement",
  "cases", "case", "try_statement", "vardecs", "vardec",
  "delete_statement", "if_statement", "inof", "for_statement", "for_init",
  "for_cond", "expr_opt", "while_statement", "do_statement", "func_expr",
  "args_opt", "typeid", "rettype", "argtype", "argdefault", "args",
  "func_statement_block", "expr", "fcall_exprs", "lvalue", "exprlist_opt",
  "exprlist", "value", "object", "items", "item", "array", YY_NULLPTR
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
   (internal) symbol number NUM (which must be that of a token).  */
static const yytype_uint16 yytoknum[] =
................................................................................
     318,   319,    62,    60,   320,   321,   322,   323,   324,   325,
      43,    45,    42,    47,    37,   326,    33,   327,   328,   126,
     329,   330,    46,    91,    40,   331,    59,   123,   125,    41,
      93
};
# endif

#define YYPACT_NINF -331

#define yypact_value_is_default(Yystate) \
  (!!((Yystate) == (-331)))

#define YYTABLE_NINF -201

#define yytable_value_is_error(Yytable_value) \
  0

  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     STATE-NUM.  */
static const yytype_int16 yypact[] =
{
     235,  -331,    -6,   -22,    89,    89,     4,  1268,    90,  1366,
      53,   -32,  1287,     2,  -331,  -331,  -331,  -331,  -331,  -331,
    -331,  -331,  -331,  1287,  1287,  1287,    53,    53,  1287,  1287,
    1287,   452,  1287,  -331,   755,   105,   373,  -331,  -331,  -331,
      22,  -331,    79,  -331,  -331,  -331,  -331,  -331,  -331,  -331,
    -331,    24,  1808,  -331,   904,  -331,  -331,  -331,  1117,  1287,
    -331,    58,    73,  -331,     8,  -331,     5,  -331,   200,  1846,
      59,   -30,  -331,  1287,    76,    32,    81,    27,   888,    40,
    1886,  1287,   -73,   -73,   -73,   -52,   -52,   -73,   -73,   -73,
    -331,   358,   -40,  1448,   111,   114,   115,   117,   119,   121,
     123,   984,  1808,   -37,  -331,  -331,  -331,  1808,     8,    93,
      94,  1154,    96,  1287,  1287,  1287,  1287,  1287,  1287,  1287,
    1287,  1287,  1287,  1287,  1287,  1287,  1287,  1287,  1287,  1287,
    1287,  1287,  1287,  1287,  1287,  1287,  1287,  1287,   188,  1287,
    -331,  1287,  1287,  1287,  1287,  1287,  1287,  1287,  1287,  1287,
    1287,  1287,  1287,  1287,  -331,  -331,   190,  1287,  1287,  -331,
    1488,  -331,  -331,     8,    30,   106,   100,   153,   108,   111,
     144,   115,   117,   119,   121,   123,  -331,  1287,    90,  -331,
    1528,  1287,  1287,  1287,  -331,  -331,  1021,   124,   -32,  -331,
    1568,  1287,  -331,   127,  1287,  1117,  1287,  1287,  1287,  1287,
    1287,  -331,   200,  -331,   116,  1249,  1287,   851,  -331,   208,
    1287,   131,   176,   479,   358,  2002,  2110,  2148,  2178,  2216,
    2246,   276,   276,   276,   276,   479,   479,   479,   479,   221,
     221,   221,    29,    29,   -73,   -73,   -73,   132,  1342,   358,
     358,   358,   358,   358,   358,   358,   358,   358,   358,   358,
     358,   479,  -331,  1410,   138,  1154,   142,    26,   256,   139,
     -49,    12,  1287,   358,  -331,   148,   145,   146,   149,  -331,
     239,  -331,  1154,   358,  1287,   358,  1964,   358,   358,   358,
     358,   358,  -331,   -27,   245,  -331,  1287,  1924,   771,  1608,
    -331,   160,  1648,  -331,  1287,  1287,   164,  -331,  -331,   253,
     -15,  -331,  -331,  -331,  -331,  -331,  -331,   237,  -331,  -331,
    -331,  -331,  -331,  -331,  -331,  -331,  -331,  -331,  -331,  -331,
    -331,  -331,  -331,  -331,   -38,  -331,   256,  -331,    41,   178,
     358,  1287,  -331,  -331,  -331,   174,  -331,   175,   256,  -331,
      61,   -29,   179,  2080,  -331,  -331,  -331,  1287,  1154,  1287,
     180,   358,   182,  1287,  1154,   256,  -331,  -331,    26,   256,
     -32,   213,    26,   256,   187,   183,   -32,  -331,   -32,  1287,
    -331,  1287,  1688,  -331,  1728,    11,  -331,   186,  -331,   -32,
    -331,  -331,  -331,  -331,   -16,  -331,  -331,   262,  -331,  1768,
     207,  2080,  1154,  -331,  1287,   225,  -331,    17,  -331,  -331,
    -331,    26,   -32,  1154,  1154,  -331,  2042,   489,  -331,  -331,
    -331,  -331,  -331,  -331,   585,   622,   718
};

  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
     Performed when YYTABLE does not specify something else to do.  Zero
     means the default is an error.  */
static const yytype_uint8 yydefact[] =
{
      34,   190,   181,     0,    32,    32,     0,     0,     0,     0,
       0,     0,     0,     0,   192,   193,   194,   183,   182,   195,
     196,   191,   176,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    22,    34,     0,    34,     6,     9,    24,
       0,     8,     0,    21,    31,    20,    13,    12,    28,    29,
      30,   114,     5,   165,   115,   113,   197,   198,    35,     0,
      33,     0,     0,    27,    75,   181,     0,    17,   200,     0,
      52,     0,    50,     0,   169,   167,   166,     0,    34,     0,
       0,     0,   120,   119,   122,   132,   134,   121,   133,   123,
     211,   188,     0,     0,   190,   181,   192,   193,   194,   195,
     191,    34,     0,     0,   201,     1,     7,     4,    75,     0,
       0,    34,     0,   186,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      11,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   130,   131,     0,     0,   186,    10,
       0,    15,    14,    75,   103,     0,     0,    76,     0,     0,
       0,     0,     0,     0,     0,     0,    16,     0,     0,    18,
       0,   186,   186,   186,    54,   112,    34,     0,     0,    19,
       0,     0,   210,   135,     0,    35,     0,     0,     0,     0,
       0,    23,     0,   199,     0,     0,     0,    34,    36,     0,
       0,     0,   187,   129,   116,     0,   137,   136,   147,   148,
     146,   142,   143,   144,   145,   139,   138,   140,   141,   149,
     150,   151,   127,   128,   124,   125,   126,   118,     0,   152,
     153,   154,   155,   156,   157,   158,   159,   160,   161,   162,
     163,   164,   185,     0,     0,    34,     0,     0,     0,     0,
       0,     0,     0,    53,    51,   168,     0,     0,     0,   111,
       0,    48,    34,   189,   186,   204,   203,   208,   206,   207,
     205,   209,   202,     0,     0,    62,    65,     0,   115,     0,
      37,     0,     0,   174,     0,   186,   117,   184,   180,    55,
       0,   102,    95,    99,   100,    98,   101,     0,    96,   104,
      89,    90,    79,    80,    88,    83,    81,    84,    85,    82,
      86,    87,    91,    93,   105,    77,     0,    71,   107,     0,
     203,   186,   173,   171,   170,     0,    38,     0,     0,    26,
      52,     0,     0,    66,    63,    57,    58,     0,    34,     0,
       0,   175,     0,   186,    34,     0,    73,    97,     0,     0,
       0,    92,     0,     0,     0,     0,     0,   179,     0,     0,
      64,    67,     0,    69,     0,     0,   177,     0,    56,     0,
     106,    94,    72,   108,   109,    78,   172,    47,    25,     0,
       0,    68,    34,    70,     0,     0,    39,     0,    41,   178,
      74,     0,     0,    34,    34,    61,     0,    34,    40,    42,
     110,    49,    60,    59,    34,    34,    34
};

  /* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -331,  -331,     3,     0,   -43,  -331,  -331,  -331,   284,  -331,
    -170,  -331,  -331,  -331,   -90,  -331,    28,   133,  -331,  -331,
     -23,  -331,  -331,  -331,  -331,  -331,  -331,   301,  -104,   -41,
    -287,  -257,  -330,  -331,  -186,    14,  -331,    -4,  -106,   288,
     311,  -331,  -331,   125,  -331
};

  /* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
      -1,    35,   101,   208,    38,    39,    40,    41,    61,    42,
     209,    43,    44,   397,   398,    45,    71,    72,    46,    47,
     347,    48,   286,   342,   390,    49,    50,    51,   166,   323,
     360,   361,   309,   167,    79,   102,    53,    54,   211,   212,
      55,    56,   103,   104,    57
};

  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
     positive, shift that token.  If negative, reduce the rule whose
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
      37,   324,   271,    36,   204,    75,    77,   191,    63,   168,
     202,   358,   164,   326,    52,   159,   328,   178,   178,   138,
     139,    69,    85,    86,   394,   395,    80,   359,   380,   301,
     394,   395,   383,   401,    37,   338,   106,    82,    83,    84,
     156,   157,    87,    88,    89,    91,    93,   355,    78,   359,
     107,   368,   254,   302,   303,   304,    58,    65,   305,   256,
     192,   203,   306,   187,   188,    78,   179,   370,   379,   345,
      78,   410,    59,   160,   327,   266,   267,   268,    37,   257,
     346,   186,    78,    17,    18,   299,   109,   180,   110,   111,
     362,   112,   258,    60,    70,   190,    81,   339,    64,    64,
     165,   106,   336,   363,   329,   105,   384,   307,   177,   396,
     177,   135,   136,   137,   356,   408,   108,   308,   113,   156,
     157,   138,   139,   184,   156,   157,   182,    91,   213,   214,
     215,   216,   217,   218,   219,   220,   221,   222,   223,   224,
     225,   226,   227,   228,   229,   230,   231,   232,   233,   234,
     235,   236,   159,   238,   161,   239,   240,   241,   242,   243,
     244,   245,   246,   247,   248,   249,   250,   251,   337,   162,
     181,   253,    91,   194,   382,   183,   195,   196,   373,   197,
     387,   198,   388,   199,   378,   200,   106,   205,   206,   352,
     210,   263,   237,   400,   252,    91,    91,    91,   259,   260,
     261,   288,   163,   169,   170,   273,   262,    37,   275,   276,
     277,   278,   279,   280,   281,   283,   411,   291,   270,   287,
     289,   274,   405,   191,   292,   365,   295,   171,   172,   173,
     293,   325,   174,   412,   413,    -2,   175,   298,     1,     2,
       3,   300,   331,   335,   332,   333,     4,   377,   334,   340,
       5,     6,     7,     8,   349,     9,    10,    11,   353,   354,
      12,    13,    14,    15,    16,    17,    18,    19,    20,   357,
     364,    21,   310,   366,   367,   371,   330,   375,   359,   385,
      22,   376,   386,   311,   114,   399,   402,   407,    91,    62,
     312,   313,   314,   315,   316,   317,   318,   319,   320,   321,
     343,   133,   134,   135,   136,   137,   404,   409,   351,    91,
      74,   264,   341,   138,   139,    23,    24,   369,   381,    92,
      76,    25,    26,    27,    28,    29,    30,   282,    31,    32,
       0,    33,    34,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    91,     0,   322,   126,   127,
     128,   129,     0,   130,   131,   132,   133,   134,   135,   136,
     137,   372,     0,   374,     0,     0,   114,    91,   138,   139,
       0,     0,     0,    -3,     0,     0,     1,     2,     3,     0,
       0,     0,     0,   389,     4,   391,     0,     0,     5,     6,
       7,     8,     0,     9,    10,    11,     0,     0,    12,    13,
      14,    15,    16,    17,    18,    19,    20,    37,   406,    21,
     415,     0,     0,     0,    37,   106,   106,   416,    22,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,     0,     0,     0,     0,     0,
     138,   139,     0,    23,    24,     1,    65,     0,     0,    25,
      26,    27,    28,    29,    30,     0,    31,    32,    66,    33,
      34,     0,     9,     0,     0,     0,     0,     0,     0,    14,


      15,    16,    17,    18,    19,    20,     0,     0,    21,     0,
       0,     0,     1,     2,     3,     0,     0,    22,     0,     0,
       4,     0,   -45,   -45,     5,     6,     7,     8,     0,     9,
      10,    11,     0,     0,    12,    13,    14,    15,    16,    17,
      18,    19,    20,     0,     0,    21,     0,     0,     0,     0,
       0,     0,    23,    24,    22,     0,     0,     0,    25,    26,
      27,    28,    29,    30,     0,    31,    32,     0,     0,    68,
       0,     0,    90,     0,     0,     0,   130,   131,   132,   133,
     134,   135,   136,   137,     0,     0,     0,     0,     0,    23,

      24,   138,   139,     0,     0,    25,    26,    27,    28,    29,
      30,     0,    31,    32,     0,    33,    34,   -45,     1,     2,
       3,     0,     0,     0,     0,     0,     4,     0,   -46,   -46,
       5,     6,     7,     8,     0,     9,    10,    11,     0,     0,
      12,    13,    14,    15,    16,    17,    18,    19,    20,     0,
       0,    21,     0,     0,     0,     1,     2,     3,     0,     0,
      22,     0,     0,     4,     0,   -44,   -44,     5,     6,     7,
       8,     0,     9,    10,    11,     0,     0,    12,    13,    14,
      15,    16,    17,    18,    19,    20,     0,     0,    21,     0,
       0,     0,     0,     0,     0,    23,    24,    22,     0,     0,
       0,    25,    26,    27,    28,    29,    30,     0,    31,    32,
       0,    33,    34,   -46,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    23,    24,     0,     0,     0,     0,    25,    26,
      27,    28,    29,    30,     0,    31,    32,     0,    33,    34,
     -44,     1,     2,     3,     0,     0,     0,     0,     0,     4,
       0,   -43,   -43,     5,     6,     7,     8,     0,     9,    10,
      11,     0,     0,    12,    13,    14,    15,    16,    17,    18,
      19,    20,     0,     0,    21,     0,     0,     0,    94,    95,
       3,     0,     0,    22,     0,     0,     4,     0,     0,     0,
       5,     6,     7,     8,     0,     9,    10,    11,     0,   345,
      12,    13,    96,    97,    98,    17,    18,    99,    20,     0,
     346,   100,     0,     0,     0,     0,     0,     0,    23,    24,













      22,     0,  -200,     0,    25,    26,    27,    28,    29,    30,
       0,    31,    32,     0,    33,    34,   -43,     0,     0,     0,
     141,   142,   143,   144,   145,   146,   147,   148,   149,   150,
     151,   152,     0,     0,     0,    23,    24,     0,     0,     0,
       0,    25,    26,    27,    28,    29,    30,   153,    31,    32,
       0,    33,    34,  -200,    94,    95,     3,     0,   154,   155,
       0,     0,     4,   156,   157,   158,     5,     6,     7,     8,


       0,     9,    10,    11,     0,     0,    12,    13,    96,    97,
      98,    17,    18,    99,    20,     0,     0,   100,     0,     0,
       0,     1,     2,     3,     0,     0,    22,     0,  -200,     4,
       0,     0,     0,     5,     6,     7,     8,     0,     9,    10,
      11,     0,     0,    12,    13,    14,    15,    16,    17,    18,
      19,    20,     0,     0,    21,     0,     0,     0,     0,     0,
       0,    23,    24,    22,     0,     0,     0,    25,    26,    27,
      28,    29,    30,     0,    31,    32,     0,    33,    34,   290,
       0,     0,     0,   141,   142,   143,   144,   145,   146,   147,

     148,   149,   150,   151,   152,     0,     0,     0,    23,    24,
       0,     0,     0,     0,    25,    26,    27,    28,    29,    30,
     153,    31,    32,     0,    33,    34,   185,     1,     2,     3,
       0,   154,   155,     0,     0,     4,   156,   157,   158,     5,
       6,     7,     8,     0,     9,    10,    11,     0,     0,    12,
      13,    14,    15,    16,    17,    18,    19,    20,     0,     0,
      21,     0,     0,     0,     1,     2,     3,     0,     0,    22,
       0,     0,     4,     0,     0,     0,     5,     6,     7,     8,
       0,     9,    10,    11,     0,     0,    12,    13,    14,    15,
      16,    17,    18,    19,    20,     0,     0,    21,     0,     0,
       0,     0,     0,     0,    23,    24,    22,     0,     0,     0,
      25,    26,    27,    28,    29,    30,     0,    31,    32,     0,
      33,    34,   201,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    23,    24,     0,     0,     0,     0,    25,    26,    27,
      28,    29,    30,     0,    31,    32,     0,    33,    34,   269,
       1,    65,     3,     0,     0,     0,     0,     0,     4,     0,
       0,     0,     5,     6,     7,     8,     0,     9,    10,    11,
       0,     0,    12,    13,    14,    15,    16,    17,    18,    19,
      20,     0,     0,    21,     0,     0,     0,     1,     2,     3,
       0,     0,    22,     0,     0,     4,     0,     0,     0,     5,
       6,     7,     8,     0,     9,    10,    11,     0,     0,    12,
      13,    14,    15,    16,    17,    18,    19,    20,     0,     0,
      21,     0,     0,     0,     0,     0,     0,    23,    24,    22,
       0,     0,     0,    25,    26,    27,    28,    29,    30,     0,
      31,    32,     0,    33,    34,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    23,    24,     0,     0,     0,     0,
      25,    26,    27,    28,    29,    30,     0,    31,    32,     0,
      33,   207,     1,    65,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    66,     0,   284,     0,     9,
       0,     1,    65,     0,     0,     0,    14,    15,    16,    17,
      18,    19,    20,     0,    66,    21,     0,     0,     9,     0,
       1,    65,     0,     0,    22,    14,    15,    16,    17,    18,
      19,    20,     0,    66,    21,     0,     0,     9,     0,     0,
       0,     0,     0,    22,    14,    15,    16,    17,    18,    19,
      20,     0,     0,    21,     0,     0,     0,     0,     0,    23,
      24,     0,    22,     0,     0,    25,    26,    27,    28,    29,
      30,     0,    31,    32,     0,   285,    68,     0,    23,    24,
     114,     0,     0,     0,    25,    26,    27,    28,    29,    30,
       0,    31,    32,     0,    67,    68,     0,    23,    24,     1,
      65,     0,     0,    25,    26,    27,    28,    29,    30,     0,
      31,    32,    66,     0,    68,     0,     0,     0,     0,   115,
       0,     0,     0,    14,    15,    16,    17,    18,    19,    20,
       0,     0,    21,   116,     0,   117,   118,   119,   120,   121,
     122,   123,   124,   125,   126,   127,   128,   129,   114,   130,
     131,   132,   133,   134,   135,   136,   137,     0,     0,     0,
       0,     0,     0,     0,   138,   139,     0,     0,     0,     0,
       0,     0,   296,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   114,   115,     0,    31,
      73,     0,     0,    68,     0,     0,     0,     0,     0,     0,
       0,   116,     0,   117,   118,   119,   120,   121,   122,   123,
     124,   125,   126,   127,   128,   129,     0,   130,   131,   132,
     133,   134,   135,   136,   137,   115,   114,     0,     0,     0,
       0,     0,   138,   139,     0,     0,     0,     0,     0,   116,
     297,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   193,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   255,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   265,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   272,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   348,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   350,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   392,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,   115,   114,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   393,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,     0,   114,   115,     0,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,   403,     0,   116,
       0,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,     0,   130,   131,   132,   133,   134,
     135,   136,   137,   115,   114,     0,     0,     0,     0,     0,
     138,   139,     0,     0,   140,     0,     0,   116,     0,   117,
     118,   119,   120,   121,   122,   123,   124,   125,   126,   127,
     128,   129,     0,   130,   131,   132,   133,   134,   135,   136,
     137,     0,   114,   115,     0,     0,     0,     0,   138,   139,
       0,     0,   176,     0,     0,     0,     0,   116,     0,   117,
     118,   119,   120,   121,   122,   123,   124,   125,   126,   127,
     128,   129,     0,   130,   131,   132,   133,   134,   135,   136,
     137,   115,   114,     0,     0,     0,     0,     0,   138,   139,
       0,     0,   189,     0,     0,   116,     0,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
       0,   130,   131,   132,   133,   134,   135,   136,   137,     0,
     114,     0,     0,     0,     0,     0,   138,   139,     0,     0,
     344,     0,     0,     0,     0,   116,     0,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
       0,   130,   131,   132,   133,   134,   135,   136,   137,   115,
     114,     0,     0,     0,     0,     0,   138,   139,     0,     0,
     140,     0,     0,   116,   294,   117,   118,   119,   120,   121,
     122,   123,   124,   125,   126,   127,   128,   129,     0,   130,
     131,   132,   133,   134,   135,   136,   137,     0,   114,   115,
       0,     0,     0,     0,   138,   139,     0,     0,     0,     0,
       0,     0,     0,   116,   414,   117,   118,   119,   120,   121,
     122,   123,   124,   125,   126,   127,   128,   129,   114,   130,
     131,   132,   133,   134,   135,   136,   137,   115,     0,     0,
       0,     0,     0,     0,   138,   139,     0,     0,     0,     0,
       0,   116,     0,   117,   118,   119,   120,   121,   122,   123,
     124,   125,   126,   127,   128,   129,   114,   130,   131,   132,
     133,   134,   135,   136,   137,     0,     0,     0,     0,     0,
       0,     0,   138,   139,   118,   119,   120,   121,   122,   123,
     124,   125,   126,   127,   128,   129,   114,   130,   131,   132,
     133,   134,   135,   136,   137,     0,     0,     0,     0,     0,
       0,     0,   138,   139,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,   114,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,     0,     0,     0,     0,     0,
     138,   139,     0,     0,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,   114,   130,   131,   132,   133,   134,
     135,   136,   137,     0,     0,     0,     0,     0,     0,     0,
     138,   139,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   121,   122,   123,   124,   125,   126,   127,
     128,   129,     0,   130,   131,   132,   133,   134,   135,   136,
     137,     0,     0,     0,     0,     0,     0,     0,   138,   139,
       0,     0,     0,     0,   122,   123,   124,   125,   126,   127,
     128,   129,     0,   130,   131,   132,   133,   134,   135,   136,
     137,     0,     0,     0,     0,     0,     0,     0,   138,   139
};

static const yytype_int16 yycheck[] =
{
       0,   258,   188,     0,   108,     9,    10,    47,     4,     4,
      47,    49,     4,    62,     0,    58,     4,    47,    47,    92,
      93,     7,    26,    27,    13,    14,    12,    65,   358,     3,
      13,    14,   362,    49,    34,    62,    36,    23,    24,    25,
      92,    93,    28,    29,    30,    31,    32,    62,    97,    65,
      36,   338,   158,    27,    28,    29,    62,     4,    32,   163,
     100,    98,    36,    23,    24,    97,    96,    96,   355,     8,
      97,   401,    94,    59,   260,   181,   182,   183,    78,    49,
      19,    78,    97,    30,    31,   255,     7,    73,     9,    10,
      49,    12,    62,     4,     4,    81,    94,   283,    94,    94,
      92,   101,   272,    62,    92,     0,   363,    81,    49,    98,
      49,    82,    83,    84,   300,    98,    94,    91,    94,    92,
      93,    92,    93,    96,    92,    93,    94,   113,   114,   115,
     116,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,   130,   131,   132,   133,   134,   135,
     136,   137,   195,   139,    96,   141,   142,   143,   144,   145,
     146,   147,   148,   149,   150,   151,   152,   153,   274,    96,
      94,   157,   158,    62,   360,    94,    62,    62,   348,    62,
     366,    62,   368,    62,   354,    62,   186,    94,    94,   295,
      94,   177,     4,   379,     4,   181,   182,   183,    92,    99,
      47,   205,    94,     3,     4,   191,    62,   207,   194,   195,
     196,   197,   198,   199,   200,    99,   402,     9,    94,   205,
     206,    94,   392,    47,   210,   331,    94,    27,    28,    29,
      99,    92,    32,   403,   404,     0,    36,    99,     3,     4,
       5,    99,    94,     4,    99,    99,    11,   353,    99,     4,
      15,    16,    17,    18,    94,    20,    21,    22,    94,     6,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    32,
      92,    36,    16,    99,    99,    96,   262,    97,    65,    92,
      45,    99,    99,    27,     8,    99,    24,    62,   274,     5,
      34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
     286,    80,    81,    82,    83,    84,    99,   397,   294,   295,
       9,   178,   284,    92,    93,    80,    81,   340,   359,    31,
       9,    86,    87,    88,    89,    90,    91,   202,    93,    94,
      -1,    96,    97,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   331,    -1,    91,    72,    73,
      74,    75,    -1,    77,    78,    79,    80,    81,    82,    83,
      84,   347,    -1,   349,    -1,    -1,     8,   353,    92,    93,
      -1,    -1,    -1,     0,    -1,    -1,     3,     4,     5,    -1,
      -1,    -1,    -1,   369,    11,   371,    -1,    -1,    15,    16,
      17,    18,    -1,    20,    21,    22,    -1,    -1,    25,    26,
      27,    28,    29,    30,    31,    32,    33,   407,   394,    36,
     407,    -1,    -1,    -1,   414,   415,   416,   414,    45,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      92,    93,    -1,    80,    81,     3,     4,    -1,    -1,    86,
      87,    88,    89,    90,    91,    -1,    93,    94,    16,    96,
      97,    -1,    20,    -1,    -1,    -1,    -1,    -1,    -1,    27,
      28,    29,    30,    31,    32,    33,    -1,    -1,    36,    -1,
      -1,    -1,     3,     4,     5,    -1,    -1,    45,    -1,    -1,
      11,    -1,    13,    14,    15,    16,    17,    18,    -1,    20,
      21,    22,    -1,    -1,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    -1,    -1,    36,    -1,    -1,    -1,    -1,
      -1,    -1,    80,    81,    45,    -1,    -1,    -1,    86,    87,
      88,    89,    90,    91,    -1,    93,    94,    -1,    -1,    97,
      -1,    -1,   100,    -1,    -1,    -1,    77,    78,    79,    80,
      81,    82,    83,    84,    -1,    -1,    -1,    -1,    -1,    80,
      81,    92,    93,    -1,    -1,    86,    87,    88,    89,    90,



      91,    -1,    93,    94,    -1,    96,    97,    98,     3,     4,
       5,    -1,    -1,    -1,    -1,    -1,    11,    -1,    13,    14,
      15,    16,    17,    18,    -1,    20,    21,    22,    -1,    -1,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
      -1,    36,    -1,    -1,    -1,     3,     4,     5,    -1,    -1,
      45,    -1,    -1,    11,    -1,    13,    14,    15,    16,    17,
      18,    -1,    20,    21,    22,    -1,    -1,    25,    26,    27,
      28,    29,    30,    31,    32,    33,    -1,    -1,    36,    -1,
      -1,    -1,    -1,    -1,    -1,    80,    81,    45,    -1,    -1,
      -1,    86,    87,    88,    89,    90,    91,    -1,    93,    94,
      -1,    96,    97,    98,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    80,    81,    -1,    -1,    -1,    -1,    86,    87,
      88,    89,    90,    91,    -1,    93,    94,    -1,    96,    97,
      98,     3,     4,     5,    -1,    -1,    -1,    -1,    -1,    11,
      -1,    13,    14,    15,    16,    17,    18,    -1,    20,    21,
      22,    -1,    -1,    25,    26,    27,    28,    29,    30,    31,
      32,    33,    -1,    -1,    36,    -1,    -1,    -1,     3,     4,
       5,    -1,    -1,    45,    -1,    -1,    11,    -1,    -1,    -1,
      15,    16,    17,    18,    -1,    20,    21,    22,    -1,     8,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
      19,    36,    -1,    -1,    -1,    -1,    -1,    -1,    80,    81,
      45,    -1,    47,    -1,    86,    87,    88,    89,    90,    91,
      -1,    93,    94,    -1,    96,    97,    98,    -1,    -1,    -1,
      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
      59,    60,    -1,    -1,    -1,    80,    81,    -1,    -1,    -1,
      -1,    86,    87,    88,    89,    90,    91,    76,    93,    94,
      -1,    96,    97,    98,     3,     4,     5,    -1,    87,    88,
      -1,    -1,    11,    92,    93,    94,    15,    16,    17,    18,
      -1,    20,    21,    22,    -1,    -1,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    -1,    -1,    36,    -1,    -1,
      -1,     3,     4,     5,    -1,    -1,    45,    -1,    47,    11,
      -1,    -1,    -1,    15,    16,    17,    18,    -1,    20,    21,
      22,    -1,    -1,    25,    26,    27,    28,    29,    30,    31,
      32,    33,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,
      -1,    80,    81,    45,    -1,    -1,    -1,    86,    87,    88,
      89,    90,    91,    -1,    93,    94,    -1,    96,    97,    98,
      -1,    -1,    -1,    49,    50,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    -1,    -1,    -1,    80,    81,
      -1,    -1,    -1,    -1,    86,    87,    88,    89,    90,    91,
      76,    93,    94,    -1,    96,    97,    98,     3,     4,     5,
      -1,    87,    88,    -1,    -1,    11,    92,    93,    94,    15,
      16,    17,    18,    -1,    20,    21,    22,    -1,    -1,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    -1,    -1,
      36,    -1,    -1,    -1,     3,     4,     5,    -1,    -1,    45,
      -1,    -1,    11,    -1,    -1,    -1,    15,    16,    17,    18,
      -1,    20,    21,    22,    -1,    -1,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    -1,    -1,    36,    -1,    -1,
      -1,    -1,    -1,    -1,    80,    81,    45,    -1,    -1,    -1,
      86,    87,    88,    89,    90,    91,    -1,    93,    94,    -1,
      96,    97,    98,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    80,    81,    -1,    -1,    -1,    -1,    86,    87,    88,
      89,    90,    91,    -1,    93,    94,    -1,    96,    97,    98,
       3,     4,     5,    -1,    -1,    -1,    -1,    -1,    11,    -1,
      -1,    -1,    15,    16,    17,    18,    -1,    20,    21,    22,
      -1,    -1,    25,    26,    27,    28,    29,    30,    31,    32,
      33,    -1,    -1,    36,    -1,    -1,    -1,     3,     4,     5,
      -1,    -1,    45,    -1,    -1,    11,    -1,    -1,    -1,    15,
      16,    17,    18,    -1,    20,    21,    22,    -1,    -1,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    -1,    -1,
      36,    -1,    -1,    -1,    -1,    -1,    -1,    80,    81,    45,
      -1,    -1,    -1,    86,    87,    88,    89,    90,    91,    -1,
      93,    94,    -1,    96,    97,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    80,    81,    -1,    -1,    -1,    -1,
      86,    87,    88,    89,    90,    91,    -1,    93,    94,    -1,
      96,    97,     3,     4,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    16,    -1,    18,    -1,    20,
      -1,     3,     4,    -1,    -1,    -1,    27,    28,    29,    30,
      31,    32,    33,    -1,    16,    36,    -1,    -1,    20,    -1,
       3,     4,    -1,    -1,    45,    27,    28,    29,    30,    31,
      32,    33,    -1,    16,    36,    -1,    -1,    20,    -1,    -1,
      -1,    -1,    -1,    45,    27,    28,    29,    30,    31,    32,
      33,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,    80,
      81,    -1,    45,    -1,    -1,    86,    87,    88,    89,    90,
      91,    -1,    93,    94,    -1,    96,    97,    -1,    80,    81,
       8,    -1,    -1,    -1,    86,    87,    88,    89,    90,    91,
      -1,    93,    94,    -1,    96,    97,    -1,    80,    81,     3,
       4,    -1,    -1,    86,    87,    88,    89,    90,    91,    -1,
      93,    94,    16,    -1,    97,    -1,    -1,    -1,    -1,    47,
      -1,    -1,    -1,    27,    28,    29,    30,    31,    32,    33,
      -1,    -1,    36,    61,    -1,    63,    64,    65,    66,    67,
      68,    69,    70,    71,    72,    73,    74,    75,     8,    77,
      78,    79,    80,    81,    82,    83,    84,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    92,    93,    -1,    -1,    -1,    -1,
      -1,    -1,   100,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,     8,    47,    -1,    93,
      94,    -1,    -1,    97,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    47,     8,    -1,    -1,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    61,
     100,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    47,     8,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,








      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,     8,    47,    -1,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    47,     8,    -1,    -1,    -1,    -1,    -1,
      92,    93,    -1,    -1,    96,    -1,    -1,    61,    -1,    63,
      64,    65,    66,    67,    68,    69,    70,    71,    72,    73,
      74,    75,    -1,    77,    78,    79,    80,    81,    82,    83,
      84,    -1,     8,    47,    -1,    -1,    -1,    -1,    92,    93,
      -1,    -1,    96,    -1,    -1,    -1,    -1,    61,    -1,    63,
      64,    65,    66,    67,    68,    69,    70,    71,    72,    73,
      74,    75,    -1,    77,    78,    79,    80,    81,    82,    83,
      84,    47,     8,    -1,    -1,    -1,    -1,    -1,    92,    93,
      -1,    -1,    96,    -1,    -1,    61,    -1,    63,    64,    65,
      66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
      -1,    77,    78,    79,    80,    81,    82,    83,    84,    -1,
       8,    -1,    -1,    -1,    -1,    -1,    92,    93,    -1,    -1,
      96,    -1,    -1,    -1,    -1,    61,    -1,    63,    64,    65,
      66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
      -1,    77,    78,    79,    80,    81,    82,    83,    84,    47,
       8,    -1,    -1,    -1,    -1,    -1,    92,    93,    -1,    -1,
      96,    -1,    -1,    61,    62,    63,    64,    65,    66,    67,
      68,    69,    70,    71,    72,    73,    74,    75,    -1,    77,
      78,    79,    80,    81,    82,    83,    84,    -1,     8,    47,
      -1,    -1,    -1,    -1,    92,    93,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    61,    62,    63,    64,    65,    66,    67,
      68,    69,    70,    71,    72,    73,    74,    75,     8,    77,
      78,    79,    80,    81,    82,    83,    84,    47,    -1,    -1,
      -1,    -1,    -1,    -1,    92,    93,    -1,    -1,    -1,    -1,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,     8,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    92,    93,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,     8,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,     8,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      92,    93,    -1,    -1,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,     8,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    -1,    -1,    -1,    -1,    -1,

      92,    93,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    67,    68,    69,    70,    71,    72,    73,
      74,    75,    -1,    77,    78,    79,    80,    81,    82,    83,
      84,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    92,    93,
      -1,    -1,    -1,    -1,    68,    69,    70,    71,    72,    73,
      74,    75,    -1,    77,    78,    79,    80,    81,    82,    83,
      84,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    92,    93
};

  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
     symbol of state STATE-NUM.  */
static const yytype_uint8 yystos[] =
{
       0,     3,     4,     5,    11,    15,    16,    17,    18,    20,
      21,    22,    25,    26,    27,    28,    29,    30,    31,    32,
      33,    36,    45,    80,    81,    86,    87,    88,    89,    90,
      91,    93,    94,    96,    97,   102,   103,   104,   105,   106,
     107,   108,   110,   112,   113,   116,   119,   120,   122,   126,

     127,   128,   136,   137,   138,   141,   142,   145,    62,    94,
       4,   109,   109,     4,    94,     4,    16,    96,    97,   136,
       4,   117,   118,    94,   128,   138,   141,   138,    97,   135,
     136,    94,   136,   136,   136,   138,   138,   136,   136,   136,
     100,   136,   140,   136,     3,     4,    27,    28,    29,    32,
      36,   103,   136,   143,   144,     0,   104,   136,    94,     7,
       9,    10,    12,    94,     8,    47,    61,    63,    64,    65,
      66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
      77,    78,    79,    80,    81,    82,    83,    84,    92,    93,
      96,    49,    50,    51,    52,    53,    54,    55,    56,    57,
      58,    59,    60,    76,    87,    88,    92,    93,    94,   105,
     136,    96,    96,    94,     4,    92,   129,   134,     4,     3,

       4,    27,    28,    29,    32,    36,    96,    49,    47,    96,
     136,    94,    94,    94,    96,    98,   103,    23,    24,    96,
     136,    47,   100,    99,    62,    62,    62,    62,    62,    62,
      62,    98,    47,    98,   129,    94,    94,    97,   104,   111,

      94,   139,   140,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,     4,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,     4,   136,   139,    99,   129,    49,    62,    92,
      99,    47,    62,   136,   118,    99,   139,   139,   139,    98,
      94,   135,    99,   136,    94,   136,   136,   136,   136,   136,
     136,   136,   144,    99,    18,    96,   123,   136,   138,   136,
      98,     9,   136,    99,    62,    94,   100,   100,    99,   111,
      99,     3,    27,    28,    29,    32,    36,    81,    91,   133,
      16,    27,    34,    35,    36,    37,    38,    39,    40,    41,
      42,    43,    91,   130,   132,    92,    62,   135,     4,    92,
     136,    94,    99,    99,    99,     4,   111,   139,    62,   135,
       4,   117,   124,   136,    96,     8,    19,   121,    99,    94,
      99,   136,   139,    94,     6,    62,   135,    32,    49,    65,

     131,   132,    49,    62,    92,   139,    99,    99,   131,   121,

      96,    96,   136,   111,   136,    97,    99,   139,   111,   131,
     133,   130,   135,   133,   132,    92,    99,   135,   135,   136,
     125,   136,    99,    99,    13,    14,    98,   114,   115,    99,
     135,    49,    24,    99,    99,   111,   136,    62,    98,   115,
     133,   135,   111,   111,    62,   103,   103

};

  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const yytype_uint8 yyr1[] =
{
       0,   101,   102,   102,   102,   102,   103,   103,   104,   104,
     104,   105,   105,   105,   105,   105,   105,   105,   105,   105,
................................................................................
     105,   105,   105,   105,   105,   106,   106,   107,   108,   108,
     108,   108,   109,   109,   110,   110,   111,   111,   112,   113,
     113,   114,   114,   115,   115,   115,   115,   116,   116,   116,
     117,   117,   118,   118,   119,   120,   120,   121,   121,   122,
     122,   122,   123,   123,   123,   124,   124,   125,   125,   126,
     127,   128,   128,   128,   128,   129,   129,   129,   129,   130,
     130,   130,   130,   130,   130,   130,   130,   130,   130,   130,
     130,   130,   131,   132,   132,   133,   133,   133,   133,   133,
     133,   133,   133,   134,   134,   134,   134,   134,   134,   134,
     134,   135,   135,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   137,   137,   137,
     137,   138,   138,   138,   138,   138,   139,   139,   140,   140,
     141,   141,   141,   141,   141,   141,   141,   141,   141,   142,
     143,   143,   143,   144,   144,   144,   144,   144,   144,   144,
     145,   145
};

  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
static const yytype_uint8 yyr2[] =
{
       0,     2,     0,     1,     2,     1,     1,     2,     1,     1,
       3,     2,     1,     1,     3,     3,     3,     2,     3,     3,
................................................................................
       1,     1,     1,     3,     1,     7,     5,     2,     1,     1,
       1,     1,     0,     1,     0,     2,     1,     2,     5,     7,
       8,     1,     2,     4,     3,     2,     3,     7,     4,     9,
       1,     3,     1,     3,     3,     5,     7,     1,     1,     9,
       9,     8,     1,     2,     3,     0,     1,     0,     1,     6,
       7,     5,     7,     6,     8,     0,     1,     3,     5,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     3,     1,     1,     2,     1,     1,
       1,     1,     1,     1,     3,     3,     5,     3,     5,     5,
       7,     3,     2,     1,     1,     1,     3,     4,     3,     2,
       2,     2,     2,     2,     3,     3,     3,     3,     3,     3,
       2,     2,     2,     2,     2,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     1,     2,     2,     4,     2,
       5,     5,     7,     5,     4,     5,     1,     6,     7,     6,
       4,     1,     1,     1,     4,     3,     0,     1,     1,     3,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     3,
       0,     1,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     2
};


#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)
#define YYEMPTY         (-2)
#define YYEOF           0
................................................................................
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 129: /* args_opt  */
      { jsi_ScopeStrsFree(pstate->interp, ((*yyvaluep).scopes)); }
        break;

    case 133: /* argdefault  */
      { Jsi_ValueFree(pstate->interp, ((*yyvaluep).value)); }
        break;

    case 134: /* args  */
      { jsi_ScopeStrsFree(pstate->interp, ((*yyvaluep).scopes)); }
        break;

    case 135: /* func_statement_block  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 136: /* expr  */
























      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 137: /* fcall_exprs  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 138: /* lvalue  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 139: /* exprlist_opt  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 140: /* exprlist  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 141: /* value  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 142: /* object  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 143: /* items  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 144: /* item  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 145: /* array  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;


      default:
        break;
    }
................................................................................
    break;

  case 13:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 14:
    { (yyval.opcodes) = code_reserved(pstate, &(yylsp[-1]), RES_BREAK, (yyvsp[-1].str)); }
    break;

  case 15:
    { (yyval.opcodes) = code_reserved(pstate, &(yylsp[-1]), RES_CONTINUE, (yyvsp[-1].str)); }
    break;

  case 16:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_ret(pstate, &(yylsp[-1]), 1)); }
    break;

  case 17:
................................................................................
  case 24:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 25:
    {
        (yyvsp[-4].scopes)->retType = (yyvsp[-1].inum);
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[-6]), (yyvsp[-6].str), 0),
          code_push_func(pstate, &(yylsp[-4]), jsi_FuncMake(pstate, (yyvsp[-4].scopes), (yyvsp[0].opcodes), &(yylsp[-6]), (yyvsp[-6].str))),
          code_assign(pstate, &(yylsp[-6]), 1), code_pop(1));
        if (pstate->eval_flag) ret = codes_join(code_local(pstate, &(yylsp[-6]), (yyvsp[-6].str)), ret);
        jsi_PstatePop(pstate);
        (yyval.opcodes) = ret;
    }
    break;

  case 26:
    {
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[-4]), (yyvsp[-4].str), 0),
          code_push_func(pstate, &(yylsp[-2]), jsi_FuncMake(pstate, (yyvsp[-2].scopes), (yyvsp[0].opcodes), &(yylsp[-4]), (yyvsp[-4].str))),
          code_assign(pstate, &(yylsp[-4]), 1), code_pop(1));
        if (pstate->eval_flag) ret = codes_join(code_local(pstate, &(yylsp[-4]), (yyvsp[-4].str)), ret);
        jsi_PstatePop(pstate);
        (yyval.opcodes) = ret;
    }
    break;

  case 27:
    {
        if (!pstate->eval_flag) {
            jsi_PstateAddVar(pstate, &(yylsp[0]), (yyvsp[0].str));
        }
        (yyval.str) = (yyvsp[0].str);
    }
    break;

  case 28:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

................................................................................
    break;

  case 31:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 32:
    { (yyval.str) = NULL; }
    break;

  case 33:
    { (yyval.str) = (yyvsp[0].str); }
    break;

  case 34:
    { (yyval.str) = NULL; }
    break;

  case 35:
    {
        (yyval.str) = (yyvsp[-1].str);
    }
    break;

  case 36:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

................................................................................
                }
                cldefault = t;
            } else {
                t->next = head;
                head = t;
            }
        }
        code_reserved_replace(allstats, 0, 1, (yyvsp[-7].str), 1);
        
        Jsi_OpCodes *ophead = code_jmp(allstats->code_len + 1);
        if (cldefault) {
            ophead = codes_join(code_jmp(ophead->code_len + cldefault->off + 1), ophead);
            if (cldefault->es)
                Jsi_Free(cldefault->es);
            Jsi_Free(cldefault);
................................................................................

  case 46:
    { (yyval.caseitem) = exprstat_new(pstate, (yyvsp[-1].opcodes), code_nop(), 0); }
    break;

  case 47:
    {
        Jsi_OpCodes *catchblock = codes_join3(code_scatch(pstate, &(yylsp[-2]), (yyvsp[-2].str)), (yyvsp[0].opcodes), code_ecatch(pstate, &(yylsp[0])));
        Jsi_OpCodes *finallyblock = codes_join(code_sfinal(pstate, &(yylsp[-2])), code_efinal(pstate, &(yylsp[-2])));
        Jsi_OpCodes *tryblock = codes_join((yyvsp[-5].opcodes), code_etry(pstate, &(yylsp[-5])));
        (yyval.opcodes) = codes_join4(code_stry(pstate, &(yylsp[-6]), tryblock->code_len, catchblock->code_len, finallyblock->code_len),
                            tryblock, catchblock, finallyblock);
    }
    break;

................................................................................
        (yyval.opcodes) = codes_join4(code_stry(pstate, &(yylsp[-3]), tryblock->code_len, catchblock->code_len, finallyblock->code_len),
                            tryblock, catchblock, finallyblock);
    }
    break;

  case 49:
    {
        Jsi_OpCodes *catchblock = codes_join3(code_scatch(pstate, &(yylsp[-4]), (yyvsp[-4].str)), (yyvsp[-2].opcodes), code_ecatch(pstate, &(yylsp[-2])));
        Jsi_OpCodes *finallyblock = codes_join3(code_sfinal(pstate, &(yylsp[-8])), (yyvsp[0].opcodes), code_efinal(pstate, &(yylsp[-8])));
        Jsi_OpCodes *tryblock = codes_join((yyvsp[-7].opcodes), code_etry(pstate, &(yylsp[-7])));
        (yyval.opcodes) = codes_join4(code_stry(pstate, &(yylsp[-8]), tryblock->code_len, catchblock->code_len, finallyblock->code_len),
                            tryblock, catchblock, finallyblock);
    }
    break;

................................................................................

  case 51:
    { (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), (yyvsp[0].opcodes)); }
    break;

  case 52:
    {
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[0]), (yyvsp[0].str), 1),
                            code_push_undef(),
                            code_assign(pstate, &(yylsp[0]), 1),
                            code_pop(1));
        if (!pstate->eval_flag) jsi_PstateAddVar(pstate, &(yylsp[0]), (yyvsp[0].str));
        else ret = codes_join(code_local(pstate, &(yylsp[0]), (yyvsp[0].str)), ret);
        (yyval.opcodes) = ret;
    }
    break;

  case 53:
    {
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[-2]), (yyvsp[-2].str), 1),
                            (yyvsp[0].opcodes),
                            code_assign(pstate, &(yylsp[-2]), 1),
                            code_pop(1));
        if (!pstate->eval_flag) jsi_PstateAddVar(pstate, &(yylsp[-2]), (yyvsp[-2].str));
        else ret = codes_join(code_local(pstate, &(yylsp[-2]), (yyvsp[-2].str)), ret);
        (yyval.opcodes) = ret;
    }
    break;

  case 54:
    {
        if (((yyvsp[-1].opcodes))->lvalue_flag == 2) {
................................................................................
    {
        Jsi_OpCodes *init = (yyvsp[-5].opcodes);
        Jsi_OpCodes *cond = (yyvsp[-4].opcodes);
        Jsi_OpCodes *step = ((yyvsp[-2].opcodes) ? codes_join((yyvsp[-2].opcodes), code_pop(1)) : code_nop());
        Jsi_OpCodes *stat = (yyvsp[0].opcodes);
        Jsi_OpCodes *cont_jmp = code_jfalse(step->code_len + stat->code_len + 2);
        Jsi_OpCodes *step_jmp = code_jmp(-(cond->code_len + step->code_len + stat->code_len + 1));
        code_reserved_replace(stat, step->code_len + 1, 0, (yyvsp[-8].str), 0);
        (yyval.opcodes) = codes_join(codes_join3(init, cond, cont_jmp),
                           codes_join3(stat, step, step_jmp));
    }
    break;

  case 60:
    {
        jsi_ForinVar *fv;
        int inof = (yyvsp[-3].inum);
        Jsi_OpCodes *loc = code_local(pstate, &(yylsp[-4]), (yyvsp[-4].str));
        jsi_mark_local(loc);
        fv = forinvar_new(pstate, (yyvsp[-4].str), loc, NULL);
        Jsi_OpCodes *lval;
        if (fv->varname) lval = code_push_index(pstate, &(yylsp[-7]), fv->varname, 1);
        else lval = fv->lval;
        
        Jsi_OpCodes *ret = make_forin(lval, &(yylsp[-7]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), (yyvsp[-8].str), (inof!=0));
        if (fv->varname && fv->local) {
            if (!pstate->eval_flag) {
                jsi_PstateAddVar(pstate, &(yylsp[-4]), fv->varname);
                jsi_FreeOpcodes(fv->local);
            } else ret = codes_join(fv->local, ret);
        }
        Jsi_Free(fv);
................................................................................
        if (((yyvsp[-4].opcodes))->lvalue_flag == 2) 
            fv = forinvar_new(pstate, NULL, NULL, codes_join((yyvsp[-4].opcodes), code_subscript(pstate, &(yylsp[-4]), 0)));
        else fv = forinvar_new(pstate, NULL, NULL, (yyvsp[-4].opcodes));
        Jsi_OpCodes *lval;
        if (fv->varname) lval = code_push_index(pstate, &(yylsp[-7]), fv->varname, 0);
        else lval = fv->lval;
        
        Jsi_OpCodes *ret = make_forin(lval, &(yylsp[-6]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), (yyvsp[-7].str), (inof!=0));
        if (fv->varname && fv->local) {
            if (!pstate->eval_flag) {
                jsi_PstateAddVar(pstate, &(yylsp[-4]), fv->varname);
                jsi_FreeOpcodes(fv->local);
            } else ret = codes_join(fv->local, ret);
        }
        Jsi_Free(fv);
................................................................................
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 69:
    {
        Jsi_OpCodes *cond = (yyvsp[-2].opcodes);
        Jsi_OpCodes *stat = (yyvsp[0].opcodes);
        code_reserved_replace(stat, 1, 0, (yyvsp[-5].str), 0);
        (yyval.opcodes) = codes_join4(cond, code_jfalse(stat->code_len + 2), stat,
                           code_jmp(-(stat->code_len + cond->code_len + 1)));
    }
    break;

  case 70:
    {
        Jsi_OpCodes *stat = (yyvsp[-4].opcodes);
        Jsi_OpCodes *cond = (yyvsp[-1].opcodes);
        code_reserved_replace(stat, cond->code_len + 1, 0, (yyvsp[-6].str), 0);
        (yyval.opcodes) = codes_join3(stat, cond,
                            code_jtrue(-(stat->code_len + cond->code_len)));
    }
    break;

  case 71:
    {
................................................................................
        (yyval.opcodes) = code_push_func(pstate,  &(yylsp[-4]), jsi_FuncMake(pstate, (yyvsp[-4].scopes), (yyvsp[0].opcodes), &(yylsp[-6]), NULL));
        jsi_PstatePop(pstate);
    }
    break;

  case 73:
    {
        (yyval.opcodes) = code_push_func(pstate, &(yylsp[-3]), jsi_FuncMake(pstate, (yyvsp[-2].scopes), (yyvsp[0].opcodes), &(yylsp[-5]), (yyvsp[-4].str)));
        jsi_PstatePop(pstate);
    }
    break;

  case 74:
    {
        (yyvsp[-4].scopes)->retType = (yyvsp[-1].inum);
        (yyval.opcodes) = code_push_func(pstate, &(yylsp[-5]), jsi_FuncMake(pstate, (yyvsp[-4].scopes), (yyvsp[0].opcodes), &(yylsp[-7]), (yyvsp[-6].str)));
        jsi_PstatePop(pstate);
    }
    break;

  case 75:
    { (yyval.scopes) = jsi_ArgsOptAdd(pstate, jsi_ScopeStrsNew()); }
    break;
................................................................................
  case 94:
    {
        (yyval.inum) = pstate->argType;
    }
    break;

  case 95:
    {     (yyval.value) = Jsi_ValueNew(pstate->interp); (yyval.value)->d.num = 0; }
    break;

  case 96:
    {    (yyval.value) = Jsi_ValueNew(pstate->interp); (yyval.value)->d.num = 1; }
    break;

  case 97:
    { *(yyvsp[0].num) = *(yyvsp[0].num) * -1; (yyval.value) = Jsi_ValueNewNumber(pstate->interp, *(yyvsp[0].num)); Jsi_Free((yyvsp[0].num));}
    break;

  case 98:
    { (yyval.value) = Jsi_ValueNewNumber(pstate->interp, *(yyvsp[0].num)); Jsi_Free((yyvsp[0].num)); }
    break;

  case 99:
    {   (yyval.value) = Jsi_ValueNewBoolean(pstate->interp, 1); }
    break;

  case 100:
    {  (yyval.value) = Jsi_ValueNewBoolean(pstate->interp, 0); }
    break;

  case 101:
    {(yyval.value) = Jsi_ValueNewNull(pstate->interp); }
    break;

  case 102:
    {  (yyval.value) = Jsi_ValueNewStringKey(pstate->interp, (yyvsp[0].str)); }
    break;

  case 103:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[0].str), NULL, &(yylsp[0]) ); }
    break;

  case 104:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[-2].str), (yyvsp[0].value), &(yylsp[-2])); }
    break;

  case 105:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[-2].str), NULL, &(yylsp[-2]));}
    break;

  case 106:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[-4].str), (yyvsp[0].value), &(yylsp[-4]));}
    break;

  case 107:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-2].scopes), (yyvsp[0].str), NULL, &(yylsp[-2])); }
    break;

  case 108:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-4].scopes), (yyvsp[-2].str), (yyvsp[0].value), &(yylsp[-4])); }
    break;

  case 109:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-4].scopes), (yyvsp[-2].str), NULL, &(yylsp[-4]));}
    break;

  case 110:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-6].scopes), (yyvsp[-4].str), (yyvsp[0].value), &(yylsp[-6]));}
    break;

  case 111:
    { (yyval.opcodes) = (yyvsp[-1].opcodes); }
    break;

  case 112:
    { (yyval.opcodes) = code_nop(); }
    break;

  case 113:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 114:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 115:




    { 
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 1)); 
        else (yyval.opcodes) = (yyvsp[0].opcodes);
    }
    break;

  case 116:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_pop(1), (yyvsp[0].opcodes)); }
    break;

  case 117:
    { (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (yyvsp[-1].opcodes), code_subscript(pstate, &(yylsp[-3]), 1)); }
    break;

  case 118:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_push_string(pstate,&(yylsp[0]),(yyvsp[0].str)), code_subscript(pstate, &(yylsp[0]), 1)); }
    break;

  case 119:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_neg()); }
    break;

  case 120:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_pos()); }
    break;

  case 121:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_bnot()); }
    break;

  case 122:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_not()); }
    break;

  case 123:
    { (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_pop(1), code_push_undef()); }
    break;

  case 124:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mul()); }
    break;

  case 125:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_div()); }
    break;

  case 126:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mod()); }
    break;

  case 127:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_add()); }
    break;

  case 128:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_sub()); }
    break;

  case 129:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_in()); }
    break;

  case 130:
    {
        if (((yyvsp[-1].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-1].opcodes), code_subscript(pstate, &(yylsp[-1]), 0), code_inc(pstate, &(yylsp[-1]), 1));
        else (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_inc(pstate, &(yylsp[-1]), 1));
    }
    break;

  case 131:
    { 
        if (((yyvsp[-1].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-1].opcodes), code_subscript(pstate, &(yylsp[-1]), 0), code_dec(pstate, &(yylsp[-1]), 1));
        else (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_dec(pstate, &(yylsp[-1]), 1)); 
    }
    break;

  case 132:
    {
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 0), code_inc(pstate, &(yylsp[0]), 0));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_inc(pstate, &(yylsp[0]), 0));
    }
    break;

  case 133:
    {
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 0), code_typeof(pstate, &(yylsp[0]), 0));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_typeof(pstate, &(yylsp[0]), 0));
    }
    break;

  case 134:
    { 
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 0), code_dec(pstate, &(yylsp[0]), 0));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_dec(pstate, &(yylsp[0]), 0));
    }
    break;

  case 135:
    { (yyval.opcodes) = (yyvsp[-1].opcodes); }
    break;

  case 136:
    {
        Jsi_OpCodes *expr2 = codes_join(code_pop(1), (yyvsp[0].opcodes));
        (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_jfalse_np(expr2->code_len + 1), expr2);
    }
    break;

  case 137:
    {
        Jsi_OpCodes *expr2 = codes_join(code_pop(1), (yyvsp[0].opcodes));
        (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_jtrue_np(expr2->code_len + 1), expr2);
    }
    break;

  case 138:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_less()); }
    break;

  case 139:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_greater()); }
    break;

  case 140:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_lessequ()); }
    break;

  case 141:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_greaterequ()); }
    break;

  case 142:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_equal()); }
    break;

  case 143:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_notequal()); }
    break;

  case 144:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_eequ());    }
    break;

  case 145:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_nneq()); }
    break;

  case 146:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_band()); }
    break;

  case 147:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bor()); }
    break;

  case 148:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bxor()); }
    break;

  case 149:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(0)); }
    break;

  case 150:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(1)); }
    break;

  case 151:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(2)); }
    break;

  case 152:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_assign(pstate, &(yylsp[-2]), ((yyvsp[-2].opcodes))->lvalue_flag)); }
    break;

  case 153:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_add()); }
    break;

  case 154:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_sub()); }
    break;

  case 155:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mul()); }
    break;

  case 156:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mod()); }
    break;

  case 157:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(0)); }
    break;

  case 158:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(1)); }
    break;

  case 159:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(2)); }
    break;

  case 160:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_band()); }
    break;

  case 161:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bor()); }
    break;

  case 162:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bxor()); }
    break;

  case 163:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_div()); }
    break;

  case 164:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_instanceof()); }
    break;

  case 165:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 166:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_newfcall(pstate, &(yylsp[-1]), 0, NULL, (yyvsp[0].opcodes))); }
    break;

  case 167:
    { 
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 1), code_newfcall(pstate, &(yylsp[0]), 0, NULL, (yyvsp[0].opcodes)));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_newfcall(pstate, &(yylsp[0]), 0, NULL, (yyvsp[0].opcodes)));}
    break;

  case 168:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_newfcall(pstate, &(yylsp[-3]),0, NULL, (yyvsp[-1].opcodes))); }
    break;

  case 169:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_newfcall(pstate, &(yylsp[-1]),0, NULL, (yyvsp[0].opcodes))); }
    break;

  case 170:
    {
        Jsi_OpCodes *lval = (yyvsp[-3].opcodes);
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-4]), expr_cnt, lval->lvalue_name, opl));
    }
    break;

  case 171:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        Jsi_OpCodes *lv = NULL;
        if (((yyvsp[-3].opcodes))->lvalue_flag == 2) lv = codes_join((yyvsp[-3].opcodes), code_subscript(pstate, &(yylsp[-3]), 1));
        else lv = (yyvsp[-3].opcodes);
        (yyval.opcodes) = codes_join3(lv, (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-4]),expr_cnt, lv?lv->lvalue_name:NULL, opl));
    }
    break;

  case 172:
    { 
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-4].opcodes), (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-6]),expr_cnt, NULL, opl));
    }
    break;

  case 173:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-4]),expr_cnt, NULL, opl));
    }
    break;

  case 174:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-3]),expr_cnt, NULL, NULL, opl, NULL));
    }
    break;

  case 175:
    {
        Jsi_OpCodes *expr2 = codes_join((yyvsp[-2].opcodes), code_jmp(((yyvsp[0].opcodes))->code_len + 1));
        (yyval.opcodes) = codes_join4((yyvsp[-4].opcodes), code_jfalse(expr2->code_len + 1), expr2, (yyvsp[0].opcodes));
    }
    break;

  case 176:
    { (yyval.opcodes) = code_debug(pstate,&(yylsp[0])); }
    break;

  case 177:
    {
        Jsi_OpCodes *lval = (yyvsp[-5].opcodes);
        const char *n1 = lval->lvalue_name;
        const char *n2 = (yyvsp[-3].str);
        Jsi_OpCodes *ff = codes_join4((yyvsp[-5].opcodes), code_push_string(pstate,&(yylsp[-3]), (yyvsp[-3].str)), code_chthis(pstate,&(yylsp[-5]), 1), code_subscript(pstate, &(yylsp[-5]), 1));
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3(ff, (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-3]), expr_cnt, n1, n2, opl, NULL));
    }
    break;

  case 178:
    {
        Jsi_OpCodes *ff = codes_join4((yyvsp[-6].opcodes), (yyvsp[-4].opcodes), code_chthis(pstate,&(yylsp[-6]), 1), code_subscript(pstate, &(yylsp[-6]), 1));
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3(ff, (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-4]), expr_cnt, NULL, NULL, opl, NULL));
    }
    break;

  case 179:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join4((yyvsp[-4].opcodes), code_chthis(pstate,&(yylsp[-5]), 0), (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-3]),expr_cnt, NULL, NULL, opl, NULL));
    }
    break;

  case 180:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        Jsi_OpCodes *pref;
        Jsi_OpCodes *lval = (yyvsp[-3].opcodes);
        const char *n1 = lval->lvalue_name;
        if (lval->lvalue_flag == 2) {
................................................................................
                pref = codes_join((yyvsp[-3].opcodes), code_chthis(pstate,&(yylsp[-3]), 0));
                (yyval.opcodes) = codes_join3(pref, (opl ? opl : code_nop()), code_fcall(pstate, jpl, expr_cnt, n1, NULL, opl, pref));
            }
        }
    }
    break;

  case 181:
    {
        Jsi_OpCodes *lval = code_push_index(pstate, &(yylsp[0]), (yyvsp[0].str), 0); 
        (yyval.opcodes) = lval;
        lval->lvalue_flag = 1; 
        lval->lvalue_name = (yyvsp[0].str); 
    }
    break;

  case 182:
    { (yyval.opcodes) = code_push_args(); ((yyval.opcodes))->lvalue_flag = 1; }
    break;

  case 183:
    { (yyval.opcodes) = code_push_this(pstate,&(yylsp[0])); ((yyval.opcodes))->lvalue_flag = 1; }
    break;

  case 184:
    {
        if (((yyvsp[-3].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), code_subscript(pstate, &(yylsp[-3]), 1), (yyvsp[-1].opcodes)); 
        else (yyval.opcodes) = codes_join((yyvsp[-3].opcodes), (yyvsp[-1].opcodes)); 
        ((yyval.opcodes))->lvalue_flag = 2;
    }
    break;

  case 185:
    {
        if (((yyvsp[-2].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_subscript(pstate, &(yylsp[-2]), 1), code_push_string(pstate,&(yylsp[0]), (yyvsp[0].str))); 
        else (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), code_push_string(pstate,&(yylsp[0]), (yyvsp[0].str)));
        ((yyval.opcodes))->lvalue_flag = 2;
    }
    break;

  case 186:
    { (yyval.opcodes) = NULL; }
    break;

  case 187:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 188:
    { (yyval.opcodes) = (yyvsp[0].opcodes); ((yyval.opcodes))->expr_counter = 1; }
    break;

  case 189:
    { 
        int exprcnt = ((yyvsp[-2].opcodes))->expr_counter + 1;
        (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), (yyvsp[0].opcodes));
        ((yyval.opcodes))->expr_counter = exprcnt;
    }
    break;

  case 190:
    { (yyval.opcodes) = code_push_string(pstate,&(yylsp[0]), (yyvsp[0].str)); }
    break;

  case 191:
    { (yyval.opcodes) = code_push_null(); }
    break;

  case 192:
    { (yyval.opcodes) = code_push_undef(); }
    break;

  case 193:
    { (yyval.opcodes) = code_push_bool(1); }
    break;

  case 194:
    { (yyval.opcodes) = code_push_bool(0); }
    break;

  case 195:
    { (yyval.opcodes) = code_push_num((yyvsp[0].num)); }
    break;

  case 196:
    { (yyval.opcodes) = code_push_regex(pstate, &(yylsp[0]), (yyvsp[0].regex)); }
    break;

  case 197:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 198:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 199:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_object(pstate, &(yylsp[-1]), ((yyvsp[-1].opcodes))->expr_counter)); }
    break;

  case 200:
    { (yyval.opcodes) = code_nop(); ((yyval.opcodes))->expr_counter = 0; }
    break;

  case 201:
    { (yyval.opcodes) = (yyvsp[0].opcodes); ((yyval.opcodes))->expr_counter = 1; }
    break;

  case 202:




    {
        int cnt = ((yyvsp[-2].opcodes))->expr_counter + 1;
        (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), (yyvsp[0].opcodes));
        ((yyval.opcodes))->expr_counter = cnt;
    }
    break;

  case 203:
    { (yyval.opcodes) = codes_join(code_push_string(pstate,&(yylsp[-2]), (yyvsp[-2].str)), (yyvsp[0].opcodes)); }
    break;

  case 204:
    { (yyval.opcodes) = codes_join(code_push_string(pstate,&(yylsp[-2]), (yyvsp[-2].str)), (yyvsp[0].opcodes)); }
    break;

  case 205:




    { (yyval.opcodes) = codes_join(code_push_num((yyvsp[-2].num)), (yyvsp[0].opcodes));  }
    break;

  case 206:
    { (yyval.opcodes) = codes_join(code_push_bool(1), (yyvsp[0].opcodes));  }
    break;

  case 207:
    { (yyval.opcodes) = codes_join(code_push_bool(0), (yyvsp[0].opcodes));  }
    break;

  case 208:
    { (yyval.opcodes) = codes_join(code_push_undef(), (yyvsp[0].opcodes));  }
    break;

  case 209:
    { (yyval.opcodes) = codes_join(code_push_null(), (yyvsp[0].opcodes));  }
    break;

  case 210:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_array(pstate, &(yylsp[-1]), ((yyvsp[-1].opcodes))->expr_counter)); }
    break;

  case 211:
    { (yyval.opcodes) = code_array(pstate, &(yylsp[-1]), 0); }
    break;


      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
................................................................................
                jsiPush(interp,1);
                break;
            case OP_PUSHNUM:
                Jsi_ValueMakeNumber(interp, &_jsi_STACKIDX(interp->framePtr->Sp), (*((Jsi_Number *)ip->data)));
                jsiPush(interp,1);
                break;
            case OP_PUSHSTR: {
                Jsi_ValueMakeStringKey(interp,&_jsi_STACKIDX(interp->framePtr->Sp), (char*)ip->data);

                interp->lastPushStr = Jsi_ValueString(interp, _jsi_STACKIDX(interp->framePtr->Sp), NULL);












                jsiPush(interp,1);
                break;
            }
            case OP_PUSHVAR: {
                rc = jsi_PushVar(ps, ip, scope, currentScope, context_id);      
                break;
            }






|







 







|
|







 







|
>







 







|
>







 







>







 







>







 







>







 







>
>
>
>







 







>
>
>
|







 







|




|
>







 







>








|
|
<
<
<







 







>
|
>
>
>
>
>
>
>
>
>




>
>
>
>
>
>
>
|







 







|
|







 







|







 







|







 







<
|
<
<
<
<
<
>







 







>
>

|




|
|







 







<
|
<
<







 







>
>
>
>
>
>
>







 







|
|




|


|







 







>
>







 







>
>
>
>
>
>
>
>
>








>







 







>
>







 







<







 







|
<
<
<
<







 







<
<
<
|







 







|







 







>








>







 







|
|







 







|
>







 







|

|




|

|

|







 







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|








|







 







|
|
|







 







|


|

|








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







|
|
|


|
|
|
|
|
|
|


|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|





|
|
|
|
|





|
|
|
|
|







|
|
|
|
|
|
|
|
|
|
|
|
|


|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
|
|
|
|
|
|
|
<
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
<
<
>
>
|
|
|




|
<
>
|

|
|








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>





|
|
|
|

|
|

|
|
|


|
|

|
|








|





|
|

|
|








|


|
<
<
<
<
<
<
<
<
<
<
|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
<
<
|
|
|

<
<
<
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>



|






|




|


|
|

|
|
|
|
|
|
<

|

|


|



|
|

|
|
|
>
|
<
|
|
|
<
|











>
|
|
|
|
|
<
|
|
|
|
|
<
>
|
|
|
|
>
|
|
|
|
|
|
<
|
|
|
|
|
|
|
<
>
|
>
|
<
|
|
<
>







 







|
|
|
|
|
|
|
|
|
|
|
|
|







 







|
|
|
|
|


|
|
|
|
|
|







 







|



|



|



|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|



|







 







|



|







 







|
|

|







|
|

|








|

|







 







|



|



|




|







 







|







 







|







 







|







 







|



|
|






|



|
|







 







|









|

|




|







 







|







 







|









|







 







|







|







 







|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|







>
>
>
>






|



|



|
|


|



|



|



|



|



|



|



|



|



|



|



|






|






|






|






|






|



|






|






|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|



|





|



|



|








|










|







|







|







|






|



|



|
|






|








|







|







 







|

|


|



|



|



|







|

|
|




|



|



|



|







|
|


|



|



|



|



|



|

<
<
<
<







|



|



|



>
>
>
>







<
<
<
<

|



>
>
>
>



|



|



|



|



|



|







 







|
>
|
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
....
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
....
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
....
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
....
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
....
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
.....
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
.....
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
.....
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
.....
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
.....
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110



16111
16112
16113
16114
16115
16116
16117
.....
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
.....
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
.....
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
.....
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
.....
18159
18160
18161
18162
18163
18164
18165

18166





18167
18168
18169
18170
18171
18172
18173
18174
.....
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
.....
18400
18401
18402
18403
18404
18405
18406

18407


18408
18409
18410
18411
18412
18413
18414
.....
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
.....
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
.....
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
.....
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
.....
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
.....
20179
20180
20181
20182
20183
20184
20185

20186
20187
20188
20189
20190
20191
20192
.....
20195
20196
20197
20198
20199
20200
20201
20202




20203
20204
20205
20206
20207
20208
20209
.....
38223
38224
38225
38226
38227
38228
38229



38230
38231
38232
38233
38234
38235
38236
38237
.....
46222
46223
46224
46225
46226
46227
46228
46229
46230
46231
46232
46233
46234
46235
46236
.....
48110
48111
48112
48113
48114
48115
48116
48117
48118
48119
48120
48121
48122
48123
48124
48125
48126
48127
48128
48129
48130
48131
48132
48133
.....
63948
63949
63950
63951
63952
63953
63954
63955
63956
63957
63958
63959
63960
63961
63962
63963
.....
64033
64034
64035
64036
64037
64038
64039
64040
64041
64042
64043
64044
64045
64046
64047
64048
.....
64312
64313
64314
64315
64316
64317
64318
64319
64320
64321
64322
64323
64324
64325
64326
64327
64328
64329
64330
64331
64332
64333
64334
64335
64336
64337
.....
64377
64378
64379
64380
64381
64382
64383
64384
64385
64386
64387
64388
64389
64390
64391
64392
64393
64394
64395
64396
64397
64398
64399
64400
64401
64402
64403
64404
64405
64406
64407
64408
64409
64410
64411
64412
64413
64414
64415
64416
64417
64418
64419
64420
64421
.....
64426
64427
64428
64429
64430
64431
64432
64433
64434
64435
64436
64437
64438
64439
64440
64441
64442
.....
64451
64452
64453
64454
64455
64456
64457
64458
64459
64460
64461
64462
64463
64464
64465
64466
64467
64468
64469
64470
64471
64472
64473
64474
64475
64476
64477
64478
64479
64480
64481
64482
64483
64484
64485
64486
64487
64488
64489
64490
64491
64492
64493
64494
64495
64496
64497
64498
64499
64500
64501
64502
64503
64504
64505
64506
64507
64508
64509
64510
64511
64512
64513
64514
64515
64516
64517
64518
64519
64520
64521
64522
64523
64524
64525
64526
64527
64528
64529
64530
64531
64532
64533
64534
64535
64536
64537
64538
64539
64540
64541
64542
64543
64544
64545
64546
64547
64548
64549
64550
64551
64552
64553
64554
64555
64556
64557
64558
64559
64560
64561
64562
64563
64564
64565
64566
64567
64568
64569
64570
64571
64572
64573
64574
64575
64576
64577
64578
64579
64580
64581
64582
64583
64584
64585
64586
64587
64588
64589
64590
64591
64592
64593
64594
64595
64596
64597
64598
64599
64600
64601
64602
64603
64604
64605
64606
64607
64608
64609
64610
64611
64612
64613
64614
64615
64616
64617
64618
64619
64620
64621
64622
64623
64624
64625
64626
64627
64628
64629
64630
64631
64632
64633
64634
64635
64636
64637
64638
64639
64640
64641
64642
64643
64644
64645
64646

64647
64648
64649
64650
64651
64652
64653
64654
64655
64656
64657
64658
64659
64660
64661
64662
64663
64664
64665
64666
64667
64668
64669
64670
64671
64672
64673
64674
64675
64676
64677
64678
64679
64680
64681
64682
64683
64684
64685
64686
64687
64688
64689


64690
64691
64692
64693
64694
64695
64696
64697
64698
64699

64700
64701
64702
64703
64704
64705
64706
64707
64708
64709
64710
64711
64712
64713
64714
64715
64716
64717
64718
64719
64720
64721
64722
64723
64724
64725
64726
64727
64728
64729
64730
64731
64732
64733
64734
64735
64736
64737
64738
64739
64740
64741
64742
64743
64744
64745
64746
64747
64748
64749
64750
64751
64752
64753
64754
64755
64756
64757
64758
64759
64760
64761
64762
64763
64764
64765
64766
64767
64768
64769
64770
64771
64772
64773
64774
64775
64776
64777
64778
64779
64780
64781
64782
64783
64784
64785
64786
64787
64788
64789
64790
64791
64792
64793
64794
64795
64796
64797
64798
64799
64800
64801
64802
64803
64804
64805
64806
64807
64808
64809
64810
64811
64812
64813
64814
64815
64816
64817
64818
64819
64820
64821
64822
64823
64824
64825
64826
64827
64828
64829
64830
64831
64832
64833
64834
64835
64836
64837
64838
64839
64840
64841
64842
64843
64844
64845
64846
64847
64848
64849
64850
64851
64852
64853
64854
64855
64856
64857
64858
64859
64860
64861
64862
64863
64864
64865
64866
64867
64868
64869
64870
64871
64872
64873
64874
64875
64876
64877
64878
64879
64880
64881
64882
64883
64884
64885
64886
64887
64888
64889
64890
64891
64892
64893
64894
64895
64896
64897
64898
64899
64900
64901
64902
64903
64904
64905
64906
64907
64908
64909
64910
64911
64912
64913
64914
64915
64916
64917
64918
64919
64920
64921
64922
64923
64924
64925
64926
64927
64928
64929
64930
64931
64932
64933
64934
64935
64936
64937
64938
64939
64940
64941
64942
64943
64944
64945
64946
64947
64948
64949
64950
64951
64952
64953
64954
64955
64956
64957










64958



64959
64960
64961
64962
64963
64964
64965
64966
64967
64968
64969
64970


64971
64972
64973
64974



64975
64976
64977
64978
64979
64980
64981
64982
64983
64984
64985
64986
64987
64988
64989
64990
64991
64992
64993
64994
64995
64996
64997
64998
64999
65000
65001
65002
65003
65004
65005
65006
65007
65008
65009
65010
65011
65012
65013
65014
65015
65016
65017
65018
65019
65020
65021
65022
65023
65024
65025
65026
65027
65028
65029
65030
65031
65032
65033
65034
65035
65036
65037
65038
65039
65040
65041
65042
65043
65044
65045

65046
65047
65048
65049
65050
65051
65052
65053
65054
65055
65056
65057
65058
65059
65060
65061
65062
65063

65064
65065
65066

65067
65068
65069
65070
65071
65072
65073
65074
65075
65076
65077
65078
65079
65080
65081
65082
65083
65084

65085
65086
65087
65088
65089

65090
65091
65092
65093
65094
65095
65096
65097
65098
65099
65100
65101

65102
65103
65104
65105
65106
65107
65108

65109
65110
65111
65112

65113
65114

65115
65116
65117
65118
65119
65120
65121
65122
.....
65123
65124
65125
65126
65127
65128
65129
65130
65131
65132
65133
65134
65135
65136
65137
65138
65139
65140
65141
65142
65143
65144
65145
65146
65147
65148
65149
.....
65150
65151
65152
65153
65154
65155
65156
65157
65158
65159
65160
65161
65162
65163
65164
65165
65166
65167
65168
65169
65170
65171
65172
65173
65174
65175
65176
.....
65752
65753
65754
65755
65756
65757
65758
65759
65760
65761
65762
65763
65764
65765
65766
65767
65768
65769
65770
65771
65772
65773
65774
65775
65776
65777
65778
65779
65780
65781
65782
65783
65784
65785
65786
65787
65788
65789
65790
65791
65792
65793
65794
65795
65796
65797
65798
65799
65800
65801
65802
























65803
65804
65805
65806
65807
65808
65809
65810
65811
65812
65813
65814
.....
66147
66148
66149
66150
66151
66152
66153
66154
66155
66156
66157
66158
66159
66160
66161
66162
66163
66164
66165
.....
66196
66197
66198
66199
66200
66201
66202
66203
66204
66205
66206
66207
66208
66209
66210
66211
66212
66213
66214
66215
66216
66217
66218
66219
66220
66221
66222
66223
66224
66225
66226
66227
66228
66229
66230
66231
66232
66233
66234
66235
.....
66242
66243
66244
66245
66246
66247
66248
66249
66250
66251
66252
66253
66254
66255
66256
66257
66258
66259
66260
66261
66262
66263
66264
66265
66266
66267
66268
66269
.....
66303
66304
66305
66306
66307
66308
66309
66310
66311
66312
66313
66314
66315
66316
66317
.....
66356
66357
66358
66359
66360
66361
66362
66363
66364
66365
66366
66367
66368
66369
66370
.....
66376
66377
66378
66379
66380
66381
66382
66383
66384
66385
66386
66387
66388
66389
66390
.....
66394
66395
66396
66397
66398
66399
66400
66401
66402
66403
66404
66405
66406
66407
66408
66409
66410
66411
66412
66413
66414
66415
66416
66417
66418
66419
66420
66421
66422
66423
66424
66425
.....
66458
66459
66460
66461
66462
66463
66464
66465
66466
66467
66468
66469
66470
66471
66472
66473
66474
66475
66476
66477
66478
66479
66480
66481
66482
66483
66484
66485
66486
66487
66488
66489
.....
66498
66499
66500
66501
66502
66503
66504
66505
66506
66507
66508
66509
66510
66511
66512
.....
66545
66546
66547
66548
66549
66550
66551
66552
66553
66554
66555
66556
66557
66558
66559
66560
66561
66562
66563
66564
66565
66566
66567
66568
66569
.....
66578
66579
66580
66581
66582
66583
66584
66585
66586
66587
66588
66589
66590
66591
66592
66593
66594
66595
66596
66597
66598
66599
66600
.....
66691
66692
66693
66694
66695
66696
66697
66698
66699
66700
66701
66702
66703
66704
66705
66706
66707
66708
66709
66710
66711
66712
66713
66714
66715
66716
66717
66718
66719
66720
66721
66722
66723
66724
66725
66726
66727
66728
66729
66730
66731
66732
66733
66734
66735
66736
66737
66738
66739
66740
66741
66742
66743
66744
66745
66746
66747
66748
66749
66750
66751
66752
66753
66754
66755
66756
66757
66758
66759
66760
66761
66762
66763
66764
66765
66766
66767
66768
66769
66770
66771
66772
66773
66774
66775
66776
66777
66778
66779
66780
66781
66782
66783
66784
66785
66786
66787
66788
66789
66790
66791
66792
66793
66794
66795
66796
66797
66798
66799
66800
66801
66802
66803
66804
66805
66806
66807
66808
66809
66810
66811
66812
66813
66814
66815
66816
66817
66818
66819
66820
66821
66822
66823
66824
66825
66826
66827
66828
66829
66830
66831
66832
66833
66834
66835
66836
66837
66838
66839
66840
66841
66842
66843
66844
66845
66846
66847
66848
66849
66850
66851
66852
66853
66854
66855
66856
66857
66858
66859
66860
66861
66862
66863
66864
66865
66866
66867
66868
66869
66870
66871
66872
66873
66874
66875
66876
66877
66878
66879
66880
66881
66882
66883
66884
66885
66886
66887
66888
66889
66890
66891
66892
66893
66894
66895
66896
66897
66898
66899
66900
66901
66902
66903
66904
66905
66906
66907
66908
66909
66910
66911
66912
66913
66914
66915
66916
66917
66918
66919
66920
66921
66922
66923
66924
66925
66926
66927
66928
66929
66930
66931
66932
66933
66934
66935
66936
66937
66938
66939
66940
66941
66942
66943
66944
66945
66946
66947
66948
66949
66950
66951
66952
66953
66954
66955
66956
66957
66958
66959
66960
66961
66962
66963
66964
66965
66966
66967
66968
66969
66970
66971
66972
66973
66974
66975
66976
66977
66978
66979
66980
66981
66982
66983
66984
66985
66986
66987
66988
66989
66990
66991
66992
66993
66994
66995
66996
66997
66998
66999
67000
67001
67002
67003
67004
67005
67006
67007
67008
67009
67010
67011
67012
67013
67014
67015
67016
67017
67018
67019
67020
67021
67022
67023
67024
67025
67026
67027
67028
67029
67030
67031
67032
67033
67034
67035
67036
67037
67038
67039
67040
67041
67042
67043
67044
67045
67046
67047
67048
67049
67050
67051
67052
67053
67054
67055
67056
67057
67058
67059
67060
67061
67062
67063
67064
67065
67066
67067
67068
67069
67070
67071
67072
67073
67074
67075
67076
67077
67078
67079
67080
67081
67082
67083
67084
67085
67086
67087
67088
67089
67090
67091
67092
67093
67094
67095
67096
67097
67098
67099
67100
67101
67102
67103
67104
67105
67106
67107
67108
67109
67110
67111
67112
67113
67114
67115
67116
67117
67118
.....
67132
67133
67134
67135
67136
67137
67138
67139
67140
67141
67142
67143
67144
67145
67146
67147
67148
67149
67150
67151
67152
67153
67154
67155
67156
67157
67158
67159
67160
67161
67162
67163
67164
67165
67166
67167
67168
67169
67170
67171
67172
67173
67174
67175
67176
67177
67178
67179
67180
67181
67182
67183
67184
67185
67186
67187
67188
67189
67190
67191
67192
67193
67194
67195
67196
67197
67198
67199
67200
67201
67202
67203
67204
67205
67206
67207
67208
67209
67210
67211
67212
67213
67214
67215
67216
67217




67218
67219
67220
67221
67222
67223
67224
67225
67226
67227
67228
67229
67230
67231
67232
67233
67234
67235
67236
67237
67238
67239
67240
67241
67242
67243
67244
67245
67246
67247




67248
67249
67250
67251
67252
67253
67254
67255
67256
67257
67258
67259
67260
67261
67262
67263
67264
67265
67266
67267
67268
67269
67270
67271
67272
67273
67274
67275
67276
67277
67278
67279
67280
67281
67282
67283
67284
67285
67286
67287
.....
69538
69539
69540
69541
69542
69543
69544
69545
69546
69547
69548
69549
69550
69551
69552
69553
69554
69555
69556
69557
69558
69559
69560
69561
69562
69563
69564
69565
69566
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 33

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif

................................................................................
#endif

/* Token type.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
  enum yytokentype
  {
    IDENTIFIER = 258,
    STRING = 259,
    IF = 260,
    ELSE = 261,
    FOR = 262,
    IN = 263,
    WHILE = 264,
    DO = 265,
    CONTINUE = 266,
................................................................................
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED

union YYSTYPE
{

    Jsi_OpCodes *opcodes;
    Jsi_Value *value;
    const char *sstr;
    Jsi_String *vstr;
    Jsi_Regex* regex;
    Jsi_Number *num;
    Jsi_ScopeStrs *scopes;
    int inum;
    struct jsi_CaseExprStat* caseitem;
    struct jsi_CaseList* caselist;

................................................................................
/* stack change */
/* 0  nothing change */
/* +1 push */
/* -1 pop */
typedef enum {      /* SC   type of data    comment                             */
    OP_NOP,         /* 0 */
    OP_PUSHNUM,     /* +1   *double         number                              */
    OP_PUSHSTR,     /* +1   *char           string                              */
    OP_PUSHVSTR,    /* +1   Jsi_String*     string                              */
    OP_PUSHVAR,     /* +1   *FastVar        variable name                       */
    OP_PUSHUND,     /* +1   -               undefined                           */
    OP_PUSHNULL,    /* +1   -               null                                */
    OP_PUSHBOO,     /* +1   int             bool                                */
    OP_PUSHFUN,     /* +1   *Jsi_Func           function                            */
    OP_PUSHREG,     /* +1   *regex_t        regex                               */
    OP_PUSHARG,     /* +1   -               push arguments(cur scope)           */
................................................................................

    int _context_id;            /* used in FastVar-locating */
    Jsi_Value *last_exception;
    Jsi_Interp *interp;
    Jsi_HashEntry *hPtr;
    Jsi_Hash *argsTbl;
    Jsi_Hash *fastVarTbl;
    Jsi_Hash *strTbl;
    int argType;                // Used during parsing to aggregate type.
    Jsi_ScopeStrs *args;        // Last push.
} jsi_Pstate;


Jsi_ScopeStrs *jsi_ScopeStrsNew(void);
void jsi_ScopeStrsPush(Jsi_Interp *interp, Jsi_ScopeStrs *ss, const char *string, int argType);
................................................................................
extern const char *jsi_ObjectTypeName(Jsi_Interp *interp, Jsi_otype otyp);
extern const char *jsi_ValueTypeName(Jsi_Interp *interp, Jsi_Value *val);
extern const char *jsi_TypeName(Jsi_Interp *interp, Jsi_ttype otyp);
extern Jsi_RC jsi_ObjectToStringCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);
extern Jsi_RC jsi_HasOwnPropertyCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);
extern Jsi_Value* jsi_ValueMakeBlobDup(Jsi_Interp *interp, Jsi_Value **vPtr, unsigned char *s, int len);

extern const char *jsi_GetHomeDir(Jsi_Interp *interp);
extern Jsi_RC jsi_RegExpValueNew(Jsi_Interp *interp, const char *regtxt, Jsi_Value *ret);
extern void jsi_DumpOptionSpecs(Jsi_Interp *interp, Jsi_Obj *nobj, Jsi_OptionSpec* spec);
extern Jsi_Func *jsi_FuncMake(jsi_Pstate *pstate, Jsi_ScopeStrs *args, Jsi_OpCodes *ops, jsi_Pline *line, const char *name);
extern Jsi_Func *jsi_FuncNew(Jsi_Interp *interp);
extern void jsi_FreeOpcodes(Jsi_OpCodes *ops);
................................................................................
 *    corrent stack elems poped(for in always has 2 elem, while switch has 1)
 */

static const char *jsi_op_names[OP_LASTOP] = {
    "NOP",
    "PUSHNUM",
    "PUSHSTR",
    "PUSHVSTR",
    "PUSHVAR",
    "PUSHUND",
    "PUSHNULL",
    "PUSHBOO",
    "PUSHFUN",
    "PUSHREG",
    "PUSHARG",
................................................................................
static Jsi_OpCodes *code_push_bool(int v) { JSI_NEW_CODES(0,OP_PUSHBOO, v); }
static Jsi_OpCodes *code_push_num(Jsi_Number *v) { JSI_NEW_CODES(1,OP_PUSHNUM, v); }
static Jsi_OpCodes *code_push_string(jsi_Pstate *p, jsi_Pline *line, const char *str) {
    if (*str == 'c' && !Jsi_Strcmp(str,"callee"))
        p->interp->hasCallee = 1;
    JSI_NEW_CODESLN(0,OP_PUSHSTR, str);
}

static Jsi_OpCodes *code_push_vstring(jsi_Pstate *p, jsi_Pline *line, Jsi_String *s) {
    JSI_NEW_CODESLN(0,OP_PUSHVSTR, s);
}

static Jsi_OpCodes *code_push_index(jsi_Pstate *p, jsi_Pline *line, const char *varname, int local)
{
    jsi_FastVar *n = (typeof(n))Jsi_Calloc(1, sizeof(*n));
    n->sig = JSI_SIG_FASTVAR;
    n->ps = p;
    n->context_id = -1;
................................................................................
        op->op == OP_POP || op->op == OP_ASSIGN ||
        op->op == OP_RET || op->op == OP_NEWFCALL ||
        op->op == OP_DELETE || op->op == OP_CHTHIS ||
        op->op == OP_OBJECT || op->op == OP_ARRAY ||
        op->op == OP_SHF ||
        op->op == OP_INC || op->op == OP_DEC) snprintf(bp, bsiz, "%" PRId64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_PUSHNUM) Jsi_NumberDtoA(interp, *((Jsi_Number *)op->data), bp, bsiz, 0);
    else if (op->op == OP_PUSHVSTR) {
        Jsi_String *ss = (Jsi_String*)op->data;
        snprintf(bp, bsiz, "\"%s\"", ss->str);
    } else if (op->op == OP_PUSHSTR || op->op == OP_LOCAL ||
             op->op == OP_SCATCH) snprintf(bp, bsiz, "\"%s\"", op->data ? (char*)op->data:"(NoCatch)");
    else if (op->op == OP_PUSHVAR) snprintf(bp, bsiz, "var: \"%s\"", ((jsi_FastVar *)op->data)->varname);
    else if (op->op == OP_PUSHFUN) snprintf(bp, bsiz, "func: 0x%" PRIx64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_JTRUE || op->op == OP_JFALSE ||
             op->op == OP_JTRUE_NP || op->op == OP_JFALSE_NP ||
             op->op == OP_JMP) snprintf(bp, bsiz, "{%" PRIu64 "}\t#%" PRIu64 "", (Jsi_Wide)(uintptr_t)op->data, (Jsi_Wide)((uintptr_t)currentip + (uintptr_t)op->data));
    else if (op->op == OP_JMPPOP) {
................................................................................
    Jsi_Interp *interp = lex->pstate->interp;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->lexkeyTbl, word);
    if (hPtr)
        return (uintptr_t)Jsi_HashValueGet(hPtr);
    return 0;
}

static Jsi_String* jsi_do_string(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    lex->inStr = 1;
    int n, c = lexer_getchar(lex);
    int endchar = c, isnull = 0;
    uint32_t flags = 0;
    
    int bufi = 0, bsiz, done = 0;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
    
    while (!done) {
        if (bufi >= (bsiz-5)) {
            int nsiz = bsiz+=JSI_BUFSIZ;
................................................................................
            n = lexer_getchar(lex);
            switch(n) {
                case 'b': buf[bufi++] = '\b'; break;
                case 'f': buf[bufi++] = '\f'; break;
                case 'n': buf[bufi++] = '\n'; break;
                case 'r': buf[bufi++] = '\r'; break;
                case 't': buf[bufi++] = '\t'; break;
                case '0': buf[bufi++] = 0; isnull=1; break;
                case 'u': {
                    char ibuf[5];
                    int ui;
                    for (ui=0; ui<4; ui++)
                        ibuf[ui] = lexer_getchar(lex);
                    ibuf[4] = 0;
                    ui = Jsi_UtfDecode(ibuf, buf+bufi);
                    if (ui>0) {
                        if (!buf[bufi])
                            isnull = 1;



                        bufi+=ui;
                    } else {
                        Jsi_LogError("Unexpected utf encoding.");
                        buf[bufi++] = 0;
                        goto done;
                    }
                    break;
................................................................................
        }
        if (c == endchar) {
            bufi --;
            break;
        }
    }
    buf[bufi] = 0;
    if (!isnull)
        ret = (char*)Jsi_KeyAdd(lex->pstate->interp, buf);
    else {
        flags |= 1;
        if (buf == unibuf) {
            buf = (char*)Jsi_Malloc(bufi+1);
            memcpy(buf, unibuf, bufi+1);
        }
        ret = buf;
        buf = unibuf;
    }
done:
    if (buf != unibuf)
        Jsi_Free(buf);
    lex->inStr = 0;
    if (!ret)
        return NULL;
    Jsi_String *s = Jsi_Calloc(1, sizeof(*s));
    s->str = ret;
    s->len = bufi;
    s->flags = flags;
    Jsi_HashSet(lex->pstate->strTbl, s, s);
    return s;
}

static char *jsi_do_regex(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    int n, bufi = 0, bsiz;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
................................................................................
        }
        Jsi_Number *db = (Jsi_Number *)Jsi_Malloc(sizeof(Jsi_Number));
        *db = fval;
        yylvalp->num = db;
        return FNUMBER;
    } else if (c == '"' || c == '\'') {
        lexer_ungetc(c, lex);
        yylvalp->vstr = jsi_do_string(lex);
        if (!yylvalp->vstr)
            return 0;
        LOCATION_END(yyllocp, lex);
        return STRING;
    } else if (isalpha(c) || c == '_' || c == '$') {
        lexer_ungetc(c, lex);
        while (wi < 1020) {
            c = lexer_getchar(lex);
................................................................................
            word[wi++] = c;
        }
        lexer_ungetc(c, lex);
        
        word[wi] = 0;
        int r = jsi_iskey(word, lex);
        if (r) return r;
        yylvalp->sstr = (char*)Jsi_KeyAdd(interp,word);
        LOCATION_END(yyllocp, lex);
        return IDENTIFIER;
    } else if (c == '/') {
        int d = lexer_getchar(lex);
        if (d == '/') {
            while ((d = lexer_getchar(lex)) != '\r' && d != '\n' && d != 0);
            return COMMENT;
................................................................................
done:
    if (lenPtr) *lenPtr = Jsi_Strlen(ntxt);
    return ntxt;
}

Jsi_Number Jsi_ValueToNumberInt(Jsi_Interp *interp, Jsi_Value *v, int isInt)
{
    char *endPtr = NULL, *sptr;
    Jsi_Number a = 0;
    switch(v->vt) {
        case JSI_VT_BOOL:
            a = (Jsi_Number)(v->d.val ? 1.0: 0);
            break;
        case JSI_VT_NULL:
            a = 0;
................................................................................
                case JSI_OT_BOOL:
                    a = (Jsi_Number)(obj->d.val ? 1.0: 0);
                    break;
                case JSI_OT_NUMBER:
                    a = obj->d.num;
                    break;
                case JSI_OT_STRING:

                    sptr = obj->d.s.str;





                    goto donum;
                    break;
                default:
                    a = 0;
                break;
            }
            break;
        }
................................................................................
        case JSI_VT_UNDEF:
            a = Jsi_NumberNaN();
            break;
        case JSI_VT_NUMBER:
            a = v->d.num;
            break;
        case JSI_VT_STRING:
            sptr = v->d.s.str;
donum:
            if (!isInt) {
                a = strtod(sptr, &endPtr);
                if (endPtr && *endPtr) {
                    a = interp->NaNValue->d.num;
                }
            } else {
                a = (Jsi_Number)strtol(sptr, &endPtr, 0);
                if (!isdigit(*sptr))
                    a = interp->NaNValue->d.num;
            }
            break;
        default:
            Jsi_LogBug("Convert a unknown type: 0x%x to number", v->vt);
            break;
    }
................................................................................
                    res.d.s = obj->d.s;
                    obj->d.s.str = NULL;
                } else if (obj->d.s.len >= 0) 
                {
                    Assert(obj->refcnt>=1);
                    obj->refcnt--;
                    int bytes = obj->d.s.len;

                    jsi_ValueMakeBlobDup(interp, &rPtr, (uchar*)obj->d.s.str, bytes);


                } else
                    Jsi_ValueMakeStringDup(interp, &rPtr, obj->d.s.str);
            }
            break;
        case JSI_OT_FUNCTION: {
            Jsi_DString dStr;
            Jsi_DSInit(&dStr);
................................................................................
    Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_STRING);
    Jsi_ValueMakeObject(interp, &v, obj);
    obj->d.s.str = (char*)s;
    obj->d.s.len = len;
    obj->isBlob = 1;
    return v;
}
Jsi_Value* jsi_ValueMakeBlobDup(Jsi_Interp *interp, Jsi_Value **ret, unsigned char *s, int len) {
    if (len<0) len = Jsi_Strlen((char*)s);
    uchar *dp = (uchar*)Jsi_Malloc(len+1);
    memcpy(dp, s, len);
    dp[len] = 0;
    return Jsi_ValueMakeBlob(interp, ret, dp, len);
}


Jsi_Value* Jsi_ValueMakeString(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
    return Jsi_ValueMakeBlob(interp, vPtr, (unsigned char *)s, Jsi_Strlen(s));
}

Jsi_Value* Jsi_ValueMakeStringKey(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
................................................................................
    if (v->vt == JSI_VT_OBJECT) {
        return v->d.obj;
    }
    return NULL;
}

int Jsi_ValueStrlen(Jsi_Value* v) {
    //if (v->vt == JSI_VT_OBJECT && v->d.obj->ot == JSI_OT_STRING && v->d.obj->isBlob)
    //    return v->d.obj->d.s.len;
    Jsi_String *s = jsi_ValueString(v);
    if (s == 0 || s->str == 0)
        return 0;
#if JSI__UTF8
    return (int)Jsi_NumUtfChars(s->str, s->len);
#else
    if (s->len>=0) return s->len;
    return (int)Jsi_NumUtfChars(s->str, s->len);
#endif
}

char *Jsi_ValueString(Jsi_Interp *interp, Jsi_Value* v, int *lenPtr)
{
    if (!v) return NULL;
    Jsi_String *s = jsi_ValueString(v);
................................................................................
    int atyp = pstate->argType;
    if (defValue) {
        int vt = defValue->vt;
        if (vt == JSI_VT_NULL)
            vt = JSI_TT_NULL;
        else if (vt == JSI_VT_UNDEF && defValue->d.num==1)
            vt = JSI_TT_VOID;
        else if (vt == JSI_VT_OBJECT && defValue->d.obj->ot==JSI_OT_STRING)
            vt = JSI_TT_STRING;
        else
            vt = (1<<defValue->vt);
        atyp |= vt;
    }
    jsi_ScopeStrsPush(interp, a, name, atyp);
    pstate->argType = 0;
    a->args[a->count-1].defValue = defValue;
................................................................................
        //printf("FV FREE: %p (%d/%d)\n", fv, v->refCnt, v->vt == JSI_VT_OBJECT?v->d.obj->refcnt:-99);
        //Jsi_DecrRefCount(interp, v);
    }
    return JSI_OK;
}
#endif


static Jsi_RC jsi_StringFree(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *d) {
    Jsi_String *s = (Jsi_String *)d;
    if (s->flags&1)
        Jsi_Free(s->str);
    Jsi_Free(s);
    return JSI_OK;
}

jsi_Pstate *jsi_PstateNew(Jsi_Interp *interp)
{
    jsi_Pstate *ps = (jsi_Pstate *)Jsi_Calloc(1,sizeof(*ps));
    SIGINIT(ps,PARSER);
    ps->lexer = (jsi_Lexer*)Jsi_Calloc(1,sizeof(*ps->lexer));
    ps->lexer->pstate = ps;
    ps->interp = interp;
    ps->fastVarTbl = Jsi_HashNew(interp, JSI_KEYS_ONEWORD, NULL /*fastVarFree*/);
    ps->strTbl = Jsi_HashNew(interp, JSI_KEYS_ONEWORD, jsi_StringFree);
    return ps;
}

const char *jsi_PstateGetFilename(jsi_Pstate *ps)
{
    Jsi_Interp *interp = ps->interp;
    return interp->curFile;
................................................................................
        jsi_FreeOpcodes(ps->opcodes);
    if (ps->hPtr)
        Jsi_HashEntryDelete(ps->hPtr);
    if (ps->argsTbl)
        Jsi_HashDelete(ps->argsTbl);
    if (ps->fastVarTbl)
        Jsi_HashDelete(ps->fastVarTbl);
    if (ps->strTbl)
        Jsi_HashDelete(ps->strTbl);
    if (ps->last_exception)
        Jsi_DecrRefCount(ps->interp, ps->last_exception);
    _JSI_MEMCLEAR(ps);
    Jsi_Free(ps);
}

#endif
................................................................................
}

/* Clean-copy value to interp: convert to JSON and back if required. */
Jsi_RC Jsi_CleanValue(Jsi_Interp *interp, Jsi_Interp *tointerp, Jsi_Value *val, Jsi_Value **ret)
{
    Jsi_RC rc = JSI_OK;
    const char *cp;

    int len, iskey;
    Jsi_Obj *obj;
    switch (val->vt) {
        case JSI_VT_UNDEF: Jsi_ValueMakeUndef(interp, ret); return rc;
        case JSI_VT_NULL: Jsi_ValueMakeNull(tointerp, ret); return rc;
        case JSI_VT_BOOL: Jsi_ValueMakeBool(tointerp, ret, val->d.val); return rc;
        case JSI_VT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, val->d.num); return rc;
................................................................................
            cp = val->d.s.str;
            len = val->d.s.len;
makestr:
            if (iskey) {
                Jsi_ValueMakeStringKey(interp, ret, cp);
                return rc;
            }
            jsi_ValueMakeBlobDup(tointerp, ret, (uchar*)cp, len);




            return rc;
        case JSI_VT_OBJECT:
            obj = val->d.obj;
            switch (obj->ot) {
                case JSI_OT_BOOL: Jsi_ValueMakeBool(tointerp, ret, obj->d.val); return rc;
                case JSI_OT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, obj->d.num); return rc;
                case JSI_OT_STRING:
................................................................................
    Jsi_CryptoHash(zbuf, cp, n, edata.type, edata.hashcash, edata.noHex, &olen);
        
done:
    Jsi_DSFree(&dStr);
    if (hasopts)
        Jsi_OptionsFree(interp, HashOptions, &edata, 0);
    if (rc == JSI_OK) {



        jsi_ValueMakeBlobDup(interp, ret, (uchar*)zbuf, olen);
    }
    return rc;

}


#ifndef JSI_OMIT_ENCRYPT
................................................................................
    if ((c & 0xf0) == 0xe0) return 3;
    if ((c & 0xf8) == 0xf0) return 4;
    return -1;
#endif
}

uint Jsi_NumUtfChars(const char *s, int length) {
    if (!s || !length) return 0;
#if !JSI__UTF8
    uint len = Jsi_Strlen(s);
    if (length<0) return len;
    if (len>length) return length;
    return len;
#else
    uint i = 0;
................................................................................
#endif

typedef struct db_ObjCmd {
  int activeCnt;  /* Count of active objects. */ 
  int newCnt;  /* Total number of new. */ 
} db_ObjCmd;

#ifndef JSI_LITE_ONLY
static db_ObjCmd dbObjCmd = {};

static Jsi_OptionSpec db_ObjCmd_Specs[] =
{
    JSI_OPT(INT,   db_ObjCmd, activeCnt, .help="Number of active objects"),
    JSI_OPT(INT,   db_ObjCmd, newCnt,    .help="Number of new calls"),
    JSI_OPT_END(db_ObjCmd, .help="Options for Sqlite module")
};
#endif

/*
** New SQL functions can be created as JSI scripts.  Each such function
** is described by an instance of the following structure.
*/
typedef struct SqlFunc SqlFunc;
struct SqlFunc {
................................................................................
#endif

/* Token type.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
  enum yytokentype
  {
    IDENTIFIER = 258,
    STRING = 259,
    IF = 260,
    ELSE = 261,
    FOR = 262,
    IN = 263,
    WHILE = 264,
    DO = 265,
    CONTINUE = 266,
................................................................................
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED

union YYSTYPE
{

    Jsi_OpCodes *opcodes;
    Jsi_Value *value;
    const char *sstr;
    Jsi_String *vstr;
    Jsi_Regex* regex;
    Jsi_Number *num;
    Jsi_ScopeStrs *scopes;
    int inum;
    struct jsi_CaseExprStat* caseitem;
    struct jsi_CaseList* caselist;

................................................................................
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  106
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   2369

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  101
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  46
/* YYNRULES -- Number of rules.  */
#define YYNRULES  212
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  418

/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
   by yylex, with out-of-bounds checking.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   331

#define YYTRANSLATE(YYX)                                                \
................................................................................
      91,    95
};

#if YYDEBUG
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_uint16 yyrline[] =
{
       0,   122,   122,   123,   126,   129,   134,   135,   140,   141,
     142,   146,   147,   148,   149,   150,   151,   152,   153,   157,
     158,   159,   160,   161,   162,   166,   175,   186,   195,   196,
     197,   198,   201,   202,   205,   206,   212,   213,   217,   223,
     224,   277,   278,   282,   283,   284,   285,   289,   296,   303,
     313,   314,   318,   327,   339,   349,   353,   362,   363,   367,
     378,   398,   422,   423,   424,   430,   431,   434,   435,   439,
     449,   459,   463,   468,   472,   479,   480,   483,   488,   496,
     497,   498,   499,   500,   501,   502,   503,   504,   505,   506,
     507,   508,   511,   519,   522,   526,   529,   530,   531,   532,
     533,   534,   535,   536,   539,   540,   541,   542,   543,   544,
     545,   546,   549,   550,   554,   555,   556,   560,   561,   562,
     563,   564,   565,   566,   567,   568,   569,   570,   571,   572,
     573,   574,   578,   582,   586,   590,   594,   595,   599,   603,
     604,   605,   606,   607,   608,   609,   610,   611,   612,   613,
     614,   615,   616,   617,   618,   619,   620,   621,   622,   623,
     624,   625,   626,   627,   628,   629,   630,   632,   633,   636,
     637,   638,   644,   652,   657,   662,   667,   671,   675,   684,
     690,   695,   723,   729,   730,   731,   736,   743,   744,   748,
     749,   756,   757,   758,   759,   760,   761,   762,   763,   764,
     768,   772,   773,   774,   782,   783,   784,   785,   786,   787,
     788,   792,   793
};
#endif

#if YYDEBUG || YYERROR_VERBOSE || 1
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "IDENTIFIER", "STRING", "IF", "ELSE",
  "FOR", "IN", "WHILE", "DO", "CONTINUE", "SWITCH", "CASE", "DEFAULT",
  "BREAK", "FUNC", "RETURN", "LOCAL", "OF", "NEW", "DELETE", "TRY",
  "CATCH", "FINALLY", "THROW", "WITH", "UNDEF", "_TRUE", "_FALSE", "_THIS",
  "ARGUMENTS", "FNUMBER", "REGEXP", "TYPESTRING", "TYPENUMBER", "TYPENULL",
  "TYPEOBJECT", "TYPEBOOLEAN", "TYPEUSEROBJ", "TYPEITEROBJ", "TYPEREGEXP",
  "TYPEANY", "TYPEARRAY", "ELLIPSIS", "__DEBUG", "MIN_PRI", "','",
  "ARGCOMMA", "'='", "ADDAS", "MNSAS", "MULAS", "MODAS", "LSHFAS",
................................................................................
  "'.'", "'['", "'('", "MAX_PRI", "';'", "'{'", "'}'", "')'", "']'",
  "$accept", "file", "statements", "statement", "commonstatement",
  "func_statement", "func_prefix", "iterstatement", "identifier_opt",
  "label_opt", "statement_or_empty", "with_statement", "switch_statement",
  "cases", "case", "try_statement", "vardecs", "vardec",
  "delete_statement", "if_statement", "inof", "for_statement", "for_init",
  "for_cond", "expr_opt", "while_statement", "do_statement", "func_expr",
  "args_opt", "typeid", "rettype", "argtype", "strlit", "argdefault",
  "args", "func_statement_block", "expr", "fcall_exprs", "lvalue",
  "exprlist_opt", "exprlist", "value", "object", "items", "item", "array", YY_NULLPTR
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
   (internal) symbol number NUM (which must be that of a token).  */
static const yytype_uint16 yytoknum[] =
................................................................................
     318,   319,    62,    60,   320,   321,   322,   323,   324,   325,
      43,    45,    42,    47,    37,   326,    33,   327,   328,   126,
     329,   330,    46,    91,    40,   331,    59,   123,   125,    41,
      93
};
# endif

#define YYPACT_NINF -322

#define yypact_value_is_default(Yystate) \
  (!!((Yystate) == (-322)))

#define YYTABLE_NINF -202

#define yytable_value_is_error(Yytable_value) \
  0

  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     STATE-NUM.  */
static const yytype_int16 yypact[] =
{
     374,   -40,  -322,   -67,    63,    63,    -1,  1285,    74,    25,
      77,    -5,  1304,    15,  -322,  -322,  -322,  -322,  -322,  -322,
    -322,  -322,  -322,  1304,  1304,  1304,    77,    77,  1304,  1304,
    1304,   235,  1304,  -322,   772,   110,   469,  -322,  -322,  -322,
      31,  -322,   114,  -322,  -322,  -322,  -322,  -322,  -322,  -322,
    -322,    33,  -322,  1780,  -322,   921,  -322,  -322,  -322,  1134,
    1304,  -322,    24,    59,  -322,     5,  -322,     6,  -322,   255,
    1818,    65,   -28,  -322,  1304,    75,   -21,    76,    93,   905,
      -8,  1858,  1304,    11,    11,    11,    20,    20,    11,    11,
      11,  -322,   359,   -36,  1420,   113,   118,   119,   121,   126,
     128,  1001,   129,  1780,   -35,  -322,  -322,  -322,  1780,     5,
      99,   100,  1171,   106,  1304,  1304,  1304,  1304,  1304,  1304,
    1304,  1304,  1304,  1304,  1304,  1304,  1304,  1304,  1304,  1304,
    1304,  1304,  1304,  1304,  1304,  1304,  1304,  1304,  1304,   198,
    1304,  -322,  1304,  1304,  1304,  1304,  1304,  1304,  1304,  1304,
    1304,  1304,  1304,  1304,  1304,  -322,  -322,   199,  1304,  1304,
    -322,  1460,  -322,  -322,     5,    32,   112,   108,   158,   125,
     166,   118,   119,   121,   126,   128,   129,  -322,  1304,    74,
    -322,  1500,  1304,  1304,  1304,  -322,  -322,  1038,   136,    -5,
    -322,  1540,  1304,  -322,   137,  1134,  1304,  1304,  1304,  1304,
    1304,  -322,  1304,   255,  -322,   135,  1266,  1304,   868,  -322,
     227,  1304,   138,   196,   490,   359,  1974,  2082,  2120,  2150,
    2188,  2218,   277,   277,   277,   277,   490,   490,   490,   490,
     215,   215,   215,   140,   140,    11,    11,    11,   150,  1342,
     359,   359,   359,   359,   359,   359,   359,   359,   359,   359,
     359,   359,   490,  -322,  1380,   147,  1171,   148,   213,  2278,
     156,   -37,    10,  1304,   359,  -322,   159,   151,   153,   155,
    -322,   253,  -322,  1171,   359,  1304,  1936,   359,   359,   359,
     359,   359,   359,  -322,   -13,   257,  -322,  1304,  1896,   788,
    1580,  -322,   167,  1620,  -322,  1304,  1304,   175,  -322,  -322,
     264,     8,  -322,  -322,  -322,  -322,  -322,   240,  -322,  -322,
    -322,  -322,  -322,  -322,  -322,  -322,  -322,  -322,  -322,  -322,
    -322,  -322,  -322,  -322,  -322,    18,  -322,  2278,  -322,    49,
     181,   359,  1304,  -322,  -322,  -322,   176,  -322,   177,  2278,
    -322,    40,   -27,   178,  2052,  -322,  -322,  -322,  1304,  1171,
    1304,   182,   359,   179,  1304,  1171,  2278,  -322,  -322,   213,
    2278,    -5,   216,   213,  2278,   194,   189,    -5,  -322,    -5,
    1304,  -322,  1304,  1660,  -322,  1700,    17,  -322,   191,  -322,
      -5,  -322,  -322,  -322,  -322,    26,  -322,  -322,   268,  -322,
    1740,   201,  2052,  1171,  -322,  1304,   231,  -322,    19,  -322,
    -322,  -322,   213,    -5,  1171,  1171,  -322,  2014,   506,  -322,
    -322,  -322,  -322,  -322,  -322,   602,   639,   735
};

  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
     Performed when YYTABLE does not specify something else to do.  Zero
     means the default is an error.  */
static const yytype_uint8 yydefact[] =
{
      34,   182,    95,     0,    32,    32,     0,     0,     0,     0,
       0,     0,     0,     0,   193,   194,   195,   184,   183,   196,
     197,   192,   177,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    22,    34,     0,    34,     6,     9,    24,
       0,     8,     0,    21,    31,    20,    13,    12,    28,    29,
      30,   115,   191,     5,   166,   116,   114,   198,   199,    35,
       0,    33,     0,     0,    27,    75,   182,     0,    17,   201,
       0,    52,     0,    50,     0,   170,   168,   167,     0,    34,
       0,     0,     0,   121,   120,   123,   133,   135,   122,   134,
     124,   212,   189,     0,     0,   182,   193,   194,   195,   196,
     192,    34,   191,     0,     0,   202,     1,     7,     4,    75,
       0,     0,    34,     0,   187,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    11,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   131,   132,     0,     0,   187,
      10,     0,    15,    14,    75,   104,     0,     0,    76,     0,
       0,     0,     0,     0,     0,     0,     0,    16,     0,     0,
      18,     0,   187,   187,   187,    54,   113,    34,     0,     0,
      19,     0,     0,   211,   136,    35,     0,     0,     0,     0,
       0,    23,     0,     0,   200,     0,     0,     0,    34,    36,
       0,     0,     0,   188,   130,   117,     0,   138,   137,   148,
     149,   147,   143,   144,   145,   146,   140,   139,   141,   142,
     150,   151,   152,   128,   129,   125,   126,   127,   119,     0,
     153,   154,   155,   156,   157,   158,   159,   160,   161,   162,
     163,   164,   165,   186,     0,     0,    34,     0,     0,     0,
       0,     0,     0,     0,    53,    51,   169,     0,     0,     0,
     112,     0,    48,    34,   190,   187,   204,   209,   207,   208,
     206,   210,   205,   203,     0,     0,    62,    65,     0,   116,
       0,    37,     0,     0,   175,     0,   187,   118,   185,   181,
      55,     0,    96,   100,   101,    99,   102,     0,    97,   103,
     105,    89,    90,    79,    80,    88,    83,    81,    84,    85,
      82,    86,    87,    91,    93,   106,    77,     0,    71,   108,
       0,   204,   187,   174,   172,   171,     0,    38,     0,     0,
      26,    52,     0,     0,    66,    63,    57,    58,     0,    34,
       0,     0,   176,     0,   187,    34,     0,    73,    98,     0,
       0,     0,    92,     0,     0,     0,     0,     0,   180,     0,
       0,    64,    67,     0,    69,     0,     0,   178,     0,    56,
       0,   107,    94,    72,   109,   110,    78,   173,    47,    25,
       0,     0,    68,    34,    70,     0,     0,    39,     0,    41,
     179,    74,     0,     0,    34,    34,    61,     0,    34,    40,
      42,   111,    49,    60,    59,    34,    34,    34
};

  /* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -322,  -322,     3,     0,   -42,  -322,  -322,  -322,   297,  -322,
    -178,  -322,  -322,  -322,   -95,  -322,    21,   132,  -322,  -322,
     -24,  -322,  -322,  -322,  -322,  -322,  -322,   296,   -99,   -48,
    -321,  -258,   -29,  -312,  -322,  -185,    14,  -322,    -3,   -97,
     282,   305,  -322,  -322,   115,  -322
};

  /* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
      -1,    35,   101,   209,    38,    39,    40,    41,    62,    42,
     210,    43,    44,   398,   399,    45,    72,    73,    46,    47,
     348,    48,   287,   343,   391,    49,    50,    51,   167,   324,
     361,   362,    52,   310,   168,    80,   103,    54,    55,   212,
     213,    56,    57,   104,   105,    58
};

  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
     positive, shift that token.  If negative, reduce the rule whose
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
      37,   325,    64,    36,   272,   102,    76,    78,   165,   169,
     205,   192,   203,   329,    53,   188,   189,   160,   369,   179,
     179,    70,    59,    86,    87,   327,    81,    60,    66,     2,
     395,   396,   395,   396,    37,   380,   107,    83,    84,    85,
     176,    67,    88,    89,    90,    92,    94,   381,   346,   339,
     108,   384,    14,    15,    16,    17,    18,    19,    20,   347,
      79,    21,   255,   204,   193,   257,    61,   359,   180,   371,
     356,   157,   158,   183,   161,   402,   328,    71,   300,    37,
      66,   258,   187,   360,    79,   267,   268,   269,   181,   178,
     411,   360,    79,    65,   259,   337,   191,   166,   363,   340,
      65,   107,   330,   139,   140,    79,   385,    17,    18,    82,
     106,   364,   157,   158,   178,   397,   357,   409,    31,    74,
     162,   110,    69,   111,   112,   109,   113,   114,    92,   214,
     215,   216,   217,   218,   219,   220,   221,   222,   223,   224,
     225,   226,   227,   228,   229,   230,   231,   232,   233,   234,
     235,   236,   237,   160,   239,   163,   240,   241,   242,   243,
     244,   245,   246,   247,   248,   249,   250,   251,   252,   182,
     184,   374,   254,    92,   176,   195,   383,   379,   338,   102,
     196,   197,   388,   198,   389,   157,   158,   107,   199,   185,
     200,   202,   264,   206,   207,   401,    92,    92,    92,   353,
     211,   238,   253,   289,   260,   262,   274,   261,    37,   276,
     277,   278,   279,   280,   281,   406,   282,     2,   412,   164,
     288,   290,   136,   137,   138,   293,   413,   414,   263,   309,
     271,   275,   139,   140,   284,   366,   292,   294,    66,     2,
     302,   303,   304,   192,   296,   305,   299,   301,   326,   306,
     333,    67,   334,   332,   335,     9,   336,   378,   170,     2,
     341,   350,    14,    15,    16,    17,    18,    19,    20,   354,
     355,    21,   358,   365,   372,   367,   368,   331,   377,   376,
      22,   360,   171,   172,   173,   115,   386,   174,   387,    92,
     400,   175,   403,   408,   307,   134,   135,   136,   137,   138,
     405,   344,    63,   410,   308,    75,   342,   139,   140,   352,
      92,   265,   382,    93,    77,    23,    24,   370,   283,     0,
       0,    25,    26,    27,    28,    29,    30,     0,    31,    32,
     309,     0,    69,     0,   309,    91,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    92,     0,     0,   127,
     128,   129,   130,     0,   131,   132,   133,   134,   135,   136,
     137,   138,   373,     0,   375,     0,     0,   115,    92,   139,
     140,     0,     0,   309,    -2,     0,     0,     1,     2,     3,
       0,     0,     0,     0,   390,     4,   392,     0,     0,     5,
       6,     7,     8,     0,     9,    10,    11,     0,     0,    12,
      13,    14,    15,    16,    17,    18,    19,    20,    37,   407,
      21,   416,     0,     0,     0,    37,   107,   107,   417,    22,
     117,     0,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,   130,     0,   131,   132,   133,   134,
     135,   136,   137,   138,     0,     0,     0,     0,     0,     0,
       0,   139,   140,     0,    23,    24,     0,     0,     0,     0,
      25,    26,    27,    28,    29,    30,     0,    31,    32,    -3,
      33,    34,     1,     2,     3,     0,     0,     0,     0,     0,
       4,     0,     0,     0,     5,     6,     7,     8,     0,     9,
      10,    11,     0,     0,    12,    13,    14,    15,    16,    17,
      18,    19,    20,     0,     0,    21,     0,     0,     0,     1,
       2,     3,     0,     0,    22,     0,     0,     4,     0,   -45,
     -45,     5,     6,     7,     8,     0,     9,    10,    11,     0,
       0,    12,    13,    14,    15,    16,    17,    18,    19,    20,
       0,     0,    21,     0,     0,     0,     0,     0,     0,    23,
      24,    22,     0,     0,     0,    25,    26,    27,    28,    29,
      30,     0,    31,    32,     0,    33,    34,   131,   132,   133,

     134,   135,   136,   137,   138,     0,     0,     0,     0,     0,
       0,     0,   139,   140,     0,     0,    23,    24,     0,     0,
       0,     0,    25,    26,    27,    28,    29,    30,     0,    31,
      32,     0,    33,    34,   -45,     1,     2,     3,     0,     0,
       0,     0,     0,     4,     0,   -46,   -46,     5,     6,     7,
       8,     0,     9,    10,    11,     0,     0,    12,    13,    14,
      15,    16,    17,    18,    19,    20,     0,     0,    21,     0,
       0,     0,     1,     2,     3,     0,     0,    22,     0,     0,
       4,     0,   -44,   -44,     5,     6,     7,     8,     0,     9,
      10,    11,     0,     0,    12,    13,    14,    15,    16,    17,
      18,    19,    20,     0,     0,    21,     0,     0,     0,     0,
       0,     0,    23,    24,    22,     0,     0,     0,    25,    26,
      27,    28,    29,    30,     0,    31,    32,     0,    33,    34,
     -46,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    23,
      24,     0,     0,     0,     0,    25,    26,    27,    28,    29,
      30,     0,    31,    32,     0,    33,    34,   -44,     1,     2,
       3,     0,     0,     0,     0,     0,     4,     0,   -43,   -43,
       5,     6,     7,     8,     0,     9,    10,    11,     0,     0,
      12,    13,    14,    15,    16,    17,    18,    19,    20,     0,
       0,    21,     0,     0,     0,    95,     2,     3,     0,     0,
      22,     0,     0,     4,     0,     0,     0,     5,     6,     7,
       8,     0,     9,    10,    11,     0,   346,    12,    13,    96,
      97,    98,    17,    18,    99,    20,     0,   347,   100,     0,
       0,     0,     0,     0,     0,    23,    24,    22,     0,  -201,
       0,    25,    26,    27,    28,    29,    30,     0,    31,    32,
       0,    33,    34,   -43,     0,     0,     0,   142,   143,   144,
     145,   146,   147,   148,   149,   150,   151,   152,   153,     0,
       0,     0,    23,    24,     0,     0,     0,     0,    25,    26,
      27,    28,    29,    30,   154,    31,    32,     0,    33,    34,
    -201,    95,     2,     3,     0,   155,   156,     0,     0,     4,
     157,   158,   159,     5,     6,     7,     8,     0,     9,    10,
      11,     0,     0,    12,    13,    96,    97,    98,    17,    18,
      99,    20,     0,     0,   100,     0,     0,     0,     1,     2,
       3,     0,     0,    22,     0,  -201,     4,     0,     0,     0,
       5,     6,     7,     8,     0,     9,    10,    11,     0,     0,
      12,    13,    14,    15,    16,    17,    18,    19,    20,     0,
       0,    21,     0,     0,     0,     0,     0,     0,    23,    24,
      22,     0,     0,     0,    25,    26,    27,    28,    29,    30,
       0,    31,    32,     0,    33,    34,   291,     0,     0,     0,
     142,   143,   144,   145,   146,   147,   148,   149,   150,   151,
     152,   153,     0,     0,     0,    23,    24,     0,     0,     0,
       0,    25,    26,    27,    28,    29,    30,   154,    31,    32,


       0,    33,    34,   186,     1,     2,     3,     0,   155,   156,
       0,     0,     4,   157,   158,   159,     5,     6,     7,     8,
       0,     9,    10,    11,     0,     0,    12,    13,    14,    15,
      16,    17,    18,    19,    20,     0,     0,    21,     0,     0,
       0,     1,     2,     3,     0,     0,    22,     0,     0,     4,
       0,     0,     0,     5,     6,     7,     8,     0,     9,    10,
      11,     0,     0,    12,    13,    14,    15,    16,    17,    18,
      19,    20,     0,     0,    21,     0,     0,     0,     0,     0,
       0,    23,    24,    22,     0,     0,     0,    25,    26,    27,
      28,    29,    30,     0,    31,    32,     0,    33,    34,   201,

       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,    23,    24,
       0,     0,     0,     0,    25,    26,    27,    28,    29,    30,
       0,    31,    32,     0,    33,    34,   270,    66,     2,     3,
       0,     0,     0,     0,     0,     4,     0,     0,     0,     5,
       6,     7,     8,     0,     9,    10,    11,     0,     0,    12,
      13,    14,    15,    16,    17,    18,    19,    20,     0,     0,
      21,     0,     0,     0,     1,     2,     3,     0,     0,    22,
       0,     0,     4,     0,     0,     0,     5,     6,     7,     8,
       0,     9,    10,    11,     0,     0,    12,    13,    14,    15,
      16,    17,    18,    19,    20,     0,     0,    21,     0,     0,
       0,     0,     0,     0,    23,    24,    22,     0,     0,     0,
      25,    26,    27,    28,    29,    30,     0,    31,    32,     0,
      33,    34,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    23,    24,     0,     0,     0,     0,    25,    26,    27,
      28,    29,    30,     0,    31,    32,     0,    33,   208,    66,
       2,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    67,     0,   285,     0,     9,     0,    66,     2,
       0,     0,     0,    14,    15,    16,    17,    18,    19,    20,
       0,    67,    21,     0,     0,     9,     0,    66,     2,     0,
       0,    22,    14,    15,    16,    17,    18,    19,    20,     0,
      67,    21,     0,     0,     9,     0,     0,     0,     0,     0,
      22,    14,    15,    16,    17,    18,    19,    20,     0,     0,
      21,     0,     0,     0,     0,     0,    23,    24,     0,    22,
     115,     0,    25,    26,    27,    28,    29,    30,     0,    31,
      32,     0,   286,    69,     0,    23,    24,     0,     0,     0,
       0,    25,    26,    27,    28,    29,    30,     0,    31,    32,
       0,    68,    69,     0,    23,    24,     0,     0,   115,   116,
      25,    26,    27,    28,    29,    30,     0,    31,    32,     0,
       0,    69,     0,   117,     0,   118,   119,   120,   121,   122,
     123,   124,   125,   126,   127,   128,   129,   130,     0,   131,
     132,   133,   134,   135,   136,   137,   138,   116,   115,     0,
       0,     0,     0,     0,   139,   140,     0,     0,     0,     0,
       0,   117,   297,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,     0,
     298,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   194,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   256,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   266,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   273,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   349,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   351,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   393,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,   116,   115,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   394,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,     0,   115,   116,     0,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,   404,
       0,   117,     0,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,     0,   131,   132,   133,
     134,   135,   136,   137,   138,   116,   115,     0,     0,     0,
       0,     0,   139,   140,     0,     0,   141,     0,     0,   117,
       0,   118,   119,   120,   121,   122,   123,   124,   125,   126,
     127,   128,   129,   130,     0,   131,   132,   133,   134,   135,
     136,   137,   138,     0,   115,   116,     0,     0,     0,     0,
     139,   140,     0,     0,   177,     0,     0,     0,     0,   117,
       0,   118,   119,   120,   121,   122,   123,   124,   125,   126,
     127,   128,   129,   130,     0,   131,   132,   133,   134,   135,
     136,   137,   138,   116,   115,     0,     0,     0,     0,     0,
     139,   140,     0,     0,   190,     0,     0,   117,     0,   118,
     119,   120,   121,   122,   123,   124,   125,   126,   127,   128,
     129,   130,     0,   131,   132,   133,   134,   135,   136,   137,
     138,     0,   115,     0,     0,     0,     0,     0,   139,   140,
       0,     0,   345,     0,     0,     0,     0,   117,     0,   118,
     119,   120,   121,   122,   123,   124,   125,   126,   127,   128,
     129,   130,     0,   131,   132,   133,   134,   135,   136,   137,
     138,   116,   115,     0,     0,     0,     0,     0,   139,   140,
       0,     0,   141,     0,     0,   117,   295,   118,   119,   120,
     121,   122,   123,   124,   125,   126,   127,   128,   129,   130,
       0,   131,   132,   133,   134,   135,   136,   137,   138,     0,
     115,   116,     0,     0,     0,     0,   139,   140,     0,     0,
       0,     0,     0,     0,     0,   117,   415,   118,   119,   120,
     121,   122,   123,   124,   125,   126,   127,   128,   129,   130,
     115,   131,   132,   133,   134,   135,   136,   137,   138,   116,
       0,     0,     0,     0,     0,     0,   139,   140,     0,     0,
       0,     0,     0,   117,     0,   118,   119,   120,   121,   122,
     123,   124,   125,   126,   127,   128,   129,   130,   115,   131,
     132,   133,   134,   135,   136,   137,   138,     0,     0,     0,
       0,     0,     0,     0,   139,   140,   119,   120,   121,   122,
     123,   124,   125,   126,   127,   128,   129,   130,   115,   131,
     132,   133,   134,   135,   136,   137,   138,     0,     0,     0,
       0,     0,     0,     0,   139,   140,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,   115,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,     0,     0,     0,
       0,     0,   139,   140,     0,     0,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,   115,   131,   132,   133,
     134,   135,   136,   137,   138,     0,     0,     0,     0,     0,
       0,     0,   139,   140,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   122,   123,   124,   125,   126,
     127,   128,   129,   130,     0,   131,   132,   133,   134,   135,
     136,   137,   138,     0,     0,     0,     0,     0,     0,     0,
     139,   140,     0,     0,     0,     0,   123,   124,   125,   126,
     127,   128,   129,   130,   311,   131,   132,   133,   134,   135,
     136,   137,   138,     0,     0,   312,     0,     0,     0,     0,
     139,   140,   313,   314,   315,   316,   317,   318,   319,   320,
     321,   322,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   323
};

static const yytype_int16 yycheck[] =
{
       0,   259,     3,     0,   189,    34,     9,    10,     3,     3,
     109,    47,    47,     3,     0,    23,    24,    59,   339,    47,
      47,     7,    62,    26,    27,    62,    12,    94,     3,     4,
      13,    14,    13,    14,    34,   356,    36,    23,    24,    25,
      69,    16,    28,    29,    30,    31,    32,   359,     8,    62,
      36,   363,    27,    28,    29,    30,    31,    32,    33,    19,
      97,    36,   159,    98,   100,   164,     3,    49,    96,    96,
      62,    92,    93,    94,    60,    49,   261,     3,   256,    79,
       3,    49,    79,    65,    97,   182,   183,   184,    74,    49,
     402,    65,    97,    94,    62,   273,    82,    92,    49,   284,
      94,   101,    92,    92,    93,    97,   364,    30,    31,    94,
       0,    62,    92,    93,    49,    98,   301,    98,    93,    94,
      96,     7,    97,     9,    10,    94,    12,    94,   114,   115,
     116,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,   130,   131,   132,   133,   134,   135,
     136,   137,   138,   195,   140,    96,   142,   143,   144,   145,
     146,   147,   148,   149,   150,   151,   152,   153,   154,    94,
      94,   349,   158,   159,   203,    62,   361,   355,   275,   208,
      62,    62,   367,    62,   369,    92,    93,   187,    62,    96,
      62,    62,   178,    94,    94,   380,   182,   183,   184,   296,
      94,     3,     3,   206,    92,    47,   192,    99,   208,   195,
     196,   197,   198,   199,   200,   393,   202,     4,   403,    94,
     206,   207,    82,    83,    84,   211,   404,   405,    62,   258,
      94,    94,    92,    93,    99,   332,     9,    99,     3,     4,
      27,    28,    29,    47,    94,    32,    99,    99,    92,    36,
      99,    16,    99,    94,    99,    20,     3,   354,     3,     4,
       3,    94,    27,    28,    29,    30,    31,    32,    33,    94,
       6,    36,    32,    92,    96,    99,    99,   263,    99,    97,
      45,    65,    27,    28,    29,     8,    92,    32,    99,   275,
      99,    36,    24,    62,    81,    80,    81,    82,    83,    84,
      99,   287,     5,   398,    91,     9,   285,    92,    93,   295,
     296,   179,   360,    31,     9,    80,    81,   341,   203,    -1,
      -1,    86,    87,    88,    89,    90,    91,    -1,    93,    94,
     359,    -1,    97,    -1,   363,   100,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   332,    -1,    -1,    72,
      73,    74,    75,    -1,    77,    78,    79,    80,    81,    82,
      83,    84,   348,    -1,   350,    -1,    -1,     8,   354,    92,
      93,    -1,    -1,   402,     0,    -1,    -1,     3,     4,     5,
      -1,    -1,    -1,    -1,   370,    11,   372,    -1,    -1,    15,
      16,    17,    18,    -1,    20,    21,    22,    -1,    -1,    25,
      26,    27,    28,    29,    30,    31,    32,    33,   408,   395,
      36,   408,    -1,    -1,    -1,   415,   416,   417,   415,    45,
      61,    -1,    63,    64,    65,    66,    67,    68,    69,    70,
      71,    72,    73,    74,    75,    -1,    77,    78,    79,    80,
      81,    82,    83,    84,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    92,    93,    -1,    80,    81,    -1,    -1,    -1,    -1,
      86,    87,    88,    89,    90,    91,    -1,    93,    94,     0,
      96,    97,     3,     4,     5,    -1,    -1,    -1,    -1,    -1,
      11,    -1,    -1,    -1,    15,    16,    17,    18,    -1,    20,
      21,    22,    -1,    -1,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    -1,    -1,    36,    -1,    -1,    -1,     3,
       4,     5,    -1,    -1,    45,    -1,    -1,    11,    -1,    13,
      14,    15,    16,    17,    18,    -1,    20,    21,    22,    -1,
      -1,    25,    26,    27,    28,    29,    30,    31,    32,    33,
      -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,    -1,    80,
      81,    45,    -1,    -1,    -1,    86,    87,    88,    89,    90,
      91,    -1,    93,    94,    -1,    96,    97,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    92,    93,    -1,    -1,    80,    81,    -1,    -1,
      -1,    -1,    86,    87,    88,    89,    90,    91,    -1,    93,
      94,    -1,    96,    97,    98,     3,     4,     5,    -1,    -1,
      -1,    -1,    -1,    11,    -1,    13,    14,    15,    16,    17,
      18,    -1,    20,    21,    22,    -1,    -1,    25,    26,    27,
      28,    29,    30,    31,    32,    33,    -1,    -1,    36,    -1,
      -1,    -1,     3,     4,     5,    -1,    -1,    45,    -1,    -1,
      11,    -1,    13,    14,    15,    16,    17,    18,    -1,    20,
      21,    22,    -1,    -1,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    -1,    -1,    36,    -1,    -1,    -1,    -1,
      -1,    -1,    80,    81,    45,    -1,    -1,    -1,    86,    87,
      88,    89,    90,    91,    -1,    93,    94,    -1,    96,    97,
      98,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    80,
      81,    -1,    -1,    -1,    -1,    86,    87,    88,    89,    90,
      91,    -1,    93,    94,    -1,    96,    97,    98,     3,     4,
       5,    -1,    -1,    -1,    -1,    -1,    11,    -1,    13,    14,
      15,    16,    17,    18,    -1,    20,    21,    22,    -1,    -1,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
      -1,    36,    -1,    -1,    -1,     3,     4,     5,    -1,    -1,
      45,    -1,    -1,    11,    -1,    -1,    -1,    15,    16,    17,
      18,    -1,    20,    21,    22,    -1,     8,    25,    26,    27,
      28,    29,    30,    31,    32,    33,    -1,    19,    36,    -1,
      -1,    -1,    -1,    -1,    -1,    80,    81,    45,    -1,    47,
      -1,    86,    87,    88,    89,    90,    91,    -1,    93,    94,
      -1,    96,    97,    98,    -1,    -1,    -1,    49,    50,    51,
      52,    53,    54,    55,    56,    57,    58,    59,    60,    -1,
      -1,    -1,    80,    81,    -1,    -1,    -1,    -1,    86,    87,
      88,    89,    90,    91,    76,    93,    94,    -1,    96,    97,
      98,     3,     4,     5,    -1,    87,    88,    -1,    -1,    11,
      92,    93,    94,    15,    16,    17,    18,    -1,    20,    21,
      22,    -1,    -1,    25,    26,    27,    28,    29,    30,    31,
      32,    33,    -1,    -1,    36,    -1,    -1,    -1,     3,     4,
       5,    -1,    -1,    45,    -1,    47,    11,    -1,    -1,    -1,
      15,    16,    17,    18,    -1,    20,    21,    22,    -1,    -1,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
      -1,    36,    -1,    -1,    -1,    -1,    -1,    -1,    80,    81,
      45,    -1,    -1,    -1,    86,    87,    88,    89,    90,    91,
      -1,    93,    94,    -1,    96,    97,    98,    -1,    -1,    -1,
      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
      59,    60,    -1,    -1,    -1,    80,    81,    -1,    -1,    -1,
      -1,    86,    87,    88,    89,    90,    91,    76,    93,    94,
      -1,    96,    97,    98,     3,     4,     5,    -1,    87,    88,
      -1,    -1,    11,    92,    93,    94,    15,    16,    17,    18,
      -1,    20,    21,    22,    -1,    -1,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    -1,    -1,    36,    -1,    -1,
      -1,     3,     4,     5,    -1,    -1,    45,    -1,    -1,    11,
      -1,    -1,    -1,    15,    16,    17,    18,    -1,    20,    21,
      22,    -1,    -1,    25,    26,    27,    28,    29,    30,    31,
      32,    33,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,
      -1,    80,    81,    45,    -1,    -1,    -1,    86,    87,    88,
      89,    90,    91,    -1,    93,    94,    -1,    96,    97,    98,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    80,    81,
      -1,    -1,    -1,    -1,    86,    87,    88,    89,    90,    91,
      -1,    93,    94,    -1,    96,    97,    98,     3,     4,     5,
      -1,    -1,    -1,    -1,    -1,    11,    -1,    -1,    -1,    15,
      16,    17,    18,    -1,    20,    21,    22,    -1,    -1,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    -1,    -1,
      36,    -1,    -1,    -1,     3,     4,     5,    -1,    -1,    45,
      -1,    -1,    11,    -1,    -1,    -1,    15,    16,    17,    18,
      -1,    20,    21,    22,    -1,    -1,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    -1,    -1,    36,    -1,    -1,
      -1,    -1,    -1,    -1,    80,    81,    45,    -1,    -1,    -1,
      86,    87,    88,    89,    90,    91,    -1,    93,    94,    -1,
      96,    97,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    80,    81,    -1,    -1,    -1,    -1,    86,    87,    88,
      89,    90,    91,    -1,    93,    94,    -1,    96,    97,     3,










       4,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,



      -1,    -1,    16,    -1,    18,    -1,    20,    -1,     3,     4,
      -1,    -1,    -1,    27,    28,    29,    30,    31,    32,    33,
      -1,    16,    36,    -1,    -1,    20,    -1,     3,     4,    -1,
      -1,    45,    27,    28,    29,    30,    31,    32,    33,    -1,
      16,    36,    -1,    -1,    20,    -1,    -1,    -1,    -1,    -1,
      45,    27,    28,    29,    30,    31,    32,    33,    -1,    -1,
      36,    -1,    -1,    -1,    -1,    -1,    80,    81,    -1,    45,
       8,    -1,    86,    87,    88,    89,    90,    91,    -1,    93,
      94,    -1,    96,    97,    -1,    80,    81,    -1,    -1,    -1,
      -1,    86,    87,    88,    89,    90,    91,    -1,    93,    94,
      -1,    96,    97,    -1,    80,    81,    -1,    -1,     8,    47,
      86,    87,    88,    89,    90,    91,    -1,    93,    94,    -1,


      -1,    97,    -1,    61,    -1,    63,    64,    65,    66,    67,
      68,    69,    70,    71,    72,    73,    74,    75,    -1,    77,
      78,    79,    80,    81,    82,    83,    84,    47,     8,    -1,
      -1,    -1,    -1,    -1,    92,    93,    -1,    -1,    -1,    -1,



      -1,    61,   100,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    -1,
     100,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    47,     8,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,     8,    47,    -1,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
      -1,    61,    -1,    63,    64,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,    -1,    77,    78,    79,
      80,    81,    82,    83,    84,    47,     8,    -1,    -1,    -1,
      -1,    -1,    92,    93,    -1,    -1,    96,    -1,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,     8,    47,    -1,    -1,    -1,    -1,
      92,    93,    -1,    -1,    96,    -1,    -1,    -1,    -1,    61,
      -1,    63,    64,    65,    66,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    47,     8,    -1,    -1,    -1,    -1,    -1,
      92,    93,    -1,    -1,    96,    -1,    -1,    61,    -1,    63,
      64,    65,    66,    67,    68,    69,    70,    71,    72,    73,
      74,    75,    -1,    77,    78,    79,    80,    81,    82,    83,
      84,    -1,     8,    -1,    -1,    -1,    -1,    -1,    92,    93,
      -1,    -1,    96,    -1,    -1,    -1,    -1,    61,    -1,    63,
      64,    65,    66,    67,    68,    69,    70,    71,    72,    73,
      74,    75,    -1,    77,    78,    79,    80,    81,    82,    83,
      84,    47,     8,    -1,    -1,    -1,    -1,    -1,    92,    93,
      -1,    -1,    96,    -1,    -1,    61,    62,    63,    64,    65,
      66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
      -1,    77,    78,    79,    80,    81,    82,    83,    84,    -1,
       8,    47,    -1,    -1,    -1,    -1,    92,    93,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    61,    62,    63,    64,    65,
      66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
       8,    77,    78,    79,    80,    81,    82,    83,    84,    47,
      -1,    -1,    -1,    -1,    -1,    -1,    92,    93,    -1,    -1,
      -1,    -1,    -1,    61,    -1,    63,    64,    65,    66,    67,
      68,    69,    70,    71,    72,    73,    74,    75,     8,    77,
      78,    79,    80,    81,    82,    83,    84,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    92,    93,    64,    65,    66,    67,

      68,    69,    70,    71,    72,    73,    74,    75,     8,    77,
      78,    79,    80,    81,    82,    83,    84,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    92,    93,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    65,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,     8,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    92,    93,    -1,    -1,    66,    67,    68,    69,
      70,    71,    72,    73,    74,    75,     8,    77,    78,    79,
      80,    81,    82,    83,    84,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    92,    93,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    67,    68,    69,    70,    71,
      72,    73,    74,    75,    -1,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      92,    93,    -1,    -1,    -1,    -1,    68,    69,    70,    71,
      72,    73,    74,    75,    16,    77,    78,    79,    80,    81,
      82,    83,    84,    -1,    -1,    27,    -1,    -1,    -1,    -1,
      92,    93,    34,    35,    36,    37,    38,    39,    40,    41,
      42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,

      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,

      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    91
};

  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
     symbol of state STATE-NUM.  */
static const yytype_uint8 yystos[] =
{
       0,     3,     4,     5,    11,    15,    16,    17,    18,    20,
      21,    22,    25,    26,    27,    28,    29,    30,    31,    32,
      33,    36,    45,    80,    81,    86,    87,    88,    89,    90,
      91,    93,    94,    96,    97,   102,   103,   104,   105,   106,
     107,   108,   110,   112,   113,   116,   119,   120,   122,   126,
     127,   128,   133,   137,   138,   139,   142,   143,   146,    62,
      94,     3,   109,   109,     3,    94,     3,    16,    96,    97,
     137,     3,   117,   118,    94,   128,   139,   142,   139,    97,
     136,   137,    94,   137,   137,   137,   139,   139,   137,   137,
     137,   100,   137,   141,   137,     3,    27,    28,    29,    32,
      36,   103,   133,   137,   144,   145,     0,   104,   137,    94,

       7,     9,    10,    12,    94,     8,    47,    61,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    77,    78,    79,    80,    81,    82,    83,    84,    92,
      93,    96,    49,    50,    51,    52,    53,    54,    55,    56,
      57,    58,    59,    60,    76,    87,    88,    92,    93,    94,

     105,   137,    96,    96,    94,     3,    92,   129,   135,     3,
       3,    27,    28,    29,    32,    36,   133,    96,    49,    47,
      96,   137,    94,    94,    94,    96,    98,   103,    23,    24,
      96,   137,    47,   100,    99,    62,    62,    62,    62,    62,
      62,    98,    62,    47,    98,   129,    94,    94,    97,   104,
     111,    94,   140,   141,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,     3,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   137,   137,
     137,   137,   137,     3,   137,   140,    99,   129,    49,    62,
      92,    99,    47,    62,   137,   118,    99,   140,   140,   140,
      98,    94,   136,    99,   137,    94,   137,   137,   137,   137,

     137,   137,   137,   145,    99,    18,    96,   123,   137,   139,
     137,    98,     9,   137,    99,    62,    94,   100,   100,    99,
     111,    99,    27,    28,    29,    32,    36,    81,    91,   133,
     134,    16,    27,    34,    35,    36,    37,    38,    39,    40,
      41,    42,    43,    91,   130,   132,    92,    62,   136,     3,
      92,   137,    94,    99,    99,    99,     3,   111,   140,    62,
     136,     3,   117,   124,   137,    96,     8,    19,   121,    99,

      94,    99,   137,   140,    94,     6,    62,   136,    32,    49,
      65,   131,   132,    49,    62,    92,   140,    99,    99,   131,
     121,    96,    96,   137,   111,   137,    97,    99,   140,   111,
     131,   134,   130,   136,   134,   132,    92,    99,   136,   136,

     137,   125,   137,    99,    99,    13,    14,    98,   114,   115,
      99,   136,    49,    24,    99,    99,   111,   137,    62,    98,

     115,   134,   136,   111,   111,    62,   103,   103
};

  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const yytype_uint8 yyr1[] =
{
       0,   101,   102,   102,   102,   102,   103,   103,   104,   104,
     104,   105,   105,   105,   105,   105,   105,   105,   105,   105,
................................................................................
     105,   105,   105,   105,   105,   106,   106,   107,   108,   108,
     108,   108,   109,   109,   110,   110,   111,   111,   112,   113,
     113,   114,   114,   115,   115,   115,   115,   116,   116,   116,
     117,   117,   118,   118,   119,   120,   120,   121,   121,   122,
     122,   122,   123,   123,   123,   124,   124,   125,   125,   126,
     127,   128,   128,   128,   128,   129,   129,   129,   129,   130,
     130,   130,   130,   130,   130,   130,   130,   130,   130,   130,
     130,   130,   131,   132,   132,   133,   134,   134,   134,   134,
     134,   134,   134,   134,   135,   135,   135,   135,   135,   135,
     135,   135,   136,   136,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   137,   137,
     137,   137,   137,   137,   137,   137,   137,   137,   138,   138,
     138,   138,   139,   139,   139,   139,   139,   140,   140,   141,
     141,   142,   142,   142,   142,   142,   142,   142,   142,   142,
     143,   144,   144,   144,   145,   145,   145,   145,   145,   145,
     145,   146,   146
};

  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
static const yytype_uint8 yyr2[] =
{
       0,     2,     0,     1,     2,     1,     1,     2,     1,     1,
       3,     2,     1,     1,     3,     3,     3,     2,     3,     3,
................................................................................
       1,     1,     1,     3,     1,     7,     5,     2,     1,     1,
       1,     1,     0,     1,     0,     2,     1,     2,     5,     7,
       8,     1,     2,     4,     3,     2,     3,     7,     4,     9,
       1,     3,     1,     3,     3,     5,     7,     1,     1,     9,
       9,     8,     1,     2,     3,     0,     1,     0,     1,     6,
       7,     5,     7,     6,     8,     0,     1,     3,     5,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     3,     1,     1,     1,     2,     1,
       1,     1,     1,     1,     1,     3,     3,     5,     3,     5,
       5,     7,     3,     2,     1,     1,     1,     3,     4,     3,
       2,     2,     2,     2,     2,     3,     3,     3,     3,     3,
       3,     2,     2,     2,     2,     2,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     1,     2,     2,     4,
       2,     5,     5,     7,     5,     4,     5,     1,     6,     7,
       6,     4,     1,     1,     1,     4,     3,     0,     1,     1,
       3,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       3,     0,     1,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     2
};


#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)
#define YYEMPTY         (-2)
#define YYEOF           0
................................................................................
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 129: /* args_opt  */
      { jsi_ScopeStrsFree(pstate->interp, ((*yyvaluep).scopes)); }
        break;

    case 134: /* argdefault  */
      { Jsi_ValueFree(pstate->interp, ((*yyvaluep).value)); }
        break;

    case 135: /* args  */
      { jsi_ScopeStrsFree(pstate->interp, ((*yyvaluep).scopes)); }
        break;

    case 136: /* func_statement_block  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 137: /* expr  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 138: /* fcall_exprs  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 139: /* lvalue  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 140: /* exprlist_opt  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 141: /* exprlist  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 142: /* value  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 143: /* object  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 144: /* items  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

























    case 145: /* item  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;

    case 146: /* array  */
      { jsi_FreeOpcodes(((*yyvaluep).opcodes)); }
        break;


      default:
        break;
    }
................................................................................
    break;

  case 13:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 14:
    { (yyval.opcodes) = code_reserved(pstate, &(yylsp[-1]), RES_BREAK, (yyvsp[-1].sstr)); }
    break;

  case 15:
    { (yyval.opcodes) = code_reserved(pstate, &(yylsp[-1]), RES_CONTINUE, (yyvsp[-1].sstr)); }
    break;

  case 16:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_ret(pstate, &(yylsp[-1]), 1)); }
    break;

  case 17:
................................................................................
  case 24:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 25:
    {
        (yyvsp[-4].scopes)->retType = (yyvsp[-1].inum);
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[-6]), (yyvsp[-6].sstr), 0),
          code_push_func(pstate, &(yylsp[-4]), jsi_FuncMake(pstate, (yyvsp[-4].scopes), (yyvsp[0].opcodes), &(yylsp[-6]), (yyvsp[-6].sstr))),
          code_assign(pstate, &(yylsp[-6]), 1), code_pop(1));
        if (pstate->eval_flag) ret = codes_join(code_local(pstate, &(yylsp[-6]), (yyvsp[-6].sstr)), ret);
        jsi_PstatePop(pstate);
        (yyval.opcodes) = ret;
    }
    break;

  case 26:
    {
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[-4]), (yyvsp[-4].sstr), 0),
          code_push_func(pstate, &(yylsp[-2]), jsi_FuncMake(pstate, (yyvsp[-2].scopes), (yyvsp[0].opcodes), &(yylsp[-4]), (yyvsp[-4].sstr))),
          code_assign(pstate, &(yylsp[-4]), 1), code_pop(1));
        if (pstate->eval_flag) ret = codes_join(code_local(pstate, &(yylsp[-4]), (yyvsp[-4].sstr)), ret);
        jsi_PstatePop(pstate);
        (yyval.opcodes) = ret;
    }
    break;

  case 27:
    {
        if (!pstate->eval_flag) {
            jsi_PstateAddVar(pstate, &(yylsp[0]), (yyvsp[0].sstr));
        }
        (yyval.sstr) = (yyvsp[0].sstr);
    }
    break;

  case 28:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

................................................................................
    break;

  case 31:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 32:
    { (yyval.sstr) = NULL; }
    break;

  case 33:
    { (yyval.sstr) = (yyvsp[0].sstr); }
    break;

  case 34:
    { (yyval.sstr) = NULL; }
    break;

  case 35:
    {
        (yyval.sstr) = (yyvsp[-1].sstr);
    }
    break;

  case 36:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

................................................................................
                }
                cldefault = t;
            } else {
                t->next = head;
                head = t;
            }
        }
        code_reserved_replace(allstats, 0, 1, (yyvsp[-7].sstr), 1);
        
        Jsi_OpCodes *ophead = code_jmp(allstats->code_len + 1);
        if (cldefault) {
            ophead = codes_join(code_jmp(ophead->code_len + cldefault->off + 1), ophead);
            if (cldefault->es)
                Jsi_Free(cldefault->es);
            Jsi_Free(cldefault);
................................................................................

  case 46:
    { (yyval.caseitem) = exprstat_new(pstate, (yyvsp[-1].opcodes), code_nop(), 0); }
    break;

  case 47:
    {
        Jsi_OpCodes *catchblock = codes_join3(code_scatch(pstate, &(yylsp[-2]), (yyvsp[-2].sstr)), (yyvsp[0].opcodes), code_ecatch(pstate, &(yylsp[0])));
        Jsi_OpCodes *finallyblock = codes_join(code_sfinal(pstate, &(yylsp[-2])), code_efinal(pstate, &(yylsp[-2])));
        Jsi_OpCodes *tryblock = codes_join((yyvsp[-5].opcodes), code_etry(pstate, &(yylsp[-5])));
        (yyval.opcodes) = codes_join4(code_stry(pstate, &(yylsp[-6]), tryblock->code_len, catchblock->code_len, finallyblock->code_len),
                            tryblock, catchblock, finallyblock);
    }
    break;

................................................................................
        (yyval.opcodes) = codes_join4(code_stry(pstate, &(yylsp[-3]), tryblock->code_len, catchblock->code_len, finallyblock->code_len),
                            tryblock, catchblock, finallyblock);
    }
    break;

  case 49:
    {
        Jsi_OpCodes *catchblock = codes_join3(code_scatch(pstate, &(yylsp[-4]), (yyvsp[-4].sstr)), (yyvsp[-2].opcodes), code_ecatch(pstate, &(yylsp[-2])));
        Jsi_OpCodes *finallyblock = codes_join3(code_sfinal(pstate, &(yylsp[-8])), (yyvsp[0].opcodes), code_efinal(pstate, &(yylsp[-8])));
        Jsi_OpCodes *tryblock = codes_join((yyvsp[-7].opcodes), code_etry(pstate, &(yylsp[-7])));
        (yyval.opcodes) = codes_join4(code_stry(pstate, &(yylsp[-8]), tryblock->code_len, catchblock->code_len, finallyblock->code_len),
                            tryblock, catchblock, finallyblock);
    }
    break;

................................................................................

  case 51:
    { (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), (yyvsp[0].opcodes)); }
    break;

  case 52:
    {
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[0]), (yyvsp[0].sstr), 1),
                            code_push_undef(),
                            code_assign(pstate, &(yylsp[0]), 1),
                            code_pop(1));
        if (!pstate->eval_flag) jsi_PstateAddVar(pstate, &(yylsp[0]), (yyvsp[0].sstr));
        else ret = codes_join(code_local(pstate, &(yylsp[0]), (yyvsp[0].sstr)), ret);
        (yyval.opcodes) = ret;
    }
    break;

  case 53:
    {
        Jsi_OpCodes *ret = codes_join4(code_push_index(pstate, &(yylsp[-2]), (yyvsp[-2].sstr), 1),
                            (yyvsp[0].opcodes),
                            code_assign(pstate, &(yylsp[-2]), 1),
                            code_pop(1));
        if (!pstate->eval_flag) jsi_PstateAddVar(pstate, &(yylsp[-2]), (yyvsp[-2].sstr));
        else ret = codes_join(code_local(pstate, &(yylsp[-2]), (yyvsp[-2].sstr)), ret);
        (yyval.opcodes) = ret;
    }
    break;

  case 54:
    {
        if (((yyvsp[-1].opcodes))->lvalue_flag == 2) {
................................................................................
    {
        Jsi_OpCodes *init = (yyvsp[-5].opcodes);
        Jsi_OpCodes *cond = (yyvsp[-4].opcodes);
        Jsi_OpCodes *step = ((yyvsp[-2].opcodes) ? codes_join((yyvsp[-2].opcodes), code_pop(1)) : code_nop());
        Jsi_OpCodes *stat = (yyvsp[0].opcodes);
        Jsi_OpCodes *cont_jmp = code_jfalse(step->code_len + stat->code_len + 2);
        Jsi_OpCodes *step_jmp = code_jmp(-(cond->code_len + step->code_len + stat->code_len + 1));
        code_reserved_replace(stat, step->code_len + 1, 0, (yyvsp[-8].sstr), 0);
        (yyval.opcodes) = codes_join(codes_join3(init, cond, cont_jmp),
                           codes_join3(stat, step, step_jmp));
    }
    break;

  case 60:
    {
        jsi_ForinVar *fv;
        int inof = (yyvsp[-3].inum);
        Jsi_OpCodes *loc = code_local(pstate, &(yylsp[-4]), (yyvsp[-4].sstr));
        jsi_mark_local(loc);
        fv = forinvar_new(pstate, (yyvsp[-4].sstr), loc, NULL);
        Jsi_OpCodes *lval;
        if (fv->varname) lval = code_push_index(pstate, &(yylsp[-7]), fv->varname, 1);
        else lval = fv->lval;
        
        Jsi_OpCodes *ret = make_forin(lval, &(yylsp[-7]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), (yyvsp[-8].sstr), (inof!=0));
        if (fv->varname && fv->local) {
            if (!pstate->eval_flag) {
                jsi_PstateAddVar(pstate, &(yylsp[-4]), fv->varname);
                jsi_FreeOpcodes(fv->local);
            } else ret = codes_join(fv->local, ret);
        }
        Jsi_Free(fv);
................................................................................
        if (((yyvsp[-4].opcodes))->lvalue_flag == 2) 
            fv = forinvar_new(pstate, NULL, NULL, codes_join((yyvsp[-4].opcodes), code_subscript(pstate, &(yylsp[-4]), 0)));
        else fv = forinvar_new(pstate, NULL, NULL, (yyvsp[-4].opcodes));
        Jsi_OpCodes *lval;
        if (fv->varname) lval = code_push_index(pstate, &(yylsp[-7]), fv->varname, 0);
        else lval = fv->lval;
        
        Jsi_OpCodes *ret = make_forin(lval, &(yylsp[-6]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), (yyvsp[-7].sstr), (inof!=0));
        if (fv->varname && fv->local) {
            if (!pstate->eval_flag) {
                jsi_PstateAddVar(pstate, &(yylsp[-4]), fv->varname);
                jsi_FreeOpcodes(fv->local);
            } else ret = codes_join(fv->local, ret);
        }
        Jsi_Free(fv);
................................................................................
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 69:
    {
        Jsi_OpCodes *cond = (yyvsp[-2].opcodes);
        Jsi_OpCodes *stat = (yyvsp[0].opcodes);
        code_reserved_replace(stat, 1, 0, (yyvsp[-5].sstr), 0);
        (yyval.opcodes) = codes_join4(cond, code_jfalse(stat->code_len + 2), stat,
                           code_jmp(-(stat->code_len + cond->code_len + 1)));
    }
    break;

  case 70:
    {
        Jsi_OpCodes *stat = (yyvsp[-4].opcodes);
        Jsi_OpCodes *cond = (yyvsp[-1].opcodes);
        code_reserved_replace(stat, cond->code_len + 1, 0, (yyvsp[-6].sstr), 0);
        (yyval.opcodes) = codes_join3(stat, cond,
                            code_jtrue(-(stat->code_len + cond->code_len)));
    }
    break;

  case 71:
    {
................................................................................
        (yyval.opcodes) = code_push_func(pstate,  &(yylsp[-4]), jsi_FuncMake(pstate, (yyvsp[-4].scopes), (yyvsp[0].opcodes), &(yylsp[-6]), NULL));
        jsi_PstatePop(pstate);
    }
    break;

  case 73:
    {
        (yyval.opcodes) = code_push_func(pstate, &(yylsp[-3]), jsi_FuncMake(pstate, (yyvsp[-2].scopes), (yyvsp[0].opcodes), &(yylsp[-5]), (yyvsp[-4].sstr)));
        jsi_PstatePop(pstate);
    }
    break;

  case 74:
    {
        (yyvsp[-4].scopes)->retType = (yyvsp[-1].inum);
        (yyval.opcodes) = code_push_func(pstate, &(yylsp[-5]), jsi_FuncMake(pstate, (yyvsp[-4].scopes), (yyvsp[0].opcodes), &(yylsp[-7]), (yyvsp[-6].sstr)));
        jsi_PstatePop(pstate);
    }
    break;

  case 75:
    { (yyval.scopes) = jsi_ArgsOptAdd(pstate, jsi_ScopeStrsNew()); }
    break;
................................................................................
  case 94:
    {
        (yyval.inum) = pstate->argType;
    }
    break;

  case 95:
    { (yyval.vstr) = (yyvsp[0].vstr); }
    break;

  case 96:
    {     (yyval.value) = Jsi_ValueNew(pstate->interp); (yyval.value)->d.num = 0; }
    break;

  case 97:
    {    (yyval.value) = Jsi_ValueNew(pstate->interp); (yyval.value)->d.num = 1; }
    break;

  case 98:
    { *(yyvsp[0].num) = *(yyvsp[0].num) * -1; (yyval.value) = Jsi_ValueNewNumber(pstate->interp, *(yyvsp[0].num)); Jsi_Free((yyvsp[0].num));}
    break;

  case 99:
    { (yyval.value) = Jsi_ValueNewNumber(pstate->interp, *(yyvsp[0].num)); Jsi_Free((yyvsp[0].num)); }
    break;

  case 100:
    {   (yyval.value) = Jsi_ValueNewBoolean(pstate->interp, 1); }
    break;

  case 101:
    {  (yyval.value) = Jsi_ValueNewBoolean(pstate->interp, 0); }
    break;

  case 102:
    {(yyval.value) = Jsi_ValueNewNull(pstate->interp); }
    break;

  case 103:
    {  (yyval.value) = Jsi_ValueNewBlob(pstate->interp, (uchar*)(yyvsp[0].vstr)->str, (yyvsp[0].vstr)->len); }
    break;

  case 104:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[0].sstr), NULL, &(yylsp[0]) ); }
    break;

  case 105:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[-2].sstr), (yyvsp[0].value), &(yylsp[-2])); }
    break;

  case 106:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[-2].sstr), NULL, &(yylsp[-2]));}
    break;

  case 107:
    { (yyval.scopes) = jsi_argInsert(pstate, NULL, (yyvsp[-4].sstr), (yyvsp[0].value), &(yylsp[-4]));}
    break;

  case 108:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-2].scopes), (yyvsp[0].sstr), NULL, &(yylsp[-2])); }
    break;

  case 109:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-4].scopes), (yyvsp[-2].sstr), (yyvsp[0].value), &(yylsp[-4])); }
    break;

  case 110:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-4].scopes), (yyvsp[-2].sstr), NULL, &(yylsp[-4]));}
    break;

  case 111:
    { (yyval.scopes) = jsi_argInsert(pstate, (yyvsp[-6].scopes), (yyvsp[-4].sstr), (yyvsp[0].value), &(yylsp[-6]));}
    break;

  case 112:
    { (yyval.opcodes) = (yyvsp[-1].opcodes); }
    break;

  case 113:
    { (yyval.opcodes) = code_nop(); }
    break;

  case 114:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 115:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 116:
    { 
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 1)); 
        else (yyval.opcodes) = (yyvsp[0].opcodes);
    }
    break;

  case 117:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_pop(1), (yyvsp[0].opcodes)); }
    break;

  case 118:
    { (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (yyvsp[-1].opcodes), code_subscript(pstate, &(yylsp[-3]), 1)); }
    break;

  case 119:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_push_string(pstate,&(yylsp[0]),(yyvsp[0].sstr)), code_subscript(pstate, &(yylsp[0]), 1)); }
    break;

  case 120:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_neg()); }
    break;

  case 121:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_pos()); }
    break;

  case 122:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_bnot()); }
    break;

  case 123:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_not()); }
    break;

  case 124:
    { (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_pop(1), code_push_undef()); }
    break;

  case 125:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mul()); }
    break;

  case 126:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_div()); }
    break;

  case 127:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mod()); }
    break;

  case 128:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_add()); }
    break;

  case 129:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_sub()); }
    break;

  case 130:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_in()); }
    break;

  case 131:
    {
        if (((yyvsp[-1].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-1].opcodes), code_subscript(pstate, &(yylsp[-1]), 0), code_inc(pstate, &(yylsp[-1]), 1));
        else (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_inc(pstate, &(yylsp[-1]), 1));
    }
    break;

  case 132:
    { 
        if (((yyvsp[-1].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-1].opcodes), code_subscript(pstate, &(yylsp[-1]), 0), code_dec(pstate, &(yylsp[-1]), 1));
        else (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_dec(pstate, &(yylsp[-1]), 1)); 
    }
    break;

  case 133:
    {
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 0), code_inc(pstate, &(yylsp[0]), 0));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_inc(pstate, &(yylsp[0]), 0));
    }
    break;

  case 134:
    {
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 0), code_typeof(pstate, &(yylsp[0]), 0));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_typeof(pstate, &(yylsp[0]), 0));
    }
    break;

  case 135:
    { 
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 0), code_dec(pstate, &(yylsp[0]), 0));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_dec(pstate, &(yylsp[0]), 0));
    }
    break;

  case 136:
    { (yyval.opcodes) = (yyvsp[-1].opcodes); }
    break;

  case 137:
    {
        Jsi_OpCodes *expr2 = codes_join(code_pop(1), (yyvsp[0].opcodes));
        (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_jfalse_np(expr2->code_len + 1), expr2);
    }
    break;

  case 138:
    {
        Jsi_OpCodes *expr2 = codes_join(code_pop(1), (yyvsp[0].opcodes));
        (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_jtrue_np(expr2->code_len + 1), expr2);
    }
    break;

  case 139:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_less()); }
    break;

  case 140:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_greater()); }
    break;

  case 141:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_lessequ()); }
    break;

  case 142:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_greaterequ()); }
    break;

  case 143:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_equal()); }
    break;

  case 144:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_notequal()); }
    break;

  case 145:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_eequ());    }
    break;

  case 146:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_nneq()); }
    break;

  case 147:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_band()); }
    break;

  case 148:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bor()); }
    break;

  case 149:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bxor()); }
    break;

  case 150:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(0)); }
    break;

  case 151:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(1)); }
    break;

  case 152:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(2)); }
    break;

  case 153:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_assign(pstate, &(yylsp[-2]), ((yyvsp[-2].opcodes))->lvalue_flag)); }
    break;

  case 154:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_add()); }
    break;

  case 155:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_sub()); }
    break;

  case 156:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mul()); }
    break;

  case 157:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_mod()); }
    break;

  case 158:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(0)); }
    break;

  case 159:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(1)); }
    break;

  case 160:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_shf(2)); }
    break;

  case 161:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_band()); }
    break;

  case 162:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bor()); }
    break;

  case 163:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_bxor()); }
    break;

  case 164:
    { (yyval.opcodes) = opassign(pstate, &(yylsp[-2]), (yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_div()); }
    break;

  case 165:
    { (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), (yyvsp[0].opcodes), code_instanceof()); }
    break;

  case 166:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 167:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_newfcall(pstate, &(yylsp[-1]), 0, NULL, (yyvsp[0].opcodes))); }
    break;

  case 168:
    { 
        if (((yyvsp[0].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[0].opcodes), code_subscript(pstate, &(yylsp[0]), 1), code_newfcall(pstate, &(yylsp[0]), 0, NULL, (yyvsp[0].opcodes)));
        else (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_newfcall(pstate, &(yylsp[0]), 0, NULL, (yyvsp[0].opcodes)));}
    break;

  case 169:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_newfcall(pstate, &(yylsp[-3]),0, NULL, (yyvsp[-1].opcodes))); }
    break;

  case 170:
    { (yyval.opcodes) = codes_join((yyvsp[0].opcodes), code_newfcall(pstate, &(yylsp[-1]),0, NULL, (yyvsp[0].opcodes))); }
    break;

  case 171:
    {
        Jsi_OpCodes *lval = (yyvsp[-3].opcodes);
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-4]), expr_cnt, lval->lvalue_name, opl));
    }
    break;

  case 172:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        Jsi_OpCodes *lv = NULL;
        if (((yyvsp[-3].opcodes))->lvalue_flag == 2) lv = codes_join((yyvsp[-3].opcodes), code_subscript(pstate, &(yylsp[-3]), 1));
        else lv = (yyvsp[-3].opcodes);
        (yyval.opcodes) = codes_join3(lv, (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-4]),expr_cnt, lv?lv->lvalue_name:NULL, opl));
    }
    break;

  case 173:
    { 
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-4].opcodes), (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-6]),expr_cnt, NULL, opl));
    }
    break;

  case 174:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (opl ? opl : code_nop()), code_newfcall(pstate, &(yylsp[-4]),expr_cnt, NULL, opl));
    }
    break;

  case 175:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-3]),expr_cnt, NULL, NULL, opl, NULL));
    }
    break;

  case 176:
    {
        Jsi_OpCodes *expr2 = codes_join((yyvsp[-2].opcodes), code_jmp(((yyvsp[0].opcodes))->code_len + 1));
        (yyval.opcodes) = codes_join4((yyvsp[-4].opcodes), code_jfalse(expr2->code_len + 1), expr2, (yyvsp[0].opcodes));
    }
    break;

  case 177:
    { (yyval.opcodes) = code_debug(pstate,&(yylsp[0])); }
    break;

  case 178:
    {
        Jsi_OpCodes *lval = (yyvsp[-5].opcodes);
        const char *n1 = lval->lvalue_name;
        const char *n2 = (yyvsp[-3].sstr);
        Jsi_OpCodes *ff = codes_join4((yyvsp[-5].opcodes), code_push_string(pstate,&(yylsp[-3]), (yyvsp[-3].sstr)), code_chthis(pstate,&(yylsp[-5]), 1), code_subscript(pstate, &(yylsp[-5]), 1));
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3(ff, (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-3]), expr_cnt, n1, n2, opl, NULL));
    }
    break;

  case 179:
    {
        Jsi_OpCodes *ff = codes_join4((yyvsp[-6].opcodes), (yyvsp[-4].opcodes), code_chthis(pstate,&(yylsp[-6]), 1), code_subscript(pstate, &(yylsp[-6]), 1));
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join3(ff, (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-4]), expr_cnt, NULL, NULL, opl, NULL));
    }
    break;

  case 180:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        (yyval.opcodes) = codes_join4((yyvsp[-4].opcodes), code_chthis(pstate,&(yylsp[-5]), 0), (opl ? opl : code_nop()), code_fcall(pstate, &(yylsp[-3]),expr_cnt, NULL, NULL, opl, NULL));
    }
    break;

  case 181:
    {
        Jsi_OpCodes *opl = (yyvsp[-1].opcodes);
        int expr_cnt = opl ? opl->expr_counter:0;
        Jsi_OpCodes *pref;
        Jsi_OpCodes *lval = (yyvsp[-3].opcodes);
        const char *n1 = lval->lvalue_name;
        if (lval->lvalue_flag == 2) {
................................................................................
                pref = codes_join((yyvsp[-3].opcodes), code_chthis(pstate,&(yylsp[-3]), 0));
                (yyval.opcodes) = codes_join3(pref, (opl ? opl : code_nop()), code_fcall(pstate, jpl, expr_cnt, n1, NULL, opl, pref));
            }
        }
    }
    break;

  case 182:
    {
        Jsi_OpCodes *lval = code_push_index(pstate, &(yylsp[0]), (yyvsp[0].sstr), 0); 
        (yyval.opcodes) = lval;
        lval->lvalue_flag = 1; 
        lval->lvalue_name = (yyvsp[0].sstr); 
    }
    break;

  case 183:
    { (yyval.opcodes) = code_push_args(); ((yyval.opcodes))->lvalue_flag = 1; }
    break;

  case 184:
    { (yyval.opcodes) = code_push_this(pstate,&(yylsp[0])); ((yyval.opcodes))->lvalue_flag = 1; }
    break;

  case 185:
    {
        if (((yyvsp[-3].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-3].opcodes), code_subscript(pstate, &(yylsp[-3]), 1), (yyvsp[-1].opcodes)); 
        else (yyval.opcodes) = codes_join((yyvsp[-3].opcodes), (yyvsp[-1].opcodes)); 
        ((yyval.opcodes))->lvalue_flag = 2;
    }
    break;

  case 186:
    {
        if (((yyvsp[-2].opcodes))->lvalue_flag == 2) (yyval.opcodes) = codes_join3((yyvsp[-2].opcodes), code_subscript(pstate, &(yylsp[-2]), 1), code_push_string(pstate,&(yylsp[0]), (yyvsp[0].sstr))); 
        else (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), code_push_string(pstate,&(yylsp[0]), (yyvsp[0].sstr)));
        ((yyval.opcodes))->lvalue_flag = 2;
    }
    break;

  case 187:
    { (yyval.opcodes) = NULL; }
    break;

  case 188:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 189:
    { (yyval.opcodes) = (yyvsp[0].opcodes); ((yyval.opcodes))->expr_counter = 1; }
    break;

  case 190:
    { 
        int exprcnt = ((yyvsp[-2].opcodes))->expr_counter + 1;
        (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), (yyvsp[0].opcodes));
        ((yyval.opcodes))->expr_counter = exprcnt;
    }
    break;

  case 191:
    { (yyval.opcodes) = code_push_vstring(pstate,&(yylsp[0]), (yyvsp[0].vstr)); }
    break;

  case 192:
    { (yyval.opcodes) = code_push_null(); }
    break;

  case 193:
    { (yyval.opcodes) = code_push_undef(); }
    break;

  case 194:
    { (yyval.opcodes) = code_push_bool(1); }
    break;

  case 195:
    { (yyval.opcodes) = code_push_bool(0); }
    break;

  case 196:
    { (yyval.opcodes) = code_push_num((yyvsp[0].num)); }
    break;

  case 197:
    { (yyval.opcodes) = code_push_regex(pstate, &(yylsp[0]), (yyvsp[0].regex)); }




    break;

  case 198:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 199:
    { (yyval.opcodes) = (yyvsp[0].opcodes); }
    break;

  case 200:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_object(pstate, &(yylsp[-1]), ((yyvsp[-1].opcodes))->expr_counter)); }
    break;

  case 201:
    { (yyval.opcodes) = code_nop(); ((yyval.opcodes))->expr_counter = 0; }
    break;

  case 202:
    { (yyval.opcodes) = (yyvsp[0].opcodes); ((yyval.opcodes))->expr_counter = 1; }
    break;

  case 203:
    {
        int cnt = ((yyvsp[-2].opcodes))->expr_counter + 1;
        (yyval.opcodes) = codes_join((yyvsp[-2].opcodes), (yyvsp[0].opcodes));
        ((yyval.opcodes))->expr_counter = cnt;
    }
    break;





  case 204:
    { (yyval.opcodes) = codes_join(code_push_string(pstate,&(yylsp[-2]), (yyvsp[-2].sstr)), (yyvsp[0].opcodes)); }
    break;

  case 205:
    { (yyval.opcodes) = codes_join(code_push_vstring(pstate,&(yylsp[-2]), (yyvsp[-2].vstr)), (yyvsp[0].opcodes)); }
    break;

  case 206:
    { (yyval.opcodes) = codes_join(code_push_num((yyvsp[-2].num)), (yyvsp[0].opcodes));  }
    break;

  case 207:
    { (yyval.opcodes) = codes_join(code_push_bool(1), (yyvsp[0].opcodes));  }
    break;

  case 208:
    { (yyval.opcodes) = codes_join(code_push_bool(0), (yyvsp[0].opcodes));  }
    break;

  case 209:
    { (yyval.opcodes) = codes_join(code_push_undef(), (yyvsp[0].opcodes));  }
    break;

  case 210:
    { (yyval.opcodes) = codes_join(code_push_null(), (yyvsp[0].opcodes));  }
    break;

  case 211:
    { (yyval.opcodes) = codes_join((yyvsp[-1].opcodes), code_array(pstate, &(yylsp[-1]), ((yyvsp[-1].opcodes))->expr_counter)); }
    break;

  case 212:
    { (yyval.opcodes) = code_array(pstate, &(yylsp[-1]), 0); }
    break;


      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
................................................................................
                jsiPush(interp,1);
                break;
            case OP_PUSHNUM:
                Jsi_ValueMakeNumber(interp, &_jsi_STACKIDX(interp->framePtr->Sp), (*((Jsi_Number *)ip->data)));
                jsiPush(interp,1);
                break;
            case OP_PUSHSTR: {
                Jsi_Value **v = &_jsi_STACKIDX(interp->framePtr->Sp);
                Jsi_ValueMakeStringKey(interp, v, (char*)ip->data);
                interp->lastPushStr = Jsi_ValueString(interp, *v, NULL);
                jsiPush(interp,1);
                break;
            }
            case OP_PUSHVSTR: {
                Jsi_String *s = (Jsi_String *)ip->data;
                Jsi_Value **v = &_jsi_STACKIDX(interp->framePtr->Sp);
                if (s->flags&1)
                    jsi_ValueMakeBlobDup(interp,v, (uchar*)s->str, s->len);
                else {
                    Jsi_ValueMakeStringKey(interp, v, s->str);
                    interp->lastPushStr = s->str;
                }
                jsiPush(interp,1);
                break;
            }
            case OP_PUSHVAR: {
                rc = jsi_PushVar(ps, ip, scope, currentScope, context_id);      
                break;
            }

Changes to src/jsi.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 32

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* jsi.h : External API header file for Jsi. */
#ifndef __JSI_H__
#define __JSI_H__

#define JSI_VERSION_MAJOR   2
#define JSI_VERSION_MINOR   8
#define JSI_VERSION_RELEASE 33

#define JSI_VERSION (JSI_VERSION_MAJOR + ((Jsi_Number)JSI_VERSION_MINOR/100.0) + ((Jsi_Number)JSI_VERSION_RELEASE/10000.0))

#ifndef JSI_EXTERN
#define JSI_EXTERN extern
#endif

Changes to src/jsiCmds.c.

4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
    Jsi_CryptoHash(zbuf, cp, n, edata.type, edata.hashcash, edata.noHex, &olen);
        
done:
    Jsi_DSFree(&dStr);
    if (hasopts)
        Jsi_OptionsFree(interp, HashOptions, &edata, 0);
    if (rc == JSI_OK) {
        char *z = (char*)Jsi_Malloc(olen+1);
        memcpy(z, zbuf, olen);
        z[olen] = 0;
        Jsi_ValueMakeBlob(interp, ret, (uchar*)z, olen);
    }
    return rc;

}


#ifndef JSI_OMIT_ENCRYPT







<
<
<
|







4047
4048
4049
4050
4051
4052
4053



4054
4055
4056
4057
4058
4059
4060
4061
    Jsi_CryptoHash(zbuf, cp, n, edata.type, edata.hashcash, edata.noHex, &olen);
        
done:
    Jsi_DSFree(&dStr);
    if (hasopts)
        Jsi_OptionsFree(interp, HashOptions, &edata, 0);
    if (rc == JSI_OK) {



        jsi_ValueMakeBlobDup(interp, ret, (uchar*)zbuf, olen);
    }
    return rc;

}


#ifndef JSI_OMIT_ENCRYPT

Changes to src/jsiCode.c.

21
22
23
24
25
26
27

28
29
30
31
32
33
34
...
218
219
220
221
222
223
224




225
226
227
228
229
230
231
...
442
443
444
445
446
447
448



449
450
451
452
453
454
455
456
 *    corrent stack elems poped(for in always has 2 elem, while switch has 1)
 */

static const char *jsi_op_names[OP_LASTOP] = {
    "NOP",
    "PUSHNUM",
    "PUSHSTR",

    "PUSHVAR",
    "PUSHUND",
    "PUSHNULL",
    "PUSHBOO",
    "PUSHFUN",
    "PUSHREG",
    "PUSHARG",
................................................................................
static Jsi_OpCodes *code_push_bool(int v) { JSI_NEW_CODES(0,OP_PUSHBOO, v); }
static Jsi_OpCodes *code_push_num(Jsi_Number *v) { JSI_NEW_CODES(1,OP_PUSHNUM, v); }
static Jsi_OpCodes *code_push_string(jsi_Pstate *p, jsi_Pline *line, const char *str) {
    if (*str == 'c' && !Jsi_Strcmp(str,"callee"))
        p->interp->hasCallee = 1;
    JSI_NEW_CODESLN(0,OP_PUSHSTR, str);
}





static Jsi_OpCodes *code_push_index(jsi_Pstate *p, jsi_Pline *line, const char *varname, int local)
{
    jsi_FastVar *n = (typeof(n))Jsi_Calloc(1, sizeof(*n));
    n->sig = JSI_SIG_FASTVAR;
    n->ps = p;
    n->context_id = -1;
................................................................................
        op->op == OP_POP || op->op == OP_ASSIGN ||
        op->op == OP_RET || op->op == OP_NEWFCALL ||
        op->op == OP_DELETE || op->op == OP_CHTHIS ||
        op->op == OP_OBJECT || op->op == OP_ARRAY ||
        op->op == OP_SHF ||
        op->op == OP_INC || op->op == OP_DEC) snprintf(bp, bsiz, "%" PRId64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_PUSHNUM) Jsi_NumberDtoA(interp, *((Jsi_Number *)op->data), bp, bsiz, 0);



    else if (op->op == OP_PUSHSTR || op->op == OP_LOCAL ||
             op->op == OP_SCATCH) snprintf(bp, bsiz, "\"%s\"", op->data ? (char*)op->data:"(NoCatch)");
    else if (op->op == OP_PUSHVAR) snprintf(bp, bsiz, "var: \"%s\"", ((jsi_FastVar *)op->data)->varname);
    else if (op->op == OP_PUSHFUN) snprintf(bp, bsiz, "func: 0x%" PRIx64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_JTRUE || op->op == OP_JFALSE ||
             op->op == OP_JTRUE_NP || op->op == OP_JFALSE_NP ||
             op->op == OP_JMP) snprintf(bp, bsiz, "{%" PRIu64 "}\t#%" PRIu64 "", (Jsi_Wide)(uintptr_t)op->data, (Jsi_Wide)((uintptr_t)currentip + (uintptr_t)op->data));
    else if (op->op == OP_JMPPOP) {







>







 







>
>
>
>







 







>
>
>
|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
...
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
...
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
 *    corrent stack elems poped(for in always has 2 elem, while switch has 1)
 */

static const char *jsi_op_names[OP_LASTOP] = {
    "NOP",
    "PUSHNUM",
    "PUSHSTR",
    "PUSHVSTR",
    "PUSHVAR",
    "PUSHUND",
    "PUSHNULL",
    "PUSHBOO",
    "PUSHFUN",
    "PUSHREG",
    "PUSHARG",
................................................................................
static Jsi_OpCodes *code_push_bool(int v) { JSI_NEW_CODES(0,OP_PUSHBOO, v); }
static Jsi_OpCodes *code_push_num(Jsi_Number *v) { JSI_NEW_CODES(1,OP_PUSHNUM, v); }
static Jsi_OpCodes *code_push_string(jsi_Pstate *p, jsi_Pline *line, const char *str) {
    if (*str == 'c' && !Jsi_Strcmp(str,"callee"))
        p->interp->hasCallee = 1;
    JSI_NEW_CODESLN(0,OP_PUSHSTR, str);
}

static Jsi_OpCodes *code_push_vstring(jsi_Pstate *p, jsi_Pline *line, Jsi_String *s) {
    JSI_NEW_CODESLN(0,OP_PUSHVSTR, s);
}

static Jsi_OpCodes *code_push_index(jsi_Pstate *p, jsi_Pline *line, const char *varname, int local)
{
    jsi_FastVar *n = (typeof(n))Jsi_Calloc(1, sizeof(*n));
    n->sig = JSI_SIG_FASTVAR;
    n->ps = p;
    n->context_id = -1;
................................................................................
        op->op == OP_POP || op->op == OP_ASSIGN ||
        op->op == OP_RET || op->op == OP_NEWFCALL ||
        op->op == OP_DELETE || op->op == OP_CHTHIS ||
        op->op == OP_OBJECT || op->op == OP_ARRAY ||
        op->op == OP_SHF ||
        op->op == OP_INC || op->op == OP_DEC) snprintf(bp, bsiz, "%" PRId64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_PUSHNUM) Jsi_NumberDtoA(interp, *((Jsi_Number *)op->data), bp, bsiz, 0);
    else if (op->op == OP_PUSHVSTR) {
        Jsi_String *ss = (Jsi_String*)op->data;
        snprintf(bp, bsiz, "\"%s\"", ss->str);
    } else if (op->op == OP_PUSHSTR || op->op == OP_LOCAL ||
             op->op == OP_SCATCH) snprintf(bp, bsiz, "\"%s\"", op->data ? (char*)op->data:"(NoCatch)");
    else if (op->op == OP_PUSHVAR) snprintf(bp, bsiz, "var: \"%s\"", ((jsi_FastVar *)op->data)->varname);
    else if (op->op == OP_PUSHFUN) snprintf(bp, bsiz, "func: 0x%" PRIx64, (Jsi_Wide)(uintptr_t)op->data);
    else if (op->op == OP_JTRUE || op->op == OP_JFALSE ||
             op->op == OP_JTRUE_NP || op->op == OP_JFALSE_NP ||
             op->op == OP_JMP) snprintf(bp, bsiz, "{%" PRIu64 "}\t#%" PRIu64 "", (Jsi_Wide)(uintptr_t)op->data, (Jsi_Wide)((uintptr_t)currentip + (uintptr_t)op->data));
    else if (op->op == OP_JMPPOP) {

Changes to src/jsiEval.c.

1252
1253
1254
1255
1256
1257
1258
1259

1260












1261
1262
1263
1264
1265
1266
1267
                jsiPush(interp,1);
                break;
            case OP_PUSHNUM:
                Jsi_ValueMakeNumber(interp, &_jsi_STACKIDX(interp->framePtr->Sp), (*((Jsi_Number *)ip->data)));
                jsiPush(interp,1);
                break;
            case OP_PUSHSTR: {
                Jsi_ValueMakeStringKey(interp,&_jsi_STACKIDX(interp->framePtr->Sp), (char*)ip->data);

                interp->lastPushStr = Jsi_ValueString(interp, _jsi_STACKIDX(interp->framePtr->Sp), NULL);












                jsiPush(interp,1);
                break;
            }
            case OP_PUSHVAR: {
                rc = jsi_PushVar(ps, ip, scope, currentScope, context_id);      
                break;
            }







|
>
|
>
>
>
>
>
>
>
>
>
>
>
>







1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
                jsiPush(interp,1);
                break;
            case OP_PUSHNUM:
                Jsi_ValueMakeNumber(interp, &_jsi_STACKIDX(interp->framePtr->Sp), (*((Jsi_Number *)ip->data)));
                jsiPush(interp,1);
                break;
            case OP_PUSHSTR: {
                Jsi_Value **v = &_jsi_STACKIDX(interp->framePtr->Sp);
                Jsi_ValueMakeStringKey(interp, v, (char*)ip->data);
                interp->lastPushStr = Jsi_ValueString(interp, *v, NULL);
                jsiPush(interp,1);
                break;
            }
            case OP_PUSHVSTR: {
                Jsi_String *s = (Jsi_String *)ip->data;
                Jsi_Value **v = &_jsi_STACKIDX(interp->framePtr->Sp);
                if (s->flags&1)
                    jsi_ValueMakeBlobDup(interp,v, (uchar*)s->str, s->len);
                else {
                    Jsi_ValueMakeStringKey(interp, v, s->str);
                    interp->lastPushStr = s->str;
                }
                jsiPush(interp,1);
                break;
            }
            case OP_PUSHVAR: {
                rc = jsi_PushVar(ps, ip, scope, currentScope, context_id);      
                break;
            }

Changes to src/jsiInt.h.

359
360
361
362
363
364
365
366

367
368
369
370
371
372
373
...
728
729
730
731
732
733
734

735
736
737
738
739
740
741
....
1442
1443
1444
1445
1446
1447
1448

1449
1450
1451
1452
1453
1454
1455
/* stack change */
/* 0  nothing change */
/* +1 push */
/* -1 pop */
typedef enum {      /* SC   type of data    comment                             */
    OP_NOP,         /* 0 */
    OP_PUSHNUM,     /* +1   *double         number                              */
    OP_PUSHSTR,     /* +1   *char        string                              */

    OP_PUSHVAR,     /* +1   *FastVar        variable name                       */
    OP_PUSHUND,     /* +1   -               undefined                           */
    OP_PUSHNULL,    /* +1   -               null                                */
    OP_PUSHBOO,     /* +1   int             bool                                */
    OP_PUSHFUN,     /* +1   *Jsi_Func           function                            */
    OP_PUSHREG,     /* +1   *regex_t        regex                               */
    OP_PUSHARG,     /* +1   -               push arguments(cur scope)           */
................................................................................

    int _context_id;            /* used in FastVar-locating */
    Jsi_Value *last_exception;
    Jsi_Interp *interp;
    Jsi_HashEntry *hPtr;
    Jsi_Hash *argsTbl;
    Jsi_Hash *fastVarTbl;

    int argType;                // Used during parsing to aggregate type.
    Jsi_ScopeStrs *args;        // Last push.
} jsi_Pstate;


Jsi_ScopeStrs *jsi_ScopeStrsNew(void);
void jsi_ScopeStrsPush(Jsi_Interp *interp, Jsi_ScopeStrs *ss, const char *string, int argType);
................................................................................
extern const char *jsi_ObjectTypeName(Jsi_Interp *interp, Jsi_otype otyp);
extern const char *jsi_ValueTypeName(Jsi_Interp *interp, Jsi_Value *val);
extern const char *jsi_TypeName(Jsi_Interp *interp, Jsi_ttype otyp);
extern Jsi_RC jsi_ObjectToStringCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);
extern Jsi_RC jsi_HasOwnPropertyCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);


extern const char *jsi_GetHomeDir(Jsi_Interp *interp);
extern Jsi_RC jsi_RegExpValueNew(Jsi_Interp *interp, const char *regtxt, Jsi_Value *ret);
extern void jsi_DumpOptionSpecs(Jsi_Interp *interp, Jsi_Obj *nobj, Jsi_OptionSpec* spec);
extern Jsi_Func *jsi_FuncMake(jsi_Pstate *pstate, Jsi_ScopeStrs *args, Jsi_OpCodes *ops, jsi_Pline *line, const char *name);
extern Jsi_Func *jsi_FuncNew(Jsi_Interp *interp);
extern void jsi_FreeOpcodes(Jsi_OpCodes *ops);







|
>







 







>







 







>







359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
...
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
....
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
/* stack change */
/* 0  nothing change */
/* +1 push */
/* -1 pop */
typedef enum {      /* SC   type of data    comment                             */
    OP_NOP,         /* 0 */
    OP_PUSHNUM,     /* +1   *double         number                              */
    OP_PUSHSTR,     /* +1   *char           string                              */
    OP_PUSHVSTR,    /* +1   Jsi_String*     string                              */
    OP_PUSHVAR,     /* +1   *FastVar        variable name                       */
    OP_PUSHUND,     /* +1   -               undefined                           */
    OP_PUSHNULL,    /* +1   -               null                                */
    OP_PUSHBOO,     /* +1   int             bool                                */
    OP_PUSHFUN,     /* +1   *Jsi_Func           function                            */
    OP_PUSHREG,     /* +1   *regex_t        regex                               */
    OP_PUSHARG,     /* +1   -               push arguments(cur scope)           */
................................................................................

    int _context_id;            /* used in FastVar-locating */
    Jsi_Value *last_exception;
    Jsi_Interp *interp;
    Jsi_HashEntry *hPtr;
    Jsi_Hash *argsTbl;
    Jsi_Hash *fastVarTbl;
    Jsi_Hash *strTbl;
    int argType;                // Used during parsing to aggregate type.
    Jsi_ScopeStrs *args;        // Last push.
} jsi_Pstate;


Jsi_ScopeStrs *jsi_ScopeStrsNew(void);
void jsi_ScopeStrsPush(Jsi_Interp *interp, Jsi_ScopeStrs *ss, const char *string, int argType);
................................................................................
extern const char *jsi_ObjectTypeName(Jsi_Interp *interp, Jsi_otype otyp);
extern const char *jsi_ValueTypeName(Jsi_Interp *interp, Jsi_Value *val);
extern const char *jsi_TypeName(Jsi_Interp *interp, Jsi_ttype otyp);
extern Jsi_RC jsi_ObjectToStringCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);
extern Jsi_RC jsi_HasOwnPropertyCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
    Jsi_Value **ret, Jsi_Func *funcPtr);
extern Jsi_Value* jsi_ValueMakeBlobDup(Jsi_Interp *interp, Jsi_Value **vPtr, unsigned char *s, int len);

extern const char *jsi_GetHomeDir(Jsi_Interp *interp);
extern Jsi_RC jsi_RegExpValueNew(Jsi_Interp *interp, const char *regtxt, Jsi_Value *ret);
extern void jsi_DumpOptionSpecs(Jsi_Interp *interp, Jsi_Obj *nobj, Jsi_OptionSpec* spec);
extern Jsi_Func *jsi_FuncMake(jsi_Pstate *pstate, Jsi_ScopeStrs *args, Jsi_OpCodes *ops, jsi_Pline *line, const char *name);
extern Jsi_Func *jsi_FuncNew(Jsi_Interp *interp);
extern void jsi_FreeOpcodes(Jsi_OpCodes *ops);

Changes to src/jsiInterp.c.

236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
...
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
}

/* Clean-copy value to interp: convert to JSON and back if required. */
Jsi_RC Jsi_CleanValue(Jsi_Interp *interp, Jsi_Interp *tointerp, Jsi_Value *val, Jsi_Value **ret)
{
    Jsi_RC rc = JSI_OK;
    const char *cp;
    unsigned char *dp;
    int len, iskey;
    Jsi_Obj *obj;
    switch (val->vt) {
        case JSI_VT_UNDEF: Jsi_ValueMakeUndef(interp, ret); return rc;
        case JSI_VT_NULL: Jsi_ValueMakeNull(tointerp, ret); return rc;
        case JSI_VT_BOOL: Jsi_ValueMakeBool(tointerp, ret, val->d.val); return rc;
        case JSI_VT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, val->d.num); return rc;
................................................................................
            cp = val->d.s.str;
            len = val->d.s.len;
makestr:
            if (iskey) {
                Jsi_ValueMakeStringKey(interp, ret, cp);
                return rc;
            }
            if (len<0) len = Jsi_Strlen(cp);
            dp = (unsigned char*)Jsi_Malloc(len+1);
            memcpy(dp, cp, len);
            dp[len] = 0;
            Jsi_ValueMakeBlob(tointerp, ret, dp, len);
            return rc;
        case JSI_VT_OBJECT:
            obj = val->d.obj;
            switch (obj->ot) {
                case JSI_OT_BOOL: Jsi_ValueMakeBool(tointerp, ret, obj->d.val); return rc;
                case JSI_OT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, obj->d.num); return rc;
                case JSI_OT_STRING:







<







 







|
<
<
<
<







236
237
238
239
240
241
242

243
244
245
246
247
248
249
...
252
253
254
255
256
257
258
259




260
261
262
263
264
265
266
}

/* Clean-copy value to interp: convert to JSON and back if required. */
Jsi_RC Jsi_CleanValue(Jsi_Interp *interp, Jsi_Interp *tointerp, Jsi_Value *val, Jsi_Value **ret)
{
    Jsi_RC rc = JSI_OK;
    const char *cp;

    int len, iskey;
    Jsi_Obj *obj;
    switch (val->vt) {
        case JSI_VT_UNDEF: Jsi_ValueMakeUndef(interp, ret); return rc;
        case JSI_VT_NULL: Jsi_ValueMakeNull(tointerp, ret); return rc;
        case JSI_VT_BOOL: Jsi_ValueMakeBool(tointerp, ret, val->d.val); return rc;
        case JSI_VT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, val->d.num); return rc;
................................................................................
            cp = val->d.s.str;
            len = val->d.s.len;
makestr:
            if (iskey) {
                Jsi_ValueMakeStringKey(interp, ret, cp);
                return rc;
            }
            jsi_ValueMakeBlobDup(tointerp, ret, (uchar*)cp, len);




            return rc;
        case JSI_VT_OBJECT:
            obj = val->d.obj;
            switch (obj->ot) {
                case JSI_OT_BOOL: Jsi_ValueMakeBool(tointerp, ret, obj->d.val); return rc;
                case JSI_OT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, obj->d.num); return rc;
                case JSI_OT_STRING:

Changes to src/jsiLexer.c.

127
128
129
130
131
132
133
134
135
136
137
138
139

140
141
142
143
144
145
146
...
160
161
162
163
164
165
166

167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
207
208
209
210
211
212
213

214









215
216
217
218







219
220
221
222
223
224
225
226
...
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
...
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
    Jsi_Interp *interp = lex->pstate->interp;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->lexkeyTbl, word);
    if (hPtr)
        return (uintptr_t)Jsi_HashValueGet(hPtr);
    return 0;
}

static char *jsi_do_string(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    lex->inStr = 1;
    int n, c = lexer_getchar(lex);
    int endchar = c;

    
    int bufi = 0, bsiz, done = 0;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
    
    while (!done) {
        if (bufi >= (bsiz-5)) {
            int nsiz = bsiz+=JSI_BUFSIZ;
................................................................................
            n = lexer_getchar(lex);
            switch(n) {
                case 'b': buf[bufi++] = '\b'; break;
                case 'f': buf[bufi++] = '\f'; break;
                case 'n': buf[bufi++] = '\n'; break;
                case 'r': buf[bufi++] = '\r'; break;
                case 't': buf[bufi++] = '\t'; break;

                case 'u': {
                    char ibuf[5];
                    int ui;
                    for (ui=0; ui<4; ui++)
                        ibuf[ui] = lexer_getchar(lex);
                    ibuf[4] = 0;
                    ui = Jsi_UtfDecode(ibuf, buf+bufi);
                    if (ui>0) {
                        if (!buf[bufi]) {
                            Jsi_LogError("unsupported code literal utf null (u0000)");
                            buf[bufi++] = 0;
                            goto done;
                        }
                        bufi+=ui;
                    } else {
                        Jsi_LogError("Unexpected utf encoding.");
                        buf[bufi++] = 0;
                        goto done;
                    }
                    break;
................................................................................
        }
        if (c == endchar) {
            bufi --;
            break;
        }
    }
    buf[bufi] = 0;

    ret = (char*)Jsi_KeyAdd(lex->pstate->interp, buf);









done:
    if (buf != unibuf)
        Jsi_Free(buf);
    lex->inStr = 0;







    return ret;
}

static char *jsi_do_regex(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    int n, bufi = 0, bsiz;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
................................................................................
        }
        Jsi_Number *db = (Jsi_Number *)Jsi_Malloc(sizeof(Jsi_Number));
        *db = fval;
        yylvalp->num = db;
        return FNUMBER;
    } else if (c == '"' || c == '\'') {
        lexer_ungetc(c, lex);
        yylvalp->str = jsi_do_string(lex);
        if (!yylvalp->str)
            return 0;
        LOCATION_END(yyllocp, lex);
        return STRING;
    } else if (isalpha(c) || c == '_' || c == '$') {
        lexer_ungetc(c, lex);
        while (wi < 1020) {
            c = lexer_getchar(lex);
................................................................................
            word[wi++] = c;
        }
        lexer_ungetc(c, lex);
        
        word[wi] = 0;
        int r = jsi_iskey(word, lex);
        if (r) return r;
        yylvalp->str = (char*)Jsi_KeyAdd(interp,word); /*Jsi_Strdup(word);*/
        LOCATION_END(yyllocp, lex);
        return IDENTIFIER;
    } else if (c == '/') {
        int d = lexer_getchar(lex);
        if (d == '/') {
            while ((d = lexer_getchar(lex)) != '\r' && d != '\n' && d != 0);
            return COMMENT;







|




|
>







 







>








|
|
<
<
<







 







>
|
>
>
>
>
>
>
>
>
>




>
>
>
>
>
>
>
|







 







|
|







 







|







127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178



179
180
181
182
183
184
185
...
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
...
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
    Jsi_Interp *interp = lex->pstate->interp;
    Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->lexkeyTbl, word);
    if (hPtr)
        return (uintptr_t)Jsi_HashValueGet(hPtr);
    return 0;
}

static Jsi_String* jsi_do_string(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    lex->inStr = 1;
    int n, c = lexer_getchar(lex);
    int endchar = c, isnull = 0;
    uint32_t flags = 0;
    
    int bufi = 0, bsiz, done = 0;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
    
    while (!done) {
        if (bufi >= (bsiz-5)) {
            int nsiz = bsiz+=JSI_BUFSIZ;
................................................................................
            n = lexer_getchar(lex);
            switch(n) {
                case 'b': buf[bufi++] = '\b'; break;
                case 'f': buf[bufi++] = '\f'; break;
                case 'n': buf[bufi++] = '\n'; break;
                case 'r': buf[bufi++] = '\r'; break;
                case 't': buf[bufi++] = '\t'; break;
                case '0': buf[bufi++] = 0; isnull=1; break;
                case 'u': {
                    char ibuf[5];
                    int ui;
                    for (ui=0; ui<4; ui++)
                        ibuf[ui] = lexer_getchar(lex);
                    ibuf[4] = 0;
                    ui = Jsi_UtfDecode(ibuf, buf+bufi);
                    if (ui>0) {
                        if (!buf[bufi])
                            isnull = 1;



                        bufi+=ui;
                    } else {
                        Jsi_LogError("Unexpected utf encoding.");
                        buf[bufi++] = 0;
                        goto done;
                    }
                    break;
................................................................................
        }
        if (c == endchar) {
            bufi --;
            break;
        }
    }
    buf[bufi] = 0;
    if (!isnull)
        ret = (char*)Jsi_KeyAdd(lex->pstate->interp, buf);
    else {
        flags |= 1;
        if (buf == unibuf) {
            buf = (char*)Jsi_Malloc(bufi+1);
            memcpy(buf, unibuf, bufi+1);
        }
        ret = buf;
        buf = unibuf;
    }
done:
    if (buf != unibuf)
        Jsi_Free(buf);
    lex->inStr = 0;
    if (!ret)
        return NULL;
    Jsi_String *s = Jsi_Calloc(1, sizeof(*s));
    s->str = ret;
    s->len = bufi;
    s->flags = flags;
    Jsi_HashSet(lex->pstate->strTbl, s, s);
    return s;
}

static char *jsi_do_regex(jsi_Lexer *lex)
{
    Jsi_Interp *interp = lex->pstate->interp;
    int n, bufi = 0, bsiz;
    char unibuf[bsiz=JSI_BUFSIZ], *buf = unibuf, *ret = NULL;
................................................................................
        }
        Jsi_Number *db = (Jsi_Number *)Jsi_Malloc(sizeof(Jsi_Number));
        *db = fval;
        yylvalp->num = db;
        return FNUMBER;
    } else if (c == '"' || c == '\'') {
        lexer_ungetc(c, lex);
        yylvalp->vstr = jsi_do_string(lex);
        if (!yylvalp->vstr)
            return 0;
        LOCATION_END(yyllocp, lex);
        return STRING;
    } else if (isalpha(c) || c == '_' || c == '$') {
        lexer_ungetc(c, lex);
        while (wi < 1020) {
            c = lexer_getchar(lex);
................................................................................
            word[wi++] = c;
        }
        lexer_ungetc(c, lex);
        
        word[wi] = 0;
        int r = jsi_iskey(word, lex);
        if (r) return r;
        yylvalp->sstr = (char*)Jsi_KeyAdd(interp,word);
        LOCATION_END(yyllocp, lex);
        return IDENTIFIER;
    } else if (c == '/') {
        int d = lexer_getchar(lex);
        if (d == '/') {
            while ((d = lexer_getchar(lex)) != '\r' && d != '\n' && d != 0);
            return COMMENT;

Changes to src/jsiParser.y.

2
3
4
5
6
7
8

9
10
11
12
13
14
15
..
60
61
62
63
64
65
66

67
68
69
70
71
72
73
...
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
...
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
...
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
// The input grammer file for lemon parser generator. (not yet used)
#ifndef JSI_AMALGAMATION
#define JSI_LEMON_PARSE
#include "jsiInt.h"
#include "jsiCode.c"
typedef struct jsi_Token {
    const char *str;

    Jsi_Number *num;
    Jsi_Regex  *regex;
    int line, col;
    int lvalue_flag;
    jsi_Pline ln;
} jsi_Token;

................................................................................
%type items {Jsi_OpCodes*}
%type iterstatement {Jsi_OpCodes*}
%type lvalue {Jsi_OpCodes*}
%type object {Jsi_OpCodes*}
%type statement {Jsi_OpCodes*}
%type statements {Jsi_OpCodes*}
%type statement_or_empty {Jsi_OpCodes*}

%type switch_statement {Jsi_OpCodes*}
%type try_statement {Jsi_OpCodes*}
%type value {Jsi_OpCodes*}
%type vardec {Jsi_OpCodes*}
%type vardecs {Jsi_OpCodes*}
%type while_statement {Jsi_OpCodes*}
%type with_statement {Jsi_OpCodes*}
................................................................................

argdefault(A) ::= VOID. {      A = Jsi_ValueNew(pstate->interp); A->d.num = 1; }
argdefault(A) ::= UNDEF. {     A = Jsi_ValueNew(pstate->interp); A->d.num = 0; }
argdefault(A) ::= FNUMBER(B). { A = Jsi_ValueNewNumber(pstate->interp, *B.num); }
argdefault(A) ::= JSTRUE. {   A = Jsi_ValueNewBoolean(pstate->interp, 1); }
argdefault(A) ::= JSFALSE. {  A = Jsi_ValueNewBoolean(pstate->interp, 0); }
argdefault(A) ::= TYPENULL. {A = Jsi_ValueNewNull(pstate->interp); }
argdefault(A) ::= STRING(B). {  A = Jsi_ValueNewStringKey(pstate->interp, B.str); }
    
args(A) ::= IDENTIFIER(B).  { A = jsi_argInsert(pstate, NULL, B.str, NULL, &B.ln ); }
args(A) ::= IDENTIFIER(B) EQUAL argdefault(C). { A = jsi_argInsert(pstate, NULL, B.str, C, &B.ln); }
args(A) ::= IDENTIFIER(B) COLON argtype. { A = jsi_argInsert(pstate, NULL, B.str, NULL, &B.ln);}
args(A) ::= IDENTIFIER(B) COLON argtype EQUAL argdefault(C). { A = jsi_argInsert(pstate, NULL, B.str, C, &B.ln);}
args(A) ::= args(B) COMMA IDENTIFIER(C). { A = jsi_argInsert(pstate, B, C.str, NULL, &C.ln); }
args(A) ::= args(B) COMMA IDENTIFIER(C) EQUAL argdefault(D). { A = jsi_argInsert(pstate, B, C.str, D, &C.ln); }
................................................................................
exprlist(A) ::=  expr(B). [ARGCOMMA] { A = B; (A)->expr_counter = 1; }
exprlist(A) ::=  exprlist(B) COMMA expr(C). [ARGCOMMA] { 
        int exprcnt = (B)->expr_counter + 1;
        A = codes_join(B, C);
        (A)->expr_counter = exprcnt;
    }

value(A) ::=  STRING(B). { A = code_push_string(pstate, &B.ln, B.str); }
value(A) ::=  TYPENULL. { A = code_push_null(); }
value(A) ::=  UNDEF. { A = code_push_undef(); }
value(A) ::=  JSTRUE. { A = code_push_bool(1); }
value(A) ::=  JSFALSE. { A = code_push_bool(0); }
// Following rule not necessary as lexer will accept negative floats.
// value(A) ::=  MINUS FNUMBER(B). [NEG] { A = code_push_num(-B.num); }
value(A) ::=  FNUMBER(B). { A = code_push_num(B.num); }
................................................................................
items(A) ::=  items(B) COMMA item(C). {
        int cnt = (B)->expr_counter + 1;
        A = codes_join(B, C);
        (A)->expr_counter = cnt;
    }

item(A) ::= IDENTIFIER(B) COLON expr(C). { A = codes_join(code_push_string(pstate, &B.ln, B.str), C); }
item(A) ::= STRING(B) COLON expr(C).   { A = codes_join(code_push_string(pstate, &B.ln, B.str), C); }
item(A) ::= FNUMBER(B) COLON expr(C).   { A = codes_join(code_push_num(B.num), C); }
item(A) ::= JSTRUE COLON expr(C).   { A = codes_join(code_push_bool(1), C); }
item(A) ::= JSFALSE COLON expr(C).   { A = codes_join(code_push_bool(0), C); }
item(A) ::= UNDEF COLON expr(C).   { A = codes_join(code_push_undef(), C); }
item(A) ::= TYPENULL COLON expr(C).   { A = codes_join(code_push_null(), C); }

array(A) ::= LBRACKET(I) exprlist(B) RBRACKET. { A = codes_join(B, code_array(pstate, &I.ln, (B)->expr_counter)); }
array(A) ::= LBRACKET(I) RBRACKET. { A = code_array(pstate, &I.ln, 0); }







>







 







>







 







|







 







|







 







|








2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
...
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
...
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
...
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
// The input grammer file for lemon parser generator. (not yet used)
#ifndef JSI_AMALGAMATION
#define JSI_LEMON_PARSE
#include "jsiInt.h"
#include "jsiCode.c"
typedef struct jsi_Token {
    const char *str;
    Jsi_String *vstr;
    Jsi_Number *num;
    Jsi_Regex  *regex;
    int line, col;
    int lvalue_flag;
    jsi_Pline ln;
} jsi_Token;

................................................................................
%type items {Jsi_OpCodes*}
%type iterstatement {Jsi_OpCodes*}
%type lvalue {Jsi_OpCodes*}
%type object {Jsi_OpCodes*}
%type statement {Jsi_OpCodes*}
%type statements {Jsi_OpCodes*}
%type statement_or_empty {Jsi_OpCodes*}
%type STRING {Jsi_String*}
%type switch_statement {Jsi_OpCodes*}
%type try_statement {Jsi_OpCodes*}
%type value {Jsi_OpCodes*}
%type vardec {Jsi_OpCodes*}
%type vardecs {Jsi_OpCodes*}
%type while_statement {Jsi_OpCodes*}
%type with_statement {Jsi_OpCodes*}
................................................................................

argdefault(A) ::= VOID. {      A = Jsi_ValueNew(pstate->interp); A->d.num = 1; }
argdefault(A) ::= UNDEF. {     A = Jsi_ValueNew(pstate->interp); A->d.num = 0; }
argdefault(A) ::= FNUMBER(B). { A = Jsi_ValueNewNumber(pstate->interp, *B.num); }
argdefault(A) ::= JSTRUE. {   A = Jsi_ValueNewBoolean(pstate->interp, 1); }
argdefault(A) ::= JSFALSE. {  A = Jsi_ValueNewBoolean(pstate->interp, 0); }
argdefault(A) ::= TYPENULL. {A = Jsi_ValueNewNull(pstate->interp); }
argdefault(A) ::= STRING(B). {  A = Jsi_ValueNewBlob(pstate->interp, (uchar*)B.vstr->str, B.vstr->len); }
    
args(A) ::= IDENTIFIER(B).  { A = jsi_argInsert(pstate, NULL, B.str, NULL, &B.ln ); }
args(A) ::= IDENTIFIER(B) EQUAL argdefault(C). { A = jsi_argInsert(pstate, NULL, B.str, C, &B.ln); }
args(A) ::= IDENTIFIER(B) COLON argtype. { A = jsi_argInsert(pstate, NULL, B.str, NULL, &B.ln);}
args(A) ::= IDENTIFIER(B) COLON argtype EQUAL argdefault(C). { A = jsi_argInsert(pstate, NULL, B.str, C, &B.ln);}
args(A) ::= args(B) COMMA IDENTIFIER(C). { A = jsi_argInsert(pstate, B, C.str, NULL, &C.ln); }
args(A) ::= args(B) COMMA IDENTIFIER(C) EQUAL argdefault(D). { A = jsi_argInsert(pstate, B, C.str, D, &C.ln); }
................................................................................
exprlist(A) ::=  expr(B). [ARGCOMMA] { A = B; (A)->expr_counter = 1; }
exprlist(A) ::=  exprlist(B) COMMA expr(C). [ARGCOMMA] { 
        int exprcnt = (B)->expr_counter + 1;
        A = codes_join(B, C);
        (A)->expr_counter = exprcnt;
    }

value(A) ::=  STRING(B). { A = code_push_vstring(pstate, &B.ln, B.vstr); }
value(A) ::=  TYPENULL. { A = code_push_null(); }
value(A) ::=  UNDEF. { A = code_push_undef(); }
value(A) ::=  JSTRUE. { A = code_push_bool(1); }
value(A) ::=  JSFALSE. { A = code_push_bool(0); }
// Following rule not necessary as lexer will accept negative floats.
// value(A) ::=  MINUS FNUMBER(B). [NEG] { A = code_push_num(-B.num); }
value(A) ::=  FNUMBER(B). { A = code_push_num(B.num); }
................................................................................
items(A) ::=  items(B) COMMA item(C). {
        int cnt = (B)->expr_counter + 1;
        A = codes_join(B, C);
        (A)->expr_counter = cnt;
    }

item(A) ::= IDENTIFIER(B) COLON expr(C). { A = codes_join(code_push_string(pstate, &B.ln, B.str), C); }
item(A) ::= STRING(B) COLON expr(C).   { A = codes_join(code_push_vstring(pstate, &B.ln, B.vstr), C); }
item(A) ::= FNUMBER(B) COLON expr(C).   { A = codes_join(code_push_num(B.num), C); }
item(A) ::= JSTRUE COLON expr(C).   { A = codes_join(code_push_bool(1), C); }
item(A) ::= JSFALSE COLON expr(C).   { A = codes_join(code_push_bool(0), C); }
item(A) ::= UNDEF COLON expr(C).   { A = codes_join(code_push_undef(), C); }
item(A) ::= TYPENULL COLON expr(C).   { A = codes_join(code_push_null(), C); }

array(A) ::= LBRACKET(I) exprlist(B) RBRACKET. { A = codes_join(B, code_array(pstate, &I.ln, (B)->expr_counter)); }
array(A) ::= LBRACKET(I) RBRACKET. { A = code_array(pstate, &I.ln, 0); }

Changes to src/jsiPstate.c.

81
82
83
84
85
86
87


88
89
90
91
92
93
94
...
169
170
171
172
173
174
175









176
177
178
179
180
181
182
183

184
185
186
187
188
189
190
...
250
251
252
253
254
255
256


257
258
259
260
261
262
263
    int atyp = pstate->argType;
    if (defValue) {
        int vt = defValue->vt;
        if (vt == JSI_VT_NULL)
            vt = JSI_TT_NULL;
        else if (vt == JSI_VT_UNDEF && defValue->d.num==1)
            vt = JSI_TT_VOID;


        else
            vt = (1<<defValue->vt);
        atyp |= vt;
    }
    jsi_ScopeStrsPush(interp, a, name, atyp);
    pstate->argType = 0;
    a->args[a->count-1].defValue = defValue;
................................................................................
        //printf("FV FREE: %p (%d/%d)\n", fv, v->refCnt, v->vt == JSI_VT_OBJECT?v->d.obj->refcnt:-99);
        //Jsi_DecrRefCount(interp, v);
    }
    return JSI_OK;
}
#endif










jsi_Pstate *jsi_PstateNew(Jsi_Interp *interp)
{
    jsi_Pstate *ps = (jsi_Pstate *)Jsi_Calloc(1,sizeof(*ps));
    SIGINIT(ps,PARSER);
    ps->lexer = (jsi_Lexer*)Jsi_Calloc(1,sizeof(*ps->lexer));
    ps->lexer->pstate = ps;
    ps->interp = interp;
    ps->fastVarTbl = Jsi_HashNew(interp, JSI_KEYS_ONEWORD, NULL /*fastVarFree*/);

    return ps;
}

const char *jsi_PstateGetFilename(jsi_Pstate *ps)
{
    Jsi_Interp *interp = ps->interp;
    return interp->curFile;
................................................................................
        jsi_FreeOpcodes(ps->opcodes);
    if (ps->hPtr)
        Jsi_HashEntryDelete(ps->hPtr);
    if (ps->argsTbl)
        Jsi_HashDelete(ps->argsTbl);
    if (ps->fastVarTbl)
        Jsi_HashDelete(ps->fastVarTbl);


    if (ps->last_exception)
        Jsi_DecrRefCount(ps->interp, ps->last_exception);
    _JSI_MEMCLEAR(ps);
    Jsi_Free(ps);
}

#endif







>
>







 







>
>
>
>
>
>
>
>
>








>







 







>
>







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
    int atyp = pstate->argType;
    if (defValue) {
        int vt = defValue->vt;
        if (vt == JSI_VT_NULL)
            vt = JSI_TT_NULL;
        else if (vt == JSI_VT_UNDEF && defValue->d.num==1)
            vt = JSI_TT_VOID;
        else if (vt == JSI_VT_OBJECT && defValue->d.obj->ot==JSI_OT_STRING)
            vt = JSI_TT_STRING;
        else
            vt = (1<<defValue->vt);
        atyp |= vt;
    }
    jsi_ScopeStrsPush(interp, a, name, atyp);
    pstate->argType = 0;
    a->args[a->count-1].defValue = defValue;
................................................................................
        //printf("FV FREE: %p (%d/%d)\n", fv, v->refCnt, v->vt == JSI_VT_OBJECT?v->d.obj->refcnt:-99);
        //Jsi_DecrRefCount(interp, v);
    }
    return JSI_OK;
}
#endif


static Jsi_RC jsi_StringFree(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *d) {
    Jsi_String *s = (Jsi_String *)d;
    if (s->flags&1)
        Jsi_Free(s->str);
    Jsi_Free(s);
    return JSI_OK;
}

jsi_Pstate *jsi_PstateNew(Jsi_Interp *interp)
{
    jsi_Pstate *ps = (jsi_Pstate *)Jsi_Calloc(1,sizeof(*ps));
    SIGINIT(ps,PARSER);
    ps->lexer = (jsi_Lexer*)Jsi_Calloc(1,sizeof(*ps->lexer));
    ps->lexer->pstate = ps;
    ps->interp = interp;
    ps->fastVarTbl = Jsi_HashNew(interp, JSI_KEYS_ONEWORD, NULL /*fastVarFree*/);
    ps->strTbl = Jsi_HashNew(interp, JSI_KEYS_ONEWORD, jsi_StringFree);
    return ps;
}

const char *jsi_PstateGetFilename(jsi_Pstate *ps)
{
    Jsi_Interp *interp = ps->interp;
    return interp->curFile;
................................................................................
        jsi_FreeOpcodes(ps->opcodes);
    if (ps->hPtr)
        Jsi_HashEntryDelete(ps->hPtr);
    if (ps->argsTbl)
        Jsi_HashDelete(ps->argsTbl);
    if (ps->fastVarTbl)
        Jsi_HashDelete(ps->fastVarTbl);
    if (ps->strTbl)
        Jsi_HashDelete(ps->strTbl);
    if (ps->last_exception)
        Jsi_DecrRefCount(ps->interp, ps->last_exception);
    _JSI_MEMCLEAR(ps);
    Jsi_Free(ps);
}

#endif

Changes to src/jsiSqlite.c.

103
104
105
106
107
108
109

110
111
112
113
114
115
116
117

118
119
120
121
122
123
124
#endif

typedef struct db_ObjCmd {
  int activeCnt;  /* Count of active objects. */ 
  int newCnt;  /* Total number of new. */ 
} db_ObjCmd;


static db_ObjCmd dbObjCmd = {};

static Jsi_OptionSpec db_ObjCmd_Specs[] =
{
    JSI_OPT(INT,   db_ObjCmd, activeCnt, .help="Number of active objects"),
    JSI_OPT(INT,   db_ObjCmd, newCnt,    .help="Number of new calls"),
    JSI_OPT_END(db_ObjCmd, .help="Options for Sqlite module")
};


/*
** New SQL functions can be created as JSI scripts.  Each such function
** is described by an instance of the following structure.
*/
typedef struct SqlFunc SqlFunc;
struct SqlFunc {







>








>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#endif

typedef struct db_ObjCmd {
  int activeCnt;  /* Count of active objects. */ 
  int newCnt;  /* Total number of new. */ 
} db_ObjCmd;

#ifndef JSI_LITE_ONLY
static db_ObjCmd dbObjCmd = {};

static Jsi_OptionSpec db_ObjCmd_Specs[] =
{
    JSI_OPT(INT,   db_ObjCmd, activeCnt, .help="Number of active objects"),
    JSI_OPT(INT,   db_ObjCmd, newCnt,    .help="Number of new calls"),
    JSI_OPT_END(db_ObjCmd, .help="Options for Sqlite module")
};
#endif

/*
** New SQL functions can be created as JSI scripts.  Each such function
** is described by an instance of the following structure.
*/
typedef struct SqlFunc SqlFunc;
struct SqlFunc {

Changes to src/jsiUtf8.c.

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
    if ((c & 0xf0) == 0xe0) return 3;
    if ((c & 0xf8) == 0xf0) return 4;
    return -1;
#endif
}

uint Jsi_NumUtfChars(const char *s, int length) {
    if (!s) return 0;
#if !JSI__UTF8
    uint len = Jsi_Strlen(s);
    if (length<0) return len;
    if (len>length) return length;
    return len;
#else
    uint i = 0;







|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
    if ((c & 0xf0) == 0xe0) return 3;
    if ((c & 0xf8) == 0xf0) return 4;
    return -1;
#endif
}

uint Jsi_NumUtfChars(const char *s, int length) {
    if (!s || !length) return 0;
#if !JSI__UTF8
    uint len = Jsi_Strlen(s);
    if (length<0) return len;
    if (len>length) return length;
    return len;
#else
    uint i = 0;

Changes to src/jsiValue.c.

565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
...
584
585
586
587
588
589
590
591
592
593
594
595
596
597

598
599
600
601
602
603
604
...
605
606
607
608
609
610
611


612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
...
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
....
1522
1523
1524
1525
1526
1527
1528







1529
1530
1531
1532
1533
1534
1535
....
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
done:
    if (lenPtr) *lenPtr = Jsi_Strlen(ntxt);
    return ntxt;
}

Jsi_Number Jsi_ValueToNumberInt(Jsi_Interp *interp, Jsi_Value *v, int isInt)
{
    char *endPtr = NULL;
    Jsi_Number a = 0;
    switch(v->vt) {
        case JSI_VT_BOOL:
            a = (Jsi_Number)(v->d.val ? 1.0: 0);
            break;
        case JSI_VT_NULL:
            a = 0;
................................................................................
                case JSI_OT_BOOL:
                    a = (Jsi_Number)(obj->d.val ? 1.0: 0);
                    break;
                case JSI_OT_NUMBER:
                    a = obj->d.num;
                    break;
                case JSI_OT_STRING:
                    if (!isInt)
                        a = strtod(obj->d.s.str, &endPtr);
                    else
                        a = (Jsi_Number)strtol(obj->d.s.str, &endPtr, 0);
                    if (endPtr && *endPtr) {
                        a = interp->NaNValue->d.num;
                    }

                    break;
                default:
                    a = 0;
                break;
            }
            break;
        }
................................................................................
        case JSI_VT_UNDEF:
            a = Jsi_NumberNaN();
            break;
        case JSI_VT_NUMBER:
            a = v->d.num;
            break;
        case JSI_VT_STRING:


            if (!isInt) {
                a = strtod(v->d.s.str, &endPtr);
                if (endPtr && *endPtr) {
                    a = interp->NaNValue->d.num;
                }
            } else {
                a = (Jsi_Number)strtol(v->d.s.str, &endPtr, 0);
                if (!isdigit(v->d.s.str[0]))
                    a = interp->NaNValue->d.num;
            }
            break;
        default:
            Jsi_LogBug("Convert a unknown type: 0x%x to number", v->vt);
            break;
    }
................................................................................
                    res.d.s = obj->d.s;
                    obj->d.s.str = NULL;
                } else if (obj->d.s.len >= 0) 
                {
                    Assert(obj->refcnt>=1);
                    obj->refcnt--;
                    int bytes = obj->d.s.len;
                    unsigned char *uptr = (unsigned char*)Jsi_Malloc(bytes+1);
                    memcpy(uptr, obj->d.s.str, bytes);
                    uptr[bytes] = 0;
                    Jsi_ValueMakeBlob(interp, &rPtr, uptr, bytes);
                } else
                    Jsi_ValueMakeStringDup(interp, &rPtr, obj->d.s.str);
            }
            break;
        case JSI_OT_FUNCTION: {
            Jsi_DString dStr;
            Jsi_DSInit(&dStr);
................................................................................
    Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_STRING);
    Jsi_ValueMakeObject(interp, &v, obj);
    obj->d.s.str = (char*)s;
    obj->d.s.len = len;
    obj->isBlob = 1;
    return v;
}









Jsi_Value* Jsi_ValueMakeString(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
    return Jsi_ValueMakeBlob(interp, vPtr, (unsigned char *)s, Jsi_Strlen(s));
}

Jsi_Value* Jsi_ValueMakeStringKey(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
................................................................................
    if (v->vt == JSI_VT_OBJECT) {
        return v->d.obj;
    }
    return NULL;
}

int Jsi_ValueStrlen(Jsi_Value* v) {
    if (v->vt == JSI_VT_OBJECT && v->d.obj->ot == JSI_OT_STRING && v->d.obj->isBlob)
        return v->d.obj->d.s.len;
    Jsi_String *s = jsi_ValueString(v);
    if (s == 0 || s->str == 0)
        return 0;
#if JSI__UTF8
    return (int)Jsi_NumUtfChars(s->str, -1);
#else
    if (s->len>=0) return s->len;
    return (int)Jsi_NumUtfChars(s->str, -1);
#endif
}

char *Jsi_ValueString(Jsi_Interp *interp, Jsi_Value* v, int *lenPtr)
{
    if (!v) return NULL;
    Jsi_String *s = jsi_ValueString(v);







|







 







<
|
<
<
<
<
<
>







 







>
>

|




|
|







 







<
|
<
<







 







>
>
>
>
>
>
>







 







|
|




|


|







565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
...
584
585
586
587
588
589
590

591





592
593
594
595
596
597
598
599
...
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
...
825
826
827
828
829
830
831

832


833
834
835
836
837
838
839
....
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
....
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
done:
    if (lenPtr) *lenPtr = Jsi_Strlen(ntxt);
    return ntxt;
}

Jsi_Number Jsi_ValueToNumberInt(Jsi_Interp *interp, Jsi_Value *v, int isInt)
{
    char *endPtr = NULL, *sptr;
    Jsi_Number a = 0;
    switch(v->vt) {
        case JSI_VT_BOOL:
            a = (Jsi_Number)(v->d.val ? 1.0: 0);
            break;
        case JSI_VT_NULL:
            a = 0;
................................................................................
                case JSI_OT_BOOL:
                    a = (Jsi_Number)(obj->d.val ? 1.0: 0);
                    break;
                case JSI_OT_NUMBER:
                    a = obj->d.num;
                    break;
                case JSI_OT_STRING:

                    sptr = obj->d.s.str;





                    goto donum;
                    break;
                default:
                    a = 0;
                break;
            }
            break;
        }
................................................................................
        case JSI_VT_UNDEF:
            a = Jsi_NumberNaN();
            break;
        case JSI_VT_NUMBER:
            a = v->d.num;
            break;
        case JSI_VT_STRING:
            sptr = v->d.s.str;
donum:
            if (!isInt) {
                a = strtod(sptr, &endPtr);
                if (endPtr && *endPtr) {
                    a = interp->NaNValue->d.num;
                }
            } else {
                a = (Jsi_Number)strtol(sptr, &endPtr, 0);
                if (!isdigit(*sptr))
                    a = interp->NaNValue->d.num;
            }
            break;
        default:
            Jsi_LogBug("Convert a unknown type: 0x%x to number", v->vt);
            break;
    }
................................................................................
                    res.d.s = obj->d.s;
                    obj->d.s.str = NULL;
                } else if (obj->d.s.len >= 0) 
                {
                    Assert(obj->refcnt>=1);
                    obj->refcnt--;
                    int bytes = obj->d.s.len;

                    jsi_ValueMakeBlobDup(interp, &rPtr, (uchar*)obj->d.s.str, bytes);


                } else
                    Jsi_ValueMakeStringDup(interp, &rPtr, obj->d.s.str);
            }
            break;
        case JSI_OT_FUNCTION: {
            Jsi_DString dStr;
            Jsi_DSInit(&dStr);
................................................................................
    Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_STRING);
    Jsi_ValueMakeObject(interp, &v, obj);
    obj->d.s.str = (char*)s;
    obj->d.s.len = len;
    obj->isBlob = 1;
    return v;
}
Jsi_Value* jsi_ValueMakeBlobDup(Jsi_Interp *interp, Jsi_Value **ret, unsigned char *s, int len) {
    if (len<0) len = Jsi_Strlen((char*)s);
    uchar *dp = (uchar*)Jsi_Malloc(len+1);
    memcpy(dp, s, len);
    dp[len] = 0;
    return Jsi_ValueMakeBlob(interp, ret, dp, len);
}


Jsi_Value* Jsi_ValueMakeString(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
    return Jsi_ValueMakeBlob(interp, vPtr, (unsigned char *)s, Jsi_Strlen(s));
}

Jsi_Value* Jsi_ValueMakeStringKey(Jsi_Interp *interp, Jsi_Value **vPtr, const char *s) {
................................................................................
    if (v->vt == JSI_VT_OBJECT) {
        return v->d.obj;
    }
    return NULL;
}

int Jsi_ValueStrlen(Jsi_Value* v) {
    //if (v->vt == JSI_VT_OBJECT && v->d.obj->ot == JSI_OT_STRING && v->d.obj->isBlob)
    //    return v->d.obj->d.s.len;
    Jsi_String *s = jsi_ValueString(v);
    if (s == 0 || s->str == 0)
        return 0;
#if JSI__UTF8
    return (int)Jsi_NumUtfChars(s->str, s->len);
#else
    if (s->len>=0) return s->len;
    return (int)Jsi_NumUtfChars(s->str, s->len);
#endif
}

char *Jsi_ValueString(Jsi_Interp *interp, Jsi_Value* v, int *lenPtr)
{
    if (!v) return NULL;
    Jsi_String *s = jsi_ValueString(v);

Changes to src/parser.y.

14
15
16
17
18
19
20
21

22
23
24
25
26
27
28
..
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60
61
...
517
518
519
520
521
522
523


524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
...
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
...
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
                       lvalue shift/reduce 
                       ',' shift/reduce
                       empty statement '{''}' empty object shift/reduct */

%union {
    Jsi_OpCodes *opcodes;
    Jsi_Value *value;
    const char *str;

    Jsi_Regex* regex;
    Jsi_Number *num;
    Jsi_ScopeStrs *scopes;
    int inum;
    struct jsi_CaseExprStat* caseitem;
    struct jsi_CaseList* caselist;
}
................................................................................
*/

%type <opcodes> array commonstatement delete_statement do_statement expr expr_opt exprlist exprlist_opt 
%type <opcodes> fcall_exprs for_cond for_init for_statement func_expr func_statement func_statement_block if_statement item items iterstatement lvalue
%type <opcodes> object statement statements statement_or_empty switch_statement try_statement value vardec vardecs while_statement with_statement
%type <scopes> args args_opt
%type <inum> typeid inof rettype argtype
%type <str> identifier_opt label_opt func_prefix

%type <caseitem> case
%type <caselist> cases
%type <value> argdefault

%token <str> STRING
%token <str> IDENTIFIER
%token IF
%token ELSE
%token FOR
%token IN
%token WHILE
%token DO
%token CONTINUE
................................................................................
    typeid {
        $$ = pstate->argType;
    }
    | argtype '|' typeid {
        $$ = pstate->argType;
    }



argdefault:
    UNDEF {     $$ = Jsi_ValueNew(pstate->interp); $$->d.num = 0; }
    | VOID {    $$ = Jsi_ValueNew(pstate->interp); $$->d.num = 1; }
    | '-' FNUMBER %prec NEG { *$2 = *$2 * -1; $$ = Jsi_ValueNewNumber(pstate->interp, *$2); Jsi_Free($2);}
    | FNUMBER { $$ = Jsi_ValueNewNumber(pstate->interp, *$1); Jsi_Free($1); }
    | _TRUE {   $$ = Jsi_ValueNewBoolean(pstate->interp, 1); }
    | _FALSE {  $$ = Jsi_ValueNewBoolean(pstate->interp, 0); }
    | TYPENULL {$$ = Jsi_ValueNewNull(pstate->interp); }
    | STRING {  $$ = Jsi_ValueNewStringKey(pstate->interp, $1); }
    
args:
    IDENTIFIER  { $$ = jsi_argInsert(pstate, NULL, $1, NULL, &@1 ); }
    | IDENTIFIER '=' argdefault { $$ = jsi_argInsert(pstate, NULL, $1, $3, &@1); }
    | IDENTIFIER ':' argtype { $$ = jsi_argInsert(pstate, NULL, $1, NULL, &@1);}
    | IDENTIFIER ':' argtype '=' argdefault { $$ = jsi_argInsert(pstate, NULL, $1, $5, &@1);}
    | args ',' IDENTIFIER { $$ = jsi_argInsert(pstate, $1, $3, NULL, &@1); }
................................................................................
    | exprlist ',' expr %prec ARGCOMMA { 
        int exprcnt = ($1)->expr_counter + 1;
        $$ = codes_join($1, $3);
        ($$)->expr_counter = exprcnt;
    }
;

value: STRING { $$ = code_push_string(pstate,&@1, $1); }
    | TYPENULL { $$ = code_push_null(); }
    | UNDEF { $$ = code_push_undef(); }
    | _TRUE { $$ = code_push_bool(1); }
    | _FALSE { $$ = code_push_bool(0); }
    | FNUMBER { $$ = code_push_num($1); }
    | REGEXP { $$ = code_push_regex(pstate, &@1, $1); }
    | object { $$ = $1; }
................................................................................
        $$ = codes_join($1, $3);
        ($$)->expr_counter = cnt;
    }
;

item:
    IDENTIFIER ':' expr { $$ = codes_join(code_push_string(pstate,&@1, $1), $3); }
    | STRING ':' expr   { $$ = codes_join(code_push_string(pstate,&@1, $1), $3); }
    | FNUMBER ':' expr { $$ = codes_join(code_push_num($1), $3);  }
    | _TRUE ':' expr { $$ = codes_join(code_push_bool(1), $3);  }
    | _FALSE ':' expr { $$ = codes_join(code_push_bool(0), $3);  }
    | UNDEF ':' expr { $$ = codes_join(code_push_undef(), $3);  }
    | TYPENULL ':' expr { $$ = codes_join(code_push_null(), $3);  }
;








|
>







 







|
>




|
|







 







>
>








|







 







|







 







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
...
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
...
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
...
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
                       lvalue shift/reduce 
                       ',' shift/reduce
                       empty statement '{''}' empty object shift/reduct */

%union {
    Jsi_OpCodes *opcodes;
    Jsi_Value *value;
    const char *sstr;
    Jsi_String *vstr;
    Jsi_Regex* regex;
    Jsi_Number *num;
    Jsi_ScopeStrs *scopes;
    int inum;
    struct jsi_CaseExprStat* caseitem;
    struct jsi_CaseList* caselist;
}
................................................................................
*/

%type <opcodes> array commonstatement delete_statement do_statement expr expr_opt exprlist exprlist_opt 
%type <opcodes> fcall_exprs for_cond for_init for_statement func_expr func_statement func_statement_block if_statement item items iterstatement lvalue
%type <opcodes> object statement statements statement_or_empty switch_statement try_statement value vardec vardecs while_statement with_statement
%type <scopes> args args_opt
%type <inum> typeid inof rettype argtype
%type <sstr> identifier_opt label_opt func_prefix
%type <vstr> strlit
%type <caseitem> case
%type <caselist> cases
%type <value> argdefault

%token <sstr> IDENTIFIER
%token <vstr> STRING
%token IF
%token ELSE
%token FOR
%token IN
%token WHILE
%token DO
%token CONTINUE
................................................................................
    typeid {
        $$ = pstate->argType;
    }
    | argtype '|' typeid {
        $$ = pstate->argType;
    }

strlit: STRING { $$ = $1; }

argdefault:
    UNDEF {     $$ = Jsi_ValueNew(pstate->interp); $$->d.num = 0; }
    | VOID {    $$ = Jsi_ValueNew(pstate->interp); $$->d.num = 1; }
    | '-' FNUMBER %prec NEG { *$2 = *$2 * -1; $$ = Jsi_ValueNewNumber(pstate->interp, *$2); Jsi_Free($2);}
    | FNUMBER { $$ = Jsi_ValueNewNumber(pstate->interp, *$1); Jsi_Free($1); }
    | _TRUE {   $$ = Jsi_ValueNewBoolean(pstate->interp, 1); }
    | _FALSE {  $$ = Jsi_ValueNewBoolean(pstate->interp, 0); }
    | TYPENULL {$$ = Jsi_ValueNewNull(pstate->interp); }
    | strlit {  $$ = Jsi_ValueNewBlob(pstate->interp, (uchar*)$1->str, $1->len); }
    
args:
    IDENTIFIER  { $$ = jsi_argInsert(pstate, NULL, $1, NULL, &@1 ); }
    | IDENTIFIER '=' argdefault { $$ = jsi_argInsert(pstate, NULL, $1, $3, &@1); }
    | IDENTIFIER ':' argtype { $$ = jsi_argInsert(pstate, NULL, $1, NULL, &@1);}
    | IDENTIFIER ':' argtype '=' argdefault { $$ = jsi_argInsert(pstate, NULL, $1, $5, &@1);}
    | args ',' IDENTIFIER { $$ = jsi_argInsert(pstate, $1, $3, NULL, &@1); }
................................................................................
    | exprlist ',' expr %prec ARGCOMMA { 
        int exprcnt = ($1)->expr_counter + 1;
        $$ = codes_join($1, $3);
        ($$)->expr_counter = exprcnt;
    }
;

value: strlit { $$ = code_push_vstring(pstate,&@1, $1); }
    | TYPENULL { $$ = code_push_null(); }
    | UNDEF { $$ = code_push_undef(); }
    | _TRUE { $$ = code_push_bool(1); }
    | _FALSE { $$ = code_push_bool(0); }
    | FNUMBER { $$ = code_push_num($1); }
    | REGEXP { $$ = code_push_regex(pstate, &@1, $1); }
    | object { $$ = $1; }
................................................................................
        $$ = codes_join($1, $3);
        ($$)->expr_counter = cnt;
    }
;

item:
    IDENTIFIER ':' expr { $$ = codes_join(code_push_string(pstate,&@1, $1), $3); }
    | strlit ':' expr   { $$ = codes_join(code_push_vstring(pstate,&@1, $1), $3); }
    | FNUMBER ':' expr { $$ = codes_join(code_push_num($1), $3);  }
    | _TRUE ':' expr { $$ = codes_join(code_push_bool(1), $3);  }
    | _FALSE ':' expr { $$ = codes_join(code_push_bool(0), $3);  }
    | UNDEF ':' expr { $$ = codes_join(code_push_undef(), $3);  }
    | TYPENULL ':' expr { $$ = codes_join(code_push_null(), $3);  }
;

Changes to tests/strict.jsi.

210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
bar4() ==> e ==> function created global: "l"
foo1(1) ==> e ==> got 1 args, expected 0, calling function foo1()
foo2() ==> e ==> got 0 args, expected 1, calling function foo2(n)
foo2(1,2) ==> e ==> got 2 args, expected 1, calling function foo2(n)
foo3() ==> e ==> got 0 args, expected 1, calling function foo3(n:string)
foo3(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo3' declared at strict.jsi:78.2 <1>.
foo4(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo4' declared at strict.jsi:91.2 <1>.
foo4('',1) ==> e ==> got 2 args, expected 0-1, calling function foo4(n="a")
foo5(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo5' declared at strict.jsi:104.2 <1>.
foo5('',1) ==> e ==> got 2 args, expected 0-1, calling function foo5(n="a")
foo6(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo6' declared at strict.jsi:118.2 <1>.
foo6('','') ==> e ==> type mismatch for argument arg 2 'm': expected "number" but got "string", in call to 'foo6' declared at strict.jsi:118.2 <>.
foo8() ==> e ==> got 0 args, expected 1 or more, calling function foo8(n:number)
foo8('','') ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "string", in call to 'foo8' declared at strict.jsi:136.2 <>.
foo9(true) ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "boolean", in call to 'foo9' declared at strict.jsi:150.2 <true>.
foo9('','') ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "string", in call to 'foo9' declared at strict.jsi:150.2 <>.
foo10(null,'') ==> e ==> type mismatch for argument arg 1 'n': expected "number|string" but got "null", in call to 'foo10' declared at strict.jsi:164.7 <null>.
foo11(xyz) ==> e ==> call with undefined var for argument arg 1 'n', in call to 'foo11' declared at strict.jsi:176.2 <undefined>.
foo11(9,'') ==> e ==> got 2 args, expected 0-1, calling function foo11(n:number|void=undefined)
foo12(xyz) ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "undefined", in call to 'foo12' declared at strict.jsi:191.7 <undefined>.
=!EXPECTEND!=
*/







|

|












210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
bar4() ==> e ==> function created global: "l"
foo1(1) ==> e ==> got 1 args, expected 0, calling function foo1()
foo2() ==> e ==> got 0 args, expected 1, calling function foo2(n)
foo2(1,2) ==> e ==> got 2 args, expected 1, calling function foo2(n)
foo3() ==> e ==> got 0 args, expected 1, calling function foo3(n:string)
foo3(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo3' declared at strict.jsi:78.2 <1>.
foo4(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo4' declared at strict.jsi:91.2 <1>.
foo4('',1) ==> e ==> got 2 args, expected 0-1, calling function foo4(n:string="a")
foo5(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo5' declared at strict.jsi:104.2 <1>.
foo5('',1) ==> e ==> got 2 args, expected 0-1, calling function foo5(n:string="a")
foo6(1) ==> e ==> type mismatch for argument arg 1 'n': expected "string" but got "number", in call to 'foo6' declared at strict.jsi:118.2 <1>.
foo6('','') ==> e ==> type mismatch for argument arg 2 'm': expected "number" but got "string", in call to 'foo6' declared at strict.jsi:118.2 <>.
foo8() ==> e ==> got 0 args, expected 1 or more, calling function foo8(n:number)
foo8('','') ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "string", in call to 'foo8' declared at strict.jsi:136.2 <>.
foo9(true) ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "boolean", in call to 'foo9' declared at strict.jsi:150.2 <true>.
foo9('','') ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "string", in call to 'foo9' declared at strict.jsi:150.2 <>.
foo10(null,'') ==> e ==> type mismatch for argument arg 1 'n': expected "number|string" but got "null", in call to 'foo10' declared at strict.jsi:164.7 <null>.
foo11(xyz) ==> e ==> call with undefined var for argument arg 1 'n', in call to 'foo11' declared at strict.jsi:176.2 <undefined>.
foo11(9,'') ==> e ==> got 2 args, expected 0-1, calling function foo11(n:number|void=undefined)
foo12(xyz) ==> e ==> type mismatch for argument arg 1 'n': expected "number" but got "undefined", in call to 'foo12' declared at strict.jsi:191.7 <undefined>.
=!EXPECTEND!=
*/

Changes to tests/utf.jsi.

22
23
24
25
26
27
28








29
30
31
32
33
34
35
..
44
45
46
47
48
49
50
51
52

;d = 'a♥c';
;d[0];
;d[1];
;d[2];
;d[3];
;d[9];









/*
=!EXPECTSTART!=
b = '♥' ==> ♥
b.length ==> 1
b+'a' ==> ♥a
encodeURI(b) ==> %e2%99%a5
c = '❤' ==> ❤
................................................................................
a === y ==> true
d = 'a♥c' ==> a♥c
d[0] ==> a
d[1] ==> ♥
d[2] ==> c
d[3] ==> undefined
d[9] ==> undefined
=!EXPECTEND!=
*/








>
>
>
>
>
>
>
>







 







|
|
>
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
..
52
53
54
55
56
57
58
59
60
61
;d = 'a♥c';
;d[0];
;d[1];
;d[2];
;d[3];
;d[9];


x = JSON.parse('"\\u0060\\u0000\\u0062"');
puts(x.length, x[0], x[1], x[2], x[3]);
y = 'ab\0c';
puts(y.length, y[0], y[1], y[2], y[3]);
z = 'ab\u0000c';
puts(z.length, z[0], z[1], z[2], z[3]);

/*
=!EXPECTSTART!=
b = '♥' ==> ♥
b.length ==> 1
b+'a' ==> ♥a
encodeURI(b) ==> %e2%99%a5
c = '❤' ==> ❤
................................................................................
a === y ==> true
d = 'a♥c' ==> a♥c
d[0] ==> a
d[1] ==> ♥
d[2] ==> c
d[3] ==> undefined
d[9] ==> undefined
3 `  b undefined
4 a b  c
4 a b  c

Changes to tools/protos.jsi.

1
2
3
4
5
6
7
8
//JSI Command Prototypes: version 2.8.32
throw("NOT EXECUTABLE: USE FILE IN GEANY EDITOR FOR CMD LINE COMPLETION + GOTO TAG");

var Array = function(cmd,args) {};
Array.prototype.concat = function(...):array {};
Array.prototype.every = function(callback:function):any {};
Array.prototype.fill = function(value:any, start:number=0, end:number=-1):array {};
Array.prototype.filter = function(callback:function, this:object=void):array {};
|







1
2
3
4
5
6
7
8
//JSI Command Prototypes: version 2.8.33
throw("NOT EXECUTABLE: USE FILE IN GEANY EDITOR FOR CMD LINE COMPLETION + GOTO TAG");

var Array = function(cmd,args) {};
Array.prototype.concat = function(...):array {};
Array.prototype.every = function(callback:function):any {};
Array.prototype.fill = function(value:any, start:number=0, end:number=-1):array {};
Array.prototype.filter = function(callback:function, this:object=void):array {};