diff options
author | albert-github <albert.tests@gmail.com> | 2018-10-01 16:58:03 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2018-10-01 16:58:03 (GMT) |
commit | 47fee387821113956e10fffa79ea22062de8c817 (patch) | |
tree | 7762308ebbeb2f3465b6515450e2314ab048eb6f /src/doctokenizer.l | |
parent | d7d4d5c443887cc63211febe40d43f26dfe41bc0 (diff) | |
download | Doxygen-47fee387821113956e10fffa79ea22062de8c817.zip Doxygen-47fee387821113956e10fffa79ea22062de8c817.tar.gz Doxygen-47fee387821113956e10fffa79ea22062de8c817.tar.bz2 |
issue_6517: Emoji support
Added issue support for the different output types.
- Sources of the emoji
- based on the Unicode definition v11.0:
- https://unicode.org/emoji/charts/full-emoji-list.html
- http://www.unicode.org/emoji/charts/full-emoji-modifiers.html
- github definition list:
- https://api.github.com/emojis
- Input of emoji: :<test>: with the restriction that direct after the opening colon and direct before the closing colon no space is allowed
- doctokinizer.l, adding detection of emoji and new command `\:`
- doktokinizer.h, adding "word" type TK_EMOJI
- docparser.* handling of new "word" type TK_EMOJI (analogous to HTML Entities), handling of new command `\:`
- cmdmapper,cpp, cmdmapper.h, adding new command `\:`
- htmlentity.cpp, adding new definition required for new command `\:`
- Emoji
- emoji.cpp, emoji.h, class for handling emoji analogous to HTML Entities, including small directions on how to update the code when a new emoji is defined. Not everything is converted to lowercase for comparison and accents are removed.
- doxygen.cpp possibility to create list of supported emoji
- handling emoji for output types (analogous to HTML Entities), see documentation for different output types
- docparser.h, *docvisitor.*
- rtfdocvisitor.* converting output to UTF-16 (based on http://scruss.com/blog/2017/03/12/in-the-unlikely-event-you-need-to-represent-emoji-in-rtf-using-perl/)
- latexdocvisitor.*, handling arguments for emoji in output (see also latexgen.cpp for meaning of the arguments of doxygenemoji).
- latexgen.cpp, adding new latex command for doxygen (doxygenemoji) and prevent too many open file (code before documentclass)
- config.xml, definition of `LATEX_EMOJI_DIRECTORY` with path to images required for LaTeX output
- Documentation:
- emojisup.doc, user description
- commands.doc, description of new command `\:`
- index.doc, reference to emoji chapter
- xmlcmds.doc, adjust reference to next chapter as a new chapter is added
- Doxyfile*, adding emoji chapter
Build system
- CMakeLists.txt adding new files
Diffstat (limited to 'src/doctokenizer.l')
-rw-r--r-- | src/doctokenizer.l | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 3118cfd..7f6c98f 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -122,6 +122,7 @@ const char *tokToString(int token) case TK_NEWPARA: return "TK_NEWPARA"; case TK_RCSTAG: return "TK_RCSTAG"; case TK_URL: return "TK_URL"; + case TK_EMOJI: return "TK_EMOJI"; } return "ERROR"; } @@ -332,6 +333,7 @@ CMD ("\\"|"@") WS [ \t\r\n] NONWS [^ \t\r\n] BLANK [ \t\r] +EMOJI (":"[a-z_A-Z0-9\x80-\xFF"'+()&\*\.!,#-]":"|":"[a-z_A-Z0-9\x80-\xFF"'+()&\*\.!,#-][a-z_A-Z0-9\x80-\xFF "'+()&\*\.!,#-]*[a-z_A-Z0-9\x80-\xFF"'+()&\*\.!,#-]":") ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]* PHPTYPE [\\:a-z_A-Z0-9\x80-\xFF\-]+ @@ -358,6 +360,7 @@ SPCMD1 {CMD}([a-z_A-Z][a-z_A-Z0-9]*|{VERBATIM}|"--"|"---") SPCMD2 {CMD}[\\@<>&$#%~".+|-] SPCMD3 {CMD}form#[0-9]+ SPCMD4 {CMD}"::" +SPCMD5 {CMD}":" INOUT "inout"|"in"|"out"|("in"{BLANK}*","{BLANK}*"out")|("out"{BLANK}*","{BLANK}*"in") PARAMIO {CMD}param{BLANK}*"["{BLANK}*{INOUT}{BLANK}*"]" VARARGS "..." @@ -583,6 +586,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} } <St_Para>{SPCMD1} | <St_Para>{SPCMD2} | +<St_Para>{SPCMD5} | <St_Para>{SPCMD4} { /* special command */ g_token->name = yytext+1; g_token->name = g_token->name.stripWhiteSpace(); @@ -674,6 +678,10 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext; return TK_SYMBOL; } +<St_Para,St_Text>{EMOJI} { /* emoji symbol */ + g_token->name = yytext; + return TK_EMOJI; + } /********* patterns for linkable words ******************/ @@ -920,6 +928,10 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext; return TK_SYMBOL; } +<St_TitleN>{EMOJI} { /* emoji */ + g_token->name = yytext; + return TK_EMOJI; + } <St_TitleN>{HTMLTAG} { } <St_TitleN>{SPCMD1} | @@ -956,6 +968,10 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext; return TK_SYMBOL; } +<St_TitleQ>{EMOJI} { /* emoji */ + g_token->name = yytext; + return TK_EMOJI; + } <St_TitleQ>{SPCMD1} | <St_TitleQ>{SPCMD2} { /* special command */ g_token->name = yytext+1; @@ -1087,6 +1103,10 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext; return TK_SYMBOL; } +<St_Ref2>{EMOJI} { /* emoji */ + g_token->name = yytext; + return TK_EMOJI; + } <St_Ref2>{SPCMD1} | <St_Ref2>{SPCMD2} { /* special command */ g_token->name = yytext+1; |