-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdenshi-parser-config.toml
162 lines (125 loc) · 5.98 KB
/
denshi-parser-config.toml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#Matcthes can be inverted with ^ in front of the identifier
#TODO Struct highlighting? struct.test[struct.something].something_else <= ????
#TODO look at all the signals defined inside of an 'always' block, and define 'clock groups'
# Also return 'always_regions'
# Python checks if cursor is within an always_region -> highlights signals based on:
# If they belong to the current clock
# If they belong to the current clock + a different clock (Clocked in two separate domains)
# If they belong to a different clock.
#
# Need to keep track of the always_ff block that each signal is assigned in. Use the 'locate' of the keyword?
# -> So, will need to
#
#TODO:
# Continuous Assignment should only be done into output port - anything else highlighted red
# input/output/inout highlighted different colours
#TODO INPUT/OUTPUT/INOUT keywords to match into different groups, so that
# input/output/inout/whatever are highlighted in different colour
#TODO functions
#TODO different colouring for types
[colors]
denshiComment = "ctermfg=8 guifg=NvimLightGray4 cterm=italic"
denshiVariableDefinition = "ctermfg=6 guifg=NvimLightGreen"
denshiParameterDefinition = "ctermfg=6 guifg=NvimLightGreen cterm=italic"
denshiParameterUse = "ctermfg=6 guifg=NvimLightGreen cterm=italic,underline"
denshiEnumDefinition = "ctermfg=5 guifg=NvimLightBlue cterm=italic"
denshiBlockIdentifier = "ctermfg=8 guifg=NvimLightGray4 cterm=italic"
denshiClockOrReset = "ctermfg=4 guifg=MediumPurple1 cterm=bold" #dark blue?
denshiUndefined = "ctermfg=1 cterm=underline" #red
denshiModuleIdentifier = "ctermfg=7 guifg=NvimLightGray2 cterm=bold"
denshiInstantiation = "ctermfg=15 cterm=bold"
#denshiIdentifier = "ctermfg=2"
denshiIdentifier = "ctermfg=148 guifg=NvimLightYellow"
denshiSubroutineCall = "ctermfg=5 guifg=NvimLightBlue"
denshiSubroutineDefinition = "ctermfg=5 guifg=NvimLightBlue"
denshiSeparator = "ctermfg=1" #blue
denshiKeyword = "ctermfg=7 guifg=NvimLightGray2 cterm=bold"
denshiAlways = "ctermfg=15 cterm=bold"
denshiBeginEnd = "ctermfg=7 guifg=NvimLightGray2 cterm=bold"
denshiAssignmentSymbol = "ctermfg=15 cterm=bold"
denshiTypeIdentifier = "ctermfg=58 guifg=NvimGreen cterm=bold"
denshiTypeIdentifierDefinition = "ctermfg=58 guifg=NvimGreen cterm=bold"
[denshiModuleIdentifier]
patterns = ["ModuleIdentifier Identifier SimpleIdentifier ^WhiteSpace Locate"]
[denshiComment]
patterns = ["WhiteSpace Comment Locate"]
[denshiInstantiation]
patterns = ["ModuleDeclarationAnsi ModuleInstantiation NameOfInstance ^WhiteSpace Locate"]
[denshiClockOrReset]
patterns = ["AlwaysConstruct ProceduralTimingControlStatement EventControl SimpleIdentifier ^WhiteSpace Locate"]
[denshiAlways]
patterns = ["AlwaysConstruct AlwaysKeyword Keyword ^WhiteSpace Locate"]
[denshiAssignmentSymbol] #FIXME there is a bug with the matcher for the one below
patterns = ["AlwaysConstruct NonblockingAssignment ^Expression Symbol ^WhiteSpace Locate"]
[denshiTypeIdentifier]
patterns = [
"NetTypeIdentifier ^WhiteSpace Locate",
"ModuleOrGenerateItemDeclaration StructUnionMember DataTypeOrVoid DataType PsClassIdentifier ClassIdentifier ^WhiteSpace Locate",
]
[denshiTypeIdentifierDefinition]
patterns = ["TypeDeclaration TypeIdentifier ^WhiteSpace Locate"]
#[denshiVariable]
#patterns = [
# "VariableIdentifier ^WhiteSpace Locate",
# "PortIdentifier ^WhiteSpace Locate",
# "NamedPortConnectionIdentifier HierarchicalIdentifier ^WhiteSpace Locate",
# "VariableDeclAssignment HierarchicalIdentifier ^WhiteSpace Locate"
#]
#ifDefined = "denshiVariableDef"
#orElse = "denshiIdentifierNotDefined"
[denshiParameterDefinition]
patterns = [
"ParameterIdentifier ^WhiteSpace Locate",
]
[denshiEnumDefinition]
patterns = [
"EnumIdentifier ^WhiteSpace Locate",
]
[denshiIdentifier]
patterns = [
"NamedParameterAssignment HierarchicalIdentifier ^WhiteSpace Locate",
"BitSelect HierarchicalIdentifier ^WhiteSpace Locate",
"ModuleInstantiation ListOfPortConnections HierarchicalIdentifier ^WhiteSpace Locate",
"VariableDeclAssignment HierarchicalIdentifier ^WhiteSpace Locate",
"AlwaysConstruct VariableDeclAssignment VariableIdentifier ^WhiteSpace Locate",
"HierarchicalVariableIdentifier HierarchicalIdentifier ^WhiteSpace Locate",
"NonblockingAssignment Expression HierarchicalIdentifier Identifier ^WhiteSpace Locate",
#"VariableDeclAssignment VariableIdentifier ^WhiteSpace Locate",
]
[denshiSubroutineCall]
patterns = [
"SubroutineCallStatement SubroutineCall SystemTfIdentifier ^WhiteSpace Locate"
]
[denshiSubroutineDefinition]
patterns = [
"FunctionBodyDeclaration FunctionIdentifier ^WhiteSpace Locate"
]
[denshiVariableDefinition]
patterns = [
"ModuleOrGenerateItemDeclaration DataDeclaration DataDeclarationVariable VariableIdentifier ^WhiteSpace Locate",
"ModuleOrGenerateItemDeclaration TypeDeclaration TypeDeclarationDataType VariableIdentifier ^WhiteSpace Locate",
"ModuleOrGenerateItemDeclaration NetDeclaration NetDeclarationNetTypeIdentifier NetDeclAssignment NetIdentifier ^WhiteSpace Locate",
]
#Generate 'for' identifier
[denshiBlockIdentifier]
patterns = [
"BlockIdentifier ^WhiteSpace Identifier ^WhiteSpace Locate", #begin/end : <here>
]
#[denshiIdentifier]
#patterns = [
# "TfIdentifier SimpleIdentifier ^WhiteSpace Locate",
# "GenvarIdentifier ^WhiteSpace Locate",
# "HierarchicalIdentifier ^WhiteSpace Locate"
#]
#ifDefined = "denshiVariable"
#orElse = "denshiIdentifierNotDefined"
#This means the block will only trigger if we have a 'denshiBlockIdentifer' that has the same text as this
[denshiKeyword]
patterns = [
"DataType Keyword ^WhiteSpace Locate",
"ParameterDeclarationParam Keyword ^WhiteSpace Locate",
"SourceText ^ParameterDeclarationParam ^AlwaysConstruct Keyword ^WhiteSpace Locate",
"StatementItem ConditionalStatement Keyword ^WhiteSpace Locate",
"EdgeIdentifier Keyword ^WhiteSpace Locate",
"SourceText AlwaysConstruct SeqBlock ^Statement Keyword ^WhiteSpace Locate"
]