antlr / antlr/stringtemplate4

How to add string condition matching judgment to the. stg template? If I add this syntax, it will report an error; Without this condition, the template can be generated normally. I am not very familiar with ST syntax. Can you help me solve this problem

Open
#324 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

```
$if(struct.scopedname.first()=="shm_msgs")$`
// Skip NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT for shm_msgs namespace
$else$
#ifndef SWIG
#include
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT($struct.name$,$\n$$struct.members:{m |$m.name$}; separator=", "$)
#endif
$endif$
```

How to add string condition matching judgment to the. stg template? If I add this syntax, it will report an error; Without this condition, the template can be generated normally. I am not very familiar with ST syntax. Can you help me solve this problem

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.