├── src ├── test │ ├── bx │ │ ├── .gitkeep │ │ ├── models │ │ │ ├── TestClass.bx │ │ │ └── Validation.bx │ │ ├── includeTest.bxs │ │ ├── index.bxm │ │ ├── MyThreadingSuperClass.bx │ │ ├── Test.bxs │ │ ├── SimpleUser.bx │ │ ├── TestSheBang.sh │ │ ├── Interceptor.bx │ │ ├── INotifiable.bx │ │ ├── MyThreadingClass.bx │ │ └── generatePrimes.cfs │ ├── resources │ │ ├── .gitkeep │ │ ├── libs │ │ │ ├── config.properties │ │ │ ├── helloworld.jar │ │ │ └── caffeine-3.1.8.jar │ │ ├── Application.bx │ │ ├── test-templates │ │ │ ├── BoxRuntime.bxs │ │ │ ├── BoxRuntime.cfm │ │ │ └── json_withBOM.json │ │ ├── chuck_norris.jpg │ │ ├── box.json │ │ └── components │ │ │ └── User.cfc │ └── java │ │ ├── TestCases │ │ ├── Test.java │ │ ├── phase1 │ │ │ ├── files │ │ │ │ ├── index.bxs │ │ │ │ ├── Runner.bx │ │ │ │ └── Application.bx │ │ │ ├── unicode.cfm │ │ │ ├── ClassWithAbstractAnnotation.bx │ │ │ ├── functionDeclare.bxs │ │ │ ├── ClassWithAbstractAnnotationCF.cfc │ │ │ ├── ClassWithAbstractAnnotationParent.bx │ │ │ ├── ClassWithAbstractAnnotationParentCF.cfc │ │ │ ├── TestReturnType.bx │ │ │ ├── tagContextLineMapping.bxs │ │ │ ├── TestReturnType.bxm │ │ │ ├── TestBodyResultError.bx │ │ │ └── AssignmentClass.bx │ │ ├── phase3 │ │ │ ├── foo@bar.bx │ │ │ ├── sub-folder │ │ │ │ └── Funky-Class.bx │ │ │ ├── MixinTest.bx │ │ │ ├── SeniorVespa.bx │ │ │ ├── TagClassWithBOM.cfc │ │ │ ├── mixin.bxs │ │ │ ├── IllegalFinalExtends.bx │ │ │ ├── KeywordAsAnnotationName.bx │ │ │ ├── PseudoConstructorError.bx │ │ │ ├── superMixinBug │ │ │ │ ├── Child.bx │ │ │ │ ├── Parent.bx │ │ │ │ ├── mixin.bxs │ │ │ │ └── Grandparent.bx │ │ │ ├── ConcreteClassNoMethod.bx │ │ │ ├── FindMe.bx │ │ │ ├── KeywordAsAnnotationNameCF.cfc │ │ │ ├── Renderer.cfc │ │ │ ├── ClassWrappedInScript.cfc │ │ │ ├── FinalClass.bx │ │ │ ├── ASMError.cfc │ │ │ ├── GeneratedGetterChild.bx │ │ │ ├── GeneratedSetterReturnCorrectThisParent.bx │ │ │ ├── DotExtendsParent.cfc │ │ │ ├── PseudoConstructorNoOutput.cfc │ │ │ ├── PseudoConstructorOutput.cfc │ │ │ ├── BadProperty.cfc │ │ │ ├── ClassWithInclude.cfc │ │ │ ├── MixinTestParent.bx │ │ │ ├── ClassTrailingComment.cfc │ │ │ ├── SemiAfteAnnotation.bx │ │ │ ├── ExceptionThrower.cfs │ │ │ ├── ConcreteClass.bx │ │ │ ├── Email.bx │ │ │ ├── PropertiesNotInheritedInMetadataParent.bx │ │ │ ├── Application.bx │ │ │ ├── ConcreteClassCF.cfc │ │ │ ├── MethodPropConflictParent.cfc │ │ │ ├── MyRenderer.cfc │ │ │ ├── NotApplication.bx │ │ │ ├── _Renderer.cfc │ │ │ ├── ImplicitGeneratedAccessor.bx │ │ │ ├── JavaImplements.bx │ │ │ ├── StaticInitializerAboveProperties.cfc │ │ │ ├── AbstractClass.bx │ │ │ ├── Mixin.cfm │ │ │ ├── ImportKeyClass.cfc │ │ │ ├── AbstractClassCF.cfc │ │ │ ├── DotExtends.cfc │ │ │ ├── ClassLeadingComment.cfc │ │ │ ├── ConcreteClassWrongMethod.bx │ │ │ ├── MissingSuperScopeChild.bx │ │ │ ├── GeneratedAccessor.bx │ │ │ ├── IMotorcycle.bx │ │ │ ├── ImplicitConstructorTest.cfc │ │ │ ├── PropertiesNotInheritedInMetadata.bx │ │ │ ├── JavaExtends2.bx │ │ │ ├── GeneratedSetterReturnCorrectThis.bx │ │ │ ├── GetterTest.cfc │ │ │ ├── RelativeSelfInstantiation.bx │ │ │ ├── Stack.cfc │ │ │ ├── StaticError.cfc │ │ │ ├── CurrentTemplateInStaticInitializer.bx │ │ │ ├── scriptIncludeASMIssue.cfm │ │ │ ├── IBicycle.bx │ │ │ ├── GeneratedGetterParent.bx │ │ │ ├── InterfaceInheritenceTest.bx │ │ │ ├── RelativeManager.bx │ │ │ ├── ClassLocatorInStaticInitializer.bx │ │ │ ├── IChildInterface.bx │ │ │ ├── InitMethodTest.bx │ │ │ ├── InterfaceStatic.bx │ │ │ ├── StaticInitCallStaticMethod.bx │ │ │ ├── ReservedAnnotations.cfc │ │ │ ├── GrandParent.cfc │ │ │ ├── CFImportTest.cfc │ │ │ ├── CFImportTest2.cfc │ │ │ ├── MethodPropConflict.cfc │ │ │ ├── JavaOverride.bx │ │ │ ├── MissingSuperScopeParent.bx │ │ │ ├── IUncleInterface.bx │ │ │ ├── tasks │ │ │ │ └── Future.cfc │ │ │ ├── IParentInterface.bx │ │ │ ├── JavaExtends.bx │ │ │ ├── FunctionMeta.cfc │ │ │ ├── MyInterfaceBL.bx │ │ │ ├── MyInterfaceCF.cfc │ │ │ ├── IMultiChildInterface.bx │ │ │ ├── WeirdParse.cfc │ │ │ ├── WheeledThing.bx │ │ │ ├── InvokeImplicitAccessorsCF.cfc │ │ │ ├── JavaExtends3.bx │ │ │ ├── StaticArgDefaultTest.cfc │ │ │ ├── InvokeImplicitAccessors.bx │ │ │ ├── MyInterfaceCFTag.cfc │ │ │ ├── OnMissingMethod.cfc │ │ │ ├── Chihuahua.cfc │ │ │ ├── TestStaticFromScript.bxs │ │ │ ├── RelativeInstantiation.bx │ │ │ ├── InterfaceMultiInheritenceTest.bx │ │ │ ├── Parent.cfc │ │ │ ├── Moped.bx │ │ │ ├── Child.cfc │ │ │ ├── ImplicitAccessor.bx │ │ │ ├── TagComponentParse.cfc │ │ │ ├── PropertyTestCF.cfc │ │ │ ├── Dog.cfc │ │ │ ├── StaticTestCF.cfc │ │ │ ├── StaticTestCF2.cfc │ │ │ └── MyClassCF.cfc │ │ ├── applications │ │ │ ├── onrequestImplicit │ │ │ │ ├── index.bxm │ │ │ │ └── Application.bx │ │ │ ├── appClass │ │ │ │ ├── index.bxm │ │ │ │ ├── sub1 │ │ │ │ │ └── index.bxm │ │ │ │ ├── sub2 │ │ │ │ │ ├── include.bxm │ │ │ │ │ ├── index.bxm │ │ │ │ │ └── Application.bx │ │ │ │ └── Application.bx │ │ │ ├── appTemplate │ │ │ │ ├── index.bxm │ │ │ │ ├── sub1 │ │ │ │ │ └── index.bxm │ │ │ │ ├── sub2 │ │ │ │ │ ├── index.bxm │ │ │ │ │ └── Application.bxm │ │ │ │ └── Application.bxm │ │ │ ├── external │ │ │ │ ├── index.bxm │ │ │ │ ├── sub1 │ │ │ │ │ ├── include.bxm │ │ │ │ │ └── index.bxm │ │ │ │ └── Application.bx │ │ │ └── timezoneAppClass │ │ │ │ ├── index.bxm │ │ │ │ └── Application.bx │ │ ├── components │ │ │ ├── MyInclude.cfm │ │ │ ├── echoTag.cfm │ │ │ ├── TestEmptyScriptBlock.bxm │ │ │ ├── TestEmptyScriptBlock.cfm │ │ │ ├── FlushUtils.bx │ │ │ ├── CallStack.bx │ │ │ ├── MyClass.cfc │ │ │ └── QuerySpaceOutput.cfc │ │ ├── phase2 │ │ │ ├── NonCompilableFileExtension.txt │ │ │ ├── RelativeIncludeTest.cfm │ │ │ ├── IncludeTest.cfs │ │ │ ├── includeFuncs.cfm │ │ │ ├── myInclude.cfs │ │ │ ├── Parent.bx │ │ │ └── Child.bx │ │ ├── debugger │ │ │ └── main.cfs │ │ └── hello │ │ │ └── HelloWorld.java │ │ ├── ortus │ │ └── boxlang │ │ │ ├── runtime │ │ │ ├── bifs │ │ │ │ └── global │ │ │ │ │ ├── io │ │ │ │ │ └── expandPathTest.txt │ │ │ │ │ ├── system │ │ │ │ │ ├── TestCustomTag.bxm │ │ │ │ │ ├── BaseTest1.cfs │ │ │ │ │ ├── BaseTest2.cfs │ │ │ │ │ ├── testApp │ │ │ │ │ │ ├── MyClass.bx │ │ │ │ │ │ └── Application.bx │ │ │ │ │ ├── BaseTest3.cfs │ │ │ │ │ ├── IncludeTest.cfs │ │ │ │ │ ├── IncludeTestAgain2.cfm │ │ │ │ │ ├── IncludeTestAgain.cfm │ │ │ │ │ ├── InvokeTest.cfc │ │ │ │ │ └── java │ │ │ │ │ │ ├── ToLongFunction.bx │ │ │ │ │ │ └── ToLongFunctionInvalidReturn.bx │ │ │ │ │ ├── xml │ │ │ │ │ ├── document.xml │ │ │ │ │ └── transformer.xsl │ │ │ │ │ ├── conversion │ │ │ │ │ └── CircularClass.bx │ │ │ │ │ └── jdbc │ │ │ │ │ └── DerbySleep.java │ │ │ ├── components │ │ │ │ └── system │ │ │ │ │ ├── relativetest │ │ │ │ │ ├── relativeTest.cfm │ │ │ │ │ └── relativeComponent.cfm │ │ │ │ │ ├── AccessThisScopeFromFunction.bxs │ │ │ │ │ ├── MyTag3.cfm │ │ │ │ │ ├── brad.cfm │ │ │ │ │ ├── bradBL.bxm │ │ │ │ │ ├── CustomTagC.cfm │ │ │ │ │ ├── CustomTagD.cfm │ │ │ │ │ ├── InvokeTest.bx │ │ │ │ │ ├── CustomTagA.cfm │ │ │ │ │ ├── CustomTagB.cfm │ │ │ │ │ ├── LoopMeAsCollection.bx │ │ │ │ │ ├── DumpParent.bx │ │ │ │ │ ├── TestDumpClass.bx │ │ │ │ │ ├── ClassWithIsEmpty.bx │ │ │ │ │ ├── InnerTag.cfm │ │ │ │ │ ├── DumpChild.bx │ │ │ │ │ ├── AbortTestInclude.cfm │ │ │ │ │ ├── ExitTests │ │ │ │ │ ├── plainInclude.bxm │ │ │ │ │ ├── UDFInclude.bxm │ │ │ │ │ ├── ExitClass.bx │ │ │ │ │ └── module.bxm │ │ │ │ │ ├── InnerTag2.cfm │ │ │ │ │ ├── MyTag2.cfm │ │ │ │ │ ├── EventMethods.cfc │ │ │ │ │ ├── OuterTag2.cfm │ │ │ │ │ ├── OuterTag.cfm │ │ │ │ │ ├── AccessThisScopeFromFunction.bx │ │ │ │ │ ├── AccessVariablesScopeFromFunction.bxm │ │ │ │ │ └── MyTag.cfm │ │ │ ├── interop │ │ │ │ ├── TestTypedArraySubtype.java │ │ │ │ ├── TestAmbiguousVarargs.java │ │ │ │ ├── TestTypedArray.java │ │ │ │ └── VarArgsExample.java │ │ │ ├── dynamic │ │ │ │ └── javaproxy │ │ │ │ │ └── BoxClassRunnable.cfc │ │ │ └── cache │ │ │ │ └── policies │ │ │ │ └── RandomTest.java │ │ │ └── compiler │ │ │ ├── Precompiled-source.bxs │ │ │ ├── Parent.cfc │ │ │ ├── Precompiled-source.bx │ │ │ ├── sourcemaptests │ │ │ ├── MissingVar.bx │ │ │ ├── MissingVarTemplate.bxm │ │ │ └── ComponentInTemplate.bxm │ │ │ ├── MyClassMDVistorCFParent.cfc │ │ │ ├── BDDTest.cfc │ │ │ ├── Child.cfc │ │ │ ├── UnencodedTest.cfm │ │ │ ├── MyClassMDVistorCFTag.cfc │ │ │ ├── QueryParamTest.cfm │ │ │ ├── CompileIssue1.cfc │ │ │ ├── template.cfm │ │ │ └── Scheduler.cfc │ │ └── external │ │ └── specs │ │ ├── QoQDistinctSortTest.cfc │ │ └── QoQDistinctEdgeCaseTest.cfc ├── main │ ├── resources │ │ ├── .gitkeep │ │ ├── META-INF │ │ │ ├── services │ │ │ │ ├── javax.script.ScriptEngineFactory │ │ │ │ └── ortus.boxlang.compiler.IBoxpiler │ │ │ └── boxlang │ │ │ │ └── version.properties │ │ ├── dump │ │ │ └── html │ │ │ │ ├── Key.bxm │ │ │ │ ├── ITemplateRunnable.bxm │ │ │ │ ├── Boolean.bxm │ │ │ │ ├── String.bxm │ │ │ │ ├── Null.bxm │ │ │ │ ├── Number.bxm │ │ │ │ ├── StringBuffer.bxm │ │ │ │ ├── Instant.bxm │ │ │ │ ├── ToString.bxm │ │ │ │ ├── Duration.bxm │ │ │ │ └── DateTime.bxm │ │ └── maven │ │ │ └── maven.md │ ├── java │ │ └── ortus │ │ │ └── boxlang │ │ │ ├── debugger │ │ │ ├── types │ │ │ │ ├── Message.java │ │ │ │ ├── Scope.java │ │ │ │ ├── StackFrame.java │ │ │ │ └── ExceptionBreakpointsFilter.java │ │ │ ├── IVMInitializationStrategy.java │ │ │ ├── request │ │ │ │ ├── ScopeRequest.java │ │ │ │ └── SetVariableRequest.java │ │ │ └── IAdapterProtocolMessage.java │ │ │ ├── compiler │ │ │ ├── asmboxpiler │ │ │ │ ├── DividerNode.java │ │ │ │ ├── ITranspiler.java │ │ │ │ ├── transformer │ │ │ │ │ ├── ReturnValueContext.java │ │ │ │ │ └── TransformerContext.java │ │ │ │ └── DebugCatchResetNode.java │ │ │ ├── BoxByteCodeVersion.java │ │ │ └── ast │ │ │ │ ├── expression │ │ │ │ ├── BoxNegateOperator.java │ │ │ │ ├── BoxAssignmentModifier.java │ │ │ │ └── IBoxLiteral.java │ │ │ │ └── statement │ │ │ │ └── BoxAccessModifier.java │ │ │ └── runtime │ │ │ ├── interop │ │ │ └── proxies │ │ │ │ └── Runnable.java │ │ │ ├── validation │ │ │ └── Validatable.java │ │ │ └── dynamic │ │ │ └── casters │ │ │ └── IBoxCaster.java │ └── apidocs │ │ └── index.html └── modules │ └── test │ ├── src │ ├── libs │ │ ├── .gitkeep │ │ └── helloworld.jar │ └── main │ │ └── bx │ │ ├── interceptors │ │ ├── .gitkeep │ │ └── Listener.bx │ │ ├── www │ │ └── test.bxm │ │ ├── models │ │ └── Hello.bx │ │ └── bifs │ │ └── ModuleNow.bx │ ├── .gitignore │ └── box.json ├── .github ├── FUNDING.YML ├── SUPPORT.md ├── CODE_OF_CONDUCT.MD ├── SECURITY.md ├── dependabot.yml └── ISSUE_TEMPLATE │ ├── FEATURE_REQUEST.md │ └── BUG_REPORT.md ├── workbench ├── www ├── samples │ ├── components │ │ ├── system │ │ │ ├── Include.md │ │ │ ├── Component.md │ │ │ ├── Exit.md │ │ │ ├── Lock.md │ │ │ ├── Silent.md │ │ │ ├── InvokeArgument.md │ │ │ ├── SaveContent.md │ │ │ ├── Execute.md │ │ │ ├── Flush.md │ │ │ ├── ObjectComponent.md │ │ │ └── Param.md │ │ ├── async │ │ │ └── Thread.md │ │ ├── jdbc │ │ │ └── ProcParam.md │ │ ├── xml │ │ │ └── XML.md │ │ ├── zip │ │ │ └── Zip.md │ │ └── net │ │ │ └── HTTPParam.md │ ├── bifs │ │ ├── io │ │ │ ├── FileSeek.md │ │ │ ├── FileMove.md │ │ │ ├── FileCopy.md │ │ │ ├── FileSetAccessMode.md │ │ │ ├── FileRead.md │ │ │ ├── DirectoryMove.md │ │ │ ├── FileExists.md │ │ │ ├── FileWriteLine.md │ │ │ ├── FileAppend.md │ │ │ ├── DirectoryDelete.md │ │ │ ├── DirectoryCopy.md │ │ │ ├── FileWrite.md │ │ │ ├── GetDirectoryFromPath.md │ │ │ ├── FileDelete.md │ │ │ ├── FileClose.md │ │ │ ├── CreateTempFile.md │ │ │ ├── FileSetLastModified.md │ │ │ ├── FileSetAttribute.md │ │ │ ├── GetCanonicalPath.md │ │ │ └── DirectoryExists.md │ │ ├── temporal │ │ │ ├── CreateDateTime.md │ │ │ ├── DateTimeFormat.md │ │ │ ├── ParseDateTime.md │ │ │ ├── CreateTime.md │ │ │ ├── ClearTimezone.md │ │ │ ├── SetTimezone.md │ │ │ ├── CreateODBCDateTime.md │ │ │ └── TimeUnits.md │ │ ├── string │ │ │ ├── ReEscape.md │ │ │ ├── Ascii.md │ │ │ ├── RepeatString.md │ │ │ ├── SpanExcluding.md │ │ │ ├── SpanIncluding.md │ │ │ ├── CompareNoCase.md │ │ │ ├── LCase.md │ │ │ ├── ReMatch.md │ │ │ ├── UCase.md │ │ │ ├── Mid.md │ │ │ ├── Find.md │ │ │ ├── StringSort.md │ │ │ └── Compare.md │ │ ├── decision │ │ │ ├── IsFileObject.md │ │ │ ├── IsDateObject.md │ │ │ ├── IsIPv6.md │ │ │ ├── IsNull.md │ │ │ ├── IsLeapYear.md │ │ │ └── IsXMLDoc.md │ │ ├── struct │ │ │ ├── StructIsOrdered.md │ │ │ ├── StructEquals.md │ │ │ └── StructToQueryString.md │ │ ├── math │ │ │ ├── Sqr.md │ │ │ ├── Tan.md │ │ │ ├── Log10.md │ │ │ ├── Acos.md │ │ │ ├── Log.md │ │ │ ├── Fix.md │ │ │ ├── Min.md │ │ │ ├── Cos.md │ │ │ ├── Exp.md │ │ │ ├── Sin.md │ │ │ ├── Max.md │ │ │ ├── Asin.md │ │ │ ├── Int.md │ │ │ ├── Atn.md │ │ │ ├── Abs.md │ │ │ ├── Randomize.md │ │ │ ├── Ceiling.md │ │ │ ├── DecrementValue.md │ │ │ ├── Rand.md │ │ │ └── Sgn.md │ │ ├── system │ │ │ ├── ApplicationStop.md │ │ │ ├── DE.md │ │ │ ├── GetBaseTemplatePath.md │ │ │ ├── CreateGUID.md │ │ │ ├── CreateUUID.md │ │ │ ├── GetCurrentTemplatePath.md │ │ │ ├── GetTempDirectory.md │ │ │ ├── GetFunctionList.md │ │ │ ├── WriteLog.md │ │ │ ├── GetFileFromPath.md │ │ │ ├── GetBaseTagData.md │ │ │ ├── PagePoolClear.md │ │ │ ├── SystemCacheClear.md │ │ │ ├── Dump.md │ │ │ ├── SystemOutput.md │ │ │ └── IIF.md │ │ ├── java │ │ │ └── CreateDynamicProxy.md │ │ ├── zip │ │ │ ├── Compress.md │ │ │ └── Extract.md │ │ ├── type │ │ │ ├── GetMetaData.md │ │ │ └── NullValue.md │ │ ├── binary │ │ │ ├── BitSh.md │ │ │ ├── BitXor.md │ │ │ ├── BitNot.md │ │ │ ├── BitOr.md │ │ │ └── BitAnd.md │ │ ├── i18n │ │ │ ├── ParseCurrency.md │ │ │ ├── GetLocaleDisplayName.md │ │ │ └── SetLocale.md │ │ ├── async │ │ │ └── IsInThread.md │ │ ├── xml │ │ │ └── XMLNew.md │ │ ├── cache │ │ │ └── Cache.md │ │ ├── array │ │ │ ├── ArrayMedian.md │ │ │ └── ArrayReduceRight.md │ │ └── conversion │ │ │ └── ToBase64.md │ └── types │ │ └── member │ │ └── struct │ │ └── append.md ├── tasks │ ├── BIFAndComponentList.bx │ └── BoxLang.Components.txt └── CodeHeader.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── grapher ├── data │ └── .gitignore └── server.json ├── modules └── bx-derby │ ├── libs │ ├── derby-10.16.1.1.jar │ └── derbyshared-10.16.1.1.jar │ ├── README.md │ └── models │ └── DerbyDriver.bx ├── book.json ├── .markdownlint.json ├── .editorconfig ├── settings.gradle ├── .vscode └── settings.json ├── .env.example └── .gitattributes /src/test/bx/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/main/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/Test.java: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/modules/test/src/libs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/FUNDING.YML: -------------------------------------------------------------------------------- 1 | patreon: ortussolutions 2 | -------------------------------------------------------------------------------- /src/modules/test/src/main/bx/interceptors/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/bx/models/TestClass.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/libs/config.properties: -------------------------------------------------------------------------------- 1 | config=value -------------------------------------------------------------------------------- /src/test/bx/models/Validation.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/test/bx/includeTest.bxs: -------------------------------------------------------------------------------- 1 | println( "hello from include land" ) -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/files/index.bxs: -------------------------------------------------------------------------------- 1 | echo( "index" ) -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/foo@bar.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | } -------------------------------------------------------------------------------- /workbench/www: -------------------------------------------------------------------------------- 1 | /Users/lmajano/Sites/projects/coldbox-platform -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/onrequestImplicit/index.bxm: -------------------------------------------------------------------------------- 1 | My output -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/io/expandPathTest.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/TestCustomTag.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/unicode.cfm: -------------------------------------------------------------------------------- 1 | 2 | kōwhai -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/sub-folder/Funky-Class.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/Precompiled-source.bxs: -------------------------------------------------------------------------------- 1 | result = 2 + 2; -------------------------------------------------------------------------------- /src/test/resources/Application.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | this.name = "test app" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/test-templates/BoxRuntime.bxs: -------------------------------------------------------------------------------- 1 | variables.hello = "Hello" 2 | -------------------------------------------------------------------------------- /src/modules/test/src/main/bx/www/test.bxm: -------------------------------------------------------------------------------- 1 | I am in the test -------------------------------------------------------------------------------- /src/test/java/TestCases/components/MyInclude.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/components/echoTag.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MixinTest.bx: -------------------------------------------------------------------------------- 1 | class extends=MixinTestParent { 2 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/SeniorVespa.bx: -------------------------------------------------------------------------------- 1 | class extends="Moped" { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/TagClassWithBOM.cfc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/bx/index.bxm: -------------------------------------------------------------------------------- 1 | 2 | This is a test template 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/mixin.bxs: -------------------------------------------------------------------------------- 1 | function mixed() { 2 | return "mixed up"; 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appClass/index.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appTemplate/index.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/components/TestEmptyScriptBlock.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/java/TestCases/components/TestEmptyScriptBlock.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/ClassWithAbstractAnnotation.bx: -------------------------------------------------------------------------------- 1 | class abstract { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/functionDeclare.bxs: -------------------------------------------------------------------------------- 1 | function func(){ 2 | return "funcb"; 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/IllegalFinalExtends.bx: -------------------------------------------------------------------------------- 1 | class extends=FinalClass { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/KeywordAsAnnotationName.bx: -------------------------------------------------------------------------------- 1 | class class interface { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/PseudoConstructorError.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | 1/0; 4 | 5 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/superMixinBug/Child.bx: -------------------------------------------------------------------------------- 1 | class name="Child" extends="Parent" {} -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/BaseTest1.cfs: -------------------------------------------------------------------------------- 1 | include "BaseTest2.cfs"; -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/BaseTest2.cfs: -------------------------------------------------------------------------------- 1 | include "BaseTest3.cfs"; -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/testApp/MyClass.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/external/index.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/ClassWithAbstractAnnotationCF.cfc: -------------------------------------------------------------------------------- 1 | component abstract { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ConcreteClassNoMethod.bx: -------------------------------------------------------------------------------- 1 | class extends="AbstractClass" { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appClass/sub1/index.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appTemplate/sub1/index.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appTemplate/sub2/index.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/FindMe.bx: -------------------------------------------------------------------------------- 1 | class { 2 | function foo() { 3 | return "bar"; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/KeywordAsAnnotationNameCF.cfc: -------------------------------------------------------------------------------- 1 | component component interface { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Renderer.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | function init() { 4 | } 5 | 6 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/BaseTest3.cfs: -------------------------------------------------------------------------------- 1 | result = getCurrentTemplatePath(); -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 04 13:13:16 UTC 2025 2 | antlrVersion=4.13.1 3 | jdkVersion=21 4 | version=1.9.0 -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appTemplate/Application.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/onrequestImplicit/Application.bx: -------------------------------------------------------------------------------- 1 | @output( false ) 2 | class { 3 | 4 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/timezoneAppClass/index.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/IncludeTest.cfs: -------------------------------------------------------------------------------- 1 | result = getCurrentTemplatePath(); -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/xml/document.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/relativetest/relativeTest.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ClassWrappedInScript.cfc: -------------------------------------------------------------------------------- 1 | 2 | component { 3 | } 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/FinalClass.bx: -------------------------------------------------------------------------------- 1 | final class { 2 | 3 | final this.CONSTANT = "constant"; 4 | 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/conversion/CircularClass.bx: -------------------------------------------------------------------------------- 1 | class { 2 | property value; 3 | } -------------------------------------------------------------------------------- /src/test/resources/test-templates/BoxRuntime.cfm: -------------------------------------------------------------------------------- 1 | 2 | variables.hello = "Hello" 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appTemplate/sub2/Application.bxm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase2/NonCompilableFileExtension.txt: -------------------------------------------------------------------------------- 1 | This will #not# compile -------------------------------------------------------------------------------- /src/test/java/TestCases/phase2/RelativeIncludeTest.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/IncludeTestAgain2.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/AccessThisScopeFromFunction.bxs: -------------------------------------------------------------------------------- 1 | attributes.bus.data = this.data; -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/MyTag3.cfm: -------------------------------------------------------------------------------- 1 | Template: #attributes.template# -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortus-boxlang/BoxLang/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /grapher/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in the folder 2 | * 3 | 4 | # But don't ignore this file 5 | !.gitignore 6 | -------------------------------------------------------------------------------- /grapher/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "web":{ 3 | "rewrites":{ 4 | "enable":"true" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/bx/MyThreadingSuperClass.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function superMethod() { 4 | return "superMethod"; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/bx/Test.bxs: -------------------------------------------------------------------------------- 1 | jScheduler = new BaseScheduler() 2 | 3 | bxScheduler = new Scheduler().setScheduler( jScheduler ) 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/ClassWithAbstractAnnotationParent.bx: -------------------------------------------------------------------------------- 1 | class extends=ClassWithAbstractAnnotation { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ASMError.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | do { 4 | break; 5 | } while ( false ); 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/GeneratedGetterChild.bx: -------------------------------------------------------------------------------- 1 | class accessors=true extends="GeneratedGetterParent" { 2 | } 3 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/GeneratedSetterReturnCorrectThisParent.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | property name="name"; 4 | 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/Parent.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public function init(){ 3 | 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/Precompiled-source.bx: -------------------------------------------------------------------------------- 1 | class { 2 | function bar() { 3 | return "brad"; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/brad.cfm: -------------------------------------------------------------------------------- 1 | This is the Brad tag #attributes.foo# -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/javax.script.ScriptEngineFactory: -------------------------------------------------------------------------------- 1 | ortus.boxlang.runtime.scripting.BoxScriptingFactory 2 | -------------------------------------------------------------------------------- /src/test/bx/SimpleUser.bx: -------------------------------------------------------------------------------- 1 | class SimpleUser{ 2 | 3 | property name; 4 | property email; 5 | property isActive; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/bx/TestSheBang.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ../../../build/scriptsShadow/boxlang 2 | 3 | println( "Hello World #now()#" ) 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appClass/sub2/include.bxm: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/timezoneAppClass/Application.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | this.timezone = "UTC"; 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/DotExtendsParent.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function parentUDF() { 3 | return "parent"; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/bradBL.bxm: -------------------------------------------------------------------------------- 1 | This is the Brad tag #attributes.foo# -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/relativetest/relativeComponent.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/chuck_norris.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortus-boxlang/BoxLang/HEAD/src/test/resources/chuck_norris.jpg -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/external/sub1/include.bxm: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/ClassWithAbstractAnnotationParentCF.cfc: -------------------------------------------------------------------------------- 1 | component extends=ClassWithAbstractAnnotationCF { 2 | 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/PseudoConstructorNoOutput.cfc: -------------------------------------------------------------------------------- 1 | component output=false { 2 | echo( "PseudoConstructorOutput" ); 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/PseudoConstructorOutput.cfc: -------------------------------------------------------------------------------- 1 | component output=true { 2 | echo( "PseudoConstructorOutput" ); 3 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/superMixinBug/Parent.bx: -------------------------------------------------------------------------------- 1 | class name="Parent" extends="Grandparent" { 2 | include "mixin.bxs"; 3 | } -------------------------------------------------------------------------------- /src/test/resources/libs/helloworld.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortus-boxlang/BoxLang/HEAD/src/test/resources/libs/helloworld.jar -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support & Help 2 | 3 | Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#support-questions). 4 | -------------------------------------------------------------------------------- /src/modules/test/src/libs/helloworld.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortus-boxlang/BoxLang/HEAD/src/modules/test/src/libs/helloworld.jar -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/TestReturnType.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | include 'TestReturnType.bxm'; 4 | this.data = getStruct(); 5 | 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase2/IncludeTest.cfs: -------------------------------------------------------------------------------- 1 | 2 | myVar = "before" 3 | include "myInclude.cfs"; 4 | result = fromInclude & " " & brad(); -------------------------------------------------------------------------------- /src/test/java/TestCases/phase2/includeFuncs.cfm: -------------------------------------------------------------------------------- 1 | 2 | function foo(){ 3 | return "second"; 4 | } 5 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/BadProperty.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | variables.foo = "bar"; 4 | 5 | property name="brad"; 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ClassWithInclude.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | include template="Mixin.cfm"; 3 | 4 | foo() 5 | 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MixinTestParent.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function includeMixin() { 4 | include "mixin.bxs"; 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/sourcemaptests/MissingVar.bx: -------------------------------------------------------------------------------- 1 | class { 2 | function init(){ 3 | foo + bar; 4 | } 5 | } -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.MD: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#code-of-conduct). 4 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#security-vulnerabilities). 4 | -------------------------------------------------------------------------------- /modules/bx-derby/libs/derby-10.16.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortus-boxlang/BoxLang/HEAD/modules/bx-derby/libs/derby-10.16.1.1.jar -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/tagContextLineMapping.bxs: -------------------------------------------------------------------------------- 1 | function foo() { 2 | for( foo in null ) { 3 | println( "good luck" ) 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase2/myInclude.cfs: -------------------------------------------------------------------------------- 1 | fromInclude = "found the value #myVar#"; 2 | 3 | function brad() { 4 | return "wood"; 5 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ClassTrailingComment.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/SemiAfteAnnotation.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | 4 | @returnFormat(json); 5 | @brad; 6 | function foo() { 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/IncludeTestAgain.cfm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/CustomTagC.cfm: -------------------------------------------------------------------------------- 1 | 2 | CustomTagC 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/CustomTagD.cfm: -------------------------------------------------------------------------------- 1 | 2 | CustomTagD 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/InvokeTest.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function foo() { 4 | return "bar"; 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/libs/caffeine-3.1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortus-boxlang/BoxLang/HEAD/src/test/resources/libs/caffeine-3.1.8.jar -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ExceptionThrower.cfs: -------------------------------------------------------------------------------- 1 | try { 2 | 1/0 3 | } catch( any e ) { 4 | e.printStackTrace() 5 | println( e.tagContext ) 6 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/CustomTagA.cfm: -------------------------------------------------------------------------------- 1 | 2 | CustomTagA 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/CustomTagB.cfm: -------------------------------------------------------------------------------- 1 | 2 | CustomTagB 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/LoopMeAsCollection.bx: -------------------------------------------------------------------------------- 1 | class { 2 | this.foo = "bar"; 3 | 4 | function baz() { 5 | } 6 | } -------------------------------------------------------------------------------- /modules/bx-derby/README.md: -------------------------------------------------------------------------------- 1 | # Apache Derby JDBC for BoxLang 2 | 3 | This is a test module only for the core to test against a db during unit testing. 4 | -------------------------------------------------------------------------------- /modules/bx-derby/libs/derbyshared-10.16.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortus-boxlang/BoxLang/HEAD/modules/bx-derby/libs/derbyshared-10.16.1.1.jar -------------------------------------------------------------------------------- /src/modules/test/src/main/bx/models/Hello.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | 3 | function sayHello(){ 4 | return "Hello World From ModuleLand!"; 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/superMixinBug/mixin.bxs: -------------------------------------------------------------------------------- 1 | 2 | function doSomething() { 3 | super.doSomething(); 4 | println( "from child" ); 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/DumpParent.bx: -------------------------------------------------------------------------------- 1 | class { 2 | property name="parentProperty" default="I am a parent property"; 3 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/TestDumpClass.bx: -------------------------------------------------------------------------------- 1 | class { 2 | public function init() { 3 | return 'UDF Dump Class'; 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/ortus.boxlang.compiler.IBoxpiler: -------------------------------------------------------------------------------- 1 | ortus.boxlang.compiler.asmboxpiler.ASMBoxpiler 2 | ortus.boxlang.compiler.NoOpBoxpiler -------------------------------------------------------------------------------- /src/main/resources/dump/html/Key.bxm: -------------------------------------------------------------------------------- 1 | 2 |
#encodeForHTML( var.getName() )#
3 |
4 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/ClassWithIsEmpty.bx: -------------------------------------------------------------------------------- 1 | class { 2 | public function isEmpty() { 3 | return 'UDF Empty Data'; 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ConcreteClass.bx: -------------------------------------------------------------------------------- 1 | class extends="AbstractClass" { 2 | 3 | function abstractMethod() { 4 | return "abstractMethod"; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Email.bx: -------------------------------------------------------------------------------- 1 | class { 2 | property String email; 3 | 4 | function getHost(){ 5 | return variables.email.listRest( '@' ); 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/PropertiesNotInheritedInMetadataParent.bx: -------------------------------------------------------------------------------- 1 | class { 2 | property name=parentProperty; 3 | property name=sharedProperty; 4 | 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/InnerTag.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Application.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | writeOutput("Hello Brad"); 4 | 5 | function run() { 6 | writeOutput("Hello World"); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/DumpChild.bx: -------------------------------------------------------------------------------- 1 | class extends="dumpParent" { 2 | property name="childProperty" default="I am a child property"; 3 | } -------------------------------------------------------------------------------- /workbench/samples/components/system/Include.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | ``` 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/boxlang/version.properties: -------------------------------------------------------------------------------- 1 | version=@build.version@ 2 | buildDate=@build.date@ 3 | codename=Jericho 4 | bytecodeVersion=@build.bytecode.version@ -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ConcreteClassCF.cfc: -------------------------------------------------------------------------------- 1 | component extends="AbstractClassCF" { 2 | 3 | function abstractMethod() { 4 | return "abstractMethod"; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MethodPropConflictParent.cfc: -------------------------------------------------------------------------------- 1 | component extends="MethodPropConflictParent"{ 2 | 3 | this.baz = "bum"; 4 | variables.baz = "bum"; 5 | 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MyRenderer.cfc: -------------------------------------------------------------------------------- 1 | component extends="src.test.java.TestCases.phase3._Renderer" { 2 | 3 | function init() { 4 | super.init(); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/NotApplication.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | writeOutput("Hello Brad"); 4 | 5 | function run() { 6 | writeOutput("Hello World"); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/_Renderer.cfc: -------------------------------------------------------------------------------- 1 | component extends="src.test.java.TestCases.phase3.Renderer" { 2 | 3 | function init() { 4 | super.init(); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/superMixinBug/Grandparent.bx: -------------------------------------------------------------------------------- 1 | class name="Grandparent" { 2 | function doSomething() { 3 | println( "from grandparent" ); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies":{ 3 | "testbox":"be" 4 | }, 5 | "installPaths":{ 6 | "testbox":"testbox/" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/java/TestCases/debugger/main.cfs: -------------------------------------------------------------------------------- 1 | value = 4; 2 | color = "green"; 3 | 4 | data = { test: true }; 5 | 6 | value = value + 2; 7 | 8 | println( "The value is: #value#" ); -------------------------------------------------------------------------------- /src/test/java/TestCases/phase2/Parent.bx: -------------------------------------------------------------------------------- 1 | class { 2 | property name="data" type="string" default=""; 3 | 4 | function add( String newData ) { 5 | data &= newData; 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ImplicitGeneratedAccessor.bx: -------------------------------------------------------------------------------- 1 | class invokeImplicitAccessor=true accessors=true { 2 | property string name; 3 | property integer age; 4 | 5 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/JavaImplements.bx: -------------------------------------------------------------------------------- 1 | class implements="java:java.lang.Runnable" { 2 | 3 | function run() { 4 | println("Hello from a thread!"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/StaticInitializerAboveProperties.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | static { 4 | foo = "bar"; 5 | }; 6 | 7 | property name="foo" default="baz"; 8 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/AbortTestInclude.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/components/FlushUtils.bx: -------------------------------------------------------------------------------- 1 | class output=false { 2 | 3 | public void function hello() output=true { 4 | writeOutput("second"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/TestReturnType.bxm: -------------------------------------------------------------------------------- 1 | 2 | struct function getStruct() { 3 | return { 4 | foo = "bar", 5 | baz = "bum" 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/AbstractClass.bx: -------------------------------------------------------------------------------- 1 | abstract class { 2 | 3 | function normal() { 4 | return "normal"; 5 | } 6 | 7 | abstract function abstractMethod() 8 | 9 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Mixin.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | struct function foo() { 4 | return {} 5 | } 6 | 7 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/ExitTests/plainInclude.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/types/Message.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger.types; 2 | 3 | public class Message { 4 | 5 | public int id; 6 | public String format; 7 | } 8 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/files/Runner.bx: -------------------------------------------------------------------------------- 1 | @output( true ) 2 | class { 3 | function main(required array args) { 4 | echo( "runner echo. Args: #JSONSerialize(args)#" ); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ImportKeyClass.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | import ortus.boxlang.runtime.scopes.Key; 3 | any function main(){ 4 | println( Key::object.getName() ); 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/MyClassMDVistorCFParent.cfc: -------------------------------------------------------------------------------- 1 | component super="man" { 2 | 3 | function init() { 4 | } 5 | 6 | function superMethod() { 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/InnerTag2.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/MyTag2.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/AbstractClassCF.cfc: -------------------------------------------------------------------------------- 1 | abstract component { 2 | 3 | function normal() { 4 | return "normal"; 5 | } 6 | 7 | abstract function abstractMethod() 8 | 9 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/DotExtends.cfc: -------------------------------------------------------------------------------- 1 | component extends="../../TestCases/phase3/DotExtendsParent" { 2 | function childUDF() { 3 | return "childUDF" & super.parentUDF(); 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ClassLeadingComment.cfc: -------------------------------------------------------------------------------- 1 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ConcreteClassWrongMethod.bx: -------------------------------------------------------------------------------- 1 | class extends="AbstractClass" { 2 | 3 | String function abstractMethod( foo = "bar" ) { 4 | return "abstractMethod"; 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MissingSuperScopeChild.bx: -------------------------------------------------------------------------------- 1 | class extends="MissingSuperScopeParent" { 2 | 3 | function overriddenMethod() { 4 | return super.overriddenMethod(); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/BDDTest.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | function run(){ 4 | function() { 5 | try { 6 | } catch ( any e ) { 7 | } 8 | }; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/sourcemaptests/MissingVarTemplate.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/EventMethods.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public string function runOnRequest() { 3 | writeOutput("This is the result of an invoke tag"); 4 | } 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/OuterTag2.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/java/TestCases/components/CallStack.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function run() { 4 | return nested(); 5 | } 6 | 7 | function nested() { 8 | return callStackGet(); 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/GeneratedAccessor.bx: -------------------------------------------------------------------------------- 1 | class accessors="true" { 2 | 3 | property string name; 4 | property integer age getter="false"; 5 | property string email setter="false"; 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/IMotorcycle.bx: -------------------------------------------------------------------------------- 1 | interface { 2 | 3 | function shift( required numeric gear ); 4 | 5 | default function needsFuel() { 6 | return false; 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ImplicitConstructorTest.cfc: -------------------------------------------------------------------------------- 1 | component accessors=true { 2 | property name="name"; 3 | property name="age"; 4 | property name="favoriteColor"; 5 | 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/PropertiesNotInheritedInMetadata.bx: -------------------------------------------------------------------------------- 1 | class extends=PropertiesNotInheritedInMetadataParent { 2 | property name=childProperty; 3 | property name=sharedProperty; 4 | 5 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/OuterTag.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /workbench/samples/components/system/Component.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | ```java 4 | component displayname="Script Widget" output="false" { 5 | // functions and properties here 6 | } 7 | ``` 8 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appClass/Application.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | request.applicationbxran = true; 4 | 5 | function onRequestStart() { 6 | request.onRequestStart = true; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appClass/sub2/index.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/TestBodyResultError.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function foo() { 4 | lock name="foo" throwontimeout=true timeout=5 { 5 | return; 6 | } 7 | } 8 | 9 | foo(); 10 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/JavaExtends2.bx: -------------------------------------------------------------------------------- 1 | class extends="java:ortus.boxlang.runtime.context.BaseBoxContext" { 2 | 3 | function getTemplatesYo() { 4 | return super.currentImports; 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/Child.cfc: -------------------------------------------------------------------------------- 1 | component extends="Parent" { 2 | public function init( num ){ 3 | super.init( argumentCollection = arguments ); 4 | return this; 5 | } 6 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/appClass/sub2/Application.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | request.applicationbxsub2ran = true; 4 | 5 | function onRequestStart() { 6 | request.onRequestStartsub2 = true; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/external/sub1/index.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/modules/test/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build/** 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### IntelliJ IDEA ### 6 | .idea/ 7 | 8 | ### VS Code ### 9 | .vscode/ 10 | 11 | ### Mac OS ### 12 | .DS_Store 13 | -------------------------------------------------------------------------------- /src/test/java/TestCases/applications/external/Application.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | request.externalapplicationbxran = true; 4 | 5 | function onRequestStart() { 6 | request.externalonRequestStart = true; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/components/User.cfc: -------------------------------------------------------------------------------- 1 | component{ 2 | 3 | this.name = "hello"; 4 | this.created = null; 5 | 6 | function init(){ 7 | this.name = "test"; 8 | this.created = now(); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/resources/dump/html/ITemplateRunnable.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
<ITemplateRunnable> #encodeForHTML( var )#
4 |
5 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/GeneratedSetterReturnCorrectThis.bx: -------------------------------------------------------------------------------- 1 | class extends="GeneratedSetterReturnCorrectThisParent" { 2 | 3 | function baseClassMethod() { 4 | return "This is the base class method."; 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/GetterTest.cfc: -------------------------------------------------------------------------------- 1 | component accessors="true" { 2 | 3 | property name="myDate" type="date"; 4 | 5 | function init() { 6 | variables.myDate = ""; 7 | } 8 | 9 | 10 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/AssignmentClass.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function init(){ 4 | variables.a = this.a = "test" 5 | } 6 | 7 | function getA(){ 8 | return variables.a; 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/RelativeSelfInstantiation.bx: -------------------------------------------------------------------------------- 1 | class { 2 | RelativeSelfInstantiation function init() { 3 | return this; 4 | } 5 | 6 | function clone() { 7 | return new RelativeSelfInstantiation(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Stack.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | function init() { 3 | stack = []; 4 | return this; 5 | } 6 | 7 | function empty() { 8 | return stack.len() == 0; 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase2/Child.bx: -------------------------------------------------------------------------------- 1 | class extends="Parent" { 2 | 3 | function addMessages( Array messages ) { 4 | messages.each( function( msg ) { 5 | super.add( msg ); 6 | } ); 7 | return data; 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/UnencodedTest.cfm: -------------------------------------------------------------------------------- 1 | 2 | #test# 3 | #encodeForHTML( test )# 4 | #getData()# 5 | #encodeForHTML( getData() )# 6 | #user.getName()# 7 | #htmlEditFormat( user.getName() )# 8 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/sourcemaptests/ComponentInTemplate.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #x# 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/StaticError.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | static { 3 | zzz = ( 4 | () => { 5 | var pattern = 42; // uncomment for breakage 6 | return 42; 7 | } 8 | )( ); 9 | } 10 | 11 | println(static.zzz) 12 | } -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/types/Scope.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger.types; 2 | 3 | public class Scope { 4 | 5 | public String name; 6 | public String presentationHint; 7 | public int variablesReference; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/test/bx/Interceptor.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | 3 | function configure(){ 4 | 5 | } 6 | 7 | function postFunctionInvoke( data ){ 8 | // Listen to events 9 | } 10 | 11 | function afterCacheElementInsert( data ){ 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/TestCases/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package TestCases.hello; 2 | 3 | public class HelloWorld { 4 | 5 | public HelloWorld() { 6 | // do nothing 7 | } 8 | 9 | public String hello() { 10 | return "Hello World"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/CurrentTemplateInStaticInitializer.bx: -------------------------------------------------------------------------------- 1 | class { 2 | static { 3 | currentTemplate = getCurrentTemplatePath(); 4 | } 5 | 6 | static function staticMethod() { 7 | return static.currentTemplate; 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/scriptIncludeASMIssue.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | try { 5 | 6 | } catch (any cfcatch) { 7 | 8 | } 9 | 10 | function initINI() { 11 | 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/AccessThisScopeFromFunction.bx: -------------------------------------------------------------------------------- 1 | class { 2 | this.data = "brad"; 3 | 4 | function run() { 5 | var bus = {}; 6 | bx:component name="AccessThisScopeFromFunction" bus=bus; 7 | return bus.data; 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/IBicycle.bx: -------------------------------------------------------------------------------- 1 | interface { 2 | 3 | public String function pedal( required numeric speed=3 ); 4 | 5 | function pedalLax( speed ); 6 | 7 | default function hasInnerTube() { 8 | return true; 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileSeek.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | NewFile = fileOpen( expandPath( "." ) & " est.txt", "write", "", true ); 9 | fileSeek( NewFile, 5 ); 10 | 11 | 12 | ``` 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/types/StackFrame.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger.types; 2 | 3 | public class StackFrame { 4 | 5 | public int id; 6 | public String name; 7 | public int line; 8 | public int column; 9 | public Source source; 10 | } 11 | -------------------------------------------------------------------------------- /src/modules/test/src/main/bx/bifs/ModuleNow.bx: -------------------------------------------------------------------------------- 1 | /** 2 | * No aliases 3 | */ 4 | @BoxMember( "string" ) 5 | class{ 6 | 7 | /** 8 | * The execution of this BIF with amazing BoxLang arguments 9 | */ 10 | function invoke(){ 11 | return now(); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/bx/INotifiable.bx: -------------------------------------------------------------------------------- 1 | /** 2 | * INotifiable interface 3 | * @foo bar 4 | */ 5 | @Anno( "value" ) 6 | interface displayName="INotifiable" { 7 | 8 | public string function getNotifiableId(); 9 | public string function getNotifiableType(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/GeneratedGetterParent.bx: -------------------------------------------------------------------------------- 1 | class accessors=true { 2 | 3 | property name="foo" type=string default="default value"; 4 | 5 | // overridden getter 6 | string function getFoo() { 7 | return "overriden"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/InterfaceInheritenceTest.bx: -------------------------------------------------------------------------------- 1 | class implements="IChildInterface" { 2 | 3 | public Any function childMethod() { 4 | return "childMethod"; 5 | } 6 | 7 | public Any function parentMethod() { 8 | return "parentMethod"; 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/RelativeManager.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | 3 | 4 | any function allApply(){ 5 | return newFuture().allApply( argumentCollection = arguments ); 6 | } 7 | 8 | Future function newFuture(){ 9 | return new tasks.Future(); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/CreateDateTime.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ClassLocatorInStaticInitializer.bx: -------------------------------------------------------------------------------- 1 | class { 2 | static { 3 | static.a = new src.test.java.TestCases.phase3.ConcreteClass(); 4 | static.x = createObject( "java", "java.io.File" ); 5 | final slashdir = createObject( "java", "java.io.File" ).separator; 6 | } 7 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/IChildInterface.bx: -------------------------------------------------------------------------------- 1 | interface extends="IParentInterface" { 2 | default function childDefaultMethod() { 3 | return "childDefaultMethod"; 4 | } 5 | default function parentOverrideMe() { 6 | return "parentOverrideMeChild"; 7 | } 8 | function childMethod(); 9 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/InitMethodTest.bx: -------------------------------------------------------------------------------- 1 | class initMethod=birth accessors=true { 2 | property inittedProperly default=false; 3 | function init() { 4 | throw "you'd better not call me!"; 5 | } 6 | function birth() { 7 | inittedProperly=true 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/MyClassMDVistorCFTag.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/interop/TestTypedArraySubtype.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.interop; 2 | 3 | public class TestTypedArraySubtype { 4 | 5 | Object stuff = null; 6 | 7 | public TestTypedArraySubtype( Object stuff ) { 8 | this.stuff = stuff; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/InterfaceStatic.bx: -------------------------------------------------------------------------------- 1 | interface { 2 | 3 | static { 4 | static.myVar = "brad"; 5 | yourVar = "luis"; 6 | } 7 | 8 | static function foo() { 9 | return static.myVar; 10 | } 11 | 12 | static function callStatic() { 13 | return foo(); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/StaticInitCallStaticMethod.bx: -------------------------------------------------------------------------------- 1 | class { 2 | static { 3 | someStruct = { 4 | foo : someStaticFunction( 'bar' ) 5 | } 6 | } 7 | 8 | private static string function someStaticFunction( required string baz ) { 9 | return arguments.baz; 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "gitbook": "3.2.3", 3 | "title": "BoxLang", 4 | "author": "Ortus Solutions", 5 | "description": "Reference Documentation for the BoxLang JVM Compiled Language", 6 | "language": "en", 7 | "root": "./docs", 8 | "structure": { 9 | "summary": "Summary.md" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ReservedAnnotations.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * @name foo2 3 | * @fullname bar2 4 | * @functions baz2 5 | * @properties bum2 6 | * @type interface2 7 | * @path C:/2 8 | */ 9 | component name="foo" fullname="bar" functions="baz" properties="bum" type="interface" path="C:/" { 10 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/GrandParent.cfc: -------------------------------------------------------------------------------- 1 | component accessors="true"{ 2 | 3 | property name="grandpa"; 4 | 5 | function init() { 6 | variables.grandpa = "me"; 7 | return this; 8 | } 9 | 10 | function grandParentFunction(){ 11 | return "grandParentFunction"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/InvokeTest.cfc: -------------------------------------------------------------------------------- 1 | component accessors="true"{ 2 | 3 | property name="baz" default=""; 4 | 5 | function foo() { 6 | return "bar"; 7 | } 8 | 9 | function runInvokeOnVariablesScope() { 10 | return invoke( variables, "foo", [] ) 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileMove.md: -------------------------------------------------------------------------------- 1 | ### Move file from here to there 2 | 3 | 4 | 5 | 6 | ```java 7 | fileMove( sourcefile, destinationfile ); 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | 15 | ```java 16 | filemove( sourceFilePath, destinationFilePath ); 17 | 18 | ``` 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/CFImportTest.cfc: -------------------------------------------------------------------------------- 1 | import src.test.java.TestCases.phase3.Stack; 2 | 3 | component { 4 | function init() { 5 | stack = new Stack(); 6 | } 7 | 8 | function doSomething() { 9 | if (!stack.empty() ) { 10 | // do stuff 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/CFImportTest2.cfc: -------------------------------------------------------------------------------- 1 | import "src.test.java.TestCases.phase3.Stack"; 2 | 3 | component { 4 | function init() { 5 | stack = new Stack(); 6 | } 7 | 8 | function doSomething() { 9 | if (!stack.empty() ) { 10 | // do stuff 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/QueryParamTest.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | SELECT * 4 | FROM Users 5 | WHERE UserID = 6 | AND active = #url.isActive# 7 | ORDER BY name #sortBy# 8 | 9 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/ExitTests/UDFInclude.bxm: -------------------------------------------------------------------------------- 1 | 2 | function foo() { 3 | result &= "beforeUDF" 4 | exit method="#request.exitMethod#"; 5 | result &= "afterUDF" 6 | } 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/dynamic/javaproxy/BoxClassRunnable.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | function run() { 4 | println( "I ran!" ); 5 | server.runnableProxyFired = true; 6 | } 7 | 8 | function call(){ 9 | return "I was called!"; 10 | } 11 | 12 | function hashCode(){ 13 | return 42; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileCopy.md: -------------------------------------------------------------------------------- 1 | ### Copy file from here to there 2 | 3 | 4 | 5 | 6 | ```java 7 | fileCopy( sourceFile, destinationFile ); 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | 15 | ```java 16 | fileCopy( "path/to/my/file.md", "new/location/for/file.md" ); 17 | 18 | ``` 19 | 20 | 21 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/ReEscape.md: -------------------------------------------------------------------------------- 1 | ### Example of reEscape 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | reEscape( "*.{}[]exam?ple" ); 9 | 10 | ``` 11 | 12 | Result: \*\.\{\}\[\]exam\?ple 13 | 14 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MethodPropConflict.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | property name="foo" default="bar"; 3 | 4 | function foo() { 5 | 6 | } 7 | 8 | function baz() { 9 | } 10 | 11 | function spyFoo() { 12 | return variables.foo; 13 | } 14 | 15 | function spyBaz() { 16 | return variables.baz; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/decision/IsFileObject.md: -------------------------------------------------------------------------------- 1 | ### Check for a filestream-object 2 | 3 | Checks if the fileObj is a filestream-object. 4 | 5 | 6 | ```java 7 | filePath = expandPath( "./myfile.txt" ); 8 | fileObj = fileOpen( filePath ); 9 | writeOutput( isFileObject( fileObj ) ); 10 | 11 | ``` 12 | 13 | Result: true 14 | 15 | -------------------------------------------------------------------------------- /workbench/samples/bifs/struct/StructIsOrdered.md: -------------------------------------------------------------------------------- 1 | ### Check if a struct is ordered 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | structNew( "ordered" ).isOrdered(); 9 | 10 | ``` 11 | 12 | Result: true 13 | 14 | -------------------------------------------------------------------------------- /modules/bx-derby/models/DerbyDriver.bx: -------------------------------------------------------------------------------- 1 | /** 2 | * In-memory DB: 3 | * https://db.apache.org/derby/docs/10.17/devguide/cdevdvlpinmemdb.html 4 | * 5 | * General: 6 | * https://db.apache.org/derby/docs/10.17/devguide/rdevdvlp22102.html 7 | */ 8 | class{ 9 | // @TODO: Custom Derby Driver implementation with helper utilities 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/asmboxpiler/DividerNode.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.compiler.asmboxpiler; 2 | 3 | import org.objectweb.asm.Opcodes; 4 | import org.objectweb.asm.tree.InsnNode; 5 | 6 | public class DividerNode extends InsnNode { 7 | 8 | public DividerNode() { 9 | super( Opcodes.NOP ); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/JavaOverride.bx: -------------------------------------------------------------------------------- 1 | class extends="java:ortus.boxlang.runtime.bifs.global.math.Rand" { 2 | 3 | @overrideJava 4 | public java.lang.Object function _invoke( ortus.boxlang.runtime.context.IBoxContext context, ortus.boxlang.runtime.scopes.ArgumentsScope arguments ) { 5 | return "From BoxLang"; 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/dump/html/Boolean.bxm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | #label# - 6 | Boolean: 7 | 8 | #encodeForHTML( var )# 9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /src/modules/test/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BoxLang Test Module", 3 | "count": 1, 4 | "isActive": true, 5 | "isActiveTruthy": "true", 6 | "keywords": [ 7 | "test", 8 | "example" 9 | ], 10 | "boxlang": { 11 | "minimumVersion": "1.0.0", 12 | "moduleName": "test", 13 | "settings": { 14 | "hello": "luis" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MissingSuperScopeParent.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function overriddenMethod() { 4 | return 'super'; 5 | } 6 | 7 | function run() { 8 | return runner( function () { 9 | return overriddenMethod(); 10 | } ); 11 | } 12 | 13 | function runner( function callback ) { 14 | return callback(); 15 | } 16 | 17 | 18 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/IUncleInterface.bx: -------------------------------------------------------------------------------- 1 | interface { 2 | default function uncleDefaultMethod() { 3 | return "uncleDefaultMethod"; 4 | } 5 | default function uncleOverrideMe() { 6 | return "uncleOverrideMeUncle"; 7 | } 8 | default function uncleOverrideMe2() { 9 | return "uncleOverrideMeUncle2"; 10 | } 11 | function uncleMethod(); 12 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/tasks/Future.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | property name="name"; 4 | 5 | Future function init( string item = "nothing" ){ 6 | variables.name = arguments.item; 7 | return this; 8 | } 9 | 10 | function allApply( items ){ 11 | return arguments 12 | .items 13 | .map( item => new Future( item ) ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/ExitTests/ExitClass.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | function init() { 4 | request.result &= "before" 5 | foo() 6 | request.result &= "after" 7 | } 8 | 9 | function foo() { 10 | request.result &= "beforeUDF" 11 | exit method="#request.exitMethod#"; 12 | request.result &= "afterUDF" 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileSetAccessMode.md: -------------------------------------------------------------------------------- 1 | ### Grant read access to everyone 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | fileSetAccessMode( "test1.txt", "004" ); 9 | 10 | 11 | ``` 12 | 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | fileSetAccessMode( "sample_test.txt", "004" ); 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/CompileIssue1.cfc: -------------------------------------------------------------------------------- 1 | 2 | component { 3 | 4 | 5 | 6 | function serializeReferenceEntity(){ 7 | switch( "test" ){ 8 | case "x": 9 | try{ 10 | 11 | } catch( any e ){ 12 | 13 | } 14 | } 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/AccessVariablesScopeFromFunction.bxm: -------------------------------------------------------------------------------- 1 | 2 | function addData() { 3 | variables.data.each( function(key, value) { 4 | variables.data.append( { "#key#-length": len( value) }); 5 | } ); 6 | } 7 | 8 | variables[ "data" ] = { 9 | "key": "value" 10 | }; 11 | 12 | addData(); 13 | -------------------------------------------------------------------------------- /src/main/apidocs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BoxLang Docs 5 | 6 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/IParentInterface.bx: -------------------------------------------------------------------------------- 1 | interface { 2 | default function parentDefaultMethod() { 3 | return "parentDefaultMethod"; 4 | } 5 | default function parentOverrideMe() { 6 | return "parentOverrideMeParent"; 7 | } 8 | default function parentOverrideMe2() { 9 | return "parentOverrideMeParent2"; 10 | } 11 | function parentMethod(); 12 | } -------------------------------------------------------------------------------- /src/main/resources/dump/html/String.bxm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | #label# - 6 | String: 7 | 8 | #encodeForHTML( var )# 9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Sqr.md: -------------------------------------------------------------------------------- 1 | ### Square Root of 144 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | sqr( 144 ); 9 | 10 | ``` 11 | 12 | Result: 12 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | #sqr( 4 )# 19 | ``` 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/dump/html/Null.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | #label#: 7 | 8 | 9 | <null> 10 | 11 | 12 |
13 |
14 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/interop/TestAmbiguousVarargs.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.interop; 2 | 3 | public class TestAmbiguousVarargs { 4 | 5 | static public String foo( int x, String y ) { 6 | return "Non-varargs method"; 7 | } 8 | 9 | static public String foo( int x, String y, Object... rest ) { 10 | return "Varargs method"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /workbench/samples/bifs/decision/IsDateObject.md: -------------------------------------------------------------------------------- 1 | ### Check if date is a date OBJECT, not just a date string 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | date = IsDateObject( now() ); 9 | writeOutput( "Can string be converted to a date/time value : " & date ); 10 | 11 | 12 | ``` 13 | 14 | Result: Can string be converted to a date/time value : YES 15 | 16 | -------------------------------------------------------------------------------- /src/main/resources/dump/html/Number.bxm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | #label# - 6 | Number [#var.getClass().getSimpleName()#]: 7 | 8 | #encodeForHTML( var )# 9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/ApplicationStop.md: -------------------------------------------------------------------------------- 1 | ### Basic applicationStop usage. 2 | 3 | Halt the application. 4 | 5 | 6 | ```java 7 | var applicationRequiresHalt = true; 8 | if( applicationRequiresHalt ) applicationStop(); 9 | writeOutput( "Still Running" ); 10 | 11 | ``` 12 | 13 | Result: // We don't expect anything to happen after the application has been stopped. 14 | 15 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/JavaExtends.bx: -------------------------------------------------------------------------------- 1 | class extends="java:java.util.TimerTask" { 2 | 3 | @overrideJava 4 | void function run() { 5 | println("Hello from a custom TimerTask!" ); 6 | println( super.scheduledExecutionTime() ); 7 | } 8 | 9 | @overrideJava 10 | public long function scheduledExecutionTime() { 11 | throw "no, not me!"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/jdbc/DerbySleep.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.bifs.global.jdbc; 2 | 3 | public class DerbySleep { 4 | 5 | public static int sleep( int milliseconds ) { 6 | try { 7 | Thread.sleep( milliseconds ); 8 | } catch ( InterruptedException e ) { 9 | // Handle interruption 10 | } 11 | return milliseconds; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/IVMInitializationStrategy.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger; 2 | 3 | import com.sun.jdi.VirtualMachine; 4 | 5 | public interface IVMInitializationStrategy { 6 | 7 | public VirtualMachine initialize() throws Exception; 8 | 9 | public void disconnect( BoxLangDebugger debugger ); 10 | 11 | public void terminate( BoxLangDebugger debugger ); 12 | } 13 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/FunctionMeta.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | /** 4 | * The bit that can be used to set all tasks created by this scheduler to always run on one server 5 | */ 6 | property name="serverFixation" type="boolean"; 7 | 8 | /** 9 | * This is my function hint 10 | * @brad wood 11 | * @param1.luis majano 12 | */ 13 | function foo( param1 ) { 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MyInterfaceBL.bx: -------------------------------------------------------------------------------- 1 | /** 2 | * This is my interface description 3 | * 4 | * @brad wood 5 | * @luis 6 | */ 7 | interface singleton gavin="pickin" inject foo="bar" { 8 | 9 | function init(); 10 | 11 | function foo(); 12 | 13 | private function bar(); 14 | 15 | default function myDefaultMethod() { 16 | return this.foo(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MyInterfaceCF.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * This is my interface description 3 | * 4 | * @brad wood 5 | * @luis 6 | */ 7 | interface singleton gavin="pickin" inject foo="bar" { 8 | 9 | function init(); 10 | 11 | function foo(); 12 | 13 | private function bar(); 14 | 15 | default function myDefaultMethod() { 16 | return this.foo(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileRead.md: -------------------------------------------------------------------------------- 1 | ### Read a file into a binary object 2 | 3 | Uses expandPath to grab a file in current directory. 4 | 5 | 6 | ```java 7 | binaryContent = fileReadBinary( expandPath( "./file.pdf" ) ); 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | 15 | ```java 16 | binaryContent = fileReadBinary( expandPath( "./image.jpg" ) ); 17 | 18 | ``` 19 | 20 | 21 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Tan.md: -------------------------------------------------------------------------------- 1 | ### Tangent of 0.3 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | tan( .3 ); 9 | 10 | ``` 11 | 12 | Result: 0.309336249609623215277756009824263 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | #tan( 90 )# 19 | ``` 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/IMultiChildInterface.bx: -------------------------------------------------------------------------------- 1 | interface extends="IParentInterface,IUncleInterface" { 2 | default function childDefaultMethod() { 3 | return "childDefaultMethod"; 4 | } 5 | default function parentOverrideMe() { 6 | return "parentOverrideMeChild"; 7 | } 8 | default function uncleOverrideMe() { 9 | return "uncleOverrideMeChild"; 10 | } 11 | function childMethod(); 12 | } -------------------------------------------------------------------------------- /workbench/samples/components/system/Exit.md: -------------------------------------------------------------------------------- 1 | ### Simple bx:exit example 2 | 3 | Here the loop over the 5 number. When it's meet the condition as true then the block of code get exit. 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | 11 | 12 | #i# 13 | 14 | 15 | 16 | ``` 17 | 18 | Result: 1 2 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/dump/html/StringBuffer.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | #label# - 7 | String Buffer/Builder: 8 | 9 | #encodeForHTML( var.toString() )# 10 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/template.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/MyTag.cfm: -------------------------------------------------------------------------------- 1 | 2 | always 3 | 4 | My Tag start #attributes.foo# #caller.brad# 5 | 6 | 7 | 8 | #reverse( thisTag.generatedContent )# 9 | 10 | My Tag End 11 | 12 | -------------------------------------------------------------------------------- /workbench/samples/components/system/Lock.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | bx:lock timeout="60" scope="session" type="exclusive" { 8 | session.MYVAR = "Hello"; 9 | } 10 | 11 | ``` 12 | 13 | 14 | ### Tag Syntax 15 | 16 | 17 | 18 | 19 | ```java 20 | 21 | 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/WeirdParse.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | static function whatever( function f ) { 3 | return f(); 4 | } 5 | 6 | function foo( ) { 7 | return src.test.java.TestCases.phase3.WeirdParse::whatever( 8 | f = () => { 9 | // 10 | // weird parse or something 11 | // 12 | return 42; 13 | } 14 | ) 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/java/CreateDynamicProxy.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 11 | 12 | 13 | #y# 14 | 15 | ``` 16 | 17 | 18 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "line-length": false, 3 | "single-h1": false, 4 | "no-hard-tabs": false, 5 | "fenced-code-language": false, 6 | "no-bare-urls": false, 7 | "first-line-h1": false, 8 | "no-multiple-blanks": { 9 | "maximum": 2 10 | }, 11 | "no-duplicate-header": { 12 | "siblings_only": true 13 | }, 14 | "no-duplicate-heading": { 15 | "siblings_only": true 16 | }, 17 | "no-inline-html": false 18 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/compiler/Scheduler.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | Scheduler function startup(){ 4 | variables.tasks = []; 5 | variables.tasks.each( function( taskName, taskRecord ){ 6 | if ( true ) { 7 | 8 | } else { 9 | 10 | } 11 | 12 | try { 13 | 14 | } catch ( any e ) { 15 | 16 | } 17 | } ); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/DirectoryMove.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | 16 | ```java 17 | reNamedirectory = "directoryPath"; 18 | directoryRename( reNamedirectory, "newname" ); 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Log10.md: -------------------------------------------------------------------------------- 1 | ### logarithm 3.1 to base 10 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | log10( 3.1 ); 9 | 10 | ``` 11 | 12 | Result: 0.4913616938350069271914042463676003 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | #log10( 10 )# 19 | ``` 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/WheeledThing.bx: -------------------------------------------------------------------------------- 1 | class implements="IBicycle,IMotorcycle" { 2 | 3 | function onMissingMethod( name, args ) { 4 | switch( arguments.name ) { 5 | case "pedal": 6 | return "Pedal speed #args[1]#" 7 | break; 8 | case "shift": 9 | return "Shift to gear #args[1]#" 10 | break; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Acos.md: -------------------------------------------------------------------------------- 1 | ### Angle Cosine of 0.3 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | acos( .3 ); 9 | 10 | ``` 11 | 12 | Result: 1.2661036727794992 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | 19 | #aCos( inputValue )# 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/java/TestCases/components/MyClass.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/DateTimeFormat.md: -------------------------------------------------------------------------------- 1 | ### Omitting the Mask 2 | 3 | Should default mask to `hh:mm tt` 4 | 5 | Run Example 6 | 7 | ```java 8 | timeFormat( createDateTime( 2017, 8, 31, 15, 25, 11 ) ); 9 | 10 | ``` 11 | 12 | Result: 03:25 pm 13 | 14 | ### Additional Examples 15 | 16 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/interop/TestTypedArray.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.interop; 2 | 3 | public class TestTypedArray { 4 | 5 | static public void test( String name ) { 6 | 7 | } 8 | 9 | static public void test( String name, Object[] stuff, TestTypedArraySubtype[] types ) { 10 | System.out.println( "Testing String, Object[], TestTypedArraySubtype[] " + name + " with size: " + types.length ); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /workbench/samples/bifs/zip/Compress.md: -------------------------------------------------------------------------------- 1 | ### Compress a file 2 | 3 | Compress the file "example.txt" to a zip-file. 4 | 5 | 6 | ```java 7 | compress( "zip", "example.txt", "output.zip" ); 8 | 9 | ``` 10 | 11 | 12 | ### Compress a directory 13 | 14 | Compress the "example-directory" to a zip-file. 15 | 16 | 17 | ```java 18 | compress( "zip", "example-directory", "output.zip" ); 19 | 20 | ``` 21 | 22 | 23 | ### Additional Examples 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/components/system/Silent.md: -------------------------------------------------------------------------------- 1 | ### Example for bx:silent tag 2 | 3 | Content within bx:silent tag will not be displayed 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | This is from inside bx:silent #a + b# 11 | 12 | This is from outside bx:silent #a - b# 13 | ``` 14 | 15 | Result: This is from outside bx:silent 5 16 | 17 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/InvokeImplicitAccessorsCF.cfc: -------------------------------------------------------------------------------- 1 | 2 | component accessors="true" { 3 | property name="name"; 4 | property name="age"; 5 | property name="supervisor"; 6 | 7 | function setAge( numeric age ) { 8 | this.age = age; 9 | } 10 | 11 | function getAge() { 12 | return this.age; 13 | } 14 | 15 | function setSupervisor( String supervisor ) { 16 | variables.supervisor = arguments.supervisor.reverse(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = false 9 | insert_final_newline = false 10 | indent_style = tab 11 | indent_size = 4 12 | tab_width = 4 13 | 14 | [*.yml] 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [*.{md,markdown}] 19 | trim_trailing_whitespace = false 20 | insert_final_newline = false 21 | indent_style = space 22 | indent_size = 2 -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/ParseDateTime.md: -------------------------------------------------------------------------------- 1 | ### Tag Example 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | #parseDateTime( dateTimeVar )# 10 | 11 | ``` 12 | 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | datetime = dateTimeFormat( now(), "yyyy.MM.dd HH:nn:ss" ); 19 | dump( ParseDateTime( datetime ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/types/member/struct/append.md: -------------------------------------------------------------------------------- 1 | *Append One Struct to Another:* 2 | 3 | ```java 4 | animals = { 5 | cow: "moo", 6 | pig: "oink" 7 | }; 8 | 9 | // Show current animals 10 | animals.dump( label ="Current animals" ); 11 | 12 | // Create a new animal 13 | newAnimal = { 14 | cat: "meow" 15 | }; 16 | 17 | // Append the newAnimal to animals 18 | animals.append( newAnimal ); 19 | 20 | animals.dump( label="Updated animals" ); 21 | ``` 22 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/JavaExtends3.bx: -------------------------------------------------------------------------------- 1 | class extends="java:ortus.boxlang.runtime.bifs.BIF" { 2 | 3 | @overrideJava 4 | Object function _invoke(ortus.boxlang.runtime.context.IBoxContext c ,ortus.boxlang.runtime.scopes.ArgumentsScope args) { 5 | 6 | } 7 | 8 | function printStuff() { 9 | println( this.__isMemberExecution ) 10 | println( this.runtime ) 11 | println( super.__isMemberExecution ) 12 | println( super.runtime ) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileExists.md: -------------------------------------------------------------------------------- 1 | ### Checks if file at the given path exists. 2 | 3 | 4 | 5 | 6 | ```java 7 | var myFile = "/path/to/the/file.jpg"; 8 | if( fileExists( expandPath( myFile ) ) ) { 9 | writeOutput( myFile & "exists!" ); 10 | } 11 | 12 | ``` 13 | 14 | 15 | ### Additional Examples 16 | 17 | 18 | ```java 19 | var filePath = "path/to/my/file.md"; 20 | if( fileExists( filePath ) ) echo; 21 | "it exists"; 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileWriteLine.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | myfile = fileOpen( "c:\temp\test1.txt", "write" ); 8 | fileWriteLine( myfile, "This line is new." ); 9 | fileClose( myfile ); 10 | 11 | ``` 12 | 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | openFile = fileopen( filepath, "read" ); 19 | readfromfile = filereadline( openfile ); 20 | filewriteline( filepath, readfromfile ); 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/CreateTime.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | Run Example 15 | 16 | ```java 17 | dump( CreateTime( "12", "57", "30" ) ); 18 | 19 | ``` 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/dump/html/Instant.bxm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | #encodeForHTML( label )# 7 | 8 | Instant: 9 | 10 | 11 | 12 | #encodeForHTML( var.toString() )# 13 | 14 | 15 |
16 |
17 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/StaticArgDefaultTest.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | 3 | static { 4 | static.FIXED = 200 5 | } 6 | 7 | public function init(required string content, numeric status=StaticArgDefaultTest::FIXED ) { 8 | this.content = arguments.content 9 | this.status = arguments.status 10 | } 11 | 12 | public static function create(required string message) { 13 | return new StaticArgDefaultTest(message); 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/request/ScopeRequest.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger.request; 2 | 3 | import ortus.boxlang.debugger.DebugAdapter; 4 | 5 | public class ScopeRequest extends AbstractRequest { 6 | 7 | public ScopeRequestArguments arguments; 8 | 9 | public static class ScopeRequestArguments { 10 | 11 | public int frameId; 12 | } 13 | 14 | @Override 15 | public void accept( DebugAdapter adapter ) { 16 | adapter.visit( this ); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/main/resources/dump/html/ToString.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | #encodeForHTML( label )# 8 | 9 | #var.$bx.$class.getCanonicalName()# 10 | 11 | 12 | 13 | #encodeForHTML( var.toString() )# 14 | 15 | 16 |
17 |
18 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase1/files/Application.bx: -------------------------------------------------------------------------------- 1 | class output=true { 2 | echo("application pseudoconstructor echo"); 3 | bx:flush; 4 | 5 | function onRequestStart() output=true { 6 | echo("onRequestStart echo"); 7 | bx:flush; 8 | } 9 | 10 | function onRequestEnd() output=true { 11 | echo("onRequestEnd echo"); 12 | bx:flush; 13 | } 14 | 15 | function onApplicationStart() output=true { 16 | echo("onApplicationStart echo"); 17 | bx:flush; 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/dump/html/Duration.bxm: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | #encodeForHTML( label )# 7 | 8 | Timespan: 9 | 10 | 11 | 12 | #( [ var.toDaysPart(), var.toHoursPart(), var.toMinutesPart(), var.toSecondsPart() ].toList( ", " ) )# 13 | 14 | 15 |
16 |
17 | -------------------------------------------------------------------------------- /src/test/resources/test-templates/json_withBOM.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "whitelist": "user\\.login,user\\.logout,^main.*", 4 | "securelist": "^user\\.*, ^admin", 5 | "match": "event", 6 | "roles": "admin", 7 | "permissions": "", 8 | "redirect": "user.login" 9 | }, 10 | { 11 | "whitelist": "", 12 | "securelist": "^shopping", 13 | "match": "url", 14 | "roles": "", 15 | "permissions": "shop,checkout", 16 | "redirect": "user.login", 17 | "useSSL": true 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileAppend.md: -------------------------------------------------------------------------------- 1 | ### Simple Example 2 | 3 | Appends a mock entry to a file. 4 | 5 | 6 | ```java 7 | // Create mock log entry 8 | logEntry = dateTimeFormat( now(), "yyyy/mm/dd HH:nn" ) & " this is a mock log entry!"; 9 | // Append line to file 10 | fileAppend( "/path/to/file.log", logEntry ); 11 | 12 | ``` 13 | 14 | 15 | ### Additional Examples 16 | 17 | 18 | ```java 19 | fileAppend( "path/to/file", "new content to append" ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Log.md: -------------------------------------------------------------------------------- 1 | ### logarithm of 3.1 2 | 3 | There will be a precision difference between running the some code on Linux or Windows 4 | 5 | Run Example 6 | 7 | ```java 8 | log( 3.1 ); 9 | 10 | ``` 11 | 12 | Result: 1.131402111492791384577570144178438 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | #log( 10 )# 19 | ``` 20 | 21 | 22 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/Ascii.md: -------------------------------------------------------------------------------- 1 | ### character and value of Korean currency symbol ( unicode number 8361 ) 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | x = char( 8361 ); 9 | writeoutput( "character: #x#" ); 10 | x = ascii( x ); 11 | writeoutput( "
Unicode value: #x#" ); 12 | 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/InvokeImplicitAccessors.bx: -------------------------------------------------------------------------------- 1 | class { 2 | property name="name"; 3 | property name="age"; 4 | property name="supervisor"; 5 | 6 | this.supervisor = "jon"; 7 | this.name = "default name" 8 | 9 | function setAge( numeric age ) { 10 | this.age = age; 11 | } 12 | 13 | function getAge() { 14 | return this.age; 15 | } 16 | 17 | function setSupervisor( String supervisor ) { 18 | variables.supervisor = arguments.supervisor.reverse(); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/io/DirectoryDelete.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | directorydelete( "DirectoryPath" ); 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # GitHub Actions - updates uses: statements in workflows 4 | - package-ecosystem: "github-actions" 5 | directory: "/" # Where your .github/workflows/ folder is 6 | schedule: 7 | interval: "monthly" 8 | 9 | # Gradle - updates dependencies in build.gradle or build.gradle.kts 10 | - package-ecosystem: "gradle" 11 | directory: "/" # Adjust if build.gradle is in a subfolder 12 | schedule: 13 | interval: "monthly" 14 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/java/ToLongFunction.bx: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional interface that maps to java.util.function.ToLongFunction 3 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/ToLongFunction.html 4 | */ 5 | class { 6 | 7 | 8 | /** 9 | * Functional interface for the apply functionional interface 10 | */ 11 | function applyAsLong( required value ){ 12 | // Return non-Long value, but castable as such 13 | return "42" 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/dump/html/DateTime.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | #encodeForHTML( label )# 8 | 9 | Date/Time 10 | 11 | 12 | 13 | #encodeForHTML( var.toString() )# 14 | 15 | 16 |
17 |
18 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MyInterfaceCFTag.cfc: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /workbench/samples/components/async/Thread.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | CF9+ 4 | 5 | 6 | ```java 7 | // do single thread stuff 8 | bx:thread action="run" name="myThread"; 9 | bx:thread action="join" name="myThread,myOtherThread"; 10 | 11 | ``` 12 | 13 | 14 | ### Tag Syntax 15 | 16 | 17 | 18 | 19 | ```java 20 | 21 | 22 | 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/OnMissingMethod.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | public any function onMissingMethod( string missingMethodName, any missingMethodArguments ){ 3 | return missingMethodName & missingMethodArguments[2]; 4 | } 5 | 6 | public function variablesMissingCaller(){ 7 | return variables.doesNotExist( argumentCollection=arguments ); 8 | } 9 | 10 | public function headlessMissingCaller(){ 11 | return doesNotExist( argumentCollection=arguments ); 12 | } 13 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/system/DE.md: -------------------------------------------------------------------------------- 1 | ### Simple Example 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | de( "pete" ); 9 | 10 | ``` 11 | 12 | Result: "pete" 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | WriteOutput( de( "susi" ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Chihuahua.cfc: -------------------------------------------------------------------------------- 1 | component extends="Dog" { 2 | results.append('Chihuahua pseudo ' & getFileFromPath( getCurrentTemplatePath())) 3 | 4 | function init() { 5 | super.init(); 6 | results.append('Chihuahua init ' & getFileFromPath( getCurrentTemplatePath())) 7 | } 8 | 9 | function speak() { 10 | return "Yip Yip!"; 11 | } 12 | 13 | function getScientificName() { 14 | return "barkus annoyus " & super.getScientificName(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/java/ToLongFunctionInvalidReturn.bx: -------------------------------------------------------------------------------- 1 | /** 2 | * Functional interface that maps to java.util.function.ToLongFunction 3 | * See https://docs.oracle.com/javase/8/docs/api/java/util/function/ToLongFunction.html 4 | */ 5 | class { 6 | 7 | 8 | /** 9 | * Functional interface for the apply functionional interface 10 | */ 11 | function applyAsLong( required value ){ 12 | // Return non-Long value, which cannot be coerced 13 | return "sdf" 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Fix.md: -------------------------------------------------------------------------------- 1 | ### Fix 1.8 to an integer 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | fix( 1.8 ); 9 | 10 | ``` 11 | 12 | Result: 1 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeOutput( fix( 7.546 ) ); 20 | // 7 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/TestStaticFromScript.bxs: -------------------------------------------------------------------------------- 1 | result1 = StaticTest::foo; 2 | result2 = StaticTest::myStaticFunc(); 3 | result4 = StaticTest::scoped; 4 | result5 = StaticTest::unscoped; 5 | result6 = StaticTest::again; 6 | myStaticUDF = StaticTest::sayHello; 7 | result7 = myStaticUDF(); 8 | result8 = StaticTest::123; 9 | result9 = StaticTest2::getInstance().getStaticBrad(); 10 | result10 = StaticTest2::getInstance().thisStaticBrad; 11 | result11 = StaticTest::finalStatic; 12 | result12 = StaticTest::finalStatic2; -------------------------------------------------------------------------------- /workbench/samples/bifs/type/GetMetaData.md: -------------------------------------------------------------------------------- 1 | ### Dump Metadata of CFC Instance 2 | 3 | CF9+ 4 | 5 | 6 | ```java 7 | writeDump( getMetadata( new Query() ) ); 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | Run Example 15 | 16 | ```java 17 | q = queryNew( "id,name", "numeric,varchar" ); 18 | dump( GetMetadata( q ) ); 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/types/ExceptionBreakpointsFilter.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger.types; 2 | 3 | public class ExceptionBreakpointsFilter { 4 | 5 | public String filter; 6 | public String label; 7 | public String description; 8 | 9 | public ExceptionBreakpointsFilter() { 10 | 11 | } 12 | 13 | public ExceptionBreakpointsFilter( String filter, String label, String description ) { 14 | this.filter = filter; 15 | this.label = label; 16 | this.description = description; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/RelativeInstantiation.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | property name="name"; 4 | 5 | RelativeInstantiation function init( string item = "nothing" ){ 6 | variables.name = arguments.item; 7 | return this; 8 | } 9 | 10 | function findSibling() { 11 | return new FindMe().foo(); 12 | } 13 | function returnSibling() { 14 | return new FindMe(); 15 | } 16 | 17 | function allApply( items ){ 18 | return arguments 19 | .items 20 | .map( item => new RelativeInstantiation( item ) ) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Min.md: -------------------------------------------------------------------------------- 1 | ### Minimum of 4 and 9 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | The minimum of #myNum1# and #myNum2# numbers is #min( myNum1, myNum2 )#. 10 | ``` 11 | 12 | Result: The minimum of 4 and 9 is 4. 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | echo( min( 1, 5 ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/struct/StructEquals.md: -------------------------------------------------------------------------------- 1 | ### Append options to config struct (without overwrite flag) 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | config1 = { 9 | A : 0, 10 | B : 0 11 | }; 12 | config2 = { 13 | A : 0, 14 | B : 1 15 | }; 16 | writeOutput( structEquals( config1, config2 ) ); 17 | 18 | ``` 19 | 20 | Result: NO 21 | 22 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Cos.md: -------------------------------------------------------------------------------- 1 | ### Cosine of 0.3 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | cos( .3 ); 9 | 10 | ``` 11 | 12 | Result: 0.9553364891256059809876433064346201717853546142578125 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeDump( cos( 90 ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/ClearTimezone.md: -------------------------------------------------------------------------------- 1 | ### Clear the timezone 2 | 3 | Set the timezone and then clear it. 4 | 5 | Run Example 6 | 7 | ```java 8 | setTimeZone( "CET" ); 9 | writeOutput( getTimezoneInfo().TIMEZONE & "→ " ); 10 | clearTimeZone(); 11 | writeOutput( getTimezoneInfo().TIMEZONE ); 12 | 13 | ``` 14 | 15 | Result: CET→ Etc/UTC 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/asmboxpiler/ITranspiler.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.compiler.asmboxpiler; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | 5 | import ortus.boxlang.compiler.ast.BoxClass; 6 | import ortus.boxlang.compiler.ast.BoxScript; 7 | import ortus.boxlang.runtime.types.exceptions.BoxRuntimeException; 8 | 9 | public interface ITranspiler { 10 | 11 | ClassNode transpile( BoxScript boxScript ) throws BoxRuntimeException; 12 | 13 | ClassNode transpile( BoxClass boxClass ) throws BoxRuntimeException; 14 | } 15 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/GetBaseTemplatePath.md: -------------------------------------------------------------------------------- 1 | ### Basic Example 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | getBaseTemplatePath(); 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | writeDump( getBaseTemplatePath() ); 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /workbench/samples/components/jdbc/ProcParam.md: -------------------------------------------------------------------------------- 1 | ### Basic Example 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | 11 | 12 | 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/asmboxpiler/transformer/ReturnValueContext.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.compiler.asmboxpiler.transformer; 2 | 3 | public enum ReturnValueContext { 4 | 5 | EMPTY( true, false ), 6 | VALUE( false, false ), 7 | VALUE_OR_NULL( false, true ), 8 | EMPTY_UNLESS_JUMPING( true, true ); 9 | 10 | public final boolean empty; 11 | public final boolean nullable; 12 | 13 | private ReturnValueContext( boolean empty, boolean nullable ) { 14 | this.empty = empty; 15 | this.nullable = nullable; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Request a new feature or enhancement 4 | --- 5 | 6 | 7 | 8 | ## Summary 9 | 10 | 11 | 12 | ## Detailed Description 13 | 14 | 15 | 16 | ## Possible Implementation Ideas 17 | 18 | 19 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Exp.md: -------------------------------------------------------------------------------- 1 | ### exponent of 1.13140211149 2 | 3 | The result could vary depending on if the server is running windows or linux. On a windows box the result will be round to 3.1 4 | 5 | Run Example 6 | 7 | ```java 8 | exp( 1.13140211149 ); 9 | 10 | ``` 11 | 12 | Result: 3.099999999991346707809724952544356 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | #exp( 10 )# 19 | ``` 20 | 21 | 22 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Sin.md: -------------------------------------------------------------------------------- 1 | ### Sine of 0.3 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | sin( .3 ); 9 | 10 | ``` 11 | 12 | Result: 0.295520206661339546183597803974407725036144256591796875 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | result = sin( 90 ); 20 | dump( result ); 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/InterfaceMultiInheritenceTest.bx: -------------------------------------------------------------------------------- 1 | class implements="IMultiChildInterface" { 2 | 3 | public Any function childMethod() { 4 | return "childMethod"; 5 | } 6 | 7 | public Any function parentMethod() { 8 | return "parentMethod"; 9 | } 10 | 11 | public Any function uncleMethod() { 12 | return "uncleMethod"; 13 | } 14 | 15 | default function parentOverrideMe2() { 16 | return "parentOverrideMe2Class"; 17 | } 18 | 19 | default function uncleOverrideMe2() { 20 | return "uncleOverrideMe2Class"; 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /workbench/samples/components/system/InvokeArgument.md: -------------------------------------------------------------------------------- 1 | ### Invoke a SOAP webservice and passing arguments using bx:invokeargument 2 | 3 | Calls a remote web service to perform an addition, uses bx:invokeargument to pass the arguments to the method. 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | 11 | #answer# 12 | ``` 13 | 14 | Result: 5.0 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/request/SetVariableRequest.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger.request; 2 | 3 | import ortus.boxlang.debugger.DebugAdapter; 4 | 5 | public class SetVariableRequest extends AbstractRequest { 6 | 7 | public SetVariableRequestArguments arguments; 8 | 9 | public static class SetVariableRequestArguments { 10 | 11 | public int variablesReference; 12 | public String name; 13 | public String value; 14 | } 15 | 16 | @Override 17 | public void accept( DebugAdapter adapter ) { 18 | adapter.visit( this ); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /workbench/samples/components/system/SaveContent.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | bx:savecontent variable="myContent" { 9 | writeOutput( "Somecontent." ); 10 | } 11 | 12 | ``` 13 | 14 | 15 | ### Tag Syntax 16 | 17 | 18 | 19 | 20 | ```java 21 | 22 | Some content. 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Max.md: -------------------------------------------------------------------------------- 1 | ### Tag Example 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | The maximum of #myNum1# and #myNum2# numbers is #max( myNum1, myNum2 )#. 10 | ``` 11 | 12 | Result: The maximum of 4 and 9 is 9. 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | echo( max( 45.94, 34.05 ) ); 20 | // outputs 45.94 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/CreateGUID.md: -------------------------------------------------------------------------------- 1 | ### Creates a Globally Unique Identifier (GUID). Each GUID will be unique 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | createGUID(); 9 | 10 | ``` 11 | 12 | Result: 38E5D44A-8D6A-42BF-B3A5-23FB2542786C 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | dump( CreateGUID() ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/CreateUUID.md: -------------------------------------------------------------------------------- 1 | ### Creates a Universally Unique Identifier (UUID). Each UUID will be unique 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | createUUID(); 9 | 10 | ``` 11 | 12 | Result: 65BA8F11-997D-429F-9BA5A4235FAA6833 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | dump( CreateUUID() ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/SetTimezone.md: -------------------------------------------------------------------------------- 1 | ### Set the current Timezone to CET 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | setTimezone( "CET" ); 9 | writeoutput( getTimezoneInfo().TIMEZONE ); 10 | 11 | ``` 12 | 13 | Result: CET 14 | 15 | ### Additional Examples 16 | 17 | 18 | ```java 19 | 20 | 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Parent.cfc: -------------------------------------------------------------------------------- 1 | component accessors="true" extends="GrandParent" { 2 | 3 | property name="properties" type="struct"; 4 | 5 | function init( struct properties = {} ) { 6 | variables.properties = arguments.properties; 7 | super.init(); 8 | setupFrameworkDefaults(); 9 | return this; 10 | } 11 | 12 | private void function setupFrameworkDefaults() { 13 | request?.calls?.append( "running parent setupFrameworkDefaults()" ); 14 | } 15 | 16 | function parentFunction(){ 17 | return "parentFunction"; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/interop/VarArgsExample.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.interop; 2 | 3 | import ortus.boxlang.runtime.types.IStruct; 4 | 5 | public class VarArgsExample { 6 | 7 | private String[] values; 8 | 9 | public VarArgsExample( String... values ) { 10 | this.values = values; 11 | } 12 | 13 | public VarArgsExample( IStruct map, String... values ) { 14 | this.values = values; 15 | } 16 | 17 | public String[] getValues() { 18 | return values; 19 | } 20 | 21 | public void setValues( String... values ) { 22 | this.values = values; 23 | } 24 | } -------------------------------------------------------------------------------- /workbench/tasks/BIFAndComponentList.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | 3 | function main(){ 4 | var bifs = GetFunctionList() 5 | var components = GetComponentList() 6 | 7 | FileWrite( "BoxLang.Bifs.json", jsonSerialize( data: bifs, pretty : true ) ) 8 | FileWrite( "BoxLang.Components.json", jsonSerialize( data: components, pretty : true ) ) 9 | 10 | fileWrite( "BoxLang.Bifs.txt", bifs.keyList( char( 10 ) ) ) 11 | fileWrite( "BoxLang.Components.txt", components.keyList( char( 10 ) ) ) 12 | 13 | println( "BoxLang.Bifs.json and BoxLang.Components.json files have been created." ) 14 | } 15 | } -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user manual at https://docs.gradle.org/8.0.2/userguide/multi_project_builds.html 8 | */ 9 | 10 | rootProject.name = "boxlang" 11 | 12 | // Gradle uses ':' instead of '/' to separate the path segments 13 | include ":src:modules:test" 14 | project( ":src:modules:test" ).projectDir = new File( "src/modules/test" ) 15 | -------------------------------------------------------------------------------- /src/main/resources/maven/maven.md: -------------------------------------------------------------------------------- 1 | # Maven Dependencies 2 | 3 | If your project relies on Java third-party dependencies, you can use the included Maven `pom.xml` file in the BoxLang home. You can add your dependencies there and then run the `mvn install` command to download them into the `lib/` folder. The BoxLang runtime will automatically class load all the jars in that folder for you! You can also use the `mvn clean` command to remove all the jars. 4 | 5 | You can find Java dependencies here: . Just grab the Maven coordinates and add them to your `pom.xml` file. 6 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Moped.bx: -------------------------------------------------------------------------------- 1 | class implements="IBicycle,IMotorcycle" { 2 | 3 | String function pedal( required numeric speed=3 ) { 4 | return "Pedal speed #speed#" 5 | } 6 | 7 | // This overachieving mehod has more details than the interfaces requires 8 | Boolean function pedalLax( required numeric speed=3 ) { 9 | } 10 | 11 | public Any function shift(required numeric gear) { 12 | return "Shift to gear #gear#" 13 | } 14 | 15 | @Override 16 | default function needsFuel() { 17 | return true; 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Asin.md: -------------------------------------------------------------------------------- 1 | ### Arcsine of 0.3 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | asin( .3 ); 9 | 10 | ``` 11 | 12 | Result: 0.3046926540153975 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | sine = 1; 20 | dump( Asin( sine ) ); 21 | // 1.570796326795 in radians 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | --- 5 | 6 | 7 | 8 | ## What are the steps to reproduce this issue? 9 | 10 | 1. … 11 | 2. … 12 | 3. … 13 | 14 | ## What happens? 15 | 16 | … 17 | 18 | ## What were you expecting to happen? 19 | 20 | … 21 | 22 | ## Any logs, error output, etc? 23 | 24 | … 25 | 26 | ## Any other comments? 27 | 28 | … 29 | 30 | ## What versions are you using? 31 | 32 | **Operating System:** … 33 | **Package Version:** … 34 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/GetCurrentTemplatePath.md: -------------------------------------------------------------------------------- 1 | ### Basic Example 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | getCurrentTemplatePath(); 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | testPath = getCurrentTemplatePath(); 19 | writeDump( testPath ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/binary/BitSh.md: -------------------------------------------------------------------------------- 1 | ### Shift right by 1 bit 2 | 3 | Uses the function bitShrn to perform a bitwise shift-right operation (no-rotation) 4 | 5 | Run Example 6 | 7 | ```java 8 | bitShrn( 5, 1 ); 9 | 10 | ``` 11 | 12 | Result: 2 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeOutput( bitSHRN( 128, 5 ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/i18n/ParseCurrency.md: -------------------------------------------------------------------------------- 1 | ### lsParseCurrency Example 2 | 3 | LSParseCurrency converts a locale-specific currency string to a number. 4 | 5 | Run Example 6 | 7 | ```java 8 | lsParseCurrency( "$120.50" ); 9 | 10 | ``` 11 | 12 | Result: 120.5 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | 19 | #LSParseCurrency( 4.5 )#
20 | #LSParseCurrency( "$4.50" )#
21 | #LSParseCurrency( "£4.50", "English (UK)" )# 22 |
23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Int.md: -------------------------------------------------------------------------------- 1 | ### Closest integer less than 1.8 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | int( 1.8 ); 9 | 10 | ``` 11 | 12 | Result: 1 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeDump( int( 7.0 ) ); // 7 20 | writeDump( int( 6.9 ) ); // 6 21 | writeDump( int( -2.9 ) ); 22 | // -3 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/struct/StructToQueryString.md: -------------------------------------------------------------------------------- 1 | ### structToQueryString with the default delimiter 2 | 3 | Converting a struct to a query string using the default delimiter (&) 4 | 5 | Run Example 6 | 7 | ```java 8 | someStruct = { 9 | "firstName" : "John", 10 | "lastName" : "Doe" 11 | }; 12 | writeDump( structToQueryString( someStruct ) ); 13 | 14 | ``` 15 | 16 | Result: firstName=John&lastName=Doe 17 | 18 | -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/CreateODBCDateTime.md: -------------------------------------------------------------------------------- 1 | ### Creates an ODBC time object 2 | 3 | Uses the CreateODBCTime function to create an ODBC time object 4 | 5 | 6 | ```java 7 | 8 | 9 | #result# 10 | ``` 11 | 12 | Result: {t '12:12:12'} 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | dump( CreateODBCTime( now() ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/bx/MyThreadingClass.bx: -------------------------------------------------------------------------------- 1 | class extends=MyThreadingSuperClass { 2 | 3 | function init() { 4 | this.foo = "bar"; 5 | } 6 | 7 | function execute() { 8 | thread name="myThread" foo="bar"{ 9 | printLn( "thread can access this scope: #this.foo#" ); 10 | sleep( 1000 ); 11 | } 12 | thread name="myThread" action="join"; 13 | return myThread; 14 | } 15 | 16 | function executeSuper() { 17 | thread name="myThread2"{ 18 | printLn( "thread can access super scope: #super.superMethod()#" ); 19 | sleep( 1000 ); 20 | } 21 | thread name="myThread2" action="join"; 22 | return myThread2; 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/binary/BitXor.md: -------------------------------------------------------------------------------- 1 | ### Calculate bitwise logical XOR 2 | 3 | Uses the bitXor function to perform the logical XOR operation on each pair of the corresponding bits 4 | 5 | Run Example 6 | 7 | ```java 8 | bitXor( 5, 3 ); 9 | 10 | ``` 11 | 12 | Result: 6 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeOutput( bitXor( 128, 5 ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/decision/IsIPv6.md: -------------------------------------------------------------------------------- 1 | ### isIPV6 Example 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | isIPV6( "127.0.0.1" ); 9 | 10 | ``` 11 | 12 | Result: false 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | ip = "FE80:CD00:0000:0CDE:1257:0000:211E:729C"; 20 | writeOutput( isIPv6( ip ) ); 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/bifs/i18n/GetLocaleDisplayName.md: -------------------------------------------------------------------------------- 1 | ### Output current Locale's display name than set it to swiss locale 2 | 3 | 4 | 5 | 6 | ```java 7 | writeOutput( getLocaleDisplayName() ); 8 | writeOutput( " → " ); 9 | setLocale( "de_ch" ); 10 | writeOutput( getLocaleDisplayName() ); 11 | 12 | ``` 13 | 14 | Result: English (United States) → Deutsch (Schweiz) 15 | 16 | ### Additional Examples 17 | 18 | Run Example 19 | 20 | ```java 21 | writeDump( getLocaleDisplayName() ); 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/GetTempDirectory.md: -------------------------------------------------------------------------------- 1 | ### Show temp directory path 2 | 3 | File system path where temporary files are stored 4 | 5 | Run Example 6 | 7 | ```java 8 | getTempDirectory(); 9 | 10 | ``` 11 | 12 | Result: /var/folders/k6/hm9skhxj2dd_901z2f2mkwt00000gn/T/ 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | dump( getTempDirectory() ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/DirectoryCopy.md: -------------------------------------------------------------------------------- 1 | ### Simple DirectoryCopy Example 2 | 3 | Copy directory from one place to another. 4 | 5 | 6 | ```java 7 | directoryCopy( expandPath( "./mySourceDirectory" ), expandPath( "../MyDestinationDirectory" ) ); 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | Run Example 15 | 16 | ```java 17 | directorycopy( "directorypath", "directorypath" ); 18 | // one directorypath to another directory path... 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/modules/test/src/main/bx/interceptors/Listener.bx: -------------------------------------------------------------------------------- 1 | class{ 2 | 3 | function configure(){ 4 | // Create The Hello Model 5 | var hello = new bxModules.test.models.Hello(); 6 | printLn( hello.sayHello() ); 7 | 8 | // // Java Class Integration 9 | // var javaHello = new java:HelloWorld@test(); 10 | // printLn( javaHello.hello() ); 11 | } 12 | 13 | function afterModuleActivations( data ){ 14 | printLn( "All modules activated" ) 15 | } 16 | 17 | function onRuntimeShutdown( data ){ 18 | printLn( "Runtime has gone down" ) 19 | } 20 | 21 | function onBxTestModule( data ){ 22 | printLn( "BX Test Module" ) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileWrite.md: -------------------------------------------------------------------------------- 1 | ### Write a Temporary File 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | fileWrite( getTempFile( getTempDirectory(), "tempFile" ), "My Data" ); 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | filewrite( "filepath", "fileContent to be write" ); 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Atn.md: -------------------------------------------------------------------------------- 1 | ### Arctangent of 0.3 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | atn( .3 ); 9 | 10 | ``` 11 | 12 | Result: 0.2911599378021857457108346581625601 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | angle_tangent = 1; 20 | dump( Atn( angle_tangent ) ); 21 | // 0.785398163397 in radians 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/GetFunctionList.md: -------------------------------------------------------------------------------- 1 | ### Check to see if a function exists 2 | 3 | CF11+ Uses the member function of structKeyExists. 4 | 5 | Run Example 6 | 7 | ```java 8 | getFunctionList().keyExists( "reMatch" ); 9 | 10 | ``` 11 | 12 | Result: true 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeDump( getFunctionList() ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/decision/IsNull.md: -------------------------------------------------------------------------------- 1 | ### isNull Example 2 | 3 | Returns true if the given object is null or the given expressions evaluates to null; Returns false is otherwise. 4 | 5 | Run Example 6 | 7 | ```java 8 | isNull( javaCast( "null", "" ) ); 9 | 10 | ``` 11 | 12 | Result: true 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | v1 = "test"; 19 | writeDump( isnull( v1 ) ); // false 20 | v2; // Defining empty variable or v2=nullValue(); 21 | writeDump( isnull( v2 ) ); 22 | // true 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/WriteLog.md: -------------------------------------------------------------------------------- 1 | ### Simple writeLog Code Example 2 | 3 | Logs an order processed successfully message to `orders.log` which will be located in the BX logs directory, eg: `{bx.root}/logs/` 4 | 5 | 6 | ```java 7 | writeLog( text="Order #order.getOrderID()# Processed Successfully", type="information", log="orders" ); 8 | 9 | ``` 10 | 11 | 12 | ### Additional Examples 13 | 14 | Run Example 15 | 16 | ```java 17 | writeLog( log="MyLog", text=now(), type="error" ); 18 | 19 | ``` 20 | 21 | 22 | -------------------------------------------------------------------------------- /workbench/samples/bifs/zip/Extract.md: -------------------------------------------------------------------------------- 1 | ### Extract a zip-file 2 | 3 | Extract a zip-file and save the data in the "output-directory". 4 | 5 | 6 | ```java 7 | extract( "zip", "test.zip", "output-directory" ); 8 | 9 | ``` 10 | 11 | 12 | ### Extract a multiple zip-files via a directory 13 | 14 | Extract all zip-files, which are stored in the "multiple-directory" and save the data in the "output-directory". 15 | 16 | 17 | ```java 18 | extract( "zip", "multiple-directory", "output-directory" ); 19 | 20 | ``` 21 | 22 | 23 | ### Additional Examples 24 | 25 | 26 | ```java 27 | extract( "zip", "D:\test.zip", "D:\zipresult" ); 28 | 29 | ``` 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Child.cfc: -------------------------------------------------------------------------------- 1 | component extends="Parent" { 2 | 3 | // If you un-comment this out, then the ClassTest.superInitTest will pass 4 | // function init( struct properties = {} ) { 5 | // super.init( argumentCollection = arguments ); 6 | // return this; 7 | // } 8 | 9 | function configure(){ 10 | return variables.properties; 11 | } 12 | 13 | private void function setupFrameworkDefaults() { 14 | request.calls.append( "running child setupFrameworkDefaults()" ); 15 | super.setupFrameworkDefaults(); 16 | } 17 | 18 | function childFunction(){ 19 | return "childFunction"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/RepeatString.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | getVal = repeatString( "Boxlang ", 3 ); 9 | writeDump( getVal ); 10 | 11 | ``` 12 | 13 | Result: Expected Result: Boxlang Boxlang Boxlang 14 | 15 | ### Additional Examples 16 | 17 | 18 | ```java 19 | writeDump( repeatString( "Hi buddy!, Have a nice day.", 2 ) ); 20 | // Member function 21 | str = "I love Boxlang "; 22 | writeDump( str.repeatString( 3 ) ); 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/GetDirectoryFromPath.md: -------------------------------------------------------------------------------- 1 | ### Basic Example 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | getDirectoryFromPath( "C:\temp\file.txt" ); 9 | 10 | ``` 11 | 12 | Result: C:\temp\ 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | some_directory = getDirectoryFromPath( "path" ); 20 | dump( some_directory ); 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileDelete.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | Obtaining files within an archive folder and then removing them if they are older than one hour. 4 | 5 | 6 | ```java 7 | var existingFiles = directoryList( expandPath( "/archive/" ), false, "query" ); 8 | for( file in existingFiles ) { 9 | if( dateDiff( "h", file.DATELASTMODIFIED, now() ) > 1 ) { 10 | fileDelete( file.DIRECTORY & "\" & file.NAME ); 11 | } 12 | } 13 | 14 | ``` 15 | 16 | Result: All files within the archive directory older than one hour will be deleted. 17 | 18 | ### Additional Examples 19 | 20 | 21 | ```java 22 | fileDelete( "my/path/to/file.md" ); 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Abs.md: -------------------------------------------------------------------------------- 1 | ### Absolute Value of -4.3 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | abs( -4.3 ); 9 | 10 | ``` 11 | 12 | Result: 4.3 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | absVal = abs( 1 ); 20 | dump( absVal ); 21 | absVal = abs( 1.1 ); 22 | dump( absVal ); 23 | absVal = abs( -1 ); 24 | dump( absVal ); 25 | absVal = abs( -1.1 ); 26 | dump( absVal ); 27 | 28 | ``` 29 | 30 | 31 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/GetFileFromPath.md: -------------------------------------------------------------------------------- 1 | ### Basic Example 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | getFileFromPath( "C:\temp\file.txt" ); 9 | 10 | ``` 11 | 12 | Result: file.txt 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | my_file = getFileFromPath( "filepath\file.ext" ); 20 | dump( my_file ); 21 | // file.ext 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/components/xml/XML.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | Creates a new BL XML document object. 4 | 5 | Run Example 6 | 7 | ```java 8 | bx:xml variable="myXml" { 9 | writeOutput( "Astley, RickNever Gonna Give You Up" ); 10 | } 11 | writeDump( myXml ); 12 | 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/ImplicitAccessor.bx: -------------------------------------------------------------------------------- 1 | class invokeImplicitAccessor=true { 2 | property string name; 3 | property integer age; 4 | 5 | methodsCalled = ""; 6 | function getName() { 7 | methodsCalled &= "getName"; 8 | return variables.name; 9 | } 10 | 11 | function setName(string name) { 12 | methodsCalled &= "setName"; 13 | variables.name = name; 14 | } 15 | 16 | function getAge() { 17 | methodsCalled &= "getAge"; 18 | return variables.age; 19 | } 20 | 21 | function setAge(integer age) { 22 | methodsCalled &= "setAge"; 23 | variables.age = age; 24 | } 25 | 26 | function getMethodsCalled() { 27 | return methodsCalled; 28 | } 29 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/TagComponentParse.cfc: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/SpanExcluding.md: -------------------------------------------------------------------------------- 1 | ### Tag Example 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | #spanExcluding( "This is Great", "r" )# 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | writeDump( spanExcluding( "Plant green! save earth!", "s" ) ); 19 | // Member Function 20 | str = "AabByyysss"; 21 | writeDump( str.spanExcluding( "s" ) ); 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/components/system/Execute.md: -------------------------------------------------------------------------------- 1 | ### Script syntax 2 | 3 | If you want to execute a script (.sh,.cmd,.bat), use bash (linux) or cmd.exe (windows) as the command and the script as argument for the shell interpreter. 4 | 5 | 6 | ```java 7 | bx:execute name="bash" arguments="/opt/jq.sh #cmdArgs#" variable="standardOut" errorVariable="errorOut" timeout="10"; 8 | 9 | ``` 10 | 11 | 12 | ### Script syntax with terminateOnTimeout 13 | 14 | Printing a PDF using lpr 15 | 16 | 17 | ```java 18 | bx:execute name="lpr" arguments="-P 'My Print Job Name' 'C:/Users/devguy/Documents/server/mynewfile.pdf'" timeout="5" terminateOnTimeout="true"; 19 | 20 | ``` 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/PropertyTestCF.cfc: -------------------------------------------------------------------------------- 1 | component accessors=true { 2 | property name="myProperty" default="myDefaultValue" type=string inject preAnno; 3 | 4 | /** 5 | * This is my property 6 | * @brad wood 7 | * @luis 8 | */ 9 | property string anotherprop preanno=["myValue", "anothervalue"]; 10 | 11 | property shortcutWithDefault default="myDefaultValue"; 12 | 13 | property String typedShortcutWithDefault default="myDefaultValue2"; 14 | 15 | property name="chain" type="array" default="#ArrayNew(1)#"; 16 | 17 | property foo.com.Bar barProp; 18 | 19 | function init() { 20 | getMyProperty(); 21 | } 22 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/async/IsInThread.md: -------------------------------------------------------------------------------- 1 | ### isinthread Example 2 | 3 | Check if the code is running inside a bx:thread. 4 | 5 | Run Example 6 | 7 | ```java 8 | request.INTHREAD = false; 9 | writeOutput( isInThread() ); 10 | bx:thread action="run" name="inThread" { 11 | request.INTHREAD = isInThread(); 12 | } 13 | sleep( 1000 ); 14 | writeOutput( request.INTHREAD ); 15 | 16 | ``` 17 | 18 | Result: falsetrue 19 | 20 | ### Additional Examples 21 | 22 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/Dog.cfc: -------------------------------------------------------------------------------- 1 | component extends="Animal" { 2 | results.append('Dog pseudo ' & getFileFromPath( getCurrentTemplatePath())) 3 | variables.inDog = true; 4 | // Our variables scope contains the variables from the parent component 5 | results.append( "dog sees variables.inAnimal as: " & variables.inAnimal ) 6 | 7 | function init() { 8 | super.init(); 9 | results.append('Dog init ' & getFileFromPath( getCurrentTemplatePath())) 10 | } 11 | 12 | function speak() { 13 | return "Woof!"; 14 | } 15 | 16 | function getScientificName() { 17 | return "Canis lupus " & super.getScientificName(); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/string/SpanIncluding.md: -------------------------------------------------------------------------------- 1 | ### Tag Example 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | #SpanIncluding( "This is Great", "p" )# 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | writeDump( spanIncluding( "Plant green! save earth!", "Plant green!r" ) ); 19 | // Member Function 20 | str = "AabByyysss"; 21 | writeDump( str.spanIncluding( "AabBz" ) ); 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/temporal/TimeUnits.md: -------------------------------------------------------------------------------- 1 | ### Year of a datetime object 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | dt = createdatetime( 2016, 1, 1, 5, 30, 25 ); 9 | y = year( dt ); 10 | writeoutput( y ); 11 | 12 | ``` 13 | 14 | Result: 2016 15 | 16 | ### Additional Examples 17 | 18 | Run Example 19 | 20 | ```java 21 | thisYear = year( now() ); 22 | dump( thisYear ); 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/xml/XMLNew.md: -------------------------------------------------------------------------------- 1 | ### The simple xmlnew example 2 | 3 | Here, We created myXml by using xmlNew function. Then created root node(sampleXml) for myXml and set the rootnode text 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | 11 | ``` 12 | 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | xml_document = XmlNew(); 20 | dump( xml_document ); 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/components/system/ExitTests/module.bxm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /workbench/samples/bifs/binary/BitNot.md: -------------------------------------------------------------------------------- 1 | ### Calculate bitwise logical NOT 2 | 3 | Uses the bitNot function to perform the logical NOT operation of a signed 32-bit integer (two's complement) 4 | 5 | Run Example 6 | 7 | ```java 8 | bitNot( 0 ); 9 | 10 | ``` 11 | 12 | Result: -1 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeOutput( bitNot( 0 ) ); 20 | writeOutput( "
" ); 21 | writeOutput( bitNot( 255 ) ); 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/cache/Cache.md: -------------------------------------------------------------------------------- 1 | ### Adding a page to the cache 2 | 3 | Puts HTML page into the cache and uses the cached version on subsequent calls to the page. 4 | 5 | 6 | ```java 7 | 8 |
Hello World!
9 |
10 | ``` 11 | 12 | Result:
Hello World!
13 | 14 | ### Flushing a page from the cache 15 | 16 | Flushes the 'hello-world.bxm' page from the cache. 17 | 18 | 19 | ```java 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/GetBaseTagData.md: -------------------------------------------------------------------------------- 1 | ### Retrieve parent tag thisTag scope 2 | 3 | Use getBaseTagData() to retrieve the execution mode of the parent CF_MAPPER custom tag. 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | template 11 | 12 | BODY 13 | 14 | ``` 15 | 16 | 17 | ### Retrieve parent tag attributes 18 | 19 | Use getBaseTagData() to retrieve the attributes of the parent cf_iframe tag 20 | 21 | 22 | ```java 23 | variables.PARENTATTRIBUTES = getBaseTagData( "cf_iframe" ).ATTRIBUTES; 24 | 25 | ``` 26 | 27 | 28 | -------------------------------------------------------------------------------- /workbench/samples/bifs/binary/BitOr.md: -------------------------------------------------------------------------------- 1 | ### Calculate bitwise logical OR 2 | 3 | Uses the bitOr function to perform the logical OR operation on each pair of the corresponding bits 4 | 5 | Run Example 6 | 7 | ```java 8 | bitOr( 5, 3 ); 9 | 10 | ``` 11 | 12 | Result: 7 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeOutput( bitOr( 4, 128 ) ); 20 | writeOutput( "
" ); 21 | writeOutput( bitOr( 10, 0 ) ); 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/PagePoolClear.md: -------------------------------------------------------------------------------- 1 | ### pagePoolClear Example 2 | 3 | Clear out all the BL code (bxm, bx) in the cache of compiled code. 4 | 5 | Run Example 6 | 7 | ```java 8 | writeDump( pagePoolClear() ); 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | result = PagePoolClear(); 19 | echo( result ); 20 | // page pool has been cleared 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/SystemCacheClear.md: -------------------------------------------------------------------------------- 1 | ### Clear all caches 2 | 3 | Clear all caches. 4 | 5 | Run Example 6 | 7 | ```java 8 | systemCacheClear(); 9 | 10 | ``` 11 | 12 | 13 | ### Clear the template cache 14 | 15 | Clear the template cache. 16 | 17 | Run Example 18 | 19 | ```java 20 | systemCacheClear( "template" ); 21 | 22 | ``` 23 | 24 | 25 | ### Additional Examples 26 | 27 | 28 | ```java 29 | SystemCacheClear( [ 30 | cacheName 31 | ] ); 32 | 33 | ``` 34 | 35 | 36 | -------------------------------------------------------------------------------- /workbench/samples/components/system/Flush.md: -------------------------------------------------------------------------------- 1 | ### Simple Script Example 2 | 3 | Outputs 'foo' to the browser approximately 1 second before 'bar' 4 | 5 | Run Example 6 | 7 | ```java 8 | writeOutput( "
foo
" ); 9 | bx:flush; 10 | sleep( 1000 ); 11 | writeOutput( "
bar
" ); 12 | 13 | ``` 14 | 15 | 16 | ### Simple Tag Example 17 | 18 | Outputs 'foo' to the browser approximately 1 second before 'bar' 19 | 20 | 21 | ```java 22 |
foo
23 | 24 |
bar
25 | ``` 26 | 27 | 28 | -------------------------------------------------------------------------------- /workbench/CodeHeader.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * [BoxLang] 3 | * 4 | * Copyright [2023] [Ortus Solutions, Corp] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.format.enabled": true, 3 | "java.format.settings.url": "workbench/ortus-java-style.xml", 4 | "java.configuration.updateBuildConfiguration": "automatic", 5 | "java.dependency.packagePresentation": "hierarchical", 6 | "java.project.explorer.showNonJavaResources": false, 7 | "java.compile.nullAnalysis.mode": "automatic", 8 | "java.dependency.syncWithFolderExplorer": true, 9 | "[java]": { 10 | "editor.formatOnSave": true, 11 | "editor.insertSpaces": false, 12 | "editor.tabSize": 4 13 | }, 14 | "editor.formatOnSave": true, 15 | "editor.codeActionsOnSave": { 16 | "source.organizeImports": "explicit" 17 | }, 18 | "java.debug.settings.onBuildFailureProceed": false 19 | } -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/BoxByteCodeVersion.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.compiler; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | @Retention( RetentionPolicy.CLASS ) 7 | public @interface BoxByteCodeVersion { 8 | 9 | /** 10 | * More informational than anything. Stores the version of BoxLang that produced the bytecode. 11 | */ 12 | String boxlangVersion(); 13 | 14 | /** 15 | * The bytecode version used when compiling this class. We will increment this value any time we make breaking changes to the bytecode format 16 | * or to the portions of the runtime that the bytecode directly interacts with. 17 | */ 18 | int bytecodeVersion(); 19 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/array/ArrayMedian.md: -------------------------------------------------------------------------------- 1 | ### Calculates the Median value 2 | 3 | Uses the arrayMedian function to calculate the Median value 4 | 5 | Run Example 6 | 7 | ```java 8 | someArray = [ 9 | 1, 10 | 2, 11 | 2 12 | ]; 13 | m = arrayMedian( someArray ); 14 | writeOutput( m ); 15 | 16 | ``` 17 | 18 | Result: 2 19 | 20 | ### Additional Examples 21 | 22 | 23 | ```java 24 | aNames = array( 10412, 42, 33, 2, 999, 12769, 888 ); 25 | dump( arrayMedian( aNames ) ); 26 | // member function 27 | dump( aNames.median() ); 28 | 29 | ``` 30 | 31 | 32 | -------------------------------------------------------------------------------- /workbench/samples/bifs/array/ArrayReduceRight.md: -------------------------------------------------------------------------------- 1 | ### Simple arrayReduceRight Example 2 | 3 | Demonstrate how the function works from right to left. 4 | 5 | Run Example 6 | 7 | ```java 8 | myArray = [ 9 | "a", 10 | "b", 11 | "c", 12 | "d" 13 | ]; 14 | newArray = arrayReduceRight( myArray, ( Any prev, Any next, Any idx, Any arr ) => { 15 | return prev & next & idx; 16 | }, "" ); 17 | writedump( newArray ); 18 | 19 | ``` 20 | 21 | Result: d4c3b2a1 22 | 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileClose.md: -------------------------------------------------------------------------------- 1 | ### Opens a file, reads a line then closes it. 2 | 3 | 4 | 5 | 6 | ```java 7 | // Open File 8 | var fileObject = fileOpen( "/path/to/file.txt" ); 9 | // Perform Actions 10 | try { 11 | // Read Line 12 | writeOutput( fileReadLine( fileObject ) ); 13 | } 14 | // Error Handling 15 | catch (any ex) { 16 | // Report Exception 17 | writeDump( ex ); 18 | }finally { 19 | // Always Close 20 | // Close File 21 | fileClose( fileObject ); 22 | } 23 | 24 | ``` 25 | 26 | 27 | ### Additional Examples 28 | 29 | 30 | ```java 31 | testFile = fileopen("filepath"),"write"); 32 | filewriteline(testfile,"I am the example of fileclose"); 33 | fileclose(testfile); 34 | ``` 35 | 36 | 37 | -------------------------------------------------------------------------------- /workbench/samples/components/system/ObjectComponent.md: -------------------------------------------------------------------------------- 1 | ### The simple bx:object example 2 | 3 | Calling the above multiply function by using bx:object tag based code. 4 | 5 | 6 | ```java 7 | 8 | 9 | #multiplyObj.multiply( 1, 2 )# 10 | 11 | ``` 12 | 13 | Result: 2 14 | 15 | ### The simple (bx:object) example 16 | 17 | Calling the above multiply function by using bx:object script based code. 18 | 19 | 20 | ```java 21 | 22 | bx:object name="multiplyNum" type="component" component="multiply" { 23 | writeOutput( multiplyNum.multiply( 6, 7 ) ); 24 | } 25 | 26 | 27 | ``` 28 | 29 | Result: 42 30 | 31 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Randomize.md: -------------------------------------------------------------------------------- 1 | ### Tag Example 2 | 3 | The following example calls the Randomize function to seed the random number generator and generates 10 random numbers. 4 | 5 | 6 | ```java 7 | 8 | 9 | #rand()# 10 | 11 | ``` 12 | 13 | 14 | ### Additional Examples 15 | 16 | 17 | ```java 18 | writeDump( Randomize( 8, "SHA1PRNG" ) ); 19 | writeDump( Randomize( 10 ) >= 0 && Randomize( 10 ) <= 1 ); 20 | randomize( 55 ); 21 | bx:loop index="i" from="1" to="3" { 22 | writeDump( rand() ); 23 | } 24 | 25 | ``` 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/StaticTestCF.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | static { 3 | static.scoped = "brad"; 4 | unscoped = "wood" 5 | static foo = 9000; 6 | final brad = "wood" 7 | } 8 | 9 | static.foo = 42; 10 | variables.staticBrad = static.brad; 11 | this.thisStaticBrad = variables.staticBrad; 12 | 13 | static { 14 | static.again = "luis" 15 | } 16 | 17 | static function myStaticFunc() { 18 | return "static" & static.foo; 19 | } 20 | 21 | function myInstanceFunc() { 22 | return "instance" & myStaticFunc(); 23 | } 24 | 25 | function getStaticBrad() { 26 | return staticBrad; 27 | } 28 | 29 | static function getInstance() { 30 | return new src.test.java.TestCases.phase3.StaticTestCF(); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/StaticTestCF2.cfc: -------------------------------------------------------------------------------- 1 | component { 2 | static { 3 | static.scoped = "brad"; 4 | unscoped = "wood" 5 | static foo = 9000; 6 | final brad = "wood" 7 | } 8 | 9 | static.foo = 42; 10 | variables.staticBrad = static.brad; 11 | this.thisStaticBrad = variables.staticBrad; 12 | 13 | static { 14 | static.again = "luis" 15 | } 16 | 17 | static function myStaticFunc() { 18 | return "static" & static.foo; 19 | } 20 | 21 | function myInstanceFunc() { 22 | return "instance" & myStaticFunc(); 23 | } 24 | 25 | function getStaticBrad() { 26 | return staticBrad; 27 | } 28 | 29 | static function getInstance() { 30 | return new src.test.java.TestCases.phase3.StaticTestCF2(); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /workbench/samples/bifs/io/CreateTempFile.md: -------------------------------------------------------------------------------- 1 | ### Create temp file in temp dir 2 | 3 | Returns path of file created 4 | 5 | Run Example 6 | 7 | ```java 8 | getTempFile( getTempDirectory(), "testFile" ); 9 | 10 | ``` 11 | 12 | Result: /private/var/folders/k6/hm9skhxj2dd_901z2f2mkwt00000gn/T/testFile13427324567646329113.tmp 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | dump( GetTempFile( getTempDirectory(), "demo" ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/Dump.md: -------------------------------------------------------------------------------- 1 | ### Dump Server Scope 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | writeDump( server ); 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | // You can dump any thing here. Easy to see the content of complex data type 19 | writeDump( var=getTimeZoneInfo(), label="Tag label" ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/CompareNoCase.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | 9 | 10 | ``` 11 | 12 | Result: 0 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | dump( CompareNoCase( "100 MAIN ST.", "675 EAST AVENUE" ) ); 20 | // -1 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/LCase.md: -------------------------------------------------------------------------------- 1 | ### lowercase BLDocs Rock 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | lCase( "BLDocs Rock" ); 9 | 10 | ``` 11 | 12 | Result: bldocs rock 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | // create variable with a string of text 20 | foo = "Hello World!"; 21 | // output variable in lower case 22 | writeOutput( LCase( foo ) ); 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/ReMatch.md: -------------------------------------------------------------------------------- 1 | ### reMatchNoCase Example 2 | 3 | Uses a regular expression (RE) to search a string for a pattern. 4 | 5 | Run Example 6 | 7 | ```java 8 | string = "1234AbcacAcdd"; 9 | writeDump( reMatchNoCase( "[A-Z]+", string ) ); 10 | 11 | ``` 12 | 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeDump( REMatchNoCase( "[A-Z]+", "12AbcacAcdd" ) ); 20 | 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/bx/generatePrimes.cfs: -------------------------------------------------------------------------------- 1 | import java.lang.System; 2 | import ortus.boxlang.runtime.types.Array; 3 | import java.util.Date; 4 | 5 | start = new Date().getTime() 6 | 7 | // Get primes up to num 8 | num = 1000 9 | 10 | i = 1; 11 | p = 1; 12 | m = 0; 13 | t = 0; 14 | l = 0; 15 | arr = []; 16 | arr2 = []; 17 | while (++i <= num) { arr[i-1] = i; } 18 | 19 | while(p-1) arr.removeAt(t); 27 | if(m>=num) break; 28 | } 29 | p++; 30 | } 31 | 32 | System.out.println( arr.size() ); 33 | 34 | System.out.println( new Date().getTime()-start & "ms" ) 35 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/UCase.md: -------------------------------------------------------------------------------- 1 | ### uppercase BLDocs Rock 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | uCase( "BLDocs Rock" ); 9 | 10 | ``` 11 | 12 | Result: BLDOCS ROCK 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | // create variable with a string of text 20 | foo = "Hello World!"; 21 | // output variable in upper case 22 | writeOutput( UCase( foo ) ); 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/type/NullValue.md: -------------------------------------------------------------------------------- 1 | ### Boxlang polyfill 2 | 3 | Using java data type null instead 4 | 5 | Run Example 6 | 7 | ```java 8 | writeOutput( isNull( nullValue() ) ); 9 | 10 | ``` 11 | 12 | Result: YES 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | my_null = NullValue(); 20 | dump( isNull( my_null ) ); 21 | 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /workbench/samples/components/system/Param.md: -------------------------------------------------------------------------------- 1 | ### bx:param in BL 2 | 3 | A very basic BL bx:param example 4 | 5 | 6 | ```java 7 | 8 | ``` 9 | 10 | 11 | ### bx:param in script 12 | 13 | A very basic script bx:param example 14 | 15 | Run Example 16 | 17 | ```java 18 | bx:param name="userID" default=0; 19 | bx:param name="userID" default=0; 20 | 21 | ``` 22 | 23 | 24 | ### Tag syntax using a regex 25 | 26 | Throws an error if the value is not one of a list of possible values 27 | 28 | 29 | ```java 30 | 31 | ``` 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/asmboxpiler/DebugCatchResetNode.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.compiler.asmboxpiler; 2 | 3 | import java.util.Map; 4 | 5 | import org.objectweb.asm.MethodVisitor; 6 | import org.objectweb.asm.tree.AbstractInsnNode; 7 | import org.objectweb.asm.tree.LabelNode; 8 | 9 | public class DebugCatchResetNode extends AbstractInsnNode { 10 | 11 | public DebugCatchResetNode() { 12 | super( -1 ); 13 | } 14 | 15 | @Override 16 | public int getType() { 17 | return -1; 18 | } 19 | 20 | @Override 21 | public void accept( MethodVisitor methodVisitor ) { 22 | return; 23 | } 24 | 25 | @Override 26 | public AbstractInsnNode clone( Map clonedLabels ) { 27 | return new DebugCatchResetNode(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/SystemOutput.md: -------------------------------------------------------------------------------- 1 | ### Write a string to the output stream "Hello World" 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | systemOutput( "Hello World" ); 9 | 10 | ``` 11 | 12 | 13 | ### Write an array to the output stream 14 | 15 | 16 | 17 | Run Example 18 | 19 | ```java 20 | systemOutput( [ 21 | "foo", 22 | "bar" 23 | ] ); 24 | 25 | ``` 26 | 27 | 28 | ### Write a struct to the output stream 29 | 30 | 31 | 32 | 33 | ```java 34 | systemOutput({ "myKey", "myValue" }); 35 | ``` 36 | 37 | 38 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileSetLastModified.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | fileSetLastModified( "c: emp est1.txt", "#now()#" ); 9 | writeOutput( getFileInfo( "c: emp est1.txt" ).LASTMODIFIED ); 10 | 11 | 12 | ``` 13 | 14 | 15 | ### Additional Examples 16 | 17 | Run Example 18 | 19 | ```java 20 | filesetlastmodified( expandPath( "./testcase.txt" ), dateAdd( "d", 2, now() ) ); 21 | writeDump( getfileinfo( expandPath( "./testcase.txt" ) ).LASTMODIFIED ); 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/tasks/BoxLang.Components.txt: -------------------------------------------------------------------------------- 1 | Abort 2 | Application 3 | Associate 4 | BoxLangComponentProxy 5 | Cache 6 | Component 7 | Content 8 | Cookie 9 | DBInfo 10 | Directory 11 | Document 12 | DocumentItem 13 | DocumentSection 14 | Dump 15 | ExampleComponent 16 | Execute 17 | Exit 18 | File 19 | Flush 20 | gzip 21 | Header 22 | HtmlFooter 23 | HtmlHead 24 | HTTP 25 | HTTPParam 26 | Include 27 | Invoke 28 | InvokeArgument 29 | Location 30 | Lock 31 | Log 32 | Loop 33 | Mail 34 | MailParam 35 | MailPart 36 | Object 37 | Output 38 | Param 39 | ProcessingDirective 40 | ProcParam 41 | ProcResult 42 | Query 43 | QueryParam 44 | SaveContent 45 | Setting 46 | Silent 47 | Sleep 48 | Stopwatch 49 | StoredProc 50 | Thread 51 | Throw 52 | Timer 53 | Trace 54 | Transaction 55 | WDDX 56 | XML 57 | Zip -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/xml/transformer.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 21 | 22 | 23 |
NamePrice
16 | 17 | 19 | 20 |
24 | 25 | 26 |
27 |
-------------------------------------------------------------------------------- /workbench/samples/components/zip/Zip.md: -------------------------------------------------------------------------------- 1 | ### Extract / Unzip a zip file into a folder 2 | 3 | Uses `action="unzip"` in the bx:zip tag to unzip into the temp directory. 4 | 5 | 6 | ```java 7 | 8 | ``` 9 | 10 | 11 | ### Extract / Unzip a zip file into a folder (Script Syntax) 12 | 13 | Uses `action="unzip"` in the bx:zip tag to unzip into the temp directory. 14 | 15 | 16 | ```java 17 | bx:zip action="unzip" file="zipFileName" destination=getTempDirectory(); 18 | 19 | ``` 20 | 21 | 22 | ### List contents of a zip folder (Script Syntax) 23 | 24 | Uses `action="list"` in the bx:zip tag to list the zip contents. 25 | 26 | 27 | ```java 28 | bx:zip action="list" file="zipFileName" name="zipList"; 29 | 30 | ``` 31 | 32 | 33 | -------------------------------------------------------------------------------- /workbench/samples/bifs/decision/IsLeapYear.md: -------------------------------------------------------------------------------- 1 | ### Is the current date in a leap year? 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | date = now(); 9 | isLeapYear = isLeapYear( year( date ) ); 10 | writeOutput( isLeapYear ); 11 | 12 | ``` 13 | 14 | 15 | ### Additional Examples 16 | 17 | Run Example 18 | 19 | ```java 20 | writeDump( label="2018", var=IsLeapYear( 2018 ) ); 21 | writeDump( label="2020", var=IsLeapYear( 2020 ) ); 22 | writeDump( label="1", var=IsLeapYear( 1 ) ); 23 | 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/java/external/specs/QoQDistinctSortTest.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copied from test\tickets\LDEV3822.cfc in Lucee 3 | */ 4 | component extends="testbox.system.BaseSpec"{ 5 | 6 | function run( testResults, textbox ) { 7 | 8 | describe("testcase for LDEV-3822", function(){ 9 | 10 | it(title="throws exception when using select distinct and ordering by a column not in the select list", body=function( currentSpec ){ 11 | var employees = queryNew( 'name,age', 'varchar,integer', 12 | [ [ 'John Doe',28 ], 13 | [ 'Jane Doe',28 ], 14 | [ 'Bane Doe',28 ]] ); 15 | 16 | expect( ()=>QueryExecute( 17 | sql = "SELECT DISTINCT age from employees ORDER BY age, name", 18 | queryoptions = { dbtype: 'query' } 19 | ) ).toThrow(); 20 | 21 | }); 22 | 23 | }); 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Ceiling.md: -------------------------------------------------------------------------------- 1 | ### Ceiling of 1.1 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | ceiling( 1.1 ); 9 | 10 | ``` 11 | 12 | Result: 2 13 | 14 | ### Ceiling of 1 15 | 16 | When ceiling an integer the result is equal to the value passed 17 | 18 | Run Example 19 | 20 | ```java 21 | ceiling( 1 ); 22 | 23 | ``` 24 | 25 | Result: 1 26 | 27 | ### Additional Examples 28 | 29 | 30 | ```java 31 | 32 | 1.2: #ceiling( 1.2 )#
33 | 1.5: #ceiling( 1.5 )#
34 | 1.7: #ceiling( 1.7 )#
35 |
36 | ``` 37 | 38 | 39 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | MYSQL_HOST=localhost 2 | MYSQL_PORT=3309 3 | MYSQL_DATABASE=myDB 4 | MYSQL_USERNAME=root 5 | MYSQL_PASSWORD=123456Password 6 | 7 | MARIADB_HOST=localhost 8 | MARIADB_PORT=3360 9 | MARIADB_DATABASE=myDB 10 | MARIADB_USERNAME=root 11 | MARIADB_PASSWORD=123456Password 12 | 13 | POSTGRES_HOST=localhost 14 | POSTGRES_PORT=5432 15 | POSTGRES_DATABASE=myDB 16 | POSTGRES_USERNAME=postgres 17 | POSTGRES_PASSWORD=123456Password 18 | 19 | ORACLE_HOST=localhost 20 | ORACLE_PORT=1521 21 | ORACLE_DATABASE=XEPDB1 22 | ORACLE_PASSWORD=123456Password 23 | 24 | MSSQL_HOST=localhost 25 | MSSQL_PORT=1433 26 | MSSQL_DATABASE=master 27 | MSSQL_USERNAME=sa 28 | MSSQL_PASSWORD=123456Password 29 | 30 | HYPERSQL_HOST=localhost 31 | HYPERSQL_PORT=??? 32 | HYPERSQL_DATABASE=myDB 33 | HYPERSQL_USER=xyz 34 | HYPERSQL_PASSWORD=123456Password -------------------------------------------------------------------------------- /workbench/samples/bifs/conversion/ToBase64.md: -------------------------------------------------------------------------------- 1 | ### String Example 2 | 3 | Converts a String to a Base64-String. 4 | 5 | Run Example 6 | 7 | ```java 8 | ToBase64( "Test String" ); 9 | 10 | ``` 11 | 12 | Result: VGVzdCBTdHJpbmc= 13 | 14 | ### Binary Object Example 15 | 16 | Converts an Image Binary to a Base64-String. 17 | 18 | 19 | ```java 20 | ToBase64( ToBinary( ImageRead( "example.jpg" ) ) ); 21 | 22 | ``` 23 | 24 | 25 | ### Additional Examples 26 | 27 | Run Example 28 | 29 | ```java 30 | dump( ToBase64( "ToBase64" ) ); 31 | // VG9CYXNlNjQ= 32 | 33 | ``` 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/cache/policies/RandomTest.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.cache.policies; 2 | 3 | import java.util.Comparator; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import ortus.boxlang.runtime.cache.ICacheEntry; 9 | 10 | public class RandomTest { 11 | 12 | @Test 13 | @DisplayName( "Random Cache Policy: Comparator Test" ) 14 | void testComparator() { 15 | Random randomPolicy = new Random(); 16 | 17 | // Get the comparator 18 | Comparator comparator = randomPolicy.getComparator(); 19 | // Test that it works return value must be between -1 and 1 20 | for ( int i = 0; i < 10; i++ ) { 21 | int result = comparator.compare( null, null ); 22 | assert result >= -1 && result <= 1; 23 | } 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/FileSetAttribute.md: -------------------------------------------------------------------------------- 1 | ### Create a temporary file and then change read-only mode 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | myFile = getTempFile( getTempDirectory(), "testFile" ); 9 | writeOutput( "is writable: " & getFileInfo( myFile ).CANWRITE ); 10 | fileSetAttribute( myFile, "readOnly" ); 11 | writeOutput( " → " & getFileInfo( myFile ).CANWRITE ); 12 | 13 | ``` 14 | 15 | Result: is writable: YES → NO 16 | 17 | ### Additional Examples 18 | 19 | 20 | ```java 21 | filesetattribute( "example.txt", "readonly" ); 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/GetCanonicalPath.md: -------------------------------------------------------------------------------- 1 | ### getCanonicalPath Example 2 | 3 | Returns the canonical path of the input path. 4 | 5 | Run Example 6 | 7 | ```java 8 | writeOutput( getCanonicalPath( getBaseTemplatePath() ) ); 9 | 10 | ``` 11 | 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | base_path = getBaseTemplatePath(); 19 | canonical = getCanonicalPath( base_path ); 20 | dump( canonical ); 21 | // /var/task 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/Mid.md: -------------------------------------------------------------------------------- 1 | ### Extract month from date 2 | 3 | Grabs the month out of a raw date yyyymmdd value. 4 | 5 | Run Example 6 | 7 | ```java 8 | mid( "20001122", "5", "2" ); 9 | 10 | ``` 11 | 12 | Result: 11 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | str = "I Love Boxlang server"; 20 | writeOutput( mid( str, 8, 5 ) ); 21 | // Member function 22 | str = "Hi buddy, Nice day!"; 23 | writeDump( str.mid( 4, 5 ) ); 24 | 25 | ``` 26 | 27 | 28 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | # Auto detect text files and perform LF normalization 11 | * text=auto 12 | 13 | # Custom for Visual Studio 14 | *.cs diff=csharp 15 | *.sln merge=union 16 | *.csproj merge=union 17 | *.vbproj merge=union 18 | *.fsproj merge=union 19 | *.dbproj merge=union 20 | 21 | # Standard to msysgit 22 | *.doc diff=astextplain 23 | *.DOC diff=astextplain 24 | *.docx diff=astextplain 25 | *.DOCX diff=astextplain 26 | *.dot diff=astextplain 27 | *.DOT diff=astextplain 28 | *.pdf diff=astextplain 29 | *.PDF diff=astextplain 30 | *.rtf diff=astextplain 31 | *.RTF diff=astextplain 32 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/runtime/interop/proxies/Runnable.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.interop.proxies; 2 | 3 | import ortus.boxlang.runtime.context.IBoxContext; 4 | import ortus.boxlang.runtime.types.exceptions.BoxRuntimeException; 5 | 6 | /** 7 | * https://docs.oracle.com/en%2Fjava%2Fjavase%2F21%2Fdocs%2Fapi%2F%2F/java.base/java/lang/Runnable.html 8 | */ 9 | public class Runnable extends BaseProxy implements java.lang.Runnable { 10 | 11 | public Runnable( Object target, IBoxContext context, String method ) { 12 | super( target, context, method ); 13 | } 14 | 15 | @Override 16 | public void run() { 17 | try { 18 | invoke(); 19 | } catch ( Exception e ) { 20 | getLogger().error( "Error invoking Runnable", e ); 21 | throw new BoxRuntimeException( "Error invoking Runnable", e ); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/ast/expression/BoxNegateOperator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * [BoxLang] 3 | * 4 | * Copyright [2023] [Ortus Solutions, Corp] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 12 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language 13 | * governing permissions and limitations under the License. 14 | */ 15 | package ortus.boxlang.compiler.ast.expression; 16 | 17 | public enum BoxNegateOperator { 18 | Not, 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/runtime/validation/Validatable.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.runtime.validation; 2 | 3 | import java.util.Set; 4 | 5 | import ortus.boxlang.runtime.context.IBoxContext; 6 | import ortus.boxlang.runtime.scopes.Key; 7 | import ortus.boxlang.runtime.types.IStruct; 8 | 9 | public interface Validatable { 10 | 11 | public Key name(); 12 | 13 | public String type(); 14 | 15 | public Object defaultValue(); 16 | 17 | public Set validators(); 18 | 19 | /** 20 | * Validate myself 21 | * 22 | * @param context 23 | * @param records 24 | */ 25 | default void validate( IBoxContext context, Key caller, IStruct records ) { 26 | // loop over validators and call 27 | for ( Validator validator : this.validators() ) { 28 | validator.validate( context, caller, this, records ); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/external/specs/QoQDistinctEdgeCaseTest.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * Copied from test\tickets\LDEV3830.cfc in Lucee 3 | */ 4 | component extends="testbox.system.BaseSpec"{ 5 | 6 | 7 | function run( testResults, textbox ) { 8 | 9 | describe("testcase for LDEV-3830", function(){ 10 | 11 | it(title="QoQ distinct rows with dupes in same original result", body=function( currentSpec ){ 12 | var a = queryNew("a","varchar"); 13 | var b = queryNew("a","varchar", [['1'],['2'],['2']]); 14 | 15 | var actual = QueryExecute( 16 | sql = " 17 | select a 18 | from a 19 | union select a 20 | from b", 21 | options = { dbtype: 'query' } 22 | ); 23 | 24 | expect( actual ).toBeQuery(); 25 | expect( actual.recordCount ).toBe( 2 ); 26 | 27 | }); 28 | 29 | }); 30 | 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/test/java/TestCases/components/QuerySpaceOutput.cfc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | SELECT * FROM tbllock 10 | WHERE 0=0 11 | ORDER BY 12 | 13 | 14 | #trim(item)# #arguments.sortOrder#, 15 | 16 | 17 | 18 | id 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/DecrementValue.md: -------------------------------------------------------------------------------- 1 | ### Decrement 7 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | decrementValue( 7 ); 9 | 10 | ``` 11 | 12 | Result: 6 13 | 14 | ### Decrement 7.5 15 | 16 | Run Example 17 | 18 | ```java 19 | decrementValue( 7.5 ); 20 | 21 | ``` 22 | 23 | Result: 6.5 24 | 25 | ### Additional Examples 26 | 27 | Run Example 28 | 29 | ```java 30 | writeDump( decrementValue( 6 ) ); // 5 31 | writeDump( decrementValue( 6.5 ) ); 32 | // 5.5 33 | 34 | ``` 35 | 36 | 37 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/Find.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | findNoCase( "s", "boxlang.ortusbooks.com", 0 ); 9 | 10 | ``` 11 | 12 | Result: 13 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | writeOutput( findNoCase( "Tree", "Grow the tree, Save the world" ) ); // 10 20 | // Member function 21 | str = "I love boxlang"; 22 | writeOutput( str.find( "boxlang" ) ); 23 | // 8 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /workbench/samples/components/net/HTTPParam.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | bx:http method="POST" charset="utf-8" url="https://www.google.com/" result="result" { 9 | bx:httpparam name="q" type="formfield" value="bx"; 10 | } 11 | writeDump( result ); 12 | 13 | ``` 14 | 15 | 16 | ### BX:HTTP Tag Syntax 17 | 18 | 19 | 20 | 21 | ```java 22 | 23 | 24 | 25 | 26 | ``` 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/runtime/dynamic/casters/IBoxCaster.java: -------------------------------------------------------------------------------- 1 | /** 2 | * [BoxLang] 3 | * 4 | * Copyright [2023] [Ortus Solutions, Corp] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package ortus.boxlang.runtime.dynamic.casters; 19 | 20 | public interface IBoxCaster { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/io/DirectoryExists.md: -------------------------------------------------------------------------------- 1 | ### Script Syntax 2 | 3 | Checking if a directory called 'icons' exists and then creating the directory if it does not exist. 4 | 5 | Run Example 6 | 7 | ```java 8 | if( !directoryExists( expandPath( "/assets/img/icons" ) ) ) { 9 | directoryCreate( "assets/img/icons" ); 10 | } 11 | 12 | ``` 13 | 14 | Result: The directory 'icons' will be created under the img folder. 15 | 16 | ### Additional Examples 17 | 18 | Run Example 19 | 20 | ```java 21 | directoryExists( "directoryPath" ); 22 | 23 | ``` 24 | 25 | Result: false 26 | 27 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/StringSort.md: -------------------------------------------------------------------------------- 1 | ### Full function 2 | 3 | Sort the string. 4 | 5 | Run Example 6 | 7 | ```java 8 | letters = "ZzgiSA"; 9 | writeOutput( stringSort( letters ) ); 10 | 11 | ``` 12 | 13 | Result: ASZgiz 14 | 15 | ### Member function 16 | 17 | Sort the string. 18 | 19 | 20 | ```java 21 | letters = "ZzgiSA"; 22 | writeOutput( letters.sort() ); 23 | 24 | ``` 25 | 26 | Result: ASZgiz 27 | 28 | ### Additional Examples 29 | 30 | Run Example 31 | 32 | ```java 33 | result = stringSort( "JohnWick" ); 34 | writeOutput( result ); 35 | 36 | ``` 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/debugger/IAdapterProtocolMessage.java: -------------------------------------------------------------------------------- 1 | package ortus.boxlang.debugger; 2 | 3 | import java.util.Map; 4 | 5 | public interface IAdapterProtocolMessage { 6 | 7 | public void setRawMessageData( Map messageData ); 8 | 9 | public Map getRawMessageData(); 10 | 11 | /** 12 | * @return The type of message event | request | request 13 | */ 14 | public String getType(); 15 | 16 | /** 17 | * @return The command that was issued by the debug tool 18 | */ 19 | public String getCommand(); 20 | 21 | /** 22 | * @return The sequence number of this command 23 | */ 24 | public int getSeq(); 25 | 26 | /** 27 | * Implement this to use a DebugAdapter as a visitor 28 | * 29 | * @param adapter The visitor that will visit this node 30 | */ 31 | public void accept( DebugAdapter adapter ); 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/TestCases/phase3/MyClassCF.cfc: -------------------------------------------------------------------------------- 1 | /** 2 | * This is my class description 3 | * 4 | * @brad wood 5 | * @luis 6 | */ 7 | component singleton gavin="pickin" inject foo="bar" { 8 | 9 | variables.setup=true; 10 | createObject('java','java.lang.System').out.println( "word" ); 11 | request.foo="bar"; 12 | isInitted = false; 13 | println( "current template is " & getCurrentTemplatePath() ); 14 | printLn( foo() ) 15 | 16 | function init() { 17 | isInitted = true; 18 | } 19 | 20 | function foo() { 21 | return "I work! #bar()# #variables.setup# #setup# #request.foo# #isInitted#"; 22 | } 23 | 24 | private function bar() { 25 | return "whee"; 26 | } 27 | 28 | function getThis() { 29 | return this; 30 | } 31 | 32 | function runThisFoo() { 33 | return this.foo(); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /src/test/java/ortus/boxlang/runtime/bifs/global/system/testApp/Application.bx: -------------------------------------------------------------------------------- 1 | class { 2 | 3 | static { 4 | final brad = "wood" 5 | } 6 | 7 | variables.staticBrad = static.brad; 8 | 9 | 10 | this.name = "testApp"; 11 | this.sessionManagement = true; 12 | this.mappings["/foobar"] = getDirectoryFromPath( getCurrentTemplatePath() ); 13 | 14 | function onApplicationStart() { 15 | println( "onApplicationStart fired!" ) 16 | } 17 | 18 | function onSessionStart() { 19 | session.luis = "majano"; 20 | } 21 | 22 | function onSessionEnd( sessionScope, appScope ) { 23 | println( "onSessionEnd fired!" ) 24 | println( "in onSessionEnd: " & expandPath( "/foobar" ) ) 25 | // This will only be found if our mapping above is present 26 | new foobar.myClass(); 27 | var tmp = application.brad 28 | tmp = appScope.brad 29 | tmp = sessionScope.luis 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/ast/expression/BoxAssignmentModifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * [BoxLang] 3 | * 4 | * Copyright [2023] [Ortus Solutions, Corp] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 12 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language 13 | * governing permissions and limitations under the License. 14 | */ 15 | package ortus.boxlang.compiler.ast.expression; 16 | 17 | public enum BoxAssignmentModifier { 18 | VAR, 19 | FINAL, 20 | STATIC 21 | } 22 | -------------------------------------------------------------------------------- /workbench/samples/bifs/binary/BitAnd.md: -------------------------------------------------------------------------------- 1 | ### Calculate bitwise logical AND 2 | 3 | Uses the bitAnd function to perform the logical AND operation on each pair of the corresponding bits, by multiplying them 4 | 5 | Run Example 6 | 7 | ```java 8 | bitAnd( 5, 3 ); 9 | 10 | ``` 11 | 12 | Result: 1 13 | 14 | ### Additional Examples 15 | 16 | Run Example 17 | 18 | ```java 19 | inputValue1 = 5; 20 | inputValue2 = 255; 21 | writeOutput( bitAnd( inputValue1, inputValue2 ) ); 22 | writeOutput( "
" ); 23 | inputValue1 = 5; 24 | inputValue2 = 0; 25 | writeOutput( bitAnd( inputValue1, inputValue2 ) ); 26 | 27 | ``` 28 | 29 | 30 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Rand.md: -------------------------------------------------------------------------------- 1 | ### simple example Using rand() 2 | 3 | To generate a random number between 0 to 1 4 | 5 | Run Example 6 | 7 | ```java 8 | writeOutput( rand() ); 9 | 10 | ``` 11 | 12 | 13 | ### simple example Using rand() with algorithm 14 | 15 | To generate a random number between 0 to 1 by using bxmX_COMPAT algorithm 16 | 17 | 18 | ```java 19 | writeOutput( rand( "bxmX_COMPAT" ) ); 20 | 21 | ``` 22 | 23 | 24 | ### Additional Examples 25 | 26 | Run Example 27 | 28 | ```java 29 | writeDump( rand() >= 0 && rand() <= 1 ); 30 | writeDump( rand( "SHA1PRNG" ) >= 0 && rand() <= 1 ); 31 | 32 | ``` 33 | 34 | 35 | -------------------------------------------------------------------------------- /workbench/samples/bifs/string/Compare.md: -------------------------------------------------------------------------------- 1 | ### Tag Syntax 2 | 3 | Run Example 4 | 5 | 6 | ```java 7 | 8 | 9 | ``` 10 | 11 | Result: -1 12 | 13 | ### Additional Examples 14 | 15 | Run Example 16 | 17 | ```java 18 | dump( Compare( "100 Main St.", "675 East Avenue" ) ); // -1 19 | dump( Compare( "500 Main St.", "1 Cupertino Way" ) ); // 1 20 | dump( Compare( "500 Main St.", "500 Main St." ) ); 21 | // 0 22 | 23 | ``` 24 | 25 | 26 | -------------------------------------------------------------------------------- /workbench/samples/bifs/system/IIF.md: -------------------------------------------------------------------------------- 1 | ### Simple iIf Example 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | iIf( server.OS.NAME == "Bacon", de( "Running Bacon OS" ), de( "Not Running Bacon OS" ) ); 9 | ``` 10 | 11 | Result: Not Running Bacon OS 12 | 13 | ### Simple Example using Ternary Operator Instead 14 | 15 | Instead of using iif, you should use the ternary operator 16 | 17 | Run Example 18 | 19 | ```java 20 | ((server.OS.NAME == "Bacon") ? "Running Bacon OS" : "Not Running Bacon OS"); 21 | 22 | ``` 23 | 24 | Result: Not Running Bacon OS 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/ast/expression/IBoxLiteral.java: -------------------------------------------------------------------------------- 1 | /** 2 | * [BoxLang] 3 | * 4 | * Copyright [2023] [Ortus Solutions, Corp] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 12 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language 13 | * governing permissions and limitations under the License. 14 | */ 15 | package ortus.boxlang.compiler.ast.expression; 16 | 17 | /** 18 | * I represent a literal value 19 | */ 20 | public interface IBoxLiteral { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/decision/IsXMLDoc.md: -------------------------------------------------------------------------------- 1 | ### Checks if a given XML is valid 2 | 3 | 4 | 5 | 6 | ```java 7 | 8 | 9 | 10 | Adobe ColdFusion 11 | 12 | 13 | Boxlang 14 | 15 | 16 | Railo 17 | 18 | 19 | Open BlueDragon 20 | 21 | 22 | 23 | 24 | writeOutput( isXMLDoc( example ) ); 25 | 26 | 27 | ``` 28 | 29 | Result: YES 30 | 31 | ### Additional Examples 32 | 33 | 34 | ```java 35 | 36 | 37 | 38 | boxlang_dev 39 | 121 40 | 41 | 42 | 43 | 44 | ``` 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/ast/statement/BoxAccessModifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * [BoxLang] 3 | * 4 | * Copyright [2023] [Ortus Solutions, Corp] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 12 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language 13 | * governing permissions and limitations under the License. 14 | */ 15 | package ortus.boxlang.compiler.ast.statement; 16 | 17 | public enum BoxAccessModifier { 18 | Public, 19 | Private, 20 | Remote, 21 | Package 22 | } 23 | -------------------------------------------------------------------------------- /workbench/samples/bifs/math/Sgn.md: -------------------------------------------------------------------------------- 1 | ### Sign of any number greater than 0 2 | 3 | 4 | 5 | Run Example 6 | 7 | ```java 8 | sgn( .3 ); 9 | 10 | ``` 11 | 12 | Result: 1 13 | 14 | ### Sign of 0 15 | 16 | 17 | 18 | Run Example 19 | 20 | ```java 21 | sgn( 0 ); 22 | 23 | ``` 24 | 25 | Result: 0 26 | 27 | ### Sign of any number less than 0 28 | 29 | 30 | 31 | Run Example 32 | 33 | ```java 34 | sgn( -.3 ); 35 | 36 | ``` 37 | 38 | Result: -1 39 | 40 | ### Additional Examples 41 | 42 | 43 | ```java 44 | 15 = #sgn( 15 )#
45 | -15 = #sgn( -15 )# 46 | ``` 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/ortus/boxlang/compiler/asmboxpiler/transformer/TransformerContext.java: -------------------------------------------------------------------------------- 1 | /** 2 | * [BoxLang] 3 | * 4 | * Copyright [2023] [Ortus Solutions, Corp] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 7 | * License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 12 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language 13 | * governing permissions and limitations under the License. 14 | */ 15 | package ortus.boxlang.compiler.asmboxpiler.transformer; 16 | 17 | public enum TransformerContext { 18 | NONE, 19 | SAFE, 20 | LEFT, RIGHT 21 | } 22 | -------------------------------------------------------------------------------- /workbench/samples/bifs/i18n/SetLocale.md: -------------------------------------------------------------------------------- 1 | ### Set Locale Script Example 2 | 3 | Outputs the current locale, Sets the locale to French (Belgian) and outputs it, then puts it back to the original and outputs it 4 | 5 | 6 | ```java 7 | 8 | currentLocale = getLocale(); 9 | writeOutput( "Current: " ); 10 | writeDump( currentLocale ); 11 | writeOutput( "
" ); 12 | setLocale( "French (Belgian)" ); 13 | writeOutput( "New: " ); 14 | writeDump( getLocale() ); 15 | writeOutput( "
" ); 16 | setLocale( currentLocale ); 17 | writeOutput( "Original: " ); 18 | writeDump( getLocale() ); 19 |
20 | 21 | ``` 22 | 23 | 24 | ### Additional Examples 25 | 26 | 27 | ```java 28 | dump( getLocale() ); 29 | setLocale( "english (australian)" ); 30 | dump( getLocale() ); 31 | dump( Server.BOXLANG.SUPPORTEDLOCALES.listToArray().sort( "text" ) ); 32 | 33 | ``` 34 | 35 | 36 | --------------------------------------------------------------------------------