-
-
Notifications
You must be signed in to change notification settings - Fork 198
Ast fixes #2731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zspitzer
wants to merge
71
commits into
lucee:7.0
Choose a base branch
from
zspitzer:ast-fixes
base: 7.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ast fixes #2731
+7,461
−247
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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