xo-reader: wip: + envframe, envframestack [not used]
This commit is contained in:
parent
8db0bf11d0
commit
8d495a6427
5 changed files with 221 additions and 2 deletions
34
src/reader/envframe.cpp
Normal file
34
src/reader/envframe.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* file envframe.cpp
|
||||
*
|
||||
* author: Roland Conybeare
|
||||
*/
|
||||
|
||||
#include "envframe.hpp"
|
||||
#include "xo/indentlog/print/vector.hpp"
|
||||
|
||||
namespace xo {
|
||||
using xo::ast::Variable;
|
||||
|
||||
namespace scm {
|
||||
rp<Variable>
|
||||
envframe::lookup(const std::string & x) const {
|
||||
for (const auto & var : argl_) {
|
||||
if (x == var->name())
|
||||
return var;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
envframe::print(std::ostream & os) const {
|
||||
os << "<envframe"
|
||||
<< xtag("argl", argl_)
|
||||
<< ">";
|
||||
}
|
||||
|
||||
} /*namespace scm */
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
/* end envframe.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue