-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PatternExpr -> TypePatternExpr refactor in preparation for record pattern implementation #4387
Merged
jlerbsc
merged 18 commits into
javaparser:master
from
johannescoetzee:johannes/record-patterns
May 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c04439b
Intellij refactor: PatternExpr -> TypePatternExpr
johannescoetzee 42405a2
Refactor: PatternExpr -> TypePatternExpr in java.jj
johannescoetzee bbc8f26
Add TypePatternExpr codegen
johannescoetzee 4b5e2fd
Remove now-unused PatternExprMetaModel and Expression.XPatternExpress…
johannescoetzee ca9f594
Add PatternExpr abstract class and add it to the MetaModelGenerator
johannescoetzee 8ef52f9
Add PatternExpr codegen
johannescoetzee 07dd530
Make TypePatternExpr a subclass of PatternExpr with codegen
johannescoetzee 0667001
Update grammar to reflect new pattern inheritance structure
johannescoetzee 7611bf5
Move TypePatternExpr type to PatternExpr
johannescoetzee d3fb640
Expect PatternExpr instead of TypePatternExpr in instanceof
johannescoetzee b59fc92
Replace TypePatternExpr with PatternExpr in javaparsermodel.contexts
johannescoetzee c33390a
Replace TypePatternExpr cast and instanceof where possible
johannescoetzee c2f3eea
Fix copyright feedback
johannescoetzee 2a364d8
Remove unused imports
johannescoetzee 3c506b3
Merge branch 'master' into johannes/record-patterns
johannescoetzee 3f33cef
Add documentation for PatternExpr
johannescoetzee bf90de2
Add tests for generated pattern methods
johannescoetzee aab474b
Merge branch 'master' into johannes/record-patterns
jlerbsc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
49 changes: 49 additions & 0 deletions
49
javaparser-core/src/main/java/com/github/javaparser/metamodel/TypePatternExprMetaModel.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (C) 2007-2010 Júlio Vilmar Gesser. | ||
johannescoetzee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Copyright (C) 2011, 2013-2024 The JavaParser Team. | ||
* | ||
* This file is part of JavaParser. | ||
* | ||
* JavaParser can be used either under the terms of | ||
* a) the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* b) the terms of the Apache License | ||
* | ||
* You should have received a copy of both licenses in LICENCE.LGPL and | ||
* LICENCE.APACHE. Please refer to those files for details. | ||
* | ||
* JavaParser is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
*/ | ||
package com.github.javaparser.metamodel; | ||
|
||
import java.util.Optional; | ||
import com.github.javaparser.ast.expr.TypePatternExpr; | ||
import com.github.javaparser.ast.Generated; | ||
|
||
/** | ||
* This file, class, and its contents are completely generated based on: | ||
* <ul> | ||
* <li>The contents and annotations within the package `com.github.javaparser.ast`, and</li> | ||
* <li>`ALL_NODE_CLASSES` within the class `com.github.javaparser.generator.metamodel.MetaModelGenerator`.</li> | ||
* </ul> | ||
* | ||
* For this reason, any changes made directly to this file will be overwritten the next time generators are run. | ||
*/ | ||
@Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") | ||
public class TypePatternExprMetaModel extends ExpressionMetaModel { | ||
|
||
@Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") | ||
TypePatternExprMetaModel(Optional<BaseNodeMetaModel> superBaseNodeMetaModel) { | ||
super(superBaseNodeMetaModel, TypePatternExpr.class, "TypePatternExpr", "com.github.javaparser.ast.expr", false, false); | ||
} | ||
|
||
public PropertyMetaModel modifiersPropertyMetaModel; | ||
|
||
public PropertyMetaModel namePropertyMetaModel; | ||
|
||
public PropertyMetaModel typePropertyMetaModel; | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be generated by the TypeCastingGenerator, whereas it seems to have been added manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the same applies as the comment I left below regarding formatting and project configuration. I think this is generated formatting which just hasn't been included before.