Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "com.dfsek.terra.codetool"
version = "1.0.0"
version = "1.0.1"

repositories {
mavenCentral()
Expand Down
125 changes: 65 additions & 60 deletions src/main/gen/com/dfsek/terra/codetool/parsing/_TerrascriptLexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,15 @@ private static int zzUnpackcmap_blocks(String packed, int offset, int [] result)
"\1\0\1\1\1\2\1\3\1\1\1\4\1\1\1\5"+
"\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\15"+
"\1\16\1\17\1\20\13\21\1\22\1\1\1\23\1\24"+
"\1\0\1\25\1\0\1\26\1\27\1\0\1\30\1\31"+
"\1\32\6\21\1\33\5\21\1\34\1\25\1\14\6\21"+
"\1\35\1\36\1\21\1\37\2\21\1\40\2\21\1\41"+
"\1\42\2\21\1\43\1\21\1\44\1\21\1\45\1\21"+
"\1\46\1\21\1\47\1\21\1\50";
"\1\0\1\25\1\0\1\26\1\0\1\27\1\0\1\30"+
"\1\31\1\32\6\21\1\33\5\21\1\34\1\25\1\0"+
"\1\14\6\21\1\35\1\36\1\21\1\37\2\21\1\0"+
"\1\27\1\40\2\21\1\41\1\42\2\21\1\43\1\21"+
"\1\44\1\21\1\45\1\21\1\46\1\21\1\47\1\21"+
"\1\50";

private static int [] zzUnpackAction() {
int [] result = new int[88];
int [] result = new int[92];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
Expand Down Expand Up @@ -143,15 +144,16 @@ private static int zzUnpackAction(String packed, int offset, int [] result) {
"\0\u0150\0\u017a\0\u01a4\0\u01ce\0\u01f8\0\u0222\0\u024c\0\u0276"+
"\0\u02a0\0\u02ca\0\u02f4\0\u031e\0\u0348\0\u0372\0\52\0\u039c"+
"\0\52\0\52\0\250\0\52\0\u03c6\0\52\0\u03f0\0\u041a"+
"\0\52\0\52\0\52\0\u0444\0\u046e\0\u0498\0\u04c2\0\u04ec"+
"\0\u0516\0\u01ce\0\u0540\0\u056a\0\u0594\0\u05be\0\u05e8\0\52"+
"\0\250\0\u041a\0\u0612\0\u063c\0\u0666\0\u0690\0\u06ba\0\u06e4"+
"\0\u01ce\0\u01ce\0\u070e\0\u01ce\0\u0738\0\u0762\0\u01ce\0\u078c"+
"\0\u07b6\0\u01ce\0\u01ce\0\u07e0\0\u080a\0\u01ce\0\u0834\0\u01ce"+
"\0\u085e\0\u01ce\0\u0888\0\u01ce\0\u08b2\0\u01ce\0\u08dc\0\u01ce";
"\0\u0444\0\52\0\52\0\52\0\u046e\0\u0498\0\u04c2\0\u04ec"+
"\0\u0516\0\u0540\0\u01ce\0\u056a\0\u0594\0\u05be\0\u05e8\0\u0612"+
"\0\52\0\250\0\u063c\0\u0444\0\u0666\0\u0690\0\u06ba\0\u06e4"+
"\0\u070e\0\u0738\0\u01ce\0\u01ce\0\u0762\0\u01ce\0\u078c\0\u07b6"+
"\0\u07e0\0\52\0\u01ce\0\u080a\0\u0834\0\u01ce\0\u01ce\0\u085e"+
"\0\u0888\0\u01ce\0\u08b2\0\u01ce\0\u08dc\0\u01ce\0\u0906\0\u01ce"+
"\0\u0930\0\u01ce\0\u095a\0\u01ce";

private static int [] zzUnpackRowMap() {
int [] result = new int[88];
int [] result = new int[92];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
Expand Down Expand Up @@ -180,53 +182,55 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) {
"\1\27\1\30\1\24\1\31\3\24\1\32\1\24\1\33"+
"\1\34\1\35\1\24\1\36\1\37\1\40\1\41\53\0"+
"\2\3\71\0\1\42\27\0\4\43\1\44\20\43\1\45"+
"\24\43\6\0\1\46\61\0\1\47\50\0\1\50\1\0"+
"\1\17\54\0\1\51\51\0\1\52\51\0\1\53\46\0"+
"\1\24\4\0\1\24\1\0\21\24\22\0\1\24\4\0"+
"\1\24\1\0\13\24\1\54\1\55\4\24\22\0\1\24"+
"\4\0\1\24\1\0\13\24\1\56\5\24\22\0\1\24"+
"\4\0\1\24\1\0\10\24\1\57\10\24\22\0\1\24"+
"\4\0\1\24\1\0\1\60\12\24\1\61\5\24\22\0"+
"\1\24\4\0\1\24\1\0\4\24\1\62\14\24\22\0"+
"\1\24\4\0\1\24\1\0\17\24\1\63\1\24\22\0"+
"\1\24\4\0\1\24\1\0\3\24\1\64\15\24\22\0"+
"\1\24\4\0\1\24\1\0\16\24\1\65\2\24\22\0"+
"\1\24\4\0\1\24\1\0\14\24\1\66\4\24\22\0"+
"\1\24\4\0\1\24\1\0\5\24\1\67\13\24\53\0"+
"\1\70\1\0\4\43\1\71\20\43\1\45\24\43\2\47"+
"\1\0\47\47\17\0\1\72\51\0\1\24\4\0\1\24"+
"\1\0\13\24\1\73\5\24\22\0\1\24\4\0\1\24"+
"\1\0\3\24\1\74\15\24\22\0\1\24\4\0\1\24"+
"\1\0\12\24\1\75\6\24\22\0\1\24\4\0\1\24"+
"\1\0\15\24\1\76\3\24\22\0\1\24\4\0\1\24"+
"\1\0\6\24\1\77\1\24\1\100\10\24\22\0\1\24"+
"\4\0\1\24\1\0\14\24\1\101\4\24\22\0\1\24"+
"\4\0\1\24\1\0\11\24\1\102\7\24\22\0\1\24"+
"\4\0\1\24\1\0\16\24\1\103\2\24\22\0\1\24"+
"\4\0\1\24\1\0\14\24\1\104\4\24\22\0\1\24"+
"\4\0\1\24\1\0\17\24\1\105\1\24\22\0\1\24"+
"\4\0\1\24\1\0\6\24\1\106\12\24\22\0\1\24"+
"\4\0\1\24\1\0\10\24\1\107\10\24\22\0\1\24"+
"\4\0\1\24\1\0\1\110\20\24\22\0\1\24\4\0"+
"\1\24\1\0\16\24\1\111\2\24\22\0\1\24\4\0"+
"\1\24\1\0\3\24\1\112\15\24\22\0\1\24\4\0"+
"\1\24\1\0\10\24\1\113\10\24\22\0\1\24\4\0"+
"\1\24\1\0\15\24\1\114\3\24\22\0\1\24\4\0"+
"\1\24\1\0\17\24\1\115\1\24\22\0\1\24\4\0"+
"\1\24\1\0\3\24\1\116\15\24\22\0\1\24\4\0"+
"\1\24\1\0\10\24\1\117\10\24\22\0\1\24\4\0"+
"\1\24\1\0\7\24\1\120\11\24\22\0\1\24\4\0"+
"\1\24\1\0\6\24\1\121\12\24\22\0\1\24\4\0"+
"\1\24\1\0\3\24\1\122\15\24\22\0\1\24\4\0"+
"\1\24\1\0\14\24\1\123\4\24\22\0\1\24\4\0"+
"\1\24\1\0\3\24\1\124\15\24\22\0\1\24\4\0"+
"\1\24\1\0\12\24\1\125\6\24\22\0\1\24\4\0"+
"\1\24\1\0\12\24\1\126\6\24\22\0\1\24\4\0"+
"\1\24\1\0\17\24\1\127\1\24\22\0\1\24\4\0"+
"\1\24\1\0\3\24\1\130\15\24\3\0";
"\24\43\6\0\1\46\54\0\1\47\4\0\1\50\50\0"+
"\1\51\1\0\1\17\54\0\1\52\51\0\1\53\51\0"+
"\1\54\46\0\1\24\4\0\1\24\1\0\21\24\22\0"+
"\1\24\4\0\1\24\1\0\13\24\1\55\1\56\4\24"+
"\22\0\1\24\4\0\1\24\1\0\13\24\1\57\5\24"+
"\22\0\1\24\4\0\1\24\1\0\10\24\1\60\10\24"+
"\22\0\1\24\4\0\1\24\1\0\1\61\12\24\1\62"+
"\5\24\22\0\1\24\4\0\1\24\1\0\4\24\1\63"+
"\14\24\22\0\1\24\4\0\1\24\1\0\17\24\1\64"+
"\1\24\22\0\1\24\4\0\1\24\1\0\3\24\1\65"+
"\15\24\22\0\1\24\4\0\1\24\1\0\16\24\1\66"+
"\2\24\22\0\1\24\4\0\1\24\1\0\14\24\1\67"+
"\4\24\22\0\1\24\4\0\1\24\1\0\5\24\1\70"+
"\13\24\53\0\1\71\1\0\4\43\1\72\20\43\1\45"+
"\24\43\11\47\1\73\40\47\2\50\1\0\47\50\17\0"+
"\1\74\51\0\1\24\4\0\1\24\1\0\13\24\1\75"+
"\5\24\22\0\1\24\4\0\1\24\1\0\3\24\1\76"+
"\15\24\22\0\1\24\4\0\1\24\1\0\12\24\1\77"+
"\6\24\22\0\1\24\4\0\1\24\1\0\15\24\1\100"+
"\3\24\22\0\1\24\4\0\1\24\1\0\6\24\1\101"+
"\1\24\1\102\10\24\22\0\1\24\4\0\1\24\1\0"+
"\14\24\1\103\4\24\22\0\1\24\4\0\1\24\1\0"+
"\11\24\1\104\7\24\22\0\1\24\4\0\1\24\1\0"+
"\16\24\1\105\2\24\22\0\1\24\4\0\1\24\1\0"+
"\14\24\1\106\4\24\22\0\1\24\4\0\1\24\1\0"+
"\17\24\1\107\1\24\22\0\1\24\4\0\1\24\1\0"+
"\6\24\1\110\12\24\3\0\11\47\1\111\4\47\1\112"+
"\33\47\17\0\1\24\4\0\1\24\1\0\10\24\1\113"+
"\10\24\22\0\1\24\4\0\1\24\1\0\1\114\20\24"+
"\22\0\1\24\4\0\1\24\1\0\16\24\1\115\2\24"+
"\22\0\1\24\4\0\1\24\1\0\3\24\1\116\15\24"+
"\22\0\1\24\4\0\1\24\1\0\10\24\1\117\10\24"+
"\22\0\1\24\4\0\1\24\1\0\15\24\1\120\3\24"+
"\22\0\1\24\4\0\1\24\1\0\17\24\1\121\1\24"+
"\22\0\1\24\4\0\1\24\1\0\3\24\1\122\15\24"+
"\22\0\1\24\4\0\1\24\1\0\10\24\1\123\10\24"+
"\3\0\11\47\1\111\4\47\1\0\33\47\17\0\1\24"+
"\4\0\1\24\1\0\7\24\1\124\11\24\22\0\1\24"+
"\4\0\1\24\1\0\6\24\1\125\12\24\22\0\1\24"+
"\4\0\1\24\1\0\3\24\1\126\15\24\22\0\1\24"+
"\4\0\1\24\1\0\14\24\1\127\4\24\22\0\1\24"+
"\4\0\1\24\1\0\3\24\1\130\15\24\22\0\1\24"+
"\4\0\1\24\1\0\12\24\1\131\6\24\22\0\1\24"+
"\4\0\1\24\1\0\12\24\1\132\6\24\22\0\1\24"+
"\4\0\1\24\1\0\17\24\1\133\1\24\22\0\1\24"+
"\4\0\1\24\1\0\3\24\1\134\15\24\3\0";

private static int [] zzUnpacktrans() {
int [] result = new int[2310];
int [] result = new int[2436];
int offset = 0;
offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
Expand Down Expand Up @@ -266,10 +270,11 @@ private static int zzUnpacktrans(String packed, int offset, int [] result) {
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\1\0\1\11\3\1\1\11\1\1\6\11\2\1\1\11"+
"\16\1\1\11\1\1\2\11\1\0\1\11\1\0\1\11"+
"\1\1\1\0\3\11\14\1\1\11\40\1";
"\1\0\1\1\1\0\3\11\14\1\1\11\1\1\1\0"+
"\15\1\1\0\1\11\22\1";

private static int [] zzUnpackAttribute() {
int [] result = new int[88];
int [] result = new int[92];
int offset = 0;
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ class TerrascriptTypedHandler : TypedHandlerDelegate() {
document.insertString(offset, "\"")
return Result.CONTINUE
}

if (c == '*') {
val document = editor.document
val offset = editor.caretModel.offset

if (offset > 0 && document.charsSequence[offset - 2] == '/') {
document.insertString(offset, "/")
document.insertString(offset, "*")
editor.caretModel.moveToOffset(offset)
return Result.STOP
}
}
return Result.CONTINUE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ class TerrascriptBlock(
TesfTypes.RPAREN,
TesfTypes.STRING,
TesfTypes.TRUE,
TesfTypes.FALSE
TesfTypes.FALSE,
TesfTypes.LITERAL,
TesfTypes.VARIABLE_USAGE,
TesfTypes.CALL_EXPRESSION
)

val expressionContainerTypes: TokenSet = TokenSet.create(
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/dfsek/terra/codetool/parsing/tesf.flex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ NUMBER=[0-9]+(\.[0-9]+)?
STRING=\"([^\"]|\\.)*\"
ID=[a-zA-Z_][a-zA-Z0-9_]*
COMMENT="//"[^\r\n]*
MULTILINE_COMMENT="/"\*([^*]|\*+[^*/])*\*"/"

%%
<YYINITIAL> {
Expand Down Expand Up @@ -73,6 +74,7 @@ COMMENT="//"[^\r\n]*
{STRING} { return STRING; }
{ID} { return ID; }
{COMMENT} { return COMMENT; }
{MULTILINE_COMMENT} { return COMMENT; }

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.dfsek.terra.codetool.template

import com.dfsek.terra.codetool.TerrascriptLanguage
import com.intellij.codeInsight.template.TemplateActionContext
import com.intellij.codeInsight.template.TemplateContextType

class TerrascriptLiveTemplateContext : TemplateContextType("Terrascript") {
override fun isInContext(templateActionContext: TemplateActionContext): Boolean {
return true
return templateActionContext.file.language.isKindOf(TerrascriptLanguage)
}
}
4 changes: 4 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
</ul>
]]></description>

<change-notes><![CDATA[
Introduce Minecraft 1.21.9 support and fix a few bugs
]]></change-notes>

<!-- Product and plugin compatibility requirements.
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
<depends>com.intellij.modules.platform</depends>
Expand Down
Loading