notepad-plus-plus/lexilla/test/examples/smalltalk/ClassificationTable.st.styled
Christian Grasser 213e9135ba Update to scintilla 5.5.3 & Lexilla 5.4.1
Release 5.5.3 (https://www.scintilla.org/scintilla553.zip)

    Released 19 October 2024.
    On Win32 change direction of horizontal mouse wheel and touchpad scrolling to match other applications. Bug #2449.

Release 5.4.1 (https://www.scintilla.org/lexilla541.zip)

    Released 19 October 2024.
    Lexer added for Dart "dart". Pull request #265, Pull request #275.
    Lexer added for troff / nroff "troff". Pull request #264.
    Lexer added for Zig "zig". Pull request #267.
    C++: Fix crash for empty documentation comment keyword where '<' occurs at line end.
    F#: Include EOLs in the style range of SCE_FSHARP_COMMENTLINE. Stabilizes EOL detection when folding line comment groups. Issue #276.
    F#: Fix per-line folding in F# documents. Issue #277.
    HTML: Improve SGML/DTD lexing. Don't terminate SGML when > inside quoted string. Lex both [ and ] as SCE_H_SGML_DEFAULT. Nested sections handled instead of switching to SCE_H_SGML_ERROR. Issue #272.
    JavaScript: New SCE_HJ_TEMPLATELITERAL and SCE_HJA_TEMPLATELITERAL styles for template literals when lexer is hypertext, or xml. Issue #280.
    PHP: Fix failure to recognize PHP start "<?php' at end of document. Caused by not capping retrieval range at document end causing no text to be retrieved. Issue #269.
    Smalltalk: Fix scaled decimal numbers without decimal separator. Pull request #274.

Fix #15228, fix #15368, fix #15650, close #15717
2024-10-20 17:33:07 +02:00

53 lines
2.8 KiB
Plaintext

{3}" File contains examples of all SCE_ST_* lexical states 0-16 "{0}
{3}" Smalltalk code from the lexer that generates the character classification table."{0}
{5}|{0} lexTable classificationBlock charClasses {5}|{0}
charClasses {14}:={0} {12}#({4}#DecDigit{0} {4}#Letter{0} {4}#Special{0} {4}#Upper{0} {4}#BinSel{12}).{0}
lexTable {14}:={0} {10}ByteArray{0} {13}new:{0} {2}128{12}.{0}
classificationBlock {14}:={0} {12}[{0} {12}:{0}charClass {12}:{0}chars {5}|{0}
{5}|{0} flag {5}|{0}
flag {14}:={0} {2}1{0} {13}bitShift:{0} {12}({0}charClasses {13}indexOf:{0} charClass{12}){0} {5}-{0} {2}1{12}.{0}
chars {13}do:{0} {12}[{0} {12}:{0}char {5}|{0} lexTable {13}at:{0} char codePoint {5}+{0} {2}1{0} {13}put:{0} {12}(({0}lexTable {13}at:{0} char codePoint {5}+{0} {2}1{12}){0} {13}bitOr:{0} flag{12})]].{0}
classificationBlock
{13}value:{0} {4}#DecDigit{0} {13}value:{0} {1}'0123456789'{12};{0}
{13}value:{0} {4}#Letter{0} {13}value:{0} {1}'_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'{12};{0}
{13}value:{0} {4}#Special{0} {13}value:{0} {1}'()[]{};.^:'{12};{0}
{13}value:{0} {4}#BinSel{0} {13}value:{0} {1}'~@%&*-+=|\/,<>?!'{12};{0}
{13}value:{0} {4}#Upper{0} {13}value:{0} {1}'ABCDEFGHIJKLMNOPQRSTUVWXYZ'{12}.{0}
{12}(({10}String{0} {13}new:{0} {2}500{12}){0} {13}streamContents:{0} {12}[{0} {12}:{0}stream {5}|{0}
stream crLf{12};{0} {13}nextPutAll:{0} {1}'static int ClassificationTable[256] = {'{12}.{0}
lexTable {13}keysAndValuesDo:{0} {12}[{0} {12}:{0}index {12}:{0}value {5}|{0}
{12}(({0}index {5}-{0} {2}1{12}){0} {13}rem:{0} {2}16{12}){0} {5}=={0} {2}0{0} {16}ifTrue:{0} {12}[{0}
stream crLf{12};{0} tab{12}]{0}
{16}ifFalse:{0} {12}[{0}
stream space{12}].{0}
stream {13}print:{0} value{12}.{0}
index {5}~={0} {2}256{0} {16}ifTrue:{0} {12}[{0}
stream {13}nextPut:{0} {15}$,{12}]].{0}
stream crLf{12};{0} {13}nextPutAll:{0} {1}'};'{12};{0} crLf{12}.{0}
charClasses {13}keysAndValuesDo:{0} {12}[{0} {12}:{0}index {12}:{0}name {5}|{0}
stream
crLf{12};{0}
{13}nextPutAll:{0} {12}({0}
{12}({1}'static inline bool is<1s>(unsigned char ch) {return (ch %< 0x80) && ((ClassificationTable[ch] & <2p>) != 0);}'{12}){0}
{13}expandMacrosWith:{0} name {13}with:{0} {12}({2}1{0} {13}bitShift:{0} {12}({0}index {5}-{0} {2}1{12}))){0}
{12}]]){0} edit
{3}" Some more syntax examples:
^ is return (SCE_ST_RETURN)
true or false is bool (SCE_ST_BOOL)
self (SCE_ST_SELF)
super (SCE_ST_SUPER)
nil (SCE_ST_NIL)
"{0}
foo
{11}^{0} {10}Array{0} {13}with:{0} {2}1{0} {13}with:{0} {2}2{0} {13}with:{0} {6}false{0} {13}with:{0} {7}self{0} {13}with:{0} {8}super{0} {13}with:{0} {9}nil{12}.{0}
{3}" Issue 274: A decimal separator is not required for scaled decimal numbers"{0}
{2}32.0s2{0}
{2}4.0e3{0}
{2}32s2{0}
{2}4e3{0}