Skip to content

Commit

Permalink
improving fileselector
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Dec 30, 2024
1 parent c84cc8f commit 10b9162
Show file tree
Hide file tree
Showing 17 changed files with 288 additions and 272 deletions.
8 changes: 4 additions & 4 deletions .idea/libraries/michael_bull_kotlin_result_jvm.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions codeCore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
dependencies {
// should have no dependencies to other modules
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.0")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.1")
}

sourceSets {
Expand All @@ -21,4 +21,4 @@ sourceSets {
}
}

// note: there are no unit tests in this module!
// note: there are no unit tests in this module!
4 changes: 2 additions & 2 deletions codeGenCpu6502/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
implementation(project(":codeCore"))
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.0")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.1")

testImplementation("io.kotest:kotest-runner-junit5-jvm:5.9.1")
testImplementation("io.kotest:kotest-framework-datatest:5.9.1")
Expand Down Expand Up @@ -43,4 +43,4 @@ tasks.test {
testLogging {
events("skipped", "failed")
}
}
}
4 changes: 2 additions & 2 deletions codeGenExperimental/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
implementation(project(":codeGenIntermediate"))
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.0")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.1")
}

sourceSets {
Expand All @@ -24,4 +24,4 @@ sourceSets {
}
}

// note: there are no unit tests in this module!
// note: there are no unit tests in this module!
4 changes: 2 additions & 2 deletions codeGenIntermediate/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
implementation(project(":intermediate"))
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.0")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.1")

testImplementation("io.kotest:kotest-runner-junit5-jvm:5.9.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
Expand Down Expand Up @@ -45,4 +45,4 @@ tasks.test {
testLogging {
events("skipped", "failed")
}
}
}
4 changes: 2 additions & 2 deletions codeOptimizers/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
implementation(project(":codeCore"))
implementation(project(":compilerAst"))
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.0")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.1")
// implementation "org.jetbrains.kotlin:kotlin-reflect"
}

Expand All @@ -23,4 +23,4 @@ sourceSets {
}
}

// note: there are no unit tests in this module!
// note: there are no unit tests in this module!
4 changes: 2 additions & 2 deletions compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-cli:0.3.6")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.0")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.1")

testImplementation(project(":codeCore"))
testImplementation(project(":intermediate"))
Expand Down Expand Up @@ -94,4 +94,4 @@ tasks.compileKotlin {

tasks.compileJava {
dependsOn(tasks.createVersionFile)
}
}
3 changes: 3 additions & 0 deletions compiler/res/prog8lib/cx16/diskio.p8
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ io_error:
; After the last filename one additional 0 byte is placed to indicate the end of the list.
; Returns number of files (it skips 'dir' entries i.e. subdirectories).
; Also sets carry on exit: Carry clear = all files returned, Carry set = directory has more files that didn't fit in the buffer.
; Note that no list of pointers of some form is returned, the names are just squashed together.
; If you really need a list of pointers to the names, that is pretty straightforward to construct by iterating over the names
; and registering when the next one starts after the 0-byte separator.
uword buffer_start = filenames_buffer
ubyte files_found = 0
filenames_buffer[0]=0
Expand Down
5 changes: 4 additions & 1 deletion compiler/res/prog8lib/shared_cbm_diskio.p8
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ io_error:
; After the last filename one additional 0 byte is placed to indicate the end of the list.
; Returns number of files (it skips 'dir' entries i.e. subdirectories).
; Also sets carry on exit: Carry clear = all files returned, Carry set = directory has more files that didn't fit in the buffer.
uword buffer_start = filenames_buffer
; Note that no list of pointers of some form is returned, the names are just squashed together.
; If you really need a list of pointers to the names, that is pretty straightforward to construct by iterating over the names
; and registering when the next one starts after the 0-byte separator.
uword buffer_start = filenames_buffer
ubyte files_found = 0
if lf_start_list(pattern_ptr) {
while lf_next_entry() {
Expand Down
3 changes: 3 additions & 0 deletions compiler/res/prog8lib/virtual/diskio.p8
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ diskio {
; After the last filename one additional 0 byte is placed to indicate the end of the list.
; Returns number of files (it skips 'dir' entries i.e. subdirectories).
; Also sets carry on exit: Carry clear = all files returned, Carry set = directory has more files that didn't fit in the buffer.
; Note that no list of pointers of some form is returned, the names are just squashed together.
; If you really need a list of pointers to the names, that is pretty straightforward to construct by iterating over the names
; and registering when the next one starts after the 0-byte separator.
txt.print("@TODO: list_filenames\n")
sys.clear_carry()
return 0
Expand Down
4 changes: 2 additions & 2 deletions compilerAst/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
implementation(project(":codeCore"))
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.antlr:antlr4-runtime:4.13.2")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.0")
implementation("com.michael-bull.kotlin-result:kotlin-result-jvm:2.0.1")
implementation(project(":parser"))
}

Expand All @@ -22,4 +22,4 @@ sourceSets {
srcDir("${project.projectDir}/src")
}
}
}
}
1 change: 1 addition & 0 deletions compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ private fun ExpressionContext.toAst(insideParentheses: Boolean=false) : Expressi
val addressOf = addressof()
val identifier = addressOf.scoped_identifier()
val msb = addressOf.ADDRESS_OF_MSB()!=null
// note: &< (ADDRESS_OF_LSB) is equivalent to a regular &.
return if (identifier != null)
AddressOf(addressof().scoped_identifier().toAst(), null, msb, toPosition())
else {
Expand Down
1 change: 1 addition & 0 deletions docs/source/libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ Provides string manipulation routines.
``pattern_match (string, pattern) -> bool`` (not on Virtual target)
Returns true if the string matches the pattern, false if not.
'?' in the pattern matches any one character. '*' in the pattern matches any substring.
An empty pattern matches nothing. If you need everything to match, use a single '*'.

``hash (string) -> ubyte``
Returns a simple 8 bit hash value for the given string.
Expand Down
Loading

0 comments on commit 10b9162

Please sign in to comment.