diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-03 13:00:01 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-03 13:00:01 +0000 |
commit | edff21d830b5e7872596e476b4cd6b7be71a169d (patch) | |
tree | 484b388b92d18b631d32038df3e6b4673136dde7 /lualib | |
parent | 45265c0fc2e726afa2fd2fa5754d2971a77fe65f (diff) | |
download | rspamd-edff21d830b5e7872596e476b4cd6b7be71a169d.tar.gz rspamd-edff21d830b5e7872596e476b4cd6b7be71a169d.zip |
[Project] Lua_content: Remebered about booleans
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_content/pdf.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua index 68adeac49..36593268c 100644 --- a/lualib/lua_content/pdf.lua +++ b/lualib/lua_content/pdf.lua @@ -166,6 +166,9 @@ local function gen_grammar() -- Identifier local id = P{'/' * C((1-(delim + ws))^1) / pdf_id_unescape} + -- Booleans (who care about them?) + local boolean = C(P("true") + P("false")) + -- Stupid references local ref = lpeg.Ct{lpeg.Cc("%REF%") * C(D^1) * " " * C(D^1) * " " * "R"} @@ -173,7 +176,7 @@ local function gen_grammar() "EXPR"; EXPR = V("ELT")^0, ELT = V("ARRAY") + V("DICT") + V("ATOM"), - ATOM = ws^0 * (comment + ref + number + V("STRING") + id) * ws^0, + ATOM = ws^0 * (comment + boolean +ref + number + V("STRING") + id) * ws^0, DICT = "<<" * lpeg.Cf(lpeg.Ct("") * V("KV_PAIR")^0, rawset) * ">>", KV_PAIR = lpeg.Cg(id * ws^0 * V("ELT") * ws^0), ARRAY = "[" * lpeg.Ct(V("ELT")^0) * "]", |