Rename 'maybe_ast' type to 'MeybeAst'

This commit is contained in:
Sameer Rahmani 2021-04-25 23:08:40 +01:00
parent 32ddfc313f
commit c1c1421531
5 changed files with 9 additions and 9 deletions

View File

@ -62,7 +62,7 @@ using Node = std::shared_ptr<Expression>;
using MaybeNode = Result<Node>;
using Ast = std::vector<Node>;
using maybe_ast = Result<Ast>;
using MaybeAst = Result<Ast>;
/// The base class of the expressions which provides the common interface for
/// the expressions to implement.

View File

@ -72,7 +72,7 @@ public:
void setInput(const llvm::StringRef string);
exprs::maybe_ast read();
exprs::MaybeAst read();
// Dumps the AST data to stdout
void toString();
@ -91,14 +91,14 @@ public:
// Dumps the AST data to stdout
void toString();
exprs::maybe_ast read();
exprs::MaybeAst read();
~FileReader();
};
/// Parses the given `input` string and returns a `Result<ast>`
/// which may contains an AST or an `llvm::Error`
exprs::maybe_ast read(llvm::StringRef input);
exprs::MaybeAst read(llvm::StringRef input);
} // namespace reader
} // namespace serene

View File

@ -36,7 +36,7 @@ namespace serene::reader {
///
/// \param ctx The serene context
/// \prama tree The raw AST to analyze
exprs::maybe_ast analyze(serene::SereneContext &ctx, exprs::Ast &tree);
exprs::MaybeAst analyze(serene::SereneContext &ctx, exprs::Ast &tree);
}; // namespace serene::reader
#endif

View File

@ -256,7 +256,7 @@ exprs::Node Reader::readExpr() {
/// Reads all the expressions in the reader's buffer as an AST.
/// Each expression type (from the reader perspective) has a
/// reader function.
exprs::maybe_ast Reader::read() {
exprs::MaybeAst Reader::read() {
char c = getChar(true);
while (c != EOF) {
@ -293,7 +293,7 @@ void Reader::toString() {
// in the reader as an AST.
/// Each expression type (from the reader perspective) has a
/// reader function.
exprs::maybe_ast FileReader::read() {
exprs::MaybeAst FileReader::read() {
// TODO: Add support for relative path as well
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> fileOrErr =
@ -333,7 +333,7 @@ FileReader::~FileReader() {
READER_LOG("Destroying the file reader");
}
exprs::maybe_ast read(llvm::StringRef input) {
exprs::MaybeAst read(llvm::StringRef input) {
reader::Reader r(input);
auto ast = r.read();
return ast;

View File

@ -39,7 +39,7 @@ namespace serene::reader {
/// semantic error.
/// \param ctx The semantic analysis context
/// \param inputAst The raw AST to analyze and possibly rewrite.
exprs::maybe_ast analyze(serene::SereneContext &ctx, exprs::Ast &inputAst) {
exprs::MaybeAst analyze(serene::SereneContext &ctx, exprs::Ast &inputAst) {
// TODO: Fetch the current namespace from the JIT engine later and if it is
// `nil` then the given `ast` has to start with a namespace definition.