Added comments
This commit is contained in:
@ -33,6 +33,7 @@ namespace fsh {
|
||||
using TokenType = Lexer::TokenType;
|
||||
AstNode(NodeType type, std::string name) : type(type), name(name) {}
|
||||
|
||||
// Pokusa da napravi od narednih tokena zadati Node ako ne uspe vrati null
|
||||
template <class T>
|
||||
static std::shared_ptr<T> Optional(std::list<Token>::iterator& it, std::shared_ptr<T>& node_ptr);
|
||||
|
||||
@ -42,6 +43,7 @@ namespace fsh {
|
||||
return Optional<T>(it, node_ptr);
|
||||
}
|
||||
|
||||
// Pravi od narednih tokena zadati Node ako ne uspe izbaci AstBuildError
|
||||
template <class T>
|
||||
static std::shared_ptr<T> Mandatory(std::list<Token>::iterator& it) {
|
||||
return T::build(it);
|
||||
@ -70,4 +72,4 @@ namespace fsh {
|
||||
AstBuildError(std::string err) : std::runtime_error(err) {}
|
||||
};
|
||||
|
||||
} // namespace fsh
|
||||
}
|
||||
Reference in New Issue
Block a user