我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何操纵HCL抽象语法树?

I'm writing a compiler using HCL (HashiCorp Configuration Language) and I'm trying to manipulate the AST so that I can add my custom logic.

hclParseTree, err := hcl.Parse(input)
check(err)
spew.Dump(hclParseTree)

I've only managed to print all the tree elements by using go-spew.

Documentation is relatively vague and there are few supporting articles on the web. I tried to follow this one, but the syntax is deprecated (written in 2015).

How could I achieve something like this?

item := hclParseTree.Get("item")

近期文章

  • 使用go和dep的Heroku:“推送被拒绝:无法编译Go应用”
  • 获取Db.Query调用背后使用的实际sql语句
  • 麻烦的TLS配置
  • 使用gofpdf编写Golang流或刷新大文件的内存
  • 加权混合顺序无关的透明度渲染问题
  • jsp 页面无法启动,既启动以后导航栏只有地址却不显示,MyEclipse
  • 将预先存在的数据列表导入Terraform
  • 为什么需要第二个文件写入golang中的pos打印机才能输出?
  • 如何在Traefik中编写PathPrefixStripRegex?
  • IPFS p2p实验功能
  • 将静态库捆绑为单个存档
  • 如何使用VGO导入和更新子包
  • 相当于Perl 5 utf :: decode
  • Golang中的终端:syscall与os / exec stty
  • 如何处理cgo中错误命名的include?
  • 如何在Iris GoLang Framework中为通配符子域设置AutoTLS
  • 使用client-go进行回滚的选项
  • 定制摆锤生成规格
  • Golang Nacl Secretbox中的Bip32密钥加密
  • 为什么该go程序在完成打印后仍会打印?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华