aboutsummaryrefslogtreecommitdiff
path: root/gen/org/jetbrains/markdown/lexer/_MarkdownLexer.flex
blob: f5aab899ec8fbcf4dffb53473d506b6d72807dd7 (plain)
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
package org.jetbrains.markdown.lexer;

import com.intellij.lexer.*;
import com.intellij.psi.tree.IElementType;
import static org.jetbrains.markdown.MarkdownElementTypes.*;

%%

%{
  public _MarkdownLexer() {
    this((java.io.Reader)null);
  }
%}

%public
%class _MarkdownLexer
%implements FlexLexer
%function advance
%type IElementType
%unicode

Newline="\r"|"\n"|"\r\n"
Spacechar=[\ \t\f]
Number=[0-9]+(\.[0-9]*)?
String=[^~:{}$\*_`&\[\]()<!#\\ \t\n\r]+
AnyChar=.
Line=!'\r' !'\n' .* {Newline}

%%
<YYINITIAL> {
  {Spacechar}                         { return SPACECHAR; }
  {Newline}                             { return NEWLINE; }
  "\\357\\273\\277"                 { return BOM; }


  {Number}                          { return NUMBER; }
  {String}                          { return STRING; }

  {AnyChar}                         { return ANYCHAR; }

  [^] { return com.intellij.psi.TokenType.BAD_CHARACTER; }
}