novos testes e new line mal feito

This commit is contained in:
Afonso Franco 2023-05-27 21:41:23 +01:00
parent b79540bab8
commit e3a0ea5bf1
Signed by: afonso
SSH key fingerprint: SHA256:JiuxZNdA5bRWXPMUJChI0AQ75yC+cXY4xM0IaVwEVys
3 changed files with 9 additions and 6 deletions

View file

@ -75,12 +75,11 @@ contributors = [
] ]
[fruie] [fruie]
apple.color = "red"
apple.taste.sweet = true apple.taste.sweet = true
[fruie.apple.color] [fruie.apple.color]
test="oi" test={"oi" = 14}
[fruie.apple.taste] [fruie.apple.color.test]
test2="oi" test2="oi"
[fruie.apple.texture] # you can add sub-tables [fruie.apple.texture] # you can add sub-tables

View file

@ -16,8 +16,12 @@ tokens = [
"INF", "INF",
"NAN", "NAN",
"COMMENT", "COMMENT",
"NEWLINE",
] ]
def t_NEWLINE(t):
r"\n+\s*"
return t
# needs to check if datetime is valid # needs to check if datetime is valid
def t_DATETIME(t): def t_DATETIME(t):
@ -115,7 +119,7 @@ def t_error(t):
t.lexer.skip(1) t.lexer.skip(1)
t_ignore = "\n\t " t_ignore = "\t "
literals = "[]{},=" literals = "[]{},="

View file

@ -16,11 +16,11 @@ def p_content_single(p):
def p_tomlEntries_table(p): def p_tomlEntries_table(p):
"""tomlEntries : table""" """tomlEntries : table NEWLINE"""
def p_tomlEntries_object(p): def p_tomlEntries_object(p):
"""tomlEntries : object""" """tomlEntries : object NEWLINE"""
def p_table_simple(p): def p_table_simple(p):