generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shirelang): add support for finish flags in output control flow #24
- Added support for defining finish flags in the output control flow to control the flow based on specific conditions.
- Loading branch information
Showing
3 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,7 @@ nav_order: 8 | |
|
||
Output Control Flow 用于定义输出的控制流,支持以下几种控制流: | ||
|
||
- `if`:条件判断。 | ||
- `case`:多条件判断。 | ||
元素: | ||
|
||
- onFlag: | ||
- onCondition: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,4 +84,3 @@ class ShireParsingTest : ParsingTestCase("parser", "shire", ShireParserDefinitio | |
doTest(true) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
--- | ||
onProcessing: [""] | ||
onResponseFinish: ["VerifyCode", "RunCode"] | ||
afterFinish: OpenFile | ||
menuActivate: "xxx" | ||
onStreamStart: [""] | ||
onStreamFinish: ["VerifyCode", "RunCode"] | ||
finishFlag: { | ||
flags: { | ||
"variable-sucesss": $selection.length > 1 | ||
"jsonpath-success": jsonpath("$.phoneNumbers[:1].type") | ||
"fail": '$content.contains("error") && $content.regex("exception")' | ||
} | ||
case flags { | ||
"variable-sucesss" { done } | ||
"jsonpath-success" { task() } | ||
"fail" { task() } | ||
} | ||
} | ||
--- | ||
|
||
afterStreamFinish: | ||
|
||
- //bookstore/book[price>35] | ||
- $.phoneNumbers[:1].type | ||
- Regex |