Skip to content

Commit

Permalink
Update CHANGELOG.md and fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jan 6, 2024
1 parent ca923d7 commit bd0ed7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Fix `Parser` handling of `template` specialization and their `friend` declarations ([pull #733](https://github.com/bytedeco/javacpp/pull/733))
* Improve `Parser` capabilities for `operator` and function templates ([pull #732](https://github.com/bytedeco/javacpp/pull/732))
* Fix `Parser` failing on nested initializer lists and on attributes found inside `enum` declarations
* Fix `Parser` for basic containers like `std::optional<std::pair<int,int> >` ([issue #718](https://github.com/bytedeco/javacpp/issues/718))
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/org/bytedeco/javacpp/tools/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1383,11 +1383,15 @@ Declarator declarator(Context context, String defaultName, int infoNumber, boole
// template arguments
Type[] types = templateArguments(context);
dcl.cppName += "<";
for (int i = 0; i<types.length; i++) {
if (i > 0) dcl.cppName += ",";
for (int i = 0; i < types.length; i++) {
if (i > 0) {
dcl.cppName += ",";
}
dcl.cppName += types[i].cppName;
}
if (dcl.cppName.endsWith(">")) dcl.cppName += " ";
if (dcl.cppName.endsWith(">")) {
dcl.cppName += " ";
}
dcl.cppName += ">";
} else if (token.match(Token.IDENTIFIER) &&
(dcl.cppName.length() == 0 || dcl.cppName.endsWith("::"))) {
Expand Down Expand Up @@ -1636,7 +1640,7 @@ Declarator declarator(Context context, String defaultName, int infoNumber, boole
// pick the Java name from the InfoMap if appropriate
String originalName = fieldPointer ? groupInfo.pointerTypes[0] : dcl.javaName;
if (attr == null && defaultName == null && info != null && info.javaNames != null && info.javaNames.length > 0
&& (dcl.operator || Templates.notExists(info.cppNames[0]) || dcl.cppName.equals(info.cppNames[0]))) {
&& (dcl.operator || Templates.notExists(info.cppNames[0]) || dcl.cppName.equals(info.cppNames[0]))) {
dcl.javaName = info.javaNames[0];
}

Expand Down

0 comments on commit bd0ed7a

Please sign in to comment.