Skip to content

Commit 9d4ce28

Browse files
committed
CE-117 include
1 parent e1f8bdc commit 9d4ce28

17 files changed

Lines changed: 394 additions & 252 deletions

File tree

gen/oap/application/plugin/gen/OapTypes.java

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/oap/application/plugin/gen/parser/OapParser.java

Lines changed: 32 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/oap/application/plugin/gen/parser/_OapLexer.java

Lines changed: 225 additions & 226 deletions
Large diffs are not rendered by default.

gen/oap/application/plugin/gen/psi/OapModuleInclude.java

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/oap/application/plugin/gen/psi/impl/OapModuleIncludeImpl.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

grammars/_OapLexer.flex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ WHITE_SPACE=[ \t\x0B\f\r]+
9999
COMMENT=("//"|"#")[^\n]*
100100
STRING=\"(\\\"|[^\"])*\"
101101
UNQUOTED_STRING=([:jletterdigit:]|[-/\.]) ([:jletterdigit:]|[-/\. ])*
102-
CLASS_NAME=([:jletter:] [:jletterdigit:]*)("." [:jletter:] [:jletterdigit:]*)+
102+
CLASS_NAME=([:jletter:] [:jletterdigit:]*)("." [:jletter:] [:jletterdigit:]*)*
103103
FIELD_NAME=[:jletter:] [:jletterdigit:]+
104104
KEY_NAME=[:jletter:] ([:jletterdigit:]|[-/])*
105105

@@ -141,7 +141,7 @@ KEY_NAME=[:jletter:] ([:jletterdigit:]|[-/])*
141141
{BOOL} { return OAP_BOOL; }
142142
"(" { return OAP_LEFTPAREN; }
143143
")" { return OAP_RIGHTPAREN; }
144-
{STRING} { return OAP_INCLUDE_RESOURCE_NAME; }
144+
{STRING} { return OAP_STRING; }
145145

146146
{WHITE_SPACE} { return WHITE_SPACE; }
147147
{NEXTLINE} { yypopState(); return WHITE_SPACE; }

grammars/oap.bnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191

9292
module ::=
9393
[]
94-
module_name_pair
94+
( &'name' module_name_pair )?
9595
( &'enabled' module_enabled )?
9696
( &'dependsOn' module_depends_on )?
9797
( &'include' module_include )*
@@ -484,7 +484,7 @@ configuration_key_value_pair ::=
484484
// ] // configurations
485485

486486
// include required("resource")
487-
module_include ::= 'include' 'required' '(' include_resource_name ')' {
487+
module_include ::= 'include' 'required' '(' string ')' {
488488
pin=1
489489
}
490490
// include required("resource")

src/main/kotlin/oap/application/plugin/highlight/OapColorSettingsPage.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class OapColorSettingsPage : ColorSettingsPage {
3030
| <module_dependson_module_name>b</module_dependson_module_name>
3131
|]
3232
|
33+
|<include>include</include> <required>required</required>("resource")
34+
|
3335
|<moduleservices>services</moduleservices> <brackets>{</brackets>
3436
| <moduleservice>service-name</moduleservice> <brackets>{</brackets>
3537
| <service_enabled>enabled</service_enabled> <eq>=</eq> <Boolean>false</Boolean>
@@ -85,6 +87,9 @@ class OapColorSettingsPage : ColorSettingsPage {
8587
"moduledependson" to OapHighlighterColors.ModuleDependsOn,
8688
"module_dependson_module_name" to OapHighlighterColors.ModuleDependsOnModuleName,
8789

90+
"include" to OapHighlighterColors.Include,
91+
"required" to OapHighlighterColors.Required,
92+
8893
"moduleservices" to OapHighlighterColors.ModuleServices,
8994
"moduleservice" to OapHighlighterColors.ModuleService,
9095
"service_enabled" to OapHighlighterColors.ModuleServiceEnabled,
@@ -138,6 +143,10 @@ class OapColorSettingsPage : ColorSettingsPage {
138143
"Module name" to OapHighlighterColors.ModuleName,
139144
"Module dependsOn" to OapHighlighterColors.ModuleDependsOn,
140145
"Module dependsOn [module name]" to OapHighlighterColors.ModuleDependsOnModuleName,
146+
147+
"Module include" to OapHighlighterColors.Include,
148+
"Module include required" to OapHighlighterColors.Required,
149+
141150
"Services" to OapHighlighterColors.ModuleServices,
142151
"Service Name" to OapHighlighterColors.ModuleService,
143152
"Service enabled/disabled" to OapHighlighterColors.ModuleServiceEnabled,

src/main/kotlin/oap/application/plugin/highlight/OapHighlighterColors.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ object OapHighlighterColors {
2020
val ModuleDependsOn = key("OAP_MODULE_DEPENDS_ON", DefaultLanguageHighlighterColors.KEYWORD)
2121
val ModuleDependsOnModuleName = key("OAP_MODULE_DEPENDS_ON_MODULE_NAME", DefaultLanguageHighlighterColors.LABEL)
2222

23+
val Include = key("OAP_INCLUDE", DefaultLanguageHighlighterColors.KEYWORD)
24+
val Required = key("OAP_REQUIRED", DefaultLanguageHighlighterColors.KEYWORD)
25+
2326
val ModuleServices = key("OAP_MODULE_SERVICES", DefaultLanguageHighlighterColors.KEYWORD)
2427
val ModuleService = key("OAP_MODULE_SERVICE", DefaultLanguageHighlighterColors.INSTANCE_FIELD)
2528
val ModuleServiceEnabled = key("OAP_MODULE_SERVICE_ENABLED", DefaultLanguageHighlighterColors.KEYWORD)

src/main/kotlin/oap/application/plugin/highlight/OapSyntaxHighlightingAnnotator.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class OapSyntaxHighlightingAnnotator : Annotator {
2525
OapTypes.OAP_ID_DEPENDS_ON -> annot(OapHighlighterColors.ModuleDependsOn)
2626
OapTypes.OAP_MODULE_DEPENDS_ON_NAME -> annot(OapHighlighterColors.ModuleDependsOnModuleName)
2727

28+
OapTypes.OAP_ID_INCLUDE -> annot(OapHighlighterColors.Include)
29+
OapTypes.OAP_ID_REQUIRED -> annot(OapHighlighterColors.Required)
30+
2831
OapTypes.OAP_ID_SERVICES -> annot(OapHighlighterColors.ModuleServices)
2932
OapTypes.OAP_SERVICE_NAME -> annot(OapHighlighterColors.ModuleService)
3033
OapTypes.OAP_ID_ENABLED -> annot(OapHighlighterColors.ModuleServiceEnabled)

0 commit comments

Comments
 (0)