Skip to content

More preparation for Ethos compiler plugins#211

Open
ajreynol wants to merge 6 commits into
mainfrom
pluginPrep-0504
Open

More preparation for Ethos compiler plugins#211
ajreynol wants to merge 6 commits into
mainfrom
pluginPrep-0504

Conversation

@ajreynol
Copy link
Copy Markdown
Member

@ajreynol ajreynol commented May 4, 2026

Makes the following changes:

  • We now permit forward declarations with non-ground type by checking whether the new type is equivalent modulo renaming. A regression is added demonstrating this.
  • getOrSetLiteralTypeRule is made public and renamed to getLiteralTypeRuleMaybeInit.
  • 2 new public methods are added which are needed in various plugins:
    (1) getAttributeTerm, which retrieves the term associated with the attribute of a symbol which impacts how it is desugared, and
    (2) mkRawExpr, which makes an expression without applying desugaring.
  • getConstructorKind is renamed to getAttributeKind.

Comment thread src/cmd_parser.cpp Outdated
d_eparser.typeCheck(pprev, progType);
// ensure that its type is compatible with the previous definition
d_eparser.typeCheckProgramFwdDecl(pprev, progType, name);
// we use the old program that was globally bound already
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "we use the forward definition". It's not clear what "old program" means here.

Comment thread src/expr_parser.cpp Outdated
}
}
std::stringstream ss;
ss << "Foward declaration of program " << progName << " had different type.";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ss << "Foward declaration of program " << progName << " had different type.";
ss << "Forward declaration of program " << progName << " had different type.";

Comment thread src/type_checker.h Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants