Skip to content

actboy168/lni

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status

lni

一种类似于ini的标记语言。语法上参考了ini和lua,目标是作为lua程序的配置语言。

build && test

luamake

语法

[ABC]
a = 'Hello'
b = 1.0
c = {'1', '2', '3'}
'd' = {
  x = 2,
  y = 4,
}
10 =
[[ | H
   | e
   | l
   | l
   | o
]]

等价的lua为

{
ABC = {
a = 'Hello',
b = 1.0,
c = {'1', '2', '3'},
d = { x = 2, y = 4 },
[10] =
[[ | H
   | e
   | l
   | l
   | o
]]
}
}

default

default是内置的对象,每个对象初始化时会复制一遍它的值。

<default>
a = 1
b = 2
[A]
b = 11
[B]
a = 10

等价的lua为

{
  A = { a = 1, b = 11 },
  B = { a = 10, b = 2 },
}

继承

对象可以继承一个已经定义的对象

[A]
a = 1
b = 2
[B:A]
c = 3

等价的lua为

{
  A = { a = 1, b = 2 },
  B = { a = 1, b = 2, c = 3 },
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published