[Libreoffice-commits] core.git: starmath/inc starmath/source

dante (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 3 19:58:57 UTC 2020


 starmath/inc/error.hxx                    |    1 
 starmath/inc/strings.hrc                  |    2 
 starmath/inc/strings.hxx                  |    2 
 starmath/inc/token.hxx                    |  108 ++++++++++++++++++------------
 starmath/source/ElementsDockingWindow.cxx |    2 
 starmath/source/parse.cxx                 |    3 
 6 files changed, 72 insertions(+), 46 deletions(-)

New commits:
commit ed8fc341678f780ceedd77db2ea4a4441bdca3e9
Author:     dante <dante19031999 at gmail.com>
AuthorDate: Tue Nov 3 12:30:40 2020 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Nov 3 20:58:13 2020 +0100

    Reordered token.hxx.
    
    It will be easier to follow the list. Minor changes respecting set ( added it/s owns tokens to setminus, setquotient ).
    
    Change-Id: I879675db8634a54ff3f16e7c00e4aedcaeb429cf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105242
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/starmath/inc/error.hxx b/starmath/inc/error.hxx
index d8179da593d5..bd2b7067a91c 100644
--- a/starmath/inc/error.hxx
+++ b/starmath/inc/error.hxx
@@ -23,6 +23,7 @@
 
 class SmNode;
 
+// Those are the errors that the parser (parser.hxx/parser.cxx) may encounter.
 enum class SmParseError
 {
     None,
diff --git a/starmath/inc/strings.hrc b/starmath/inc/strings.hrc
index 50adc4a3e042..7cd2c73c09d7 100644
--- a/starmath/inc/strings.hrc
+++ b/starmath/inc/strings.hrc
@@ -69,7 +69,7 @@
 #define RID_XUNIONY_HELP                    NC_("RID_XUNIONY_HELP", "Union" )
 #define RID_XINTERSECTIONY_HELP             NC_("RID_XINTERSECTIONY_HELP", "Intersection" )
 #define RID_XSETMINUSY_HELP                 NC_("RID_XSETMINUSY_HELP", "Difference" )
-#define RID_XSLASHY_HELP                    NC_("RID_XSLASHY_HELP", "Quotient Set" )
+#define RID_XSETQUOTIENTY_HELP              NC_("RID_XSETQUOTIENTY_HELP", "Quotient Set" )
 #define RID_XSUBSETY_HELP                   NC_("RID_XSUBSETY_HELP", "Subset" )
 #define RID_XSUBSETEQY_HELP                 NC_("RID_XSUBSETEQY_HELP", "Subset Or Equal To" )
 #define RID_XSUPSETY_HELP                   NC_("RID_XSUPSETY_HELP", "Superset" )
diff --git a/starmath/inc/strings.hxx b/starmath/inc/strings.hxx
index 2daf463afd25..17de13505fdf 100644
--- a/starmath/inc/strings.hxx
+++ b/starmath/inc/strings.hxx
@@ -59,7 +59,7 @@
 #define RID_XUNIONY         "<?> union <?> "
 #define RID_XINTERSECTIONY  "<?> intersection <?> "
 #define RID_XSETMINUSY      "<?> setminus <?> "
-#define RID_XSLASHY         "<?> slash <?> "
+#define RID_XSETQUOTIENTY   "<?> setquotient <?> "
 #define RID_XSUBSETY        "<?> subset <?> "
 #define RID_XSUBSETEQY      "<?> subseteq <?> "
 #define RID_XSUPSETY        "<?> supset <?> "
diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx
index a58e28d42be8..5b5d8e80634f 100644
--- a/starmath/inc/token.hxx
+++ b/starmath/inc/token.hxx
@@ -49,56 +49,80 @@ namespace o3tl {
     template<> struct typed_flags<TG> : is_typed_flags<TG, 0x037fff> {};
 }
 
+// Tokens identifiers. Allow to know what kind of information the node contains.
 enum SmTokenType
 {
-    TEND,           TLGROUP,        TRGROUP,        TLPARENT,       TRPARENT,
-    TLBRACKET,      TRBRACKET,      TPLUS,          TMINUS,         TMULTIPLY,
-    TDIVIDEBY,      TASSIGN,        TPOUND,         TSPECIAL,       TSLASH,
-    TBACKSLASH,     TBLANK,         TSBLANK,        TRSUB,          TRSUP,
-    TCSUB,          TCSUP,          TLSUB,          TLSUP,          TGT,
-    TLT,            TAND,           TOR,            TINTERSECT,     TUNION,
-    TNEWLINE,       TBINOM,         TFROM,          TTO,            TINT,
-    TSUM,           TOPER,          TABS,           TSQRT,          TFACT,
-    TNROOT,         TOVER,          TTIMES,         TGE,            TLE,
-    TGG,            TLL,            TDOTSAXIS,      TDOTSLOW,       TDOTSVERT,
-    TDOTSDIAG,      TDOTSUP,        TDOTSDOWN,      TACUTE,         TBAR,
-    TBREVE,         TCHECK,         TCIRCLE,        TDOT,           TDDOT,
-    TDDDOT,         TGRAVE,         THAT,           TTILDE,         TVEC,
-    TUNDERLINE,     TOVERLINE,      TOVERSTRIKE,    TITALIC,        TNITALIC,
-    TBOLD,          TNBOLD,         TPHANTOM,       TFONT,          TSIZE,
-    TCOLOR,         TALIGNL,        TALIGNC,        TALIGNR,        TLEFT,
-    TRIGHT,         TLANGLE,        TLBRACE,        TLLINE,         TLDLINE,
-    TLCEIL,         TLFLOOR,        TNONE,          TMLINE,         TRANGLE,
-    TRBRACE,        TRLINE,         TRDLINE,        TRCEIL,         TRFLOOR,
-    TSTACK,         TMATRIX,        TDPOUND,        TPLACE,
-    TTEXT,          TNUMBER,        TCHARACTER,     TIDENT,         TNEQ,
-    TEQUIV,         TDEF,           TPROP,          TSIM,           TSIMEQ,
-    TAPPROX,        TPARALLEL,      TORTHO,         TIN,            TNOTIN,
-    TSUBSET,        TSUBSETEQ,      TSUPSET,        TSUPSETEQ,      TPLUSMINUS,
-    TMINUSPLUS,     TOPLUS,         TOMINUS,        TDIV,           TOTIMES,
-    TODIVIDE,       TTRANSL,        TTRANSR,        TIINT,          TIIINT,
-    TLINT,          TLLINT,         TLLLINT,        TPROD,          TCOPROD,
-    TFORALL,        TEXISTS,        TNOTEXISTS,     TLIM,           TNABLA,
-    TUOPER,         TBOPER,         TFIXED,         TSANS,          TSERIF,
-    TCDOT,          TODOT,          TLESLANT,       TGESLANT,       TNSUBSET,
-    TNSUPSET,       TNSUBSETEQ,     TNSUPSETEQ,     TPARTIAL,       TNEG,
-    TNI,            TBACKEPSILON,   TALEPH,         TIM,            TRE,
-    TWP,            TEMPTYSET,      TINFINITY,      TESCAPE,        TLIMSUP,
-    TLIMINF,        TNDIVIDES,      TDRARROW,       TDLARROW,       TDLRARROW,
-    TUNDERBRACE,    TOVERBRACE,     TCIRC,          THBAR,
-    TLAMBDABAR,     TLEFTARROW,     TRIGHTARROW,    TUPARROW,       TDOWNARROW,
-    TDIVIDES,       TSETN,          TSETZ,          TSETQ,
-    TSETR,          TSETC,          TWIDEVEC,       TWIDEHARPOON,   TWIDETILDE,
-    TWIDESLASH,     TWIDEBACKSLASH, TLDBRACKET,     TRDBRACKET,     TNOSPACE,
-    TUNKNOWN,       TPRECEDES,      TSUCCEEDS,      TPRECEDESEQUAL, TSUCCEEDSEQUAL,
-    TPRECEDESEQUIV, TSUCCEEDSEQUIV, TNOTPRECEDES,   TNOTSUCCEEDS,   THARPOON,
-    TINTD,          TLAPLACE,       TFOURIER,       TTOWARD,        TWIDEHAT,
+    // Uncategorized
+    TEND,           TSPECIAL,       TNONE,          TESCAPE,        TUNKNOWN,
+    TBLANK,         TSBLANK,        TPLACE,         TNOSPACE,       TDOTSDOWN,
+    TNEWLINE,       TDOTSAXIS,      TDOTSLOW,       TDOTSVERT,      TBACKEPSILON,
+    TDOTSDIAG,      TDOTSUP,
+    // Basic
+    TPLUS,          TMINUS,         TMULTIPLY,      TDIVIDEBY,      // +-*/
+    TGT,            TLT,            TGE,            TLE,            // > < >= <=
+    TASSIGN,        TNEQ,           TGG,            TLL,            // = != >>> <<<
+    TPARALLEL,      TORTHO,         TEQUIV,                         // Geometry
+    TOPER,          TSUM,           TPROD,          TCOPROD,        // Operators
+    TIM,            TRE,            THBAR,          TLAMBDABAR,     // Complex and constants
+    TPLUSMINUS,     TMINUSPLUS,     TSIM,           TSIMEQ,         // +- -+ ~ ~=
+    TLIM,           TLIMSUP,        TLIMINF,        TTOWARD,        // Limits
+    TOVER,          TTIMES,         TCDOT,          TDIV,           // Product type
+    TSLASH,         TBACKSLASH,     TWIDESLASH,     TWIDEBACKSLASH, //Slash
+    // Structure
+    TMATRIX,         TPOUND,        TDPOUND,        TSTACK,         TBINOM,
+    // Logic
+    TAND,           TOR,            TNEG,                           // && || !
+    TPRECEDES,      TSUCCEEDS,      TNOTPRECEDES,   TNOTSUCCEEDS,   // Order
+    TPRECEDESEQUAL, TSUCCEEDSEQUAL, TPRECEDESEQUIV, TSUCCEEDSEQUIV, // Order eq
+    TLEFTARROW,     TRIGHTARROW,    TUPARROW,       TDOWNARROW,     // Arrows
+    TDRARROW,       TDLARROW,       TDLRARROW,      TDEF,           // Double arrows, definition
+    TPROP,          TNDIVIDES,      TDIVIDES,       TAPPROX,        // Proportions, approximisation
+    TLESLANT,       TGESLANT,       TTRANSL,        TTRANSR,        // <= >= corresponds
+    // Tensors
+    TOPLUS,         TOMINUS,        TOTIMES,        TODIVIDE,       TODOT,
+    TCIRC,
+    // Positions
+    TRSUB,          TRSUP,          TCSUB,          TCSUP,          TLSUB,
+    TLSUP,          TFROM,          TTO,            TUOPER,         TBOPER,
+    // Set theory
+    TSETN,          TSETZ,          TSETQ,          TSETR,          TSETC,
+    TIN,            TNOTIN,         TNI,            TEMPTYSET,      // Insideout
+    TSUBSET,        TSUBSETEQ,      TSUPSET,        TSUPSETEQ,      // Subsupset
+    TNSUBSET,       TNSUPSET,       TNSUBSETEQ,     TNSUPSETEQ,     // Not subsupset
+    TINTERSECT,     TUNION,         TSETMINUS,      TSETQUOTIENT,   // +-/
+    TALEPH,         TWP,            TINFINITY,                      // Abstract sets
+    TFORALL,        TEXISTS,        TNOTEXISTS,                     // Existential
+    // Font
+    TFONT,          TSIZE,          TCOLOR,         TPHANTOM,       // Basic
+    TITALIC,        TNITALIC,       TBOLD,          TNBOLD,         // Bold ital
+    TALIGNL,        TALIGNC,        TALIGNR,                        // Align
+    TUNDERLINE,     TOVERLINE,      TOVERSTRIKE,    TBAR,           // Lines
+    TFIXED,         TSANS,          TSERIF,                         // Types
+    TACUTE,         TGRAVE,         THAT,           TBREVE,         // Accents
+    TWIDEVEC,       TWIDEHARPOON,   TWIDETILDE,     TWIDEHAT,       // Wide math
+    TVEC,           THARPOON,       TTILDE,         TCIRCLE,        // math
+    TCHECK,
+    TTEXT,          TNUMBER,        TCHARACTER,     TIDENT,         // Content type
+    // Brackets
+    TLEFT,          TRIGHT,         TUNDERBRACE,    TOVERBRACE,     // Scalable, upsidedown
+    TLGROUP,        TRGROUP,        TLPARENT,       TRPARENT,       // Structural
+    TLBRACKET,      TRBRACKET,      TLDBRACKET,     TRDBRACKET,     // Bracket x1 & x2
+    TLCEIL,         TRCEIL,         TLFLOOR,        TRFLOOR,        // Reals -> Wholes
+    TLANGLE,        TRANGLE,        TLBRACE,        TRBRACE,        // <x> {x}
+    // Brackets Lines
+    TLLINE,         TRLINE,         TLDLINE,        TRDLINE,        TMLINE,
+    // Differencial calculus
+    TNABLA,         TPARTIAL,       TFOURIER,       TLAPLACE,       // Derivative, Transformation
+    TINTD,          TINT,           TIINT,          TIIINT,         // Integral
+    TLINT,          TLLINT,         TLLLINT,                        // Circuit integral
+    TDOT,           TDDOT,          TDDDOT,                         // Derivative dots
     // Function
     TFUNC,          TLN,            TLOG,           TEXP,           // Exp - Log
     TSIN,           TCOS,           TTAN,           TCOT,           // Trigo
     TSINH,          TCOSH,          TTANH,          TCOTH,          // Trigo hyperbolic
     TASIN,          TACOS,          TATAN,          TACOT,          // Arctrigo
     TASINH,         TACOSH,         TATANH,         TACOTH,         // Arctrigo hyperbolic
+    TSQRT,          TNROOT,         TFACT,          TABS,           // roots, n! |z|
     // Color
     TRGB,           TRGBA,          THEX,
     TAQUA,          TBLACK,         TBLUE,          TCYAN,          TFUCHSIA,
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 053c7e04dc06..1e2f295c3e09 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -98,7 +98,7 @@ const SmElementDescr SmElementsControl::m_aSetOperationsList[] =
     {RID_XINY, RID_XINY_HELP}, {RID_XNOTINY, RID_XNOTINY_HELP}, {RID_XOWNSY, RID_XOWNSY_HELP},
     {nullptr, nullptr},
     {RID_XINTERSECTIONY, RID_XINTERSECTIONY_HELP}, {RID_XUNIONY, RID_XUNIONY_HELP},
-    {RID_XSETMINUSY, RID_XSETMINUSY_HELP}, {RID_XSLASHY, RID_XSLASHY_HELP},
+    {RID_XSETMINUSY, RID_XSETMINUSY_HELP}, {RID_XSETQUOTIENTY, RID_XSETQUOTIENTY_HELP},
     {RID_XSUBSETY, RID_XSUBSETY_HELP}, {RID_XSUBSETEQY, RID_XSUBSETEQY_HELP},
     {RID_XSUPSETY, RID_XSUPSETY_HELP}, {RID_XSUPSETEQY, RID_XSUPSETEQY_HELP},
     {RID_XNSUBSETY, RID_XNSUBSETY_HELP}, {RID_XNSUBSETEQY, RID_XNSUBSETEQY_HELP},
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 6d7e1891b762..13898f6edc0d 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -235,9 +235,10 @@ const SmTokenTableEntry aTokenTable[] =
     { "sans", TSANS, '\0', TG::Font, 0},
     { "serif", TSERIF, '\0', TG::Font, 0},
     { "setC" , TSETC, MS_SETC, TG::Standalone, 5},
-    { "setminus", TBACKSLASH, MS_BACKSLASH, TG::Product, 0 },
+    { "setminus", TSETMINUS, MS_BACKSLASH, TG::Product, 0 },
     { "setN" , TSETN, MS_SETN, TG::Standalone, 5},
     { "setQ" , TSETQ, MS_SETQ, TG::Standalone, 5},
+    { "setquotient", TSETQUOTIENT, MS_SLASH, TG::Product, 0 },
     { "setR" , TSETR, MS_SETR, TG::Standalone, 5},
     { "setZ" , TSETZ, MS_SETZ, TG::Standalone, 5},
     { "sim", TSIM, MS_SIM, TG::Relation, 0},


More information about the Libreoffice-commits mailing list