Skip to content

Commit

Permalink
Added OperatorDeclaration
Browse files Browse the repository at this point in the history
This PR adds support for an operator declaration. They are not resolved yet.
  • Loading branch information
oxisto committed Jul 22, 2024
1 parent cdd2f29 commit 32e8139
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class DeclaratorHandler(lang: CXXLanguageFrontend) :
// Check if it's an operator
name.isKnownOperatorName -> {
// retrieve the operator code
var operatorCode = name.localName.drop("operator".length)
val operatorCode = name.localName.drop("operator".length)
newOperatorDeclaration(name, operatorCode, rawNode = ctx)
}
// Check, if it's a constructor. This is the case if the local names of the function
Expand Down Expand Up @@ -225,8 +225,12 @@ class DeclaratorHandler(lang: CXXLanguageFrontend) :
/*
* As always, there are some special cases to consider and one of those are C++ operators.
* They are regarded as functions and eclipse CDT for some reason introduces a whitespace
<<<<<<< HEAD
* in the function name, which will complicate things later on. But we only want to replace
* the whitespace for "standard" operators.
=======
* in the function name, which will complicate things later on
>>>>>>> a5d63345d6 (Added `OperatorDeclaration`)
*/
if (nameDecl.name is CPPASTOperatorName && name.replace(" ", "").isKnownOperatorName) {
name = name.replace(" ", "")
Expand Down

0 comments on commit 32e8139

Please sign in to comment.