SCL Parser

A line-aware SCL (Simple Configuration Language) parser for Elixir.

Features

Installation

Add scl_parser to your list of dependencies in mix.exs:

def deps do
  [
    {:scl_parser, "~> 1.0.0"}
  ]
end

Usage (Library)

# Basic Parsing
{:ok, ast} = SCLParser.parse("key value")

# Expression Parsing
{:ok, expr_ast} = SCLParser.ExpressionParser.parse("$var('foo')")

The AST format is a list of tuples:

Usage (CLI)

You can run the parser as a command-line tool to convert SCL to JSON.

# Using mix
mix run -e 'SCLParser.CLI.main(["path/to/file.scl"])'

# Or via built binary (if using Burrito/Release)
./scl-parser path/to/file.scl

Development

# Run tests
mix test

# Run code analysis
mix credo --strict

License

Apache 2.0