Skip to main content

Crate hk_parser

Crate hk_parser 

Source
Expand description

Hacker Lang Configuration Parser

This crate provides a robust parser and serializer for .hk files used in Hacker Lang, the programming language for HackerOS. It supports nested structures, comments, and error handling.

Enums§

HkError
Custom error type for parsing .hk files.
HkValue
Enum for values in the .hk config: either a simple string or a nested map.

Functions§

load_hk_file
Loads and parses a .hk file from the given path.
parse_hk
Parses a .hk file from a string input.
serialize_hk
Serializes a HkConfig back to a .hk string.
write_hk_file
Writes a HkConfig to a file.

Type Aliases§

HkConfig
Represents the structure of a .hk file. Sections are top-level keys in the outer HashMap. Values can be simple strings or nested HashMaps for subsections.