ts-parser-perl 1.0.1

Perl grammar for tree-sitter
Documentation
/* THIS FILE IS GENERATED BY generate_keywords.pl
 *
 * Statement keywords recognized by peek_is_statement_keyword().
 * To add a keyword, edit the @keywords list in generate_keywords.pl
 * and re-run: perl generate_keywords.pl
 *
 * Current keywords: class, method, no, package, role, sub, use
 */

// First-char filter: returns PEEK_NO_MATCH immediately if the
// lookahead can't start any statement keyword.
#define KEYWORD_FIRST_CHAR_FILTER(la) \
  (!(la == 'c' || la == 'm' || la == 'n' || la == 'p' || la == 'r' || la == 's' || la == 'u'))

// Word-reading loop: characters that appear in any keyword.
#define KEYWORD_WORD_CHAR(la) \
  (la == 'a' || la == 'b' || la == 'c' || la == 'd' || la == 'e' || la == 'g' || la == 'h' || la == 'k' || la == 'l' || la == 'm' || la == 'n' || la == 'o' || la == 'p' || la == 'r' || la == 's' || la == 't' || la == 'u')

// Keyword matching: sets needs_name for keywords that require an
// identifier to be a declaration (sub, method).  Falls through to
// PEEK_NOT_KEYWORD for non-keywords.
#define KEYWORD_MATCH(word, needs_name) do { \
    if (strcmp(word, "package") == 0 || strcmp(word, "use") == 0 || strcmp(word, "no") == 0 || strcmp(word, "class") == 0 || strcmp(word, "role") == 0) { \
      /* always statement keywords */ \
    } else if (strcmp(word, "sub") == 0 || strcmp(word, "method") == 0) { \
      (needs_name) = true; \
    } else { \
      return PEEK_NOT_KEYWORD; \
    } \
  } while(0)