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(compiler): add query statement support in pattern action #16
Added a new field 'isQueryStatement' in PatternAction and PatternActionTransform classes to identify query statements. Introduced a new QueryStatementProcessor class to handle query statement processing. Updated PatternActionProcessor to use QueryStatementProcessor for query statements and improved error handling for unknown pattern processor types.
- Loading branch information
Showing
5 changed files
with
38 additions
and
12 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
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
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
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
17 changes: 17 additions & 0 deletions
17
...ng/src/main/kotlin/com/phodal/shirelang/compiler/patternaction/QueryStatementProcessor.kt
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.phodal.shirelang.compiler.patternaction | ||
|
||
import com.intellij.openapi.editor.Editor | ||
import com.intellij.openapi.project.Project | ||
import com.phodal.shirelang.compiler.hobbit.HobbitHole | ||
|
||
class QueryStatementProcessor(myProject: Project, editor: Editor, hole: HobbitHole) { | ||
fun execute(transform: PatternActionTransform): String { | ||
val fromStmt = transform.patternActionFuncs.find { it is PatternActionFunc.From } as PatternActionFunc.From | ||
val selectStmt = | ||
transform.patternActionFuncs.find { it is PatternActionFunc.Select } as PatternActionFunc.Select | ||
val whereStmt = transform.patternActionFuncs.find { it is PatternActionFunc.Where } as PatternActionFunc.Where | ||
|
||
|
||
return "Test" | ||
} | ||
} |