[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-09 Thread Mikael Holmén via Phabricator via cfe-commits
uabelho added inline comments. Comment at: clang-tools-extra/pseudo/lib/grammar/GrammarBNF.cpp:235 Out.Sequence.push_back({Chunk}); } hokein wrote: > uabelho wrote: > > I get a warning/error on this line with this commit: > > ``` > > 13:31:17

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/grammar/GrammarBNF.cpp:235 Out.Sequence.push_back({Chunk}); } uabelho wrote: > I get a warning/error on this line with this commit: > ``` > 13:31:17

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-09 Thread Mikael Holmén via Phabricator via cfe-commits
uabelho added inline comments. Comment at: clang-tools-extra/pseudo/lib/grammar/GrammarBNF.cpp:235 Out.Sequence.push_back({Chunk}); } I get a warning/error on this line with this commit: ``` 13:31:17

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf1ac00c9b0d1: [pseudo] Add grammar annotations support. (authored by hokein). Changed prior to commit:

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h:219 + // ExtensionID is the index of the table. + std::vector AttributeValues; }; sammccall wrote: > looking at this

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-08 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h:91 +// attribute value (all attributes share a namespace). +// An ExtensionID is the index into

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h:22 // +// The grammar supports extensions, which have the syntax form of +// [key=value;key=value]. Extensions are associated with a grammar symbol ( sammccall

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 434906. hokein marked 5 inline comments as done. hokein added a comment. - bring back the attribute concept, narrow down the ExtensionID scope (only used for semantic); - loose and simplify the BNF annotations parsing; ([] only allows single attribute,

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Thanks, this looks better. Sorry about confusion with the names - I think annotation is a great name, and we should only use "extension" for the narrower "opaque thing that an annotation value refers to". Happy to chat about this offline if you like

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 433354. hokein marked 2 inline comments as done. hokein added a comment. remove a left-out change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126536/new/ https://reviews.llvm.org/D126536 Files:

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I addressed comments on the grammar part, (the remaining GLR, pseudo_gen parts are not covered yet), I think it would be better them into different patches, so that we can land the grammar bit first, then start doing the error recovery and guard implementation in

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 433351. hokein marked 3 inline comments as done and an inline comment as not done. hokein added a comment. [pseudo] Support annotations in the grammar. This patch adds annotations in the bnf grammar. Annotations (which has a form of

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-05-31 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Nice! This has tests for the parsing-the-attribute bits, but I think we're missing tests for the actual guards added. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/GLR.h:114 +using ReduceGuard = +std::function RHS, +

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h:87 +// Defines the built-in attribute keys. +enum class AttributeKey : uint8_t { + // A guard controls whether a reduction of a rule will be conducted by the GLR

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. This patch might cover too many things (at least we could split the guide/glr implementation bit), but want to give you an overview of the picture first. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126536/new/

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: mgrang, mgorny. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. - Add annotation handling