Skip to contents

Converts an eon-formatted character string into the corresponding R representation. Maps, lists, and scalars are returned as named lists, unnamed lists, and R scalars respectively.

Usage

parse_eon(x)

parse_eon(x)

Arguments

x

A character string containing eon-formatted text.

Value

An R object (named list, unnamed list, or scalar) representing the eon value.

Examples

parse_eon('name: "Alice"\nage: 30')
#> $name
#> [1] "Alice"
#> 
#> $age
#> [1] 30
#> 
parse_eon('scores: [1, 2, 3]')
#> $scores
#> $scores[[1]]
#> [1] 1
#> 
#> $scores[[2]]
#> [1] 2
#> 
#> $scores[[3]]
#> [1] 3
#> 
#> 
parse_eon('x: true')
#> $x
#> [1] TRUE
#> 
parse_eon('x: +inf')
#> $x
#> [1] Inf
#>