Can`t parse attributes defined by macro
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
調査の方向性
src/CppAst.Tests/TestAttributes.cs の TestStructAttributes を開き、提供された MIDL_INTERFACE 入力を使用して ParseAttributes と ParseMacros を有効にした状態で実行します。ParseMacros と ParseAttributes がマクロ展開された uuid をどのように処理するかを追跡します。テストが struct を解析し、regex workaround 後と同じように期待される uuid 属性を返せば完了です。
索引モデルが issue の本文から書いたものです。
説明
I try to parse DirectX headers and parser doesn't handle uuid attribute if it is defined by macro:
MIDL_INTERFACE("9d06dffa-d1e5-4d07-83a8-1bb123f2f841")
ID3D11Device2 : public ID3D11Device1
As a workaround, replacing MIDL_INTERFACE by regex works and parser returns correct attributes
struct __declspec(uuid("9d06dffa-d1e5-4d07-83a8-1bb123f2f841")) __declspec(novtable)
ID3D11Device2 : public ID3D11Device1
Both ParseAttributes and ParseMacros are set to true
You can reproduce it if you replace input text in TestStructAttributes and enable macros parsing.
@"
#ifndef DECLSPEC_NOVTABLE
#if (_MSC_VER >= 1100) && defined(__cplusplus)
#define DECLSPEC_NOVTABLE __declspec(novtable)
#else
#define DECLSPEC_NOVTABLE
#endif
#endif
#ifndef DECLSPEC_UUID
#if (_MSC_VER >= 1100) && defined(__cplusplus)
#define DECLSPEC_UUID(x) __declspec(uuid(x))
#else
#define DECLSPEC_UUID(x)
#endif
#endif
#define MIDL_INTERFACE(x) struct DECLSPEC_UUID(x) DECLSPEC_NOVTABLE
MIDL_INTERFACE(""9d06dffa-d1e5-4d07-83a8-1bb123f2f841"") Test{
int a;
int b;
};"
- 主要言語
- C#
- スター
- 625
- フォーク
- 79
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
xoofx/CppAst.NET のほかの issue
-
CppContainerList throws "The item belongs already to a container" when parsing VTK 9.5 headers Bodyオープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
xoofx/CppAst.NET#122 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
xoofx/CppAst.NET#117 ·
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
xoofx/CppAst.NET#115 · コメント 3 件 ·
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
xoofx/CppAst.NET#95 · コメント 4 件 ·
-
NullReferenceException when parsing instantiation of a previously partially specialised templateオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
xoofx/CppAst.NET#77 · コメント 6 件 ·
xoofx/CppAst.NET の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
HicServices/RDMP#2398 ·
-
is:bug is:FQNIssue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nunit/nunit3-vs-adapter#1527 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug effort:S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nightscout/nocturne#2840 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
fluentmigrator/fluentmigrator#2424 ·