Skip to content

Commit 35b14e7

Browse files
authored
Merge pull request #205 from ortus-boxlang/development
version bump
2 parents 6ffdf53 + 6bec42a commit 35b14e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+887
-189
lines changed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ dependencies {
123123
// https://mvnrepository.com/artifact/com.fasterxml.jackson.jr/jackson-jr-extension-javatime
124124
implementation 'com.fasterxml.jackson.jr:jackson-jr-extension-javatime:2.19.0'
125125
// https://mvnrepository.com/artifact/com.fasterxml.jackson.jr/jackson-jr-stree
126-
implementation 'com.fasterxml.jackson.jr:jackson-jr-stree:2.18.3'
126+
implementation 'com.fasterxml.jackson.jr:jackson-jr-stree:2.19.0'
127127
// https://mvnrepository.com/artifact/com.fasterxml.jackson.jr/jackson-jr-annotation-support
128128
implementation 'com.fasterxml.jackson.jr:jackson-jr-annotation-support:2.19.0'
129129
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
@@ -137,7 +137,7 @@ dependencies {
137137
// https://mvnrepository.com/artifact/org.ow2.asm/asm-util
138138
implementation 'org.ow2.asm:asm-util:9.8'
139139
// https://mvnrepository.com/artifact/org.semver4j/semver4j
140-
implementation 'org.semver4j:semver4j:5.6.0'
140+
implementation 'org.semver4j:semver4j:5.7.0'
141141

142142
}
143143

@@ -167,9 +167,9 @@ project.ext.bumpVersion = {
167167
if( patch ){
168168
newVersion = "${versionParts[ 0 ]}.${versionParts[ 1 ]}.${newPathVersion}"
169169
} else if( minor ){
170-
newVersion = "${versionParts[ 0 ]}.${newPathVersion}.${versionParts[ 2 ]}"
170+
newVersion = "${versionParts[ 0 ]}.${newPathVersion}.0"
171171
} else if( major ){
172-
newVersion = "${newPathVersion}.${versionParts[ 1 ]}.${versionParts[ 2 ]}"
172+
newVersion = "${newPathVersion}.0.0"
173173
} else if( beta ){
174174
// Get's the -betaX version.
175175
def betaString = currentVersion.split( '-' )[ 1 ]

changelog.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
### New Features
13+
14+
- [BL-1365](https://ortussolutions.atlassian.net/browse/BL-1365) Add parse\(\) helper methods directly to runtime which returns parse result
15+
- [BL-1388](https://ortussolutions.atlassian.net/browse/BL-1388) new security configuration item: populateServerSystemScope that can allow or not the population of the server.system scope or not
16+
17+
### Improvements
18+
19+
- [BL-1333](https://ortussolutions.atlassian.net/browse/BL-1333) Create links to BoxLang modules
20+
- [BL-1351](https://ortussolutions.atlassian.net/browse/BL-1351) match getHTTPTimeString\(\) and default time to now
21+
- [BL-1358](https://ortussolutions.atlassian.net/browse/BL-1358) Work harder to return partial AST on invalid parse
22+
- [BL-1363](https://ortussolutions.atlassian.net/browse/BL-1363) Error executing dump template \[/dump/html/BoxClass.bxm\]
23+
- [BL-1375](https://ortussolutions.atlassian.net/browse/BL-1375) Compat - Move Legacy Date Format Interception to Module-Specific Interception Point
24+
- [BL-1381](https://ortussolutions.atlassian.net/browse/BL-1381) allow box class to be looped over as collection
25+
- [BL-1382](https://ortussolutions.atlassian.net/browse/BL-1382) Rework event bus interceptors to accelerate during executions
26+
- [BL-1383](https://ortussolutions.atlassian.net/browse/BL-1383) Compat - Allow handling of decimals where timespan is used
27+
- [BL-1387](https://ortussolutions.atlassian.net/browse/BL-1387) Allow Numeric ApplicationTimeout assignment to to be decimal
28+
29+
### Bugs
30+
31+
- [BL-1354](https://ortussolutions.atlassian.net/browse/BL-1354) BoxLang date time not accepted by JDBC as a date object
32+
- [BL-1359](https://ortussolutions.atlassian.net/browse/BL-1359) contracting path doesn't work if casing of mapping doesn't match casing of abs path
33+
- [BL-1366](https://ortussolutions.atlassian.net/browse/BL-1366) sessionInvalidate\(\) "Cannot invoke String.length\(\) because "s" is null"
34+
- [BL-1370](https://ortussolutions.atlassian.net/browse/BL-1370) Some methods not found in java interop
35+
- [BL-1372](https://ortussolutions.atlassian.net/browse/BL-1372) string functions accepting null
36+
- [BL-1374](https://ortussolutions.atlassian.net/browse/BL-1374) onMissingTemplate event mystyped as missingtemplate
37+
- [BL-1377](https://ortussolutions.atlassian.net/browse/BL-1377) fileExists\(\) not working with relative paths
38+
- [BL-1378](https://ortussolutions.atlassian.net/browse/BL-1378) optional capture groups throw NPE in reReplace\(\)
39+
- [BL-1379](https://ortussolutions.atlassian.net/browse/BL-1379) array length incorrect for xml nodes
40+
- [BL-1384](https://ortussolutions.atlassian.net/browse/BL-1384) Numeric Session Timeout Values Should Be Duration of Days not Seconds
41+
1242
## [1.0.1] - 2025-05-01
1343

1444
### Fixed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Tue Feb 18 09:03:33 UTC 2025
1+
#Thu May 01 01:47:33 UTC 2025
22
antlrVersion=4.13.1
33
jdkVersion=21
4-
version=1.0.1
4+
version=1.1.0

src/main/java/ortus/boxlang/compiler/asmboxpiler/transformer/statement/BoxFunctionDeclarationTransformer.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,22 @@ public List<AbstractInsnNode> transform( BoxNode node, TransformerContext contex
300300
true )
301301
);
302302

303-
if ( returnContext == ReturnValueContext.VALUE || returnContext == ReturnValueContext.VALUE_OR_NULL ) {
304-
nodes.add( new InsnNode( Opcodes.ACONST_NULL ) );
305-
}
306-
307303
if ( !function.getModifiers().contains( BoxMethodDeclarationModifier.STATIC )
308304
&& !function.getModifiers().contains( BoxMethodDeclarationModifier.ABSTRACT ) ) {
309305
transpiler.addUDFRegistration( function.getName(), nodes );
310306
}
311307

312308
if ( function.getModifiers().contains( BoxMethodDeclarationModifier.STATIC ) ) {
313309
return nodes;
314-
} else {
315-
return new ArrayList<>();
316310
}
311+
312+
ArrayList<AbstractInsnNode> blankResult = new ArrayList<>();
313+
314+
if ( returnContext == ReturnValueContext.VALUE || returnContext == ReturnValueContext.VALUE_OR_NULL ) {
315+
blankResult.add( new InsnNode( Opcodes.ACONST_NULL ) );
316+
}
317+
318+
return blankResult;
317319
}
318320

319321
private boolean shouldDefaultOutput( BoxFunctionDeclaration function ) {

src/main/java/ortus/boxlang/compiler/ast/BoxExpressionError.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public BoxExpressionError( Position position, String sourceText ) {
2222
*/
2323
@Override
2424
public void accept( VoidBoxVisitor v ) {
25-
25+
v.visit( this );
2626
}
2727

2828
/**
@@ -35,6 +35,6 @@ public void accept( VoidBoxVisitor v ) {
3535
*/
3636
@Override
3737
public BoxNode accept( ReplacingBoxVisitor v ) {
38-
return this;
38+
return v.visit( this );
3939
}
4040
}

src/main/java/ortus/boxlang/compiler/ast/BoxStatementError.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public BoxStatementError( Position position, String sourceText ) {
2222
*/
2323
@Override
2424
public void accept( VoidBoxVisitor v ) {
25-
25+
v.visit( this );
2626
}
2727

2828
/**
@@ -35,6 +35,6 @@ public void accept( VoidBoxVisitor v ) {
3535
*/
3636
@Override
3737
public BoxNode accept( ReplacingBoxVisitor v ) {
38-
return null;
38+
return v.visit( this );
3939
}
4040
}

src/main/java/ortus/boxlang/compiler/ast/visitor/PrettyPrintBoxVisitor.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818

1919
import ortus.boxlang.compiler.ast.BoxClass;
2020
import ortus.boxlang.compiler.ast.BoxExpression;
21+
import ortus.boxlang.compiler.ast.BoxExpressionError;
2122
import ortus.boxlang.compiler.ast.BoxInterface;
2223
import ortus.boxlang.compiler.ast.BoxNode;
2324
import ortus.boxlang.compiler.ast.BoxScript;
25+
import ortus.boxlang.compiler.ast.BoxStatementError;
2426
import ortus.boxlang.compiler.ast.BoxStaticInitializer;
2527
import ortus.boxlang.compiler.ast.BoxTemplate;
2628
import ortus.boxlang.compiler.ast.comment.BoxDocComment;
@@ -1758,6 +1760,23 @@ public void visit( BoxFunctionalMemberAccess node ) {
17581760
printPostComments( node );
17591761
}
17601762

1763+
/**
1764+
* An invalid AST (containing error nodes) probably should not be printed out as it may be missing code.
1765+
* If an error node is printed, it should be printed as the original source text.
1766+
* This may or may not duplicate comments depending on whether or not the associated comments were inside the error node boundaries or not
1767+
*/
1768+
public void visit( BoxStatementError node ) {
1769+
printPreComments( node );
1770+
print( node.getSourceText() );
1771+
printPostComments( node );
1772+
}
1773+
1774+
public void visit( BoxExpressionError node ) {
1775+
printPreComments( node );
1776+
print( node.getSourceText() );
1777+
printPostComments( node );
1778+
}
1779+
17611780
// SQL AST Nodes
17621781

17631782
public void visit( SQLBooleanLiteral node ) {

src/main/java/ortus/boxlang/compiler/ast/visitor/ReplacingBoxVisitor.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818

1919
import ortus.boxlang.compiler.ast.BoxClass;
2020
import ortus.boxlang.compiler.ast.BoxExpression;
21+
import ortus.boxlang.compiler.ast.BoxExpressionError;
2122
import ortus.boxlang.compiler.ast.BoxInterface;
2223
import ortus.boxlang.compiler.ast.BoxNode;
2324
import ortus.boxlang.compiler.ast.BoxScript;
2425
import ortus.boxlang.compiler.ast.BoxStatement;
26+
import ortus.boxlang.compiler.ast.BoxStatementError;
2527
import ortus.boxlang.compiler.ast.BoxStaticInitializer;
2628
import ortus.boxlang.compiler.ast.BoxTemplate;
2729
import ortus.boxlang.compiler.ast.comment.BoxDocComment;
@@ -1046,6 +1048,14 @@ public BoxNode visit( BoxComponent node ) {
10461048
return node;
10471049
}
10481050

1051+
public BoxNode visit( BoxStatementError node ) {
1052+
return node;
1053+
}
1054+
1055+
public BoxNode visit( BoxExpressionError node ) {
1056+
return node;
1057+
}
1058+
10491059
private void handleStatements( List<BoxStatement> statements, BoxNode node ) {
10501060
if ( statements == null ) {
10511061
return;

src/main/java/ortus/boxlang/compiler/ast/visitor/VoidBoxVisitor.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
package ortus.boxlang.compiler.ast.visitor;
1616

1717
import ortus.boxlang.compiler.ast.BoxClass;
18+
import ortus.boxlang.compiler.ast.BoxExpressionError;
1819
import ortus.boxlang.compiler.ast.BoxInterface;
1920
import ortus.boxlang.compiler.ast.BoxNode;
2021
import ortus.boxlang.compiler.ast.BoxScript;
22+
import ortus.boxlang.compiler.ast.BoxStatementError;
2123
import ortus.boxlang.compiler.ast.BoxStaticInitializer;
2224
import ortus.boxlang.compiler.ast.BoxTemplate;
2325
import ortus.boxlang.compiler.ast.comment.BoxDocComment;
@@ -397,6 +399,14 @@ public void visit( BoxFunctionalMemberAccess node ) {
397399
visitChildren( node );
398400
}
399401

402+
public void visit( BoxStatementError node ) {
403+
visitChildren( node );
404+
}
405+
406+
public void visit( BoxExpressionError node ) {
407+
visitChildren( node );
408+
}
409+
400410
// SQL AST Nodes
401411

402412
public void visit( SQLBooleanLiteral node ) {

src/main/java/ortus/boxlang/compiler/parser/BoxParser.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import ortus.boxlang.compiler.ast.BoxNode;
3737
import ortus.boxlang.compiler.ast.BoxScript;
3838
import ortus.boxlang.compiler.ast.BoxStatement;
39+
import ortus.boxlang.compiler.ast.BoxStatementError;
3940
import ortus.boxlang.compiler.ast.BoxTemplate;
4041
import ortus.boxlang.compiler.ast.Issue;
4142
import ortus.boxlang.compiler.ast.Point;
@@ -374,6 +375,7 @@ protected BoxNode parserFirstStage( InputStream stream, boolean classOrInterface
374375
rootNode = toAst( null, ( BoxGrammar.TemplateContext ) parseTree );
375376
}
376377
} catch ( Exception e ) {
378+
// e.printStackTrace();
377379
// Ignore issues creating AST if the parsing already had failures
378380
if ( issues.isEmpty() ) {
379381
throw e;
@@ -664,7 +666,7 @@ private List<BoxStatement> statementsToAst( File file, ParserRuleContext node )
664666
}
665667
}
666668
} else {
667-
statements.add( toAst( file, statement ) );
669+
statements.add( toStatementOrError( () -> ( BoxStatement ) toAst( file, statement ), statement ) );
668670
}
669671
} else if ( child instanceof Template_textContentContext textContent ) {
670672
statements.addAll( toAst( file, textContent ) );
@@ -680,7 +682,7 @@ private List<BoxStatement> statementsToAst( File file, ParserRuleContext node )
680682
);
681683
}
682684
} else if ( child instanceof Template_boxImportContext importContext ) {
683-
statements.add( toAst( file, importContext ) );
685+
statements.add( toStatementOrError( () -> ( BoxStatement ) toAst( file, importContext ), importContext ) );
684686
}
685687
}
686688
}
@@ -695,6 +697,20 @@ private List<BoxStatement> statementsToAst( File file, ParserRuleContext node )
695697
return statements;
696698
}
697699

700+
public BoxStatement toStatementOrError( java.util.function.Supplier<BoxStatement> statementGenerator, ParserRuleContext node ) {
701+
try {
702+
return statementGenerator.get();
703+
} catch ( Exception e ) {
704+
if ( !issues.isEmpty() ) {
705+
// If we have issues, then we are in error and should return an error node
706+
return new BoxStatementError( getPosition( node ), getSourceText( node ) );
707+
} else {
708+
// Otherwise, throw the exception to be handled by the caller
709+
throw e;
710+
}
711+
}
712+
}
713+
698714
private boolean allStatementsAreWhitespace( List<BoxStatement> bodyStatements ) {
699715
for ( BoxStatement statement : bodyStatements ) {
700716
if ( statement instanceof BoxBufferOutput bffr ) {

0 commit comments

Comments
 (0)