Menu

[r3880]: / branches / parsnip / Src / Lib / SynEdit / SynHighlighterHtml.pas  Maximize  Restore  History

Download this file

1236 lines (1150 with data), 53.7 kB

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 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
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 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
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 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
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 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
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 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
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
{-------------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: SynHighlighterHTML.pas, released 2000-04-10.
The Original Code is based on the hkHTMLSyn.pas file from the
mwEdit component suite by Martin Waldenburg and other developers, the Initial
Author of this file is Hideo Koiso.
Unicode translation by Maël Hörz.
HTML5 tags added by CodehunterWorks
All Rights Reserved.
Contributors to the SynEdit and mwEdit projects are listed in the
Contributors.txt file.
Alternatively, the contents of this file may be used under the terms of the
GNU General Public License Version 2 or later (the "GPL"), in which case
the provisions of the GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms
of the GPL and not to allow others to use your version of this file
under the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: SynHighlighterHtml.pas,v 1.24.3 2012/09/13 12:05:00 codehunterworks Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
Known Issues:
-------------------------------------------------------------------------------}
{
@abstract(Provides an HTML highlighter for SynEdit)
@author(Hideo Koiso, converted to SynEdit by Michael Hieke)
@created(1999-11-02, converted to SynEdit 2000-04-10)
@lastmod(2012-09-13)
The SynHighlighterHTML unit provides SynEdit with an HTML highlighter.
}
{$IFNDEF QSYNHIGHLIGHTERHTML}
unit SynHighlighterHtml;
{$ENDIF}
interface
{$I SynEdit.inc}
uses
{$IFDEF UNICODE}
WideStrUtils,
{$ENDIF}
{$IFDEF SYN_CLX}
QGraphics,
QSynEditTypes,
QSynEditHighlighter,
QSynUnicode,
{$ELSE}
Graphics,
SynEditTypes,
SynEditHighlighter,
SynUnicode,
{$ENDIF}
SysUtils,
Classes;
const
MAX_ESCAPEAMPS = 249;
EscapeAmps: array[0..MAX_ESCAPEAMPS - 1] of PWideChar = (
('Α'), { ? } { greek capital alpha }
('Β'), { ? } { greek capital beta }
('Γ'), { G } { greek capital gamma }
('Δ'), { ? } { greek capital delta }
('Ε'), { ? } { greek capital epsilon }
('Ζ'), { ? } { greek capital zeta }
('Η'), { ? } { greek capital eta }
('Θ'), { T } { greek capital theta }
('Ι'), { ? } { greek capital iota }
('Κ'), { ? } { greek capital kappa }
('Λ'), { ? } { greek capital lambda }
('Μ'), { ? } { greek capital mu }
('Ν'), { ? } { greek capital nu }
('Ξ'), { ? } { greek capital xi }
('Ο'), { ? } { greek capital omicron }
('Π'), { ? } { greek capital pi }
('Ρ'), { ? } { greek capital rho }
('Σ'), { S } { greek capital sigma }
('Τ'), { ? } { greek capital tau }
('Υ'), { ? } { greek capital upsilon }
('Φ'), { F } { greek capital phi }
('Χ'), { ? } { greek capital chi }
('Ψ'), { ? } { greek capital psi }
('Ω'), { O } { greek capital omega }
('α'), { a } { greek small alpha }
('β'), { ß } { greek small beta }
('γ'), { ? } { greek small gamma }
('δ'), { d } { greek small delta }
('ε'), { e } { greek small epsilon }
('ζ'), { ? } { greek small zeta }
('η'), { ? } { greek small eta }
('θ'), { ? } { greek small theta }
('ι'), { ? } { greek small iota }
('κ'), { ? } { greek small kappa }
('λ'), { ? } { greek small lambda }
('μ'), { µ } { greek small mu }
('ν'), { ? } { greek small nu }
('ξ'), { ? } { greek small xi }
('ο'), { ? } { greek small omicron }
('π'), { p } { greek small pi }
('ρ'), { ? } { greek small rho }
('ς'), { ? } { greek small final sigma }
('σ'), { s } { greek small sigma }
('τ'), { t } { greek small tau }
('υ'), { ? } { greek small upsilon }
('φ'), { f } { greek small phi }
('χ'), { ? } { greek small chi }
('ψ'), { ? } { greek small psi }
('ω'), { ? } { greek small omega }
('ϑ'), { ? } { greek small theta symbol }
('ϒ'), { ? } { greek upsilon with hook symbol }
('ϖ'), { ? } { greek pi symbol }
('•'), { • } { bullet }
('…'), { … } { horizontal ellipsis }
('′'), { ' } { prime }
('″'), { " } { double prime }
('‾'), { ? } { overline, = spacing overscore }
('⁄'), { / } { fraction slash }
('℘'), { P } { script capital P }
('ℑ'), { I } { imaginary part }
('ℜ'), { R } { real part }
('™'), { ™ } { trademark sign }
('ℵ'), { ? } { first transfinite cardinal }
('←'), { ? } { leftwards arrow }
('↑'), { ? } { upwards arrow }
('→'), { ? } { rightwards arrow }
('↓'), { ? } { downwards arrow }
('↔'), { ? } { left right arrow }
('↵'), { ? } { carriage return arrow }
('⇐'), { ? } { leftwards double arrow }
('⇑'), { ? } { upwards double arrow }
('⇒'), { ? } { rightwards double arrow }
('⇓'), { ? } { downwards double arrow }
('⇔'), { ? } { left right double arrow }
('∀'), { ? } { for all }
('∂'), { ? } { partial differential }
('∃'), { ? } { there exists }
('∅'), { Ø } { empty set }
('∇'), { ? } { backward difference }
('∈'), { ? } { element of }
('∉'), { ? } { not an element of }
('∋'), { ? } { contains as member }
('∏'), { ? } { n-ary product }
('∑'), { ? } { n-ary sumation }
('−'), { - } { minus sign }
('∗'), { * } { asterisk operator }
('√'), { v } { square root }
('∝'), { ? } { proportional to }
('∞'), { 8 } { infinity }
('∠'), { ? } { angle }
('∧'), { ? } { logical and }
('∨'), { ? } { logical or }
('∩'), { n } { intersection }
('∪'), { ? } { union }
('∫'), { ? } { integral }
('∴'), { ? } { therefore }
('∼'), { ~ } { similar to = tilde operator }
('≅'), { ? } { approximately equal to }
('≈'), { ˜ } { almost euqal to }
('≠'), { ? } { not equal to }
('≡'), { = } { identical to }
('≤'), { = } { less-than or equal to }
('≥'), { = } { greater-than or equal to }
('⊂'), { ? } { subset of }
('⊃'), { ? } { superset of }
('⊄'), { ? } { not a subset of }
('⊆'), { ? } { subset of or equal to }
('⊇'), { ? } { superset of or equal to }
('⊕'), { ? } { circled plus }
('⊗'), { ? } { circled times }
('⊥'), { ? } { orthogonal to = perpendicular }
('⋅'), { · } { dot operator }
('⌈'), { ? } { left ceiling }
('⌉'), { ? } { right ceiling }
('⌊'), { ? } { left floor }
('⌋'), { ? } { right floor }
('&lang;'), { < } { left-pointing angle bracket }
('&rang;'), { > } { right-pointing angle bracket }
('&loz;'), { ? } { lozenge }
('&spades;'), { ? } { black spade suit }
('&clubs;'), { ? } { black club suit }
('&hearts;'), { ? } { black heart suit }
('&diams;'), { ? } { black diamond suit }
('&lsquo;'), { ‘ } { left single quote }
('&rsquo;'), { ’ } { right single quote }
('&sbquo;'), { ‚ } { single low-9 quote }
('&ldquo;'), { “ } { left double quote }
('&rdquo;'), { ” } { right double quote }
('&bdquo;'), { „ } { double low-9 quote }
('&dagger;'), { † } { dagger }
('&Dagger;'), { ‡ } { double dagger }
('&permil;'), { ‰ } { per mill sign }
('&lsaquo;'), { ‹ } { single left-pointing angle quote }
('&rsaquo;'), { › } { single right-pointing angle quote }
('&quot;'), { &#034; " } { double quotation mark }
('&amp;'), { &#038; & } { ampersand }
('&lt;'), { &#060; < } { less-than sign }
('&gt;'), { > } { greater-than sign }
('&ndash;'), { &#150; – } { en dash }
('&mdash;'), { &#151; — } { em dash }
('&nbsp;'), { &#160; } { nonbreaking space }
('&thinsp;'), { } { thin space }
('&ensp;'), { } { en space }
('&emsp;'), { } { em space }
('&iexcl;'), { &#161; ! } { inverted exclamation }
('&cent;'), { &#162; c } { cent sign }
('&pound;'), { &#163; L } { pound sterling }
('&curren;'), { &#164; ¤ } { general currency sign }
('&yen;'), { &#165; Y } { yen sign }
('&brvbar;'), { &#166; ¦ } { broken vertical bar }
('&brkbar;'), { &#166; ¦ } { broken vertical bar }
('&sect;'), { &#167; § } { section sign }
('&uml;'), { &#168; ¨ } { umlaut }
('&die;'), { &#168; ¨ } { umlaut }
('&copy;'), { &#169; © } { copyright }
('&ordf;'), { &#170; a } { feminine ordinal }
('&laquo;'), { &#171; « } { left angle quote }
('&not;'), { &#172; ¬ } { not sign }
('&shy;'), { &#173; ­ } { soft hyphen }
('&reg;'), { &#174; ® } { registered trademark }
('&macr;'), { &#175; — } { macron accent }
('&hibar;'), { &#175; — } { macron accent }
('&deg;'), { &#176; ° } { degree sign }
('&plusmn;'), { &#177; ± } { plus or minus }
('&sup2;'), { &#178; 2 } { superscript two }
('&sup3;'), { &#179; 3 } { superscript three }
('&acute;'), { &#180; ´ } { acute accent }
('&micro;'), { &#181; µ } { micro sign }
('&para;'), { &#182; ¶ } { paragraph sign }
('&middot;'), { &#183; · } { middle dot }
('&cedil;'), { &#184; ¸ } { cedilla }
('&sup1;'), { &#185; 1 } { superscript one }
('&ordm;'), { &#186; o } { masculine ordinal }
('&raquo;'), { &#187; » } { right angle quote }
('&frac14;'), { &#188; 1 } { one-fourth }
('&frac12;'), { &#189; 1 } { one-half }
('&frac34;'), { &#190; 3 } { three-fourths }
('&iquest;'), { &#191; ? } { inverted question mark }
('&Agrave;'), { &#192; A } { uppercase A, grave accent }
('&Aacute;'), { &#193; Á } { uppercase A, acute accent }
('&Acirc;'), { &#194; Â } { uppercase A, circumflex accent }
('&Atilde;'), { &#195; A } { uppercase A, tilde }
('&Auml;'), { &#196; Ä } { uppercase A, umlaut }
('&Aring;'), { &#197; A } { uppercase A, ring }
('&AElig;'), { &#198; A } { uppercase AE }
('&Ccedil;'), { &#199; Ç } { uppercase C, cedilla }
('&Egrave;'), { &#200; E } { uppercase E, grave accent }
('&Eacute;'), { &#201; É } { uppercase E, acute accent }
('&Ecirc;'), { &#202; E } { uppercase E, circumflex accent }
('&Euml;'), { &#203; Ë } { uppercase E, umlaut }
('&Igrave;'), { &#204; I } { uppercase I, grave accent }
('&Iacute;'), { &#205; Í } { uppercase I, acute accent }
('&Icirc;'), { &#206; Î } { uppercase I, circumflex accent }
('&Iuml;'), { &#207; I } { uppercase I, umlaut }
('&ETH;'), { &#208; ? } { uppercase Eth, Icelandic }
('&Ntilde;'), { &#209; N } { uppercase N, tilde }
('&Ograve;'), { &#210; O } { uppercase O, grave accent }
('&Oacute;'), { &#211; Ó } { uppercase O, acute accent }
('&Ocirc;'), { &#212; Ô } { uppercase O, circumflex accent }
('&Otilde;'), { &#213; O } { uppercase O, tilde }
('&Ouml;'), { &#214; Ö } { uppercase O, umlaut }
('&times;'), { &#215; × } { multiplication sign }
('&Oslash;'), { &#216; O } { uppercase O, slash }
('&Ugrave;'), { &#217; U } { uppercase U, grave accent }
('&Uacute;'), { &#218; Ú } { uppercase U, acute accent }
('&Ucirc;'), { &#219; U } { uppercase U, circumflex accent }
('&Uuml;'), { &#220; Ü } { uppercase U, umlaut }
('&Yacute;'), { &#221; Ý } { uppercase Y, acute accent }
('&THORN;'), { &#222; ? } { uppercase THORN, Icelandic }
('&szlig;'), { &#223; ß } { lowercase sharps, German }
('&agrave;'), { &#224; à } { lowercase a, grave accent }
('&aacute;'), { &#225; á } { lowercase a, acute accent }
('&acirc;'), { &#226; â } { lowercase a, circumflex accent }
('&atilde;'), { &#227; ã } { lowercase a, tilde }
('&auml;'), { &#228; ä } { lowercase a, umlaut }
('&aring;'), { &#229; å } { lowercase a, ring }
('&aelig;'), { &#230; a } { lowercase ae }
('&ccedil;'), { &#231; ç } { lowercase c, cedilla }
('&egrave;'), { &#232; e } { lowercase e, grave accent }
('&eacute;'), { &#233; é } { lowercase e, acute accent }
('&ecirc;'), { &#234; ê } { lowercase e, circumflex accent }
('&euml;'), { &#235; ë } { lowercase e, umlaut }
('&igrave;'), { &#236; i } { lowercase i, grave accent }
('&iacute;'), { &#237; í } { lowercase i, acute accent }
('&icirc;'), { &#238; î } { lowercase i, circumflex accent }
('&iuml;'), { &#239; i } { lowercase i, umlaut }
('&eth;'), { &#240; ? } { lowercase eth, Icelandic }
('&ntilde;'), { &#241; ñ } { lowercase n, tilde }
('&ograve;'), { &#242; o } { lowercase o, grave accent }
('&oacute;'), { &#243; ó } { lowercase o, acute accent }
('&ocirc;'), { &#244; ô } { lowercase o, circumflex accent }
('&otilde;'), { &#245; o } { lowercase o, tilde }
('&ouml;'), { &#246; ö } { lowercase o, umlaut }
('&divide;'), { &#247; ÷ } { division sign }
('&oslash;'), { &#248; o } { lowercase o, slash }
('&ugrave;'), { &#249; u } { lowercase u, grave accent }
('&uacute;'), { &#250; ú } { lowercase u, acute accent }
('&ucirc;'), { &#251; u } { lowercase u, circumflex accent }
('&uuml;'), { &#252; ü } { lowercase u, umlaut }
('&yacute;'), { &#253; ý } { lowercase y, acute accent }
('&thorn;'), { &#254; ? } { lowercase thorn, Icelandic }
('&yuml;'), { &#255; y } { lowercase y, umlaut }
('&euro;'), { € } { euro sign }
('&OElig;'), { Œ } { capital ligature OE }
('&oelig;'), { œ } { small ligature oe }
('&scaron;'), { š } { small S with caron }
('&Scaron;'), { Š } { capital S with caron }
('&fnof;'), { ƒ } { function }
('&circ;') { ˆ } { circumflex accent }
);
type
TtkTokenKind = (tkAmpersand, tkComment, tkIdentifier, tkKey, tkNull,
tkSpace, tkSymbol, tkText, tkUndefKey, tkValue);
TRangeState = (rsAmpersand, rsComment, rsKey, rsParam, rsText,
rsUnKnown, rsValue, rsQuoteValue, rsDoubleQuoteValue);
PIdentFuncTableFunc = ^TIdentFuncTableFunc;
TIdentFuncTableFunc = function (Index: Integer): TtkTokenKind of object;
TSynHTMLSyn = class(TSynCustomHighlighter)
private
fAndCode: Integer;
fRange: TRangeState;
// fIdentFuncTable: array[0..1542] of TIdentFuncTableFunc;
fIdentFuncTable: array[0..2178] of TIdentFuncTableFunc;
fTokenID: TtkTokenKind;
fAndAttri: TSynHighlighterAttributes;
fCommentAttri: TSynHighlighterAttributes;
fIdentifierAttri: TSynHighlighterAttributes;
fKeyAttri: TSynHighlighterAttributes;
fSpaceAttri: TSynHighlighterAttributes;
fSymbolAttri: TSynHighlighterAttributes;
fTextAttri: TSynHighlighterAttributes;
fUndefKeyAttri: TSynHighlighterAttributes;
fValueAttri: TSynHighlighterAttributes;
function AltFunc(Index: Integer): TtkTokenKind;
function KeyWordFunc(Index: Integer): TtkTokenKind;
function HashKey(Str: PWideChar): Cardinal;
function IdentKind(MayBe: PWideChar): TtkTokenKind;
procedure InitIdent;
procedure TextProc;
procedure CommentProc;
procedure BraceCloseProc;
procedure BraceOpenProc;
procedure CRProc;
procedure EqualProc;
procedure IdentProc;
procedure LFProc;
procedure NullProc;
procedure SpaceProc;
procedure StringProc;
procedure AmpersandProc;
protected
function GetSampleSource: UnicodeString; override;
function IsFilterStored: Boolean; override;
procedure NextProcedure;
public
class function GetLanguageName: string; override;
class function GetFriendlyLanguageName: UnicodeString; override;
public
constructor Create(AOwner: TComponent); override;
function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
override;
function GetEol: Boolean; override;
function GetRange: Pointer; override;
function GetTokenID: TtkTokenKind;
function GetTokenAttribute: TSynHighlighterAttributes; override;
function GetTokenKind: Integer; override;
function IsIdentChar(AChar: WideChar): Boolean; override;
procedure Next; override;
procedure SetRange(Value: Pointer); override;
procedure ResetRange; override;
published
property AndAttri: TSynHighlighterAttributes read fAndAttri write fAndAttri;
property CommentAttri: TSynHighlighterAttributes read fCommentAttri
write fCommentAttri;
property IdentifierAttri: TSynHighlighterAttributes read fIdentifierAttri
write fIdentifierAttri;
property KeyAttri: TSynHighlighterAttributes read fKeyAttri write fKeyAttri;
property SpaceAttri: TSynHighlighterAttributes read fSpaceAttri
write fSpaceAttri;
property SymbolAttri: TSynHighlighterAttributes read fSymbolAttri
write fSymbolAttri;
property TextAttri: TSynHighlighterAttributes read fTextAttri
write fTextAttri;
property UndefKeyAttri: TSynHighlighterAttributes read fUndefKeyAttri
write fUndefKeyAttri;
property ValueAttri: TSynHighlighterAttributes read fValueAttri
write fValueAttri;
end;
implementation
uses
{$IFDEF SYN_CLX}
QSynEditStrConst;
{$ELSE}
SynEditStrConst;
{$ENDIF}
const
// KeyWords: array[0..201] of UnicodeString = (
// '!doctype', '/a', '/abbr', '/acronym', '/address', '/applet', '/b', '/bdo',
// '/big', '/blink', '/blockquote', '/body', '/button', '/caption', '/center',
// '/cite', '/code', '/colgroup', '/comment', '/dd', '/del', '/dfn', '/dir',
// '/div', '/dl', '/dt', '/em', '/embed', '/fieldset', '/font', '/form',
// '/frameset', '/h1', '/h2', '/h3', '/h4', '/h5', '/h6', '/head', '/html',
// '/i', '/iframe', '/ilayer', '/ins', '/kbd', '/label', '/layer', '/legend',
// '/li', '/listing', '/map', '/marquee', '/menu', '/multicol', '/nobr',
// '/noembed', '/noframes', '/nolayer', '/noscript', '/object', '/ol',
// '/optgroup', '/option', '/p', '/pre', '/q', '/s', '/samp', '/script',
// '/select', '/server', '/small', '/span', '/strike', '/strong', '/style',
// '/sub', '/sup', '/table', '/tbody', '/td', '/textarea', '/tfoot', '/th',
// '/thead', '/title', '/tr', '/tt', '/u', '/ul', '/var', '/xmp', 'a', 'abbr',
// 'acronym', 'address', 'applet', 'area', 'b', 'base', 'basefont', 'bdo',
// 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'caption',
// 'center', 'cite', 'code', 'col', 'colgroup', 'comment', 'dd', 'del', 'dfn',
// 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'font', 'form',
// 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr',
// 'html', 'i', 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'kbd',
// 'keygen', 'label', 'layer', 'legend', 'li', 'link', 'listing', 'map',
// 'marquee', 'menu', 'meta', 'multicol', 'nextid', 'nobr', 'noembed',
// 'noframes', 'nolayer', 'noscript', 'object', 'ol', 'optgroup', 'option',
// 'p', 'param', 'plaintext', 'pre', 'q', 's', 'samp', 'script', 'select',
// 'server', 'small', 'spacer', 'span', 'strike', 'strong', 'style', 'sub',
// 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'title',
// 'tr', 'tt', 'u', 'ul', 'var', 'wbr', 'xmp'
// );
//
// KeyIndices: array[0..1542] of Integer = (
// -1, -1, 182, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, 33, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, 137, 189, -1, -1,
// -1, -1, -1, -1, -1, -1, 191, -1, -1, -1, -1, -1, -1, -1, 52, 170, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, 5, 55, -1, 83, -1, -1, 34, -1, 198, -1, -1, -1,
// -1, -1, -1, -1, 82, -1, -1, -1, -1, -1, 74, 111, -1, 62, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, 35, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 130,
// 190, -1, 117, -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, 36, -1, -1, 157, -1, -1, -1,
// -1, -1, 13, 114, -1, -1, -1, -1, 131, -1, -1, -1, -1, -1, -1, 21, -1, -1,
// -1, 161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, -1,
// -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 192, -1, -1,
// 132, 103, -1, -1, -1, 199, -1, -1, -1, -1, -1, -1, -1, 129, -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, 133, -1, -1, -1, -1, -1, -1, -1, -1, 54,
// -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, -1, -1, -1,
// 148, -1, -1, -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, 134,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 183, -1, -1, 168, -1, 45,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 179, -1, -1, 63, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, -1, -1, -1, -1, 60, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, 65, -1, -1, -1, -1, -1, -1, -1, 125, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, 4, -1, -1, 39, -1, -1, -1, -1, 128, 20, -1, -1, 51, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 176, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, 112, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// 180, -1, -1, -1, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 107,
// -1, -1, -1, -1, 66, -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, 162, -1, 8, -1, -1, -1, -1, -1, -1, 166, -1,
// -1, -1, 169, 141, 86, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 95, -1, -1,
// -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, 19, -1, -1, 41, -1, 173, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, 88, -1, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, 186,
// -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, 200, -1,
// -1, -1, 87, 181, -1, -1, -1, -1, 119, -1, -1, -1, 57, -1, -1, -1, 104, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 47, -1, 26, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, 174, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, 201, -1, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// 58, 50, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, 101,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, 113, 187, -1, -1,
// -1, 94, -1, -1, -1, -1, -1, 165, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1,
// -1, -1, 167, -1, -1, 163, -1, -1, 197, -1, -1, -1, -1, 78, -1, 68, -1, -1,
// -1, -1, -1, -1, 145, -1, -1, 196, -1, -1, -1, -1, 12, -1, -1, -1, 160, -1,
// 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 123,
// -1, -1, -1, -1, -1, -1, 76, 120, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, 10, -1, -1, -1, -1, -1, 153, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1,
// -1, -1, -1, -1, 142, -1, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 152, -1, 171,
// -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, 150, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// 22, -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// 24, -1, 70, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, -1, 177, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, 100, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -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, 144, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, -1, -1,
// -1, 121, 159, 102, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 155, 149, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, 81, 2, -1, 110, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, 146, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// 178, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, 143, -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, 164, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, 9,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 31, -1, 6, -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, 188, -1, -1, -1, -1, -1, -1, -1, 25, -1, -1, 73, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64,
// 79, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127, -1, -1, -1, 18, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, 184, -1, -1, -1, 175, -1, -1, 193, -1, 92, 151, 154, -1, -1, -1, -1,
// 106, -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, -1, -1, -1, -1, -1, -1, -1,
// -1, 75, -1, -1, -1, -1, -1, -1, 84, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1,
// -1, -1, 98, -1, 80, -1, -1, -1, 85, -1, -1, -1, -1, 67, -1, 118, -1, -1, -1,
// -1, -1, -1, -1, -1, 126, -1, -1, -1, -1, -1, 77, -1, -1, 122, 44, -1, -1,
// -1, -1, -1, 89, -1, -1, -1, 115, 136, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, 147, -1,
// 16, 185, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// 158, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
// -1, -1, 156, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
// );
KeyWords: array[0..256] of UnicodeString = (
'!doctype', '/!doctype', '/a', '/abbr', '/acronym', '/address', '/applet',
'/area', '/article', '/aside', '/audio', '/b', '/base', '/basefont', '/bb',
'/bdo', '/big', '/blockquote', '/body', '/button', '/canvas', '/caption',
'/center', '/cite', '/code', '/col', '/colgroup', '/command', '/datalist',
'/dd', '/del', '/details', '/dfn', '/dialog', '/dir', '/div', '/dl', '/dt',
'/em', '/embed', '/fieldset', '/figcaption', '/figure', '/font', '/footer',
'/form', '/frame', '/frameset', '/h1', '/h2', '/h3', '/h4', '/h5', '/h6',
'/head', '/header', '/hgroup', '/html', '/i', '/iframe', '/img', '/input',
'/ins', '/kbd', '/keygen', '/label', '/layer', '/legend', '/li', '/link',
'/map', '/mark', '/marquee', '/menu', '/meta', '/meter', '/multicol',
'/nav', '/nobr', '/noembed', '/noframes', '/nolayer', '/noscript',
'/object', '/ol', '/optgroup', '/option', '/output', '/p', '/param', '/pre',
'/progress', '/q', '/rp', '/rt', '/ruby', '/s', '/samp', '/script',
'/section', '/select', '/server', '/small', '/source', '/span', '/strike',
'/strong', '/style', '/sub', '/summary', '/sup', '/table', '/tbody', '/td',
'/textarea', '/tfoot', '/th', '/thead', '/time', '/title', '/tr', '/track',
'/tt', '/u', '/ul', '/var', '/video', '/wbr', '/xmp', 'a', 'abbr',
'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b',
'base', 'basefont', 'bb', 'bdo', 'big', 'blockquote', 'body', 'button',
'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command',
'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl',
'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer',
'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head',
'header', 'hgroup', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd',
'keygen', 'label', 'layer', 'legend', 'li', 'link', 'map', 'mark',
'marquee', 'menu', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed',
'noframes', 'nolayer', 'noscript', 'object', 'ol', 'optgroup', 'option',
'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's',
'samp', 'script', 'section', 'select', 'server', 'small', 'source', 'span',
'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'synedit', 'table',
'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr',
'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp'
);
KeyIndices: array[0..2178] of Integer = (
-1, -1, -1, 3, -1, -1, 231, 250, -1, -1, -1, 212, -1, -1, -1, -1, -1, -1,
-1, -1, 175, -1, -1, -1, -1, -1, 128, -1, -1, -1, -1, 155, -1, -1, -1, -1,
-1, -1, -1, 83, -1, 201, 122, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 48, -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, 70, -1, -1, -1, -1, -1, -1, 183, -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, 216, -1, -1, -1, -1, -1, -1, 31, -1, -1, -1,
-1, 89, -1, -1, -1, 234, -1, -1, 188, -1, -1, -1, -1, -1, -1, -1, -1, 107,
-1, -1, 61, -1, -1, -1, -1, -1, 21, -1, -1, -1, 8, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 225, -1, -1, 150, -1, -1, 91, -1, -1, -1, 88, -1,
-1, -1, 158, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1,
-1, -1, 137, 12, -1, 67, -1, -1, 47, -1, -1, -1, -1, -1, 10, -1, -1, 135,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 218, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 170, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
174, -1, 7, -1, -1, -1, 142, -1, -1, -1, -1, -1, -1, -1, -1, 133, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 232, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, 178, -1, -1, -1, -1, -1,
-1, 209, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 130, -1, 162,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, -1, -1, 237, -1, -1, -1,
17, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 157, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
210, -1, -1, -1, 104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 206, -1, -1, -1, -1, -1, -1, -1, -1, 165, -1, -1, -1, -1,
-1, -1, -1, 254, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, -1, 126, -1, -1,
-1, -1, -1, -1, -1, 24, -1, -1, 238, -1, 96, -1, 38, -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, 248, -1, -1, -1, 156, -1, 103, -1, -1,
-1, -1, -1, -1, -1, -1, 239, 211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
111, -1, -1, -1, -1, -1, -1, -1, 120, -1, -1, -1, 29, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 71, 84, -1, -1, -1, -1, -1, 87, -1, -1, -1, -1, 186, -1,
-1, -1, -1, -1, -1, -1, -1, 243, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1,
115, -1, -1, -1, -1, -1, -1, 26, 138, -1, -1, -1, -1, -1, -1, -1, 163, -1,
-1, 144, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 181, 22, -1, -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, 36, -1, -1, 240,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 112, -1, -1, -1, -1, -1, -1,
153, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, -1, -1, -1,
-1, -1, -1, -1, 106, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256,
-1, 164, -1, -1, -1, -1, -1, -1, -1, -1, -1, 192, 145, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 37,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, -1, 197,
63, -1, -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, 202, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 44, -1, 200, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, 151,
-1, -1, -1, -1, -1, -1, 242, -1, -1, -1, -1, -1, -1, -1, -1, 193, 176, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, 220, -1, -1, -1,
141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, 93, 76, -1, -1, 14, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, -1, -1, 230, -1, 198, -1,
-1, -1, -1, -1, -1, 69, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 244, -1, -1, -1, -1, 208, -1, -1, -1,
-1, -1, -1, -1, 100, 203, 5, -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 25, -1, -1, -1, -1, -1, 45, 92, -1, -1, -1, -1, 80, 204, -1,
-1, -1, -1, -1, 42, -1, -1, -1, -1, -1, 132, -1, 249, -1, -1, -1, -1, -1,
-1, -1, 82, -1, 16, -1, 121, 86, -1, -1, -1, 224, -1, 195, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, 54,
-1, -1, -1, -1, -1, -1, -1, -1, 207, -1, -1, 68, -1, -1, -1, -1, -1, -1,
252, -1, 233, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1,
-1, -1, -1, -1, -1, -1, 251, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 179, 18, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 191, -1, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
171, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 168, -1, -1, -1, 226, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 222, -1, -1, -1, -1, -1, 253, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 246, -1, -1, -1, -1, -1, -1, -1, -1, -1, 196,
-1, -1, -1, -1, -1, -1, 199, -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, 6, -1, -1,
-1, -1, 0, -1, -1, 229, -1, -1, 228, -1, -1, -1, -1, -1, 215, -1, 125, 102,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 227, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 194, -1, -1,
-1, -1, -1, -1, -1, 184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 169, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 213, -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, 205, -1, -1, 190, -1, -1, -1, 97, -1, -1, -1, -1, -1, 33, -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, 247, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 119, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 55, -1, 19, -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, -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, 148, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 223, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 187, -1, -1, -1,
95, -1, 136, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1,
118, -1, -1, -1, -1, -1, -1, 152, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1,
-1, -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 143, -1, -1, -1, -1, -1, -1, -1, 214, -1, 166,
60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, -1, -1, -1, 147, -1, -1,
-1, -1, -1, 15, -1, -1, 167, -1, -1, 173, -1, -1, -1, -1, -1, -1, -1, 131,
-1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, -1,
-1, -1, -1, -1, -1, -1, 149, -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, 235, 35, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, -1, -1, -1, -1,
27, -1, -1, -1, -1, -1, -1, -1, 160, -1, -1, -1, -1, -1, 74, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, 30, -1,
217, -1, -1, -1, -1, -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
182, -1, 146, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 139, -1, -1, 98, -1, -1, -1, -1, 129,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, -1, 180, -1, -1,
245, -1, -1, -1, -1, -1, -1, 241, -1, -1, -1, -1, 117, -1, 221, -1, -1, -1,
-1, -1, 23, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, 1, -1, -1,
-1, -1, -1, -1, -1, 113, -1, -1, 134, -1, -1, -1, 94, -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, 185, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, 109, -1, -1, -1,
-1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 85, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 127, -1, -1, -1, 28, -1, -1, -1, -1, 123, -1, -1, -1, -1, -1, -1,
-1, 236, -1, 219, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1
);
{$Q-}
function TSynHTMLSyn.HashKey(Str: PWideChar): Cardinal;
begin
// Result := 0;
// while IsIdentChar(Str^) or CharInSet(Str^, ['!', '/']) do
// begin
// Result := Result * 932 + Ord(Str^) * 46;
// inc(Str);
// end;
// Result := Result mod 1543;
// fStringLen := Str - fToIdent;
Result := 0;
while IsIdentChar(Str^) do
begin
Result := Result * 627 + Ord(Str^) * 829;
inc(Str);
end;
Result := Result mod 2179;
fStringLen := Str - fToIdent;
end;
{$Q+}
function TSynHTMLSyn.IdentKind(MayBe: PWideChar): TtkTokenKind;
var
Key: Cardinal;
begin
fToIdent := MayBe;
Key := HashKey(MayBe);
if Key <= High(fIdentFuncTable) then
Result := fIdentFuncTable[Key](KeyIndices[Key])
else
Result := tkIdentifier;
end;
procedure TSynHTMLSyn.InitIdent;
var
i: Integer;
begin
for i := Low(fIdentFuncTable) to High(fIdentFuncTable) do
if KeyIndices[i] = -1 then
fIdentFuncTable[i] := AltFunc;
for i := Low(fIdentFuncTable) to High(fIdentFuncTable) do
if @fIdentFuncTable[i] = nil then
fIdentFuncTable[i] := KeyWordFunc;
end;
function TSynHTMLSyn.AltFunc(Index: Integer): TtkTokenKind;
begin
Result := tkUndefKey;
end;
function TSynHTMLSyn.KeyWordFunc(Index: Integer): TtkTokenKind;
begin
if IsCurrentToken(KeyWords[Index]) then
Result := tkKey
else
Result := tkUndefKey;
end;
constructor TSynHTMLSyn.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fCaseSensitive := False;
fCommentAttri := TSynHighlighterAttributes.Create(SYNS_AttrComment, SYNS_FriendlyAttrComment);
AddAttribute(fCommentAttri);
fIdentifierAttri := TSynHighlighterAttributes.Create(SYNS_AttrIdentifier, SYNS_FriendlyAttrIdentifier);
fIdentifierAttri.Style := [fsBold];
AddAttribute(fIdentifierAttri);
fKeyAttri := TSynHighlighterAttributes.Create(SYNS_AttrReservedWord, SYNS_FriendlyAttrReservedWord);
fKeyAttri.Style := [fsBold];
fKeyAttri.Foreground := $00ff0080;
AddAttribute(fKeyAttri);
fSpaceAttri := TSynHighlighterAttributes.Create(SYNS_AttrSpace, SYNS_FriendlyAttrSpace);
AddAttribute(fSpaceAttri);
fSymbolAttri := TSynHighlighterAttributes.Create(SYNS_AttrSymbol, SYNS_FriendlyAttrSymbol);
fSymbolAttri.Style := [fsBold];
AddAttribute(fSymbolAttri);
fTextAttri := TSynHighlighterAttributes.Create(SYNS_AttrText, SYNS_FriendlyAttrText);
AddAttribute(fTextAttri);
fUndefKeyAttri := TSynHighlighterAttributes.Create(SYNS_AttrUnknownWord, SYNS_FriendlyAttrUnknownWord);
fUndefKeyAttri.Style := [fsBold];
fUndefKeyAttri.Foreground := clRed;
AddAttribute(fUndefKeyAttri);
fValueAttri := TSynHighlighterAttributes.Create(SYNS_AttrValue, SYNS_FriendlyAttrValue);
fValueAttri.Foreground := $00ff8000;
AddAttribute(fValueAttri);
fAndAttri := TSynHighlighterAttributes.Create(SYNS_AttrEscapeAmpersand, SYNS_FriendlyAttrEscapeAmpersand);
fAndAttri.Style := [fsBold];
fAndAttri.Foreground := $0000ff00;
AddAttribute(fAndAttri);
SetAttributesOnChange(DefHighlightChange);
InitIdent;
fRange := rsText;
fDefaultFilter := SYNS_FilterHTML;
fAndCode := -1;
end;
procedure TSynHTMLSyn.BraceCloseProc;
begin
fRange := rsText;
fTokenId := tkSymbol;
Inc(Run);
end;
procedure TSynHTMLSyn.CommentProc;
begin
fTokenID := tkComment;
if IsLineEnd(Run) then
begin
NextProcedure;
Exit;
end;
while not IsLineEnd(Run) do
begin
if (fLine[Run] = '>') and (fLine[Run - 1] = '-') and (fLine[Run - 2] = '-') then
begin
fRange := rsText;
Inc(Run);
break;
end;
Inc(Run);
end;
end;
procedure TSynHTMLSyn.BraceOpenProc;
begin
Inc(Run);
if (fLine[Run] = '!') and (fLine[Run + 1] = '-') and (fLine[Run + 2] = '-') then
begin
fRange := rsComment;
fTokenID := tkComment;
Inc(Run, 3);
end
else
begin
fRange := rsKey;
fTokenID := tkSymbol;
end;
end;
procedure TSynHTMLSyn.CRProc;
begin
fTokenID := tkSpace;
Inc(Run);
if fLine[Run] = #10 then Inc(Run);
end;
procedure TSynHTMLSyn.EqualProc;
begin
fRange := rsValue;
fTokenID := tkSymbol;
Inc(Run);
end;
procedure TSynHTMLSyn.IdentProc;
begin
case fRange of
rsKey:
begin
fRange := rsParam;
fTokenID := IdentKind((fLine + Run));
Inc(Run, fStringLen);
end;
rsValue:
begin
fRange := rsParam;
fTokenID := tkValue;
repeat
Inc(Run);
until (fLine[Run] <= #32) or (fLine[Run] = '>');
end;
else
fTokenID := tkIdentifier;
repeat
Inc(Run);
until (fLine[Run] <= #32) or (fLine[Run] = '=') or (fLine[Run] = '"') or
(fLine[Run] = '>');
end;
end;
procedure TSynHTMLSyn.LFProc;
begin
fTokenID := tkSpace;
Inc(Run);
end;
procedure TSynHTMLSyn.NullProc;
begin
fTokenID := tkNull;
inc(Run);
end;
procedure TSynHTMLSyn.TextProc;
function IsStopChar: Boolean;
begin
case fLine[Run] of
#0..#31, '<', '&':
Result := True;
else
Result := False;
end;
end;
function IsNumberChar: Boolean;
begin
case fLine[Run] of
'0'..'9', 'A'..'F', 'a'..'f':
Result := True;
else
Result := False;
end;
end;
var
i: Integer;
begin
if CharInSet(fLine[Run], [#0..#31, '<']) then
begin
NextProcedure;
exit;
end;
fTokenID := tkText;
while True do
begin
while not IsStopChar do Inc(Run);
if (fLine[Run] = '&') then
begin
if (fLine[Run + 1] = '#') then
begin
fAndCode := -1;
i := Run;
inc(Run, 2);
if CharInSet(fLine[Run], ['X', 'x']) then
begin
inc(Run);
while IsNumberChar do
inc(Run);
end
else
while CharInSet(fLine[Run], ['0'..'9']) do
inc(Run);
if (fLine[Run] = ';') then
begin
inc(Run);
Run := i;
fRange := rsAmpersand;
end;
break;
end
else
for i := Low(EscapeAmps) To High(EscapeAmps) do
if (WStrLComp((fLine + Run), EscapeAmps[i], WStrLen(EscapeAmps[i])) = 0) then
begin
fAndCode := i;
fRange := rsAmpersand;
Exit;
end;
Inc(Run);
end
else
Break;
end;
end;
procedure TSynHTMLSyn.AmpersandProc;
function IsNumberChar: Boolean;
begin
case fLine[Run] of
'0'..'9', 'A'..'F', 'a'..'f':
Result := True;
else
Result := False;
end;
end;
begin
if fRange <> rsAmpersand then
begin
if fRange = rsKey then
begin
Inc(Run);
fRange := rsText;
fTokenID := tkText;
end
else
IdentProc;
Exit;
end;
case fAndCode of
Low(EscapeAmps)..High(EscapeAmps):
begin
fTokenID := tkAmpersand;
Inc(Run, WStrLen(EscapeAmps[fAndCode]));
end;
else begin
if (fLine[Run + 1] = '#') then
begin
fAndCode := -1;
inc(Run, 2);
if CharInSet(fLine[Run], ['X', 'x']) then
begin
inc(Run);
while IsNumberChar do
inc(Run);
end
else
while CharInSet(fLine[Run], ['0'..'9']) do
inc(Run);
if (fLine[Run] = ';') then begin
inc(Run);
fTokenID := tkAmpersand;
end else
fTokenID := tkText;
end;
end;
end;
fAndCode := -1;
fRange := rsText;
end;
procedure TSynHTMLSyn.SpaceProc;
begin
inc(Run);
fTokenID := tkSpace;
while fLine[Run] <= #32 do
begin
if CharInSet(fLine[Run], [#0, #9, #10, #13]) then break;
Inc(Run);
end;
end;
procedure TSynHTMLSyn.StringProc;
var
iOpenChar: WideChar;
begin
case fRange of
rsQuoteValue:
begin
iOpenChar := #39;
fTokenID := tkValue;
end;
rsDoubleQuoteValue:
begin
iOpenChar := '"';
fTokenID := tkValue;
end;
else
begin
iOpenChar := fLine[Run];
if fRange = rsValue then
begin
if iOpenChar = '"' then
fRange := rsDoubleQuoteValue
else
fRange := rsQuoteValue;
fTokenID := tkValue;
end else
begin
IdentProc;
Exit;
end;
Inc(Run); { jumps over the opening char }
end;
end;
while not IsLineEnd(Run) do
begin
if fLine[Run] = iOpenChar then
begin
Inc(Run); { jumps over the closing char }
if fRange in [rsDoubleQuoteValue, rsQuoteValue] then
fRange := rsParam
else
fRange := rsText;
break;
end;
Inc(Run);
end;
end;
function TSynHTMLSyn.IsIdentChar(AChar: WideChar): Boolean;
begin
case AChar of
'_', '/', '0'..'9', 'A'..'Z', 'a'..'z':
Result := True;
else
Result := False;
end;
end;
procedure TSynHTMLSyn.Next;
begin
fTokenPos := Run;
case fRange of
rsText:
TextProc;
rsComment:
CommentProc;
rsQuoteValue, rsDoubleQuoteValue:
if IsLineEnd(Run) then
NextProcedure
else
StringProc;
else
NextProcedure;
end;
// ensure that one call of Next is enough to reach next token
if (fOldRun = Run) and not GetEol then Next;
inherited;
end;
procedure TSynHTMLSyn.NextProcedure;
begin
case fLine[Run] of
#0: NullProc;
#10: LFProc;
#13: CRProc;
#1..#9, #11, #12, #14..#32: SpaceProc;
'&': AmpersandProc;
'"', #39: StringProc;
'<': BraceOpenProc;
'>': BraceCloseProc;
'=': EqualProc;
else IdentProc;
end;
end;
function TSynHTMLSyn.GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
begin
case Index of
SYN_ATTR_COMMENT: Result := fCommentAttri;
SYN_ATTR_IDENTIFIER: Result := fIdentifierAttri;
SYN_ATTR_KEYWORD: Result := fKeyAttri;
SYN_ATTR_WHITESPACE: Result := fSpaceAttri;
SYN_ATTR_SYMBOL: Result := fSymbolAttri;
else
Result := nil;
end;
end;
function TSynHTMLSyn.GetEol: Boolean;
begin
Result := Run = fLineLen + 1;
end;
function TSynHTMLSyn.GetTokenID: TtkTokenKind;
begin
Result := fTokenId;
end;
function TSynHTMLSyn.GetTokenAttribute: TSynHighlighterAttributes;
begin
case fTokenID of
tkAmpersand: Result := fAndAttri;
tkComment: Result := fCommentAttri;
tkIdentifier: Result := fIdentifierAttri;
tkKey: Result := fKeyAttri;
tkSpace: Result := fSpaceAttri;
tkSymbol: Result := fSymbolAttri;
tkText: Result := fTextAttri;
tkUndefKey: Result := fUndefKeyAttri;
tkValue: Result := fValueAttri;
else Result := nil;
end;
end;
function TSynHTMLSyn.GetTokenKind: integer;
begin
Result := Ord(fTokenId);
end;
function TSynHTMLSyn.GetRange: Pointer;
begin
Result := Pointer(fRange);
end;
procedure TSynHTMLSyn.SetRange(Value: Pointer);
begin
fRange := TRangeState(Value);
end;
procedure TSynHTMLSyn.ResetRange;
begin
fRange:= rsText;
end;
function TSynHTMLSyn.IsFilterStored: Boolean;
begin
Result := fDefaultFilter <> SYNS_FilterHTML;
end;
class function TSynHTMLSyn.GetLanguageName: string;
begin
Result := SYNS_LangHTML;
end;
function TSynHTMLSyn.GetSampleSource: UnicodeString;
begin
Result := '<!-- Syntax highlighting -->'#13#10 +
#13#10 +
'<html>'#13#10 +
'<body bgcolor="red">'#13#10 +
' <form name="frmLogin" action="doSomething.asp">'#13#10 +
' <input name="user" value=''any'#13#10 +
' value''>'#13#10 +
' </form>'#13#10 +
' <invalid>Sample HTML code &copy; 2001</invalid>'#13#10 +
'</body>'#13#10 +
'</html>';
end;
class function TSynHTMLSyn.GetFriendlyLanguageName: UnicodeString;
begin
Result := SYNS_FriendlyLangHTML;
end;
initialization
{$IFNDEF SYN_CPPB_1}
RegisterPlaceableHighlighter(TSynHTMLSyn);
{$ENDIF}
end.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.