<commit_before>%define api.pure

%{
#include <stdio.h>
#include "core.h"
#include "util.h"

void yyerror(interp_core_type *interp, void *scanner, char *s);

%}

%parse-param {interp_core_type *interp}
%parse-param {void *scanner}
%lex-param {void *scanner}

%token OPEN_PAREN
%token CLOSE_PAREN
%token DOT

%token TRUE_OBJ
%token FALSE_OBJ

%token QUOTE
%token DOUBLE_QUOTE

%token STRING_CONSTANT
%token CHAR_CONSTANT

%token FIXED_NUMBER
%token FLOAT_NUMBER

%token SYMBOL


%%

expression:
    object          

/* list processing */
list:
    OPEN_PAREN CLOSE_PAREN  { add_object(interp, 0); }
  | OPEN_PAREN     { push_state(interp); }
    object_pair_list
    CLOSE_PAREN    { pop_state(interp); }

object_pair_list:
    object         { set(interp, CAR); }<commit_msg>Added YYACCEPT to the expression rule.  I'll need to modify the lexer to allow for multiple statements latter.<commit_after>%define api.pure

%{
#include <stdio.h>
#include "core.h"
#include "util.h"

void yyerror(interp_core_type *interp, void *scanner, char *s);

%}

%parse-param {interp_core_type *interp}
%parse-param {void *scanner}
%lex-param {void *scanner}

%token OPEN_PAREN
%token CLOSE_PAREN
%token DOT

%token TRUE_OBJ
%token FALSE_OBJ

%token QUOTE
%token DOUBLE_QUOTE

%token STRING_CONSTANT
%token CHAR_CONSTANT

%token FIXED_NUMBER
%token FLOAT_NUMBER

%token SYMBOL


%%

expression:
    object         { YYACCEPT; }

/* list processing */
list:
    OPEN_PAREN CLOSE_PAREN  { add_object(interp, 0); }
  | OPEN_PAREN     { push_state(interp); }
    object_pair_list
    CLOSE_PAREN    { pop_state(interp); }

object_pair_list:
    object         { set(interp, CAR); }
{'fraction_non_alphanumeric': 0.10970464135021098, 'fraction_numerical': 0.0012055455093429777, 'mean_word_length': 4.1234567901234565, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4083662', 'n_tokens_mistral': 678, 'n_tokens_neox': 635, 'n_words': 150}