Skip to content

Commit

Permalink
Update Groovy and Gradle keywords, improve / handling on typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Aug 26, 2023
1 parent 3e84cce commit d43be55
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 40 deletions.
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ Latest development builds (artifacts in Release configuration for each compiler
* [F#](tools/lang/FSharp.fs), up to F# 7.0.
* [Fortran](tools/lang/Fortran.f), up to Fortran 2018.
* [GN Build](tools/lang/GN.gn), up to GN 2019-03-13.
* [Go](tools/lang/Go.go), up to Go 1.14.
* [Go](tools/lang/Go.go), up to Go 1.21.
* [Go+ (GoPlus)](https://goplus.org/) and the Q language
* [Gradle](tools/lang/Gradle.gradle), up to Gradle 6.8, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#gradle)
* [Gradle](tools/lang/Gradle.gradle), up to Gradle 8.3, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#gradle)
* [GraphViz Dot](tools/lang/GraphViz.dot), up to GraphViz 2.49, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#graphviz)
* [Groovy](tools/lang/Groovy.groovy), up to Groovy 4.0.
* [Groovy](tools/lang/Groovy.groovy), up to Groovy 5.0.
* [Haskell](tools/lang/Haskell.hs), up to GHC 9.6.
* [Haxe](tools/lang/Haxe.hx), up to Haxe 4.2.
* [Haxe](tools/lang/Haxe.hx), up to Haxe 4.3.
* [HTML](tools/lang/html.html), up to [WHATWG](https://html.spec.whatwg.org/multipage/) June 2023. [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#html)
* ASP
* ASP.NET
Expand All @@ -86,7 +86,7 @@ Latest development builds (artifacts in Release configuration for each compiler
* [JavaScript](tools/lang/JavaScript.js), up to ECMAScript 2023 with [JSX](https://facebook.github.io/jsx/) and [Web APIs](https://developer.mozilla.org/en-US/docs/Web/API).
* [JSON](https://www.json.org) and [JSON5](https://json5.org/) Document
* [Julia Script](tools/lang/Julia.jl), up to Julia 1.9. [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#julia)
* [Kotlin](tools/lang/Kotlin.kt), up to Kotlin 1.7.
* [Kotlin](tools/lang/Kotlin.kt), up to Kotlin 1.9.
* LaTeX
* Lisp Script (Common Lisp, Clojure, Scheme, etc.)
* [LLVM IR](tools/lang/LLVM.ll), up to LLVM 16.
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexers/LexGroovy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ constexpr bool IsSpaceEquiv(int state) noexcept {

constexpr bool FollowExpression(int chPrevNonWhite, int stylePrevNonWhite) noexcept {
return chPrevNonWhite == ')' || chPrevNonWhite == ']'
|| stylePrevNonWhite == SCE_GROOVY_OPERATOR_PF
|| (stylePrevNonWhite >= SCE_GROOVY_OPERATOR_PF && stylePrevNonWhite <= SCE_GROOVY_NUMBER)
|| IsIdentifierCharEx(chPrevNonWhite);
}

Expand Down
20 changes: 11 additions & 9 deletions src/EditLexers/stlGradle.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

static KEYWORDLIST Keywords_Gradle = {{
//++Autogenerated -- start of section automatically generated
"abstract as assert break case catch class const continue def default do else enum extends false final finally for goto "
"if implements import in instanceof interface it native new non-sealed null "
"abstract as assert break case catch class const continue def default delegate do else enum extends "
"false final finally for goto if implements import in instanceof interface it native new non-sealed null owner "
"package parcelable permits println private protected public record return "
"sealed static strictfp super switch synchronized this threadsafe throw throws trait transient true try var volatile "
"while yield "
Expand Down Expand Up @@ -75,23 +75,25 @@ NULL
, // 8 function
"absoluteProjectPath actions addBuildListener addListener addProjectEvaluationListener afterEvaluate afterProject "
"allJava allSource allprojects allprojects^{} ant ant^{} application^{} apply artifacts artifacts^{} "
"beforeEvaluate beforeProject buildCache buildDir buildFile buildFinished buildscript buildscript^{} "
"beforeEvaluate beforeProject buildCache buildFile buildFinished buildscript buildscript^{} "
"caseSensitive childProjects classpath "
"compileClasspath compiledBy configurations configurations^{} configure container convention copy copySpec "
"defaultTasks delete dependencies dependencies^{} dependencyLocking dependsOn description destinationDir destroyables "
"didWork dirMode disableAutoTargetJvm distributions^{} doFirst doLast duplicatesStrategy "
"compileClasspath compiledBy configurations configurations^{} configure container copy copySpec "
"defaultTasks delete dependencies dependencies^{} dependencyLocking dependsOn "
"description destinationDir destinationDirectory destroyables didWork dirPermissions distributions^{} "
"doFirst doLast doNotTrackState duplicatesStrategy "
"eachFile enabled evaluationDependsOn exclude excludes exec expand extensions "
"file fileMode fileTree files filesMatching filesNotMatching filter finalizedBy findProject findProperty from "
"file filePermissions fileTree files filesMatching filesNotMatching filter finalizedBy findProject findProperty from "
"getAllTasks getCompileTaskName getTaskName getTasksByName gradle gradleHomeDir gradleUserHomeDir gradleVersion group "
"hasProperty include includeBuild includeEmptyDirs includeFlat includedBuild includedBuilds includes inputs into "
"java java^{} javaexec localState logger logging manifest mkdir mustRunAfter name normalization "
"java javaCompiler java^{} javaexec layout localState logger logging manifest mkdir mustRunAfter name normalization "
"onlyIf options output outputs "
"parent path pluginManager plugins project projectDir projectsEvaluated projectsLoaded properties property publishing^{} "
"relativePath relativeProjectPath removeListener removeProjectEvaluationListener rename "
"reporting^{} repositories repositories^{} resources resources^{} rootDir rootProject runtimeClasspath "
"setProperty settings settingsDir settingsEvaluated shouldRunAfter signing^{} source sourceCompatibility sourceSets^{} "
"startParameter state status subprojects subprojects^{} sync "
"tarTree targetCompatibility task taskDependencies taskGraph tasks temporaryDir uri useLogger version with zipTree "
"tarTree targetCompatibility task taskDependencies taskGraph tasks temporaryDir timeout uri useLogger usesService "
"version with zipTree "

, // 9 GroovyDoc
"author code deprecated docRoot end exception exclude hidden hide highlight index inheritDoc link linkplain literal "
Expand Down
4 changes: 2 additions & 2 deletions src/EditLexers/stlGroovy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

static KEYWORDLIST Keywords_Groovy = {{
//++Autogenerated -- start of section automatically generated
"abstract as assert break case catch class const continue def default do else enum extends false final finally for goto "
"if implements import in instanceof interface it native new non-sealed null "
"abstract as assert break case catch class const continue def default delegate do else enum extends "
"false final finally for goto if implements import in instanceof interface it native new non-sealed null owner "
"package parcelable permits println private protected public record return "
"sealed static strictfp super switch synchronized this threadsafe throw throws trait transient true try var volatile "
"while yield "
Expand Down
2 changes: 1 addition & 1 deletion tools/lang/Go.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Go 1.14 https://golang.org/
// Go 1.21 https://golang.org/
// https://github.com/golang/go/blob/master/doc/go_spec.html

//! Keywords
Expand Down
18 changes: 11 additions & 7 deletions tools/lang/Gradle.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 6.8.2 https://gradle.org/
// 8.3 https://gradle.org/

//! api
// https://docs.gradle.org/current/dsl/index.html
Expand All @@ -10,19 +10,18 @@ class Project {
Set<Project> allprojects
AntBuilder ant
ArtifactHandler artifacts
File buildDir
File buildFile
ScriptHandler buildscript
Map<String, Project> childProjects
ConfigurationContainer configurations
Convention convention
List<String> defaultTasks
DependencyHandler dependencies
DependencyLockingHandler dependencyLocking
String description
ExtensionContainer extensions
Gradle gradle
Object group
ProjectLayout layout
Logger logger
LoggingManager logging
String name
Expand Down Expand Up @@ -110,7 +109,6 @@ class Project {
URI uri(Object path)
FileTree zipTree(Object zipPath)
// Methods added by the java plugin
void disableAutoTargetJvm()
Manifest manifest()
Manifest manifest(Closure closure)
Manifest manifest(Action<? super Manifest> action)
Expand All @@ -137,7 +135,6 @@ class Task {
// Properties
List<Action<? super Task>> actions
AntBuilder ant
Convention convention
Set<Object> dependsOn
String description
TaskDestroyables destroyables
Expand All @@ -159,6 +156,7 @@ class Task {
TaskState state
TaskDependency taskDependencies
File temporaryDir
Property<Duration> timeout

// Methods
Task dependsOn(Object... paths)
Expand All @@ -168,6 +166,7 @@ class Task {
Task doLast(Closure action)
Task doLast(String actionName, Action<? super Task> action)
Task doLast(Action<? super Task> action)
void doNotTrackState(String reasonNotToTrackState)
Task finalizedBy(Object... paths)
boolean hasProperty(String propertyName)
Task mustRunAfter(Object... paths)
Expand All @@ -176,11 +175,13 @@ class Task {
Object property(String propertyName)
void setProperty(String name, Object value)
TaskDependency shouldRunAfter(Object... paths)
void usesService(Provider<? extends BuildService<?>> service)
}

// https://docs.gradle.org/current/dsl/org.gradle.api.invocation.Gradle.html
class Gradle {
// Properties
ExtensionContainer extensions
Gradle gradle
File gradleHomeDir
File gradleUserHomeDir
Expand Down Expand Up @@ -315,10 +316,10 @@ class Copy {
// Properties
boolean caseSensitive
File destinationDir
Integer dirMode
Property<ConfigurableFilePermissions> dirPermissions
DuplicatesStrategy duplicatesStrategy
Set<String> excludes
Integer fileMode
Property<ConfigurableFilePermissions> filePermissions
boolean includeEmptyDirs
Set<String> includes
FileCollection source
Expand Down Expand Up @@ -360,9 +361,12 @@ class Copy {
class JavaCompile {
// Properties
FileCollection classpath
DirectoryProperty destinationDirectory
Set<String> excludes
Set<String> includes
Property<JavaCompiler> javaCompiler
CompileOptions options
FileTree source
String sourceCompatibility
String targetCompatibility

Expand Down
28 changes: 15 additions & 13 deletions tools/lang/Groovy.groovy
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
// 4.0 https://www.groovy-lang.org/
// 5.0 https://www.groovy-lang.org/
// https://www.groovy-lang.org/documentation.html

//! keywords
// https://www.groovy-lang.org/syntax.html#_keywords
as assert
// https://github.com/apache/groovy/tree/master/src/antlr
abstract assert
break
case catch class const continue
def default do
else enum extends
false finally for
false final finally for
goto
if implements import in instanceof interface
new null
package
if implements import instanceof interface
native new null non-sealed
package public protected private
return
super switch
this throw throws trait true try
var
super strictfp switch synchronized
this threadsafe throw throws true transient try
while

// Contextual Keywords
as in permits record sealed trait var yield

// Other reserved words

// https://www.groovy-lang.org/closures.html
it
it owner delegate

// https://www.groovy-lang.org/dsls.html
println

// https://github.com/apache/groovy/blob/master/src/antlr/GroovyLexer.g4
as def in trait threadsafe

// others, from Java.java
2 changes: 1 addition & 1 deletion tools/lang/Haxe.hx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 4.2.5 https://haxe.org
// 4.3.1 https://haxe.org

//! keywords
// https://haxe.org/manual/expression.html#keywords
Expand Down
2 changes: 1 addition & 1 deletion tools/lang/Kotlin.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Kotlin 1.7 https://kotlinlang.org/docs/home.html
// Kotlin 1.9 https://kotlinlang.org/docs/home.html

//! Keywords ===========================================================
// https://kotlinlang.org/docs/keyword-reference.html
Expand Down

0 comments on commit d43be55

Please sign in to comment.