private static void writeRules()

in src/main/software/amazon/event/ruler/RuleCompiler.java [754:795]


        private static void writeRules(final Map<List<String>, List<Patterns>> rule,
                                       final List<String> name,
                                       final JsonParser parser,
                                       final boolean withQuotes) throws IOException {
            JsonToken token;
            final List<Patterns> values = new ArrayList<>();

            while ((token = parser.nextToken()) != JsonToken.END_ARRAY) {
                switch (token) {
                    case START_OBJECT:
                        values.add(processMatchExpression(parser));
                        break;

                    case VALUE_STRING:
                        if (withQuotes) {
                            values.add(Patterns.exactMatch('"' + parser.getText() + '"'));
                        } else {
                            values.add(Patterns.exactMatch(parser.getText()));
                        }
                        break;

                    case VALUE_NUMBER_FLOAT:
                    case VALUE_NUMBER_INT:
                        values.add(Patterns.numericEquals(parser.getText()));
                        values.add(Patterns.exactMatch(parser.getText()));
                        break;

                    case VALUE_NULL:
                    case VALUE_TRUE:
                    case VALUE_FALSE:
                        values.add(Patterns.exactMatch(parser.getText()));
                        break;

                    default:
                        barf(parser, "Match value must be String, number, true, false, or null");
                }
            }
            if (values.isEmpty()) {
                barf(parser, "Empty arrays are not allowed");
            }
            rule.put(name, values);
        }