<commit_before>"""
Cypher language parser
   - clear logical separation between lexing/parsing still missing
   - e_XXX class object should be considered internal
"""

import re
from collections import defaultdict
import logging

#
# Tokens
#
tok_set__quote = ['`', '\'']

tok_set__paren = ['(', ')', '[', ']', '{', '}']

tok_set__kw__write = [
                      'create',
                      'set',
                      'delete',
                      'remove',
                      'foreach'
                      ]

tok_set__kw__supported = [  # order critical
                          'create',
                          'optional match',
                          'match',
                          ]

tok_set__kw__unsupported = [  # these are treated as generic clauses, capturing until the next keyword
                            'delete',
                            'foreach',
                            'limit',
                            'merge',
                            'order by',
                            'return',
                            'remove',
                            'set',
                            'skip',
                            'start',<commit_msg>neo4j_cypher_parser: explicit naming for tok__quote__xx tokens<commit_after>"""
Cypher language parser
   - clear logical separation between lexing/parsing still missing
   - e_XXX class object should be considered internal
"""

import re
from collections import defaultdict
import logging

#
# Tokens
#
tok__quote__backquote = '`'  # used to quote labels
tok__quote__singlequote = '\''  # used to quote values
tok_set__quote = [tok__quote__backquote, tok__quote__singlequote]

tok_set__paren = ['(', ')', '[', ']', '{', '}']

tok_set__kw__write = [
                      'create',
                      'set',
                      'delete',
                      'remove',
                      'foreach'
                      ]

tok_set__kw__supported = [  # order critical
                          'create',
                          'optional match',
                          'match',
                          ]

tok_set__kw__unsupported = [  # these are treated as generic clauses, capturing until the next keyword
                            'delete',
                            'foreach',
                            'limit',
                            'merge',
                            'order by',
                            'return',
                            'remove',
                            'set',
                            'skip',
                            'start',
{'fraction_non_alphanumeric': 0.09104878985785632, 'fraction_numerical': 0.000384172109104879, 'mean_word_length': 1.0471698113207548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5916814', 'n_tokens_mistral': 612, 'n_tokens_neox': 598, 'n_words': 146}