Skip to content

Conversation

@zspitzer
Copy link
Member

@zspitzer zspitzer commented Dec 11, 2025

This PR contains many bug fixes all with testcases

With these bug fixes, I am able to successfully round trip cfml to ast back to cfml to ast repeatedly.

All associated tickets a child tasks of this epic

https://luceeserver.atlassian.net/browse/LDEV-5715

…ations

Also fixes LDEV-5978, LDEV-5979, LDEV-5980
Throws FunctionException for invalid mode values instead of silently defaulting to tag mode.
Added wrappedInScript flag to SourceCode to track when parser wraps
script content in cfscript tags, replacing the fragile sourceOffset==10 hack.
AST output now correctly returns component at root for .cfc files.
- _literalStruct/_literalOrderedStruct → ObjectExpression
- _literalArray → ArrayExpression
- _createComponent → NewExpression with correct callee/arguments

Fixed NewExpression argument order: parser adds constructor args
first, then component path and type string at the end. Using
getArguments() instead of getSourceArguments() to include all.
- Use appendix as name when tagLibTag.getName() is empty (imported custom tags)
- Skip default attributes in AST dump (filters out __custom_tag_path)
…perties

Add separator field to distinguish colon syntax (key: value) from equals
syntax (key=value) in AST output for both NamedArgument and ObjectExpression
Property nodes.
…ion, compound assignment

- Unary plus now outputs UnaryExpression with operator PLUS instead of CastExpression
- Integer divide (\) now outputs operator INTDIV instead of DIVIDE
- Safe navigation (?.) now includes optional: true on MemberExpression
- Compound assignments (+=, -=, *=, /=, %=, &=) now output AssignmentExpression with compound operators
…tadata

- Docblock description goes to annotations.description
- Docblock @tags go to annotations (e.g. @return, @deprecated)
- Inline hint attribute goes to metadata.hint (detected via quoteChar)
- Raw docblock preserved in docblock field for round-tripping
…uter function

When a function param has a closure as default value, the docblock was
incorrectly consumed by the inner closure instead of the outer function.

Fix: save/restore docComment around closure parsing in AbstrCFMLExprTransformer,
and skip docComment attachment for closures in AbstrCFMLScriptTransformer.
…/param

Naked attributes should only be TRUE for boolean-like contexts (e.g.
component singleton), not for positional arguments where NULL indicates
type/name positions (e.g. property string name).
Check for end of source after stripping comments to avoid calling
literal() which would create an empty StringLiteral node.
…t tags

Handle syntax like throw (message="test") by detecting and skipping
optional parentheses around named attributes.
…ier case

- Add declaration property to AssignmentExpression/ForOfStatement when var keyword used
- Add explicit flag to returnType/param types to distinguish implicit from explicit any
- Preserve original BIF callee name casing via originalName field
- Add typeExplicit tracking in Argument for function parameters
Track when access modifier (public/private/package/remote) was
explicitly specified in source code vs defaulted. Similar to
returnTypeExplicit for return types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant