]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_hash.C
fix typo that put too many include paths for most people
[lyx.git] / src / mathed / math_hash.C
index dc1de913e526a21c6f9962f277682bc12eec70a8..dcc7643a130755148559b5ec585fee340afeadd8 100644 (file)
@@ -1,28 +1,33 @@
 #include <config.h>
 
 #include "math_parser.h"
+#include "math_metricsinfo.h"
 #include "lyxlex.h"
 #include "debug.h"
 #include "support/filetools.h" // LibFileSearch
 
 #include <map>
 
+using std::map;
 
 namespace {
 
-std::map<string, latexkeys> theWordList;
+// file scope
+typedef map<string, latexkeys> WordList;
+WordList theWordList;
 
 
 struct key_type {
        ///
        char const * name;
        ///
-       short token;
+       MathTokenEnum token;
        ///
        unsigned int id;
 };
 
-key_type wordlist_array[] = 
+
+key_type wordlist_array[] =
 {
        {"!",  LM_TK_SPACE, 0},
        {"#",  LM_TK_SPECIAL, '#'},
@@ -37,7 +42,6 @@ key_type wordlist_array[] =
        {";",  LM_TK_SPACE, 3},
        {"Pr",  LM_TK_FUNCLIM, 0},
        {"[",  LM_TK_BEGIN, LM_OT_EQUATION},
-       {"\\",  LM_TK_NEWLINE, static_cast<unsigned>(-1)}, // -1 needed in mathed_parse_lines!
        {"]",  LM_TK_END, LM_OT_EQUATION},
        {"_",  LM_TK_SPECIAL, '_'},
        {"acute",  LM_TK_DECORATION, 0},
@@ -62,15 +66,17 @@ key_type wordlist_array[] =
        {"coth",  LM_TK_FUNC, 0},
        {"csc",  LM_TK_FUNC, 0},
        {"ddot",  LM_TK_DECORATION, 0},
+       {"dddot",  LM_TK_DECORATION, 0},
        {"ddots",  LM_TK_DOTS, 0},
        {"deg",  LM_TK_FUNC, 0},
        {"det",  LM_TK_FUNCLIM, 0},
        {"dim",  LM_TK_FUNC, 0},
-       //{"displaystyle",  LM_TK_STY, LM_ST_DISPLAY},
+       {"displaystyle",  LM_TK_STY, LM_ST_DISPLAY},
        {"dot",  LM_TK_DECORATION, 0},
        {"end",  LM_TK_END, 0},
        {"exp",  LM_TK_FUNC, 0},
        {"frac",  LM_TK_FRAC, 0},
+       {"frak",  LM_TK_FONT, LM_TC_EUFRAK},
        {"gcd",  LM_TK_FUNCLIM, 0},
        {"grave",  LM_TK_DECORATION, 0},
        {"hat",  LM_TK_DECORATION, 0},
@@ -78,7 +84,6 @@ key_type wordlist_array[] =
        {"inf",  LM_TK_FUNCLIM, 0},
        {"it",  LM_TK_OLDFONT, LM_TC_IT},
        {"ker",  LM_TK_FUNC, 0},
-       {"kern",  LM_TK_KERN, 0},
        {"label",  LM_TK_LABEL, 0},
        {"lefteqn",  LM_TK_LEFTEQN, 1},
        {"ldots",  LM_TK_DOTS, 0},
@@ -90,9 +95,12 @@ key_type wordlist_array[] =
        {"limsup",  LM_TK_FUNCLIM, 0},
        {"ln",  LM_TK_FUNC, 0},
        {"log",  LM_TK_FUNC, 0},
+       {"lyxbox",  LM_TK_BOX, 0},
+       {"lyxnegspace",  LM_TK_SPACE, 6},
        {"mathbb",  LM_TK_FONT, LM_TC_BB},
        {"mathbf",  LM_TK_FONT, LM_TC_BF},
        {"mathcal",  LM_TK_FONT, LM_TC_CAL},
+       {"mathfrak",  LM_TK_FONT, LM_TC_EUFRAK},
        {"mathit",  LM_TK_FONT, LM_TC_IT},
        {"mathnormal",  LM_TK_FONT, LM_TC_VAR},
        {"mathrm",  LM_TK_FONT, LM_TC_RM},
@@ -110,14 +118,15 @@ key_type wordlist_array[] =
        {"overleftarrow",  LM_TK_DECORATION, 0},
        {"overline",  LM_TK_DECORATION, 0},
        {"overrightarrow",  LM_TK_DECORATION, 0},
+       {"overleftrightarrow", LM_TK_DECORATION, 0},
        {"protect",  LM_TK_PROTECT, 0},
        {"qquad",  LM_TK_SPACE, 5},
        {"quad",  LM_TK_SPACE, 4},
        {"right",  LM_TK_RIGHT, 0},
        {"rm",  LM_TK_OLDFONT, LM_TC_RM},
        {"root",  LM_TK_ROOT, 0},
-       //{"scriptscriptstyle",  LM_TK_STY, LM_ST_SCRIPTSCRIPT},
-       //{"scriptstyle",  LM_TK_STY, LM_ST_SCRIPT},
+       {"scriptscriptstyle",  LM_TK_STY, LM_ST_SCRIPTSCRIPT},
+       {"scriptstyle",  LM_TK_STY, LM_ST_SCRIPT},
        {"sec",  LM_TK_FUNC, 0},
        {"sin",  LM_TK_FUNC, 0},
        {"sinh",  LM_TK_FUNC, 0},
@@ -127,11 +136,16 @@ key_type wordlist_array[] =
        {"tan",  LM_TK_FUNC, 0},
        {"tanh",  LM_TK_FUNC, 0},
        {"textrm",  LM_TK_FONT, LM_TC_TEXTRM},
-       //{"textstyle",  LM_TK_STY, LM_ST_TEXT},
+       {"textstyle",  LM_TK_STY, LM_ST_TEXT},
        {"tilde",  LM_TK_DECORATION, 0},
        {"tt",  LM_TK_OLDFONT, LM_TC_TT},
+       {"underbar",  LM_TK_DECORATION, 0},
        {"underbrace",  LM_TK_DECORATION, 0},
+       {"underleftarrow", LM_TK_DECORATION, 0},
        {"underline",  LM_TK_DECORATION, 0},
+       {"underrightarrow", LM_TK_DECORATION, 0},
+       {"underleftrightarrow", LM_TK_DECORATION, 0},
+       {"underset",  LM_TK_UNDERSET, 0},
        {"vdots",  LM_TK_DOTS, 0},
        {"vec",  LM_TK_DECORATION, 0},
        {"widehat",  LM_TK_DECORATION, 0},
@@ -175,6 +189,8 @@ void readSymbols(string const & filename)
                        tmp.id = lex.getInteger();
                if (lex.next())
                        tmp.type = lex.getString();
+               if (lex.next())
+                       tmp.xmlname = lex.getString();
                if (theWordList.find(tmp.name) != theWordList.end())
                        lyxerr << "readSymbols: token " << tmp.name
                               << " already exists.\n";
@@ -183,6 +199,7 @@ void readSymbols(string const & filename)
        }
 }
 
+
 void initSymbols()
 {
        unsigned const n = sizeof(wordlist_array) / sizeof(wordlist_array[0]);
@@ -216,6 +233,6 @@ latexkeys const * in_word_set(string const & str)
                initialized = true;
        }
 
-       std::map<string, latexkeys>::iterator it = theWordList.find(str);
+       WordList::iterator it = theWordList.find(str);
        return (it != theWordList.end()) ? &(it->second) : 0;
 }