Skip to content
wynlangPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yaml - Official Wyn Package

Simple YAML parser (key: value). Pure Wyn.

Install

wyn pkg install github.com/wynlang/yaml

Usage

import yaml

var config = "host: localhost\nport: 6379\n# comment lines are skipped"

print(yaml.yaml_get(config, "host"))    // localhost
print(yaml.yaml_get(config, "port"))    // 6379
print(yaml.yaml_has(config, "host"))    // true
print(yaml.yaml_has(config, "missing")) // false

API

Function Description
yaml_get(content, key) Value for key, or "" if absent
yaml_has(content, key) True if key is present
yaml_parse(content) Parse into a HashMap (same-module use only — HashMap values cannot cross an import boundary)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors