Skip to content

Commit

Permalink
Merge pull request #126 from ortus-boxlang/development
Browse files Browse the repository at this point in the history
1.0.0-Beta19
  • Loading branch information
lmajano authored Oct 18, 2024
2 parents 2ced95d + 5d09a9b commit 616256b
Show file tree
Hide file tree
Showing 181 changed files with 7,991 additions and 1,255 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ dependencies {
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation 'org.slf4j:slf4j-api:2.0.16'
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
implementation 'ch.qos.logback:logback-classic:1.5.8'
implementation 'ch.qos.logback:logback-classic:1.5.10'
// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
implementation 'com.zaxxer:HikariCP:6.0.0'
// https://mvnrepository.com/artifact/org.ow2.asm/asm-tree
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Oct 04 18:10:20 UTC 2024
#Fri Oct 11 15:26:50 UTC 2024
antlrVersion=4.13.1
jdkVersion=21
version=1.0.0-beta18
version=1.0.0-beta19
2 changes: 1 addition & 1 deletion src/main/java/ortus/boxlang/compiler/BXCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static void main( String[] args ) {
}
}

private static void compileFile( Path sourcePath, Path targetPath, Boolean stopOnError, BoxRuntime runtime, Path basePath, String mapping ) {
public static void compileFile( Path sourcePath, Path targetPath, Boolean stopOnError, BoxRuntime runtime, Path basePath, String mapping ) {
try {
Path directoryPath = targetPath.getParent();
if ( directoryPath != null && !Files.exists( directoryPath ) ) {
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/ortus/boxlang/compiler/IBoxpiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@

public interface IBoxpiler {

static final Set<String> RESERVED_WORDS = new HashSet<>( Arrays.asList( "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char",
static final Set<String> RESERVED_WORDS = new HashSet<>( Arrays.asList( "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char",
"class", "const", "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "goto", "if", "implements",
"import", "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static",
"strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", "volatile", "while" ) );

static final Pattern FQNBasePattern = Pattern.compile( "(.*?)(\\$Closure_.*|\\$Func_.*|\\$Lambda_.*)$" );

/**
* Generate an MD5 hash.
* TODO: Move to util class
Expand Down Expand Up @@ -80,7 +82,7 @@ static String MD5( String md5 ) {

static String getBaseFQN( String FQN ) {
// If fqn ends with $Cloure_xxx or $Func_xxx, $Lambda_xxx, then we need to strip that off to get the original FQN
Matcher m = Pattern.compile( "(.*?)(\\$Closure_.*|\\$Func_.*|\\$Lambda_.*)$" ).matcher( FQN );
Matcher m = FQNBasePattern.matcher( FQN );
if ( m.find() ) {
FQN = m.group( 1 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import ortus.boxlang.compiler.Boxpiler;
import ortus.boxlang.compiler.ClassInfo;
import ortus.boxlang.compiler.ast.BoxClass;
import ortus.boxlang.compiler.ast.BoxInterface;
import ortus.boxlang.compiler.ast.BoxNode;
import ortus.boxlang.compiler.ast.BoxScript;
import ortus.boxlang.compiler.ast.visitor.QueryEscapeSingleQuoteVisitor;
Expand Down Expand Up @@ -130,8 +131,10 @@ private void doCompileClassInfo( Transpiler transpiler, ClassInfo classInfo, Box
classNode = transpiler.transpile( boxScript );
} else if ( node instanceof BoxClass boxClass ) {
classNode = transpiler.transpile( boxClass );
} else if ( node instanceof BoxInterface boxInterface ) {
classNode = transpiler.transpile( boxInterface );
} else {
throw new IllegalStateException( "Unexpected root type: " + node );
throw new IllegalStateException( "Unexpected root type: " + node.getClass() + ": " + node );
}
transpiler.getAuxiliary().forEach( consumer );
consumer.accept( classInfo.fqn().toString(), classNode );
Expand Down
Loading

0 comments on commit 616256b

Please sign in to comment.