File tree Expand file tree Collapse file tree 4 files changed +11
-16
lines changed Expand file tree Collapse file tree 4 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import com.intellij.psi.TokenType;
27
27
28
28
IDENTIFIER = [ a- zA- Z0- 9] ( [ _\- a- zA- Z0- 9] *)
29
29
REF_BLOCK =( "@" {IDENTIFIER} )
30
- TEXT_SEGMENT =.*
30
+ TEXT_SEGMENT = [^ $/@ ] +
31
31
NEWLINE =\n|\r\n
32
32
33
33
%{
Original file line number Diff line number Diff line change 13
13
elementTypeHolderClass="cc.unitmesh.language.psi.DevInTypes"
14
14
elementTypeClass="cc.unitmesh.language.psi.DevInElementType"
15
15
tokenTypeClass="cc.unitmesh.language.lexer.DevInTokenType"
16
+
17
+ tokens=[
18
+ ]
16
19
}
17
20
18
- DevInFile ::= (REF_BLOCK | TEXT_SEGMENT | NEWLINE)*
21
+ DevInFile ::= (REF_BLOCK | TEXT_SEGMENT | CODE_FENCE | NEWLINE)*
22
+
23
+ //used ::= (AGENT | COMMAND | VARIABLE) IDENTIFIER
Original file line number Diff line number Diff line change 1
1
FILE
2
- PsiElement(DevInTokenType.TEXT_SEGMENT)('你好 @hello-world sm')
2
+ PsiElement(DevInTokenType.TEXT_SEGMENT)('你好 ')
3
+ PsiElement(DevInTokenType.REF_BLOCK)('@hello-world')
4
+ PsiElement(DevInTokenType.TEXT_SEGMENT)(' sm')
Original file line number Diff line number Diff line change 1
1
FILE
2
- PsiElement(DevInTokenType.TEXT_SEGMENT)('```java')
3
- PsiElement(DevInTokenType.NEWLINE)('\n')
4
- PsiElement(DevInTokenType.TEXT_SEGMENT)('public class Main {')
5
- PsiElement(DevInTokenType.NEWLINE)('\n')
6
- PsiElement(DevInTokenType.TEXT_SEGMENT)(' public static void main(String[] args) {')
7
- PsiElement(DevInTokenType.NEWLINE)('\n')
8
- PsiElement(DevInTokenType.TEXT_SEGMENT)(' System.out.println("Hello, world!");')
9
- PsiElement(DevInTokenType.NEWLINE)('\n')
10
- PsiElement(DevInTokenType.TEXT_SEGMENT)(' }')
11
- PsiElement(DevInTokenType.NEWLINE)('\n')
12
- PsiElement(DevInTokenType.TEXT_SEGMENT)('}')
13
- PsiElement(DevInTokenType.NEWLINE)('\n')
14
- PsiElement(DevInTokenType.TEXT_SEGMENT)('```')
2
+ PsiElement(DevInTokenType.TEXT_SEGMENT)('```java\npublic class Main {\n public static void main(String[] args) {\n System.out.println("Hello, world!");\n }\n}\n```')
You can’t perform that action at this time.
0 commit comments