소스 검색

Pattern grammar

master
Rocketsoup 4 년 전
부모
커밋
3863c75e8d
1개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 9
    7
      patterns.md

+ 9
- 7
patterns.md 파일 보기

@@ -136,17 +136,19 @@ $rb_pattern add "lunch" reply "Lunch is at noon." if content.plain == "When is l
136 136
 
137 137
 ## Grammar
138 138
 
139
-`<statement>` ::= `<actions>` " if " `<expression>`
139
+`<statement>` ::= `<actions>` `<ws>` "if" `<ws>` `<expression>`
140 140
 
141
-`<actions>` ::= `<action>` | `<action>` " " `<actions>`
141
+`<ws>` ::= SPACE | TAB | CR | LF | <ws> <ws>
142 142
 
143
-`<action>` ::= "ban" | "delete" | "kick" | "modinfo" | "modwarn" | "reply " `<quoted_string>`
143
+`<actions>` ::= `<action>` | `<action>` `<ws>` `<actions>`
144 144
 
145
-`<quoted_string>` ::= '"' `<any>` '"'
145
+`<action>` ::= "ban" | "delete" | "kick" | "modinfo" | "modwarn" | "reply" `<ws>` `<quoted_string>`
146
+
147
+`<quoted_string>` ::= '"' ANY '"'
146 148
 
147 149
 `<expression>` ::= `<simple_expr>` | `<not_expr>` | `<paren_expr>` | `<compound_expr>`
148 150
 
149
-`<simple_expr>` ::= `<field_name>` " " `<op>` " " `<value>`
151
+`<simple_expr>` ::= `<field_name>` `<ws>` `<op>` `<ws>` `<value>`
150 152
 
151 153
 `<not_expr>` ::= "!" `<expression>`
152 154
 
@@ -154,9 +156,9 @@ $rb_pattern add "lunch" reply "Lunch is at noon." if content.plain == "When is l
154 156
 
155 157
 `<compound_expr>` ::= `<and_expr>` | `<or_expr>`
156 158
 
157
-`<and_expr>` ::= `<expression>` " and " `<expression>`
159
+`<and_expr>` ::= `<expression>` `<ws>` "and" `<ws>` `<expression>`
158 160
 
159
-`<or_expr>` ::= `<expression>` " or " `<expression>`
161
+`<or_expr>` ::= `<expression>` `<ws>` "or" `<ws>` `<expression>`
160 162
 
161 163
 `<field_name>` ::= "author" | "author.id" | "author.joinage" | "author.name" | "content.markdown" | "content.plain" | "lastmatched"
162 164
 

Loading…
취소
저장