Ruby Parser for the Hashicorp Configuration Language
- Built using the
rexical
library (https://github.com/tenderlove/rexical)
- Built using the
racc
library (https://github.com/tenderlove/racc)
some_value "other_value" {
key = "value"
}
will create a hash which looks like:
{"some_value" => {"other_value" => {"key" => "value"}}}
require 'hcl'
require 'json'
contents = HCLParser.new.parse(File.read("file_to_parse.hcl"))
puts JSON.dump(contents)
- Properly handle nested multi-line comments
- Properly handle floating point values
- Create a
HCL
class as an to load/dump/parseHCL
files - Write tests for the lexer
- Write tests for the parser