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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: 'temurin'
java-version: '21'

- name: Cache Gradle packages
Expand Down
85 changes: 50 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,57 @@
.gradle
.gradle/
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
**/build/

# IntelliJ
.idea/
*.iml
*.ipr
*.iws
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
# Eclipse
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.classpath
.settings/

# macOS
.DS_Store

# Java/Kotlin
*.class
*.jar
*.war
*.ear

# generated sources
src/main/gen/
generated/
generated-src/

# output folders
output/

# temporary files
*.log
*.tmp

# test artifacts
sample.class
sample.java
GeneratedClass.class
Test.class

# Gradle wrapper
gradle/wrapper/gradle-wrapper.jar

# local config
local.properties

# node/npm
node_modules/

# VS Code
.vscode/

### Mac OS ###
.DS_Store
# misc
Thumbs.db

22 changes: 21 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies {
testImplementation(kotlin("test"))
antlr("org.antlr:antlr4:4.5")
implementation("com.fifesoft:rsyntaxtextarea:3.3.3")
implementation("io.arrow-kt:arrow-core:2.2.0")
implementation("com.formdev:flatlaf:3.5.4")
testImplementation("com.approvaltests:approvaltests:23.0.0")
implementation("com.github.ajalt.clikt:clikt:5.0.3")
Expand Down Expand Up @@ -58,4 +59,23 @@ tasks.register("showGui", JavaExec::class) {

application {
mainClass.set("MainKt")
}
}

// Task to approve snapshot tests using the helper script.
// Dry-run by default; pass -PapproveSnapshotsCommit=true to actually git-mv and commit.
tasks.register<Exec>("approveSnapshots") {
group = "verification"
description = "Run scripts/approve_snapshots.sh (dry-run). Use -PapproveSnapshotsCommit=true to commit approvals."

val commit = (project.findProperty("approveSnapshotsCommit") as String?).toBoolean()
val scriptFile = file("scripts/approve_snapshots.sh")
if (!scriptFile.exists()) {
throw GradleException("Snapshot approval script not found: ${scriptFile.absolutePath}")
}

// Use bash for portability and to support script features.
commandLine = listOf("bash", scriptFile.absolutePath) + if (commit) listOf("--commit") else emptyList()

// Stream output to console so user sees what will happen.
isIgnoreExitValue = false
}
7 changes: 7 additions & 0 deletions sample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class sample {
public static void main(String[] args) {
double a = 1820.0;
double b = 1912.0;
System.out.println(Test.call(a,b));
}
}
File renamed without changes.
125 changes: 125 additions & 0 deletions src/main/gen/SimpleLangLexer.interp
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
token literal names:
null
'let'
'='
';'
'fun'
'('
')'
'=>'
'{'
'}'
'while'
'for'
'print'
'if'
'else'
'return'
'record'
':'
','
'readInput'
'+'
'-'
'*'
'/'
'=='
'!='
'<'
'>'
'&&'
'||'
'ifte'
'.'
null
null
null
null
null

token symbolic names:
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
BOOL
ID
INT
STRING
WS

rule names:
T__0
T__1
T__2
T__3
T__4
T__5
T__6
T__7
T__8
T__9
T__10
T__11
T__12
T__13
T__14
T__15
T__16
T__17
T__18
T__19
T__20
T__21
T__22
T__23
T__24
T__25
T__26
T__27
T__28
T__29
T__30
BOOL
ID
INT
STRING
WS

channel names:
DEFAULT_TOKEN_CHANNEL
HIDDEN

mode names:
DEFAULT_MODE

atn:
[4, 0, 36, 220, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 3, 31, 189, 8, 31, 1, 32, 1, 32, 5, 32, 193, 8, 32, 10, 32, 12, 32, 196, 9, 32, 1, 33, 4, 33, 199, 8, 33, 11, 33, 12, 33, 200, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 207, 8, 34, 10, 34, 12, 34, 210, 9, 34, 1, 34, 1, 34, 1, 35, 4, 35, 215, 8, 35, 11, 35, 12, 35, 216, 1, 35, 1, 35, 0, 0, 36, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 1, 0, 5, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 34, 34, 92, 92, 3, 0, 9, 10, 13, 13, 32, 32, 225, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 1, 73, 1, 0, 0, 0, 3, 77, 1, 0, 0, 0, 5, 79, 1, 0, 0, 0, 7, 81, 1, 0, 0, 0, 9, 85, 1, 0, 0, 0, 11, 87, 1, 0, 0, 0, 13, 89, 1, 0, 0, 0, 15, 92, 1, 0, 0, 0, 17, 94, 1, 0, 0, 0, 19, 96, 1, 0, 0, 0, 21, 102, 1, 0, 0, 0, 23, 106, 1, 0, 0, 0, 25, 112, 1, 0, 0, 0, 27, 115, 1, 0, 0, 0, 29, 120, 1, 0, 0, 0, 31, 127, 1, 0, 0, 0, 33, 134, 1, 0, 0, 0, 35, 136, 1, 0, 0, 0, 37, 138, 1, 0, 0, 0, 39, 148, 1, 0, 0, 0, 41, 150, 1, 0, 0, 0, 43, 152, 1, 0, 0, 0, 45, 154, 1, 0, 0, 0, 47, 156, 1, 0, 0, 0, 49, 159, 1, 0, 0, 0, 51, 162, 1, 0, 0, 0, 53, 164, 1, 0, 0, 0, 55, 166, 1, 0, 0, 0, 57, 169, 1, 0, 0, 0, 59, 172, 1, 0, 0, 0, 61, 177, 1, 0, 0, 0, 63, 188, 1, 0, 0, 0, 65, 190, 1, 0, 0, 0, 67, 198, 1, 0, 0, 0, 69, 202, 1, 0, 0, 0, 71, 214, 1, 0, 0, 0, 73, 74, 5, 108, 0, 0, 74, 75, 5, 101, 0, 0, 75, 76, 5, 116, 0, 0, 76, 2, 1, 0, 0, 0, 77, 78, 5, 61, 0, 0, 78, 4, 1, 0, 0, 0, 79, 80, 5, 59, 0, 0, 80, 6, 1, 0, 0, 0, 81, 82, 5, 102, 0, 0, 82, 83, 5, 117, 0, 0, 83, 84, 5, 110, 0, 0, 84, 8, 1, 0, 0, 0, 85, 86, 5, 40, 0, 0, 86, 10, 1, 0, 0, 0, 87, 88, 5, 41, 0, 0, 88, 12, 1, 0, 0, 0, 89, 90, 5, 61, 0, 0, 90, 91, 5, 62, 0, 0, 91, 14, 1, 0, 0, 0, 92, 93, 5, 123, 0, 0, 93, 16, 1, 0, 0, 0, 94, 95, 5, 125, 0, 0, 95, 18, 1, 0, 0, 0, 96, 97, 5, 119, 0, 0, 97, 98, 5, 104, 0, 0, 98, 99, 5, 105, 0, 0, 99, 100, 5, 108, 0, 0, 100, 101, 5, 101, 0, 0, 101, 20, 1, 0, 0, 0, 102, 103, 5, 102, 0, 0, 103, 104, 5, 111, 0, 0, 104, 105, 5, 114, 0, 0, 105, 22, 1, 0, 0, 0, 106, 107, 5, 112, 0, 0, 107, 108, 5, 114, 0, 0, 108, 109, 5, 105, 0, 0, 109, 110, 5, 110, 0, 0, 110, 111, 5, 116, 0, 0, 111, 24, 1, 0, 0, 0, 112, 113, 5, 105, 0, 0, 113, 114, 5, 102, 0, 0, 114, 26, 1, 0, 0, 0, 115, 116, 5, 101, 0, 0, 116, 117, 5, 108, 0, 0, 117, 118, 5, 115, 0, 0, 118, 119, 5, 101, 0, 0, 119, 28, 1, 0, 0, 0, 120, 121, 5, 114, 0, 0, 121, 122, 5, 101, 0, 0, 122, 123, 5, 116, 0, 0, 123, 124, 5, 117, 0, 0, 124, 125, 5, 114, 0, 0, 125, 126, 5, 110, 0, 0, 126, 30, 1, 0, 0, 0, 127, 128, 5, 114, 0, 0, 128, 129, 5, 101, 0, 0, 129, 130, 5, 99, 0, 0, 130, 131, 5, 111, 0, 0, 131, 132, 5, 114, 0, 0, 132, 133, 5, 100, 0, 0, 133, 32, 1, 0, 0, 0, 134, 135, 5, 58, 0, 0, 135, 34, 1, 0, 0, 0, 136, 137, 5, 44, 0, 0, 137, 36, 1, 0, 0, 0, 138, 139, 5, 114, 0, 0, 139, 140, 5, 101, 0, 0, 140, 141, 5, 97, 0, 0, 141, 142, 5, 100, 0, 0, 142, 143, 5, 73, 0, 0, 143, 144, 5, 110, 0, 0, 144, 145, 5, 112, 0, 0, 145, 146, 5, 117, 0, 0, 146, 147, 5, 116, 0, 0, 147, 38, 1, 0, 0, 0, 148, 149, 5, 43, 0, 0, 149, 40, 1, 0, 0, 0, 150, 151, 5, 45, 0, 0, 151, 42, 1, 0, 0, 0, 152, 153, 5, 42, 0, 0, 153, 44, 1, 0, 0, 0, 154, 155, 5, 47, 0, 0, 155, 46, 1, 0, 0, 0, 156, 157, 5, 61, 0, 0, 157, 158, 5, 61, 0, 0, 158, 48, 1, 0, 0, 0, 159, 160, 5, 33, 0, 0, 160, 161, 5, 61, 0, 0, 161, 50, 1, 0, 0, 0, 162, 163, 5, 60, 0, 0, 163, 52, 1, 0, 0, 0, 164, 165, 5, 62, 0, 0, 165, 54, 1, 0, 0, 0, 166, 167, 5, 38, 0, 0, 167, 168, 5, 38, 0, 0, 168, 56, 1, 0, 0, 0, 169, 170, 5, 124, 0, 0, 170, 171, 5, 124, 0, 0, 171, 58, 1, 0, 0, 0, 172, 173, 5, 105, 0, 0, 173, 174, 5, 102, 0, 0, 174, 175, 5, 116, 0, 0, 175, 176, 5, 101, 0, 0, 176, 60, 1, 0, 0, 0, 177, 178, 5, 46, 0, 0, 178, 62, 1, 0, 0, 0, 179, 180, 5, 116, 0, 0, 180, 181, 5, 114, 0, 0, 181, 182, 5, 117, 0, 0, 182, 189, 5, 101, 0, 0, 183, 184, 5, 102, 0, 0, 184, 185, 5, 97, 0, 0, 185, 186, 5, 108, 0, 0, 186, 187, 5, 115, 0, 0, 187, 189, 5, 101, 0, 0, 188, 179, 1, 0, 0, 0, 188, 183, 1, 0, 0, 0, 189, 64, 1, 0, 0, 0, 190, 194, 7, 0, 0, 0, 191, 193, 7, 1, 0, 0, 192, 191, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 66, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 199, 7, 2, 0, 0, 198, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 68, 1, 0, 0, 0, 202, 208, 5, 34, 0, 0, 203, 207, 8, 3, 0, 0, 204, 205, 5, 92, 0, 0, 205, 207, 9, 0, 0, 0, 206, 203, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 34, 0, 0, 212, 70, 1, 0, 0, 0, 213, 215, 7, 4, 0, 0, 214, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 219, 6, 35, 0, 0, 219, 72, 1, 0, 0, 0, 7, 0, 188, 194, 200, 206, 208, 216, 1, 6, 0, 0]
Loading
Loading