mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add support for inline Cpp declarations. (#6994)
For #6830, add support for inline C++ fragments as a declaration rather than as a packaging directive. For now, this uses `inline Cpp <string-literal>;` as syntax. The prior `import Cpp inline <string-literal>;` is left alone for the time being. We can decide separately whether to remove that. `inline Cpp` requires that there was at least one `import Cpp`. It's not clear to me if that's the right design long-term, but it seems reasonable for now. Assisted-by: Gemini via Google Antigravity
This commit is contained in:
@@ -478,6 +478,8 @@ class NodeStack {
|
||||
case Parse::NodeKind::TuplePatternStart:
|
||||
case Parse::NodeKind::VariableInitializer:
|
||||
case Parse::NodeKind::VariableIntroducer:
|
||||
case Parse::NodeKind::InlineImportBody:
|
||||
case Parse::NodeKind::InlineIntroducer:
|
||||
return Id::Kind::None;
|
||||
case Parse::NodeKind::AdaptIntroducer:
|
||||
case Parse::NodeKind::AliasInitializer:
|
||||
@@ -511,7 +513,6 @@ class NodeStack {
|
||||
case Parse::NodeKind::LibraryIntroducer:
|
||||
case Parse::NodeKind::LibrarySpecifier:
|
||||
case Parse::NodeKind::InlineImportSpecifier:
|
||||
case Parse::NodeKind::InlineImportBody:
|
||||
case Parse::NodeKind::MatchCase:
|
||||
case Parse::NodeKind::MatchCaseGuard:
|
||||
case Parse::NodeKind::MatchCaseGuardIntroducer:
|
||||
|
||||
Reference in New Issue
Block a user