From 0aef7a4f11b85053af7020ab70e608f322f4b03e Mon Sep 17 00:00:00 2001 From: Nic Watson Date: Fri, 17 May 2019 11:52:18 -0400 Subject: [PATCH] Disallow reserved words from being storm command names (#1240) * Disallow reserved words from being storm command names --- CHANGELOG.rst | 3 ++- synapse/lib/storm.lark | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 71c78b7f64..e4569d1b1e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,7 +18,8 @@ Features and Enhancements Bugfixes -------- -- Resolve grammar ambiguity between tag condition filters with value and left join (`#1237 `_) +- Resolve Storm grammar ambiguity between tag condition filters with value and left join. (`#1237 `_) +- Resolve Storm grammar ambiguity to prevent reserved words from being identified as a Storm command. (`#1240 `_) Improved Documentation ---------------------- diff --git a/synapse/lib/storm.lark b/synapse/lib/storm.lark index 428269dfbf..35abc4b0a5 100644 --- a/synapse/lib/storm.lark +++ b/synapse/lib/storm.lark @@ -190,7 +190,7 @@ ABSPROPNOUNIV: PROPS RELPROP: /:[$.\w][$.\w:]*/ // The name of a storm command -CMDNAME: /[a-z][a-z0-9.]+/ +CMDNAME: /\b(?!(break|continue|for|switch|else|elif|if|not|or|and)\b)[a-z][a-z0-9.]+\b/ // The entry point for a $(...) expression dollarexpr: _EXPRSTART _WSCOMM? exprcmp _WSCOMM? ")"