AFAIK Marpa should be ok with unicode, c.f. advent calendar that is 
somewhere in the test suite.
C.f. attachment that replays your example.
Jean-Damien.

-- 
You received this message because you are subscribed to the Google Groups 
"marpa parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to marpa-parser+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!env perl
use strict;
use warnings FATAL => 'all';
use Marpa::R2;
use Data::Section -setup;
use open ':std', ':encoding(utf8)';
use Data::Dumper;

our $DATA = __PACKAGE__->local_section_data;

# Grammar and test suite are in __DATA__
# --------------------------------------
my $grammar = Marpa::R2::Scanless::G->new( { source => $DATA->{grammar_source } });
my @tests = grep {"$_"} split(/\n/, ${$DATA->{tests}});

map {printf "%-40s : %s\n", $_, play($grammar, $_)} @tests;

#######################################################

sub play {
    my ($grammar, $input) = @_;

    my $recognizer = Marpa::R2::Scanless::R->new({grammar => $grammar});
    my $length  = length($input);

    my %played = ();
    #
    # 1: Parse
    #
    my $pos = eval {$recognizer->read(\$input)} || do {return $@};
    my $value = $recognizer->value();
    print STDERR Dumper($value);
    return ($value ? 'OK' : 'KO') . ", pos=$pos";
}

__DATA__
__[ grammar_source ]__
:start ::= Start
:default ::= action => [values]
Start ::= Rule1 
Rule1 ::= '≠'
event 'Start' = completed Start
__[ tests ]__
≠

Reply via email to