javacpp icon indicating copy to clipboard operation
javacpp copied to clipboard

Unexpected token '::' in namespace name

Open Toxlen opened this issue 1 year ago • 3 comments

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 ?

Toxlen avatar Jul 28 '22 09:07 Toxlen

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!

saudet avatar Jul 28 '22 10:07 saudet

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.

Toxlen avatar Jul 28 '22 11:07 Toxlen

JavaCPP doesn't fully support any version of C++: http://bytedeco.org/faq/

saudet avatar Jul 28 '22 12:07 saudet

Fixed in commit https://github.com/bytedeco/javacpp/commit/f9b07466dd686ec876be29deb5ffbdf592b3ecca! Please give it a try with the snapshots: http://bytedeco.org/builds/

saudet avatar Mar 25 '23 07:03 saudet

Fix released with JavaCPP 1.5.9! Thanks for reporting

saudet avatar Jun 06 '23 02:06 saudet