Rename 'maybe_ast' type to 'MeybeAst'
This commit is contained in:
parent
32ddfc313f
commit
c1c1421531
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue