From 8d65a8aabda5759844044c042b7d72b557568e89 Mon Sep 17 00:00:00 2001 From: Saigut Date: Wed, 8 Jun 2022 18:57:11 +0800 Subject: [PATCH] Update version to 0.1.8; fix a structure view issue; reduce debug log --- src/main/parser/AST.java | 1 + src/main/parser/SchemePsiCreator.java | 38 ++++++++++++++++++- src/main/psi/impl/SchemeFormQuasiquote.java | 11 ++++++ src/main/psi/impl/SchemeFormQuasisyntax.java | 11 ++++++ src/main/psi/impl/SchemeFormQuote.java | 11 ++++++ src/main/psi/impl/SchemeFormSyntax.java | 11 ++++++ src/main/psi/impl/SchemeFormUnquote.java | 11 ++++++ .../psi/impl/SchemeFormUnquoteSplicing.java | 11 ++++++ src/main/psi/impl/SchemeFormUnsyntax.java | 11 ++++++ .../psi/impl/SchemeFormUnsyntaxSplicing.java | 11 ++++++ .../structure/SchemeStructureViewElement.java | 5 ++- 11 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 src/main/psi/impl/SchemeFormQuasiquote.java create mode 100644 src/main/psi/impl/SchemeFormQuasisyntax.java create mode 100644 src/main/psi/impl/SchemeFormQuote.java create mode 100644 src/main/psi/impl/SchemeFormSyntax.java create mode 100644 src/main/psi/impl/SchemeFormUnquote.java create mode 100644 src/main/psi/impl/SchemeFormUnquoteSplicing.java create mode 100644 src/main/psi/impl/SchemeFormUnsyntax.java create mode 100644 src/main/psi/impl/SchemeFormUnsyntaxSplicing.java diff --git a/src/main/parser/AST.java b/src/main/parser/AST.java index f2d4b11..ea2cdbb 100644 --- a/src/main/parser/AST.java +++ b/src/main/parser/AST.java @@ -76,6 +76,7 @@ public interface AST AST_BASIC_ELE_BOOL, AST_BASIC_ELE_NUM, AST_BASIC_ELE_CHAR, AST_BASIC_ELE_STR, AST_BASIC_ELE_KEYWORD, AST_BASIC_ELE_PROCEDURE, AST_BASIC_ELE_SYMBOL, AST_ELE_VECTOR, + AST_BODY_OF_FORM, AST_FORM_DEFINE, AST_FORM_DEFINE_RECORD_TYPE, AST_FORM_DEFINE_SYNTAX, AST_FORM_PROCEDURE, AST_FORM_CALL_PROCEDURE, AST_FORM_LET, AST_FORM_SET, AST_FORM_QUOTE, AST_FORM_QUASIQUOTE, AST_FORM_CAR, AST_FORM_CDR, AST_FORM_CONS, AST_FORM_LIST, diff --git a/src/main/parser/SchemePsiCreator.java b/src/main/parser/SchemePsiCreator.java index dbe9a4e..1338951 100644 --- a/src/main/parser/SchemePsiCreator.java +++ b/src/main/parser/SchemePsiCreator.java @@ -104,6 +104,10 @@ else if (elementType == AST.AST_FORM_DEFINE_SYNTAX) { return new SchemeFormDefineSyntax(node); } + else if (elementType == AST.AST_FORM_DO) + { + return new SchemeFormDo(node); + } else if (elementType == AST.AST_FORM_IF) { return new SchemeFormIf(node); @@ -128,6 +132,18 @@ else if (elementType == AST.AST_FORM_OR) { return new SchemeFormOr(node); } + else if (elementType == AST.AST_FORM_QUASIQUOTE) + { + return new SchemeFormQuasiquote(node); + } + else if (elementType == AST.AST_FORM_QUASISYNTAX) + { + return new SchemeFormQuasisyntax(node); + } + else if (elementType == AST.AST_FORM_QUOTE) + { + return new SchemeFormQuote(node); + } else if (elementType == AST.AST_FORM_PROCEDURE) { return new SchemeFormProcedure(node); @@ -136,10 +152,30 @@ else if (elementType == AST.AST_FORM_SET) { return new SchemeFormSet(node); } + else if (elementType == AST.AST_FORM_SYNTAX) + { + return new SchemeFormSyntax(node); + } else if (elementType == AST.AST_FORM_UNLESS) { return new SchemeFormUnless(node); } + else if (elementType == AST.AST_FORM_UNQUOTE) + { + return new SchemeFormUnquote(node); + } + else if (elementType == AST.AST_FORM_UNQUOTE_SPLICING) + { + return new SchemeFormUnquoteSplicing(node); + } + else if (elementType == AST.AST_FORM_UNSYNTAX) + { + return new SchemeFormUnsyntax(node); + } + else if (elementType == AST.AST_FORM_UNSYNTAX_SPLICING) + { + return new SchemeFormUnsyntaxSplicing(node); + } else if (elementType == AST.AST_FORM_WHEN) { return new SchemeFormWhen(node); @@ -162,7 +198,7 @@ else if (elementType == AST.AST_FORM_CALL_PROCEDURE) } else { - System.out.println(">>> Unexpected AST Node Type: " + elementType.toString()); + System.out.println(">>> Unexpected AST Node Type: " + elementType); return new SchemeUnrecognizedForm(node); } diff --git a/src/main/psi/impl/SchemeFormQuasiquote.java b/src/main/psi/impl/SchemeFormQuasiquote.java new file mode 100644 index 0000000..7a3e004 --- /dev/null +++ b/src/main/psi/impl/SchemeFormQuasiquote.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormQuasiquote extends SchemePsiElementBase +{ + public SchemeFormQuasiquote(ASTNode node) + { + super(node, "SchemeFormQuasiquote"); + } +} diff --git a/src/main/psi/impl/SchemeFormQuasisyntax.java b/src/main/psi/impl/SchemeFormQuasisyntax.java new file mode 100644 index 0000000..ab95154 --- /dev/null +++ b/src/main/psi/impl/SchemeFormQuasisyntax.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormQuasisyntax extends SchemePsiElementBase +{ + public SchemeFormQuasisyntax(ASTNode node) + { + super(node, "SchemeFormQuasisyntax"); + } +} diff --git a/src/main/psi/impl/SchemeFormQuote.java b/src/main/psi/impl/SchemeFormQuote.java new file mode 100644 index 0000000..7dd631f --- /dev/null +++ b/src/main/psi/impl/SchemeFormQuote.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormQuote extends SchemePsiElementBase +{ + public SchemeFormQuote(ASTNode node) + { + super(node, "SchemeFormQuote"); + } +} diff --git a/src/main/psi/impl/SchemeFormSyntax.java b/src/main/psi/impl/SchemeFormSyntax.java new file mode 100644 index 0000000..8224a9f --- /dev/null +++ b/src/main/psi/impl/SchemeFormSyntax.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormSyntax extends SchemePsiElementBase +{ + public SchemeFormSyntax(ASTNode node) + { + super(node, "SchemeFormSyntax"); + } +} diff --git a/src/main/psi/impl/SchemeFormUnquote.java b/src/main/psi/impl/SchemeFormUnquote.java new file mode 100644 index 0000000..36362a8 --- /dev/null +++ b/src/main/psi/impl/SchemeFormUnquote.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormUnquote extends SchemePsiElementBase +{ + public SchemeFormUnquote(ASTNode node) + { + super(node, "SchemeFormUnquote"); + } +} diff --git a/src/main/psi/impl/SchemeFormUnquoteSplicing.java b/src/main/psi/impl/SchemeFormUnquoteSplicing.java new file mode 100644 index 0000000..cf29bf1 --- /dev/null +++ b/src/main/psi/impl/SchemeFormUnquoteSplicing.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormUnquoteSplicing extends SchemePsiElementBase +{ + public SchemeFormUnquoteSplicing(ASTNode node) + { + super(node, "SchemeFormUnquoteSplicing"); + } +} diff --git a/src/main/psi/impl/SchemeFormUnsyntax.java b/src/main/psi/impl/SchemeFormUnsyntax.java new file mode 100644 index 0000000..7683ad3 --- /dev/null +++ b/src/main/psi/impl/SchemeFormUnsyntax.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormUnsyntax extends SchemePsiElementBase +{ + public SchemeFormUnsyntax(ASTNode node) + { + super(node, "SchemeFormUnsyntax"); + } +} diff --git a/src/main/psi/impl/SchemeFormUnsyntaxSplicing.java b/src/main/psi/impl/SchemeFormUnsyntaxSplicing.java new file mode 100644 index 0000000..ddc9a1e --- /dev/null +++ b/src/main/psi/impl/SchemeFormUnsyntaxSplicing.java @@ -0,0 +1,11 @@ +package main.psi.impl; + +import com.intellij.lang.ASTNode; + +public class SchemeFormUnsyntaxSplicing extends SchemePsiElementBase +{ + public SchemeFormUnsyntaxSplicing(ASTNode node) + { + super(node, "SchemeFormUnquoteSplicing"); + } +} diff --git a/src/main/structure/SchemeStructureViewElement.java b/src/main/structure/SchemeStructureViewElement.java index 900b6ab..28c0364 100644 --- a/src/main/structure/SchemeStructureViewElement.java +++ b/src/main/structure/SchemeStructureViewElement.java @@ -17,11 +17,14 @@ public class SchemeStructureViewElement implements StructureViewTreeElement, SortableTreeElement { private final NavigatablePsiElement element; - private final NavigatablePsiElement nameChild; + private NavigatablePsiElement nameChild; public SchemeStructureViewElement(NavigatablePsiElement element) { nameChild = (NavigatablePsiElement)getDeclareNameChild(element); + if (nameChild == null) { + nameChild = element; + } this.element = element; }