Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 1 | # common pyparsing variables |
| 2 | # |
| 3 | # Copyright (C) 2016 Intel Corporation |
| 4 | # |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0-only |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 6 | |
| 7 | import pyparsing |
| 8 | |
| 9 | # general |
| 10 | colon = pyparsing.Literal(":") |
| 11 | start = pyparsing.LineStart() |
| 12 | end = pyparsing.LineEnd() |
| 13 | at = pyparsing.Literal("@") |
| 14 | lessthan = pyparsing.Literal("<") |
| 15 | greaterthan = pyparsing.Literal(">") |
| 16 | opensquare = pyparsing.Literal("[") |
| 17 | closesquare = pyparsing.Literal("]") |
| 18 | inappropriate = pyparsing.CaselessLiteral("Inappropriate") |
| 19 | submitted = pyparsing.CaselessLiteral("Submitted") |
| 20 | |
| 21 | # word related |
| 22 | nestexpr = pyparsing.nestedExpr(opener='[', closer=']') |
| 23 | inappropriateinfo = pyparsing.Literal("Inappropriate") + nestexpr |
| 24 | submittedinfo = pyparsing.Literal("Submitted") + nestexpr |
| 25 | word = pyparsing.Word(pyparsing.alphas) |
| 26 | worddot = pyparsing.Word(pyparsing.alphas+".") |