Skip to content
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

Unexpected token '::' in namespace name #595

Closed
Toxlen opened this issue Jul 28, 2022 · 5 comments
Closed

Unexpected token '::' in namespace name #595

Toxlen opened this issue Jul 28, 2022 · 5 comments

Comments

@Toxlen
Copy link

Toxlen commented Jul 28, 2022

Hello,

The first line of the following is raising org.bytedeco.javacpp.tools.ParserException saying : Unexpected token '::'.

Exception in thread "main" org.bytedeco.javacpp.tools.ParserException: "thefileconcerned.h":Unexpected token '::'
        at org.bytedeco.javacpp.tools.Token.expect(Token.java:114)
        at org.bytedeco.javacpp.tools.Parser.namespace(Parser.java:3954)
        at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:4077)
        at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:4167)
        at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:4322)
        at org.bytedeco.javacpp.tools.Builder.parse(Builder.java:95)
        at org.bytedeco.javacpp.tools.Builder.build(Builder.java:1095)
        at org.bytedeco.javacpp.tools.Builder.main(Builder.java:1450)
namespace namespace1::namespace2
{
    // Some code ...
}

I don't know if it is a bug or a limitation ?

@saudet
Copy link
Member

saudet commented Jul 28, 2022

This looks like new syntax available starting with C++17: https://en.cppreference.com/w/cpp/language/namespace

We'll need to add support for that. Contributions are welcome!

@Toxlen
Copy link
Author

Toxlen commented Jul 28, 2022

I didn't know you didn't support C++17 yet!

What is the C++ standard currently supported by JavaCPP? It would be nice if it was written in the README on the home page.

@saudet
Copy link
Member

saudet commented Jul 28, 2022 via email

saudet added a commit that referenced this issue Mar 25, 2023
…n JDK (issue bytedeco/javacv#2001)

 * Fix `Parser` ignoring `Info.skip` for enumerators that do not get translated (issue bytedeco/javacpp-presets#1315)
 * Fix `Parser` error on C++17 style namespace declarations containing `::` separators (issue #595)
@saudet
Copy link
Member

saudet commented Mar 25, 2023

Fixed in commit f9b0746! Please give it a try with the snapshots: http://bytedeco.org/builds/

@saudet
Copy link
Member

saudet commented Jun 6, 2023

Fix released with JavaCPP 1.5.9! Thanks for reporting

@saudet saudet closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants