Crates.io | sjfl |
lib.rs | sjfl |
version | 0.4.0 |
source | src |
created_at | 2023-06-18 07:46:56.368628 |
updated_at | 2024-01-21 11:04:03.543003 |
description | Simple language for config files |
homepage | |
repository | |
max_upload_size | |
id | 893316 |
size | 93,564 |
SJFL is a simple language for configuration files. SJFL is a (syntactically and semantically) superset of JSON and a (syntactically) subset of Python. That means you can parse JSON files using a SJFL parser, and use Python syntax highlighters for SJFL files.
It's not a general-purpose script language. It's intended for config files. That means it's not turing complete.
#
s{{[] : []} : {[] : []}}
is valid in SJFL.datetime(2024, 1, 20)
is 1st, January, 2024.datetime(2022, 7, 16, 18, 30, 31, 0)
where the arguments are year, month, day, hour, minute, second and microsecond. The last 4 arguments are optional. When the optional arguments are missing, the default value 0 is given.For now, statements are not implemented... at all!
Unlike Python, all the SJFL statements must be followed by a semi-colon.
[a-zA-Z_] [0-9a-zA-Z]*
)
true
, false
, null
, True
, False
, None
and import
. You cannot use them as a variable name.TODO
Everytime the engine parses a .sjfl
file, it generates a binary version in the same directory, with .bsjfl
extension. It reads .bsjfl
next time if the raw text file has not been modified. It also re-parse the raw-text version if one of its dependency is modified.
Everything is done under the hood, and you don't have to care about it. You just modify .sjfl
files, and do not touch .bsjfl
files.
(TODO) All the binary conversions are done automatically. All you have to do is call execute_file
function.