Skip to content

treetop 1.4.12 specs fail with ruby 1.8 #32

Closed
graaff opened this Issue Apr 21, 2013 · 2 comments

3 participants

@graaff
graaff commented Apr 21, 2013

With ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux] I get the following failures when trying to run the specs.

  1) a character class with a negated POSIX bracket expression matches a character outside the negated class
     Failure/Error: parse('a').should_not be_nil
     RegexpError:
       invalid regular expression; [:^space:] is not a character class: /\G[[:^space:]]/
     # ./lib/treetop/runtime/compiled_parser.rb:97:in `initialize'
     # ./lib/treetop/runtime/compiled_parser.rb:97:in `new'
     # ./lib/treetop/runtime/compiled_parser.rb:97:in `has_terminal?'
     # (eval):19:in `_nt_expression_under_test'
     # ./lib/treetop/runtime/compiled_parser.rb:18:in `send'
     # ./lib/treetop/runtime/compiled_parser.rb:18:in `parse'
     # ./spec/compiler/character_class_spec.rb:91

  2) a character class with a negated POSIX bracket expression doesn't match a character within the negated class
     Failure/Error: parse(' ').should be_nil
     RegexpError:
       invalid regular expression; [:^space:] is not a character class: /\G[[:^space:]]/
     # ./lib/treetop/runtime/compiled_parser.rb:97:in `initialize'
     # ./lib/treetop/runtime/compiled_parser.rb:97:in `new'
     # ./lib/treetop/runtime/compiled_parser.rb:97:in `has_terminal?'
     # (eval):19:in `_nt_expression_under_test'
     # ./lib/treetop/runtime/compiled_parser.rb:18:in `send'
     # ./lib/treetop/runtime/compiled_parser.rb:18:in `parse'
     # ./spec/compiler/character_class_spec.rb:94
@boutil
boutil commented Jun 19, 2013

Hi,

Same problem here, with 1.4.14. I seems that [:^space:] is not recognized by Ruby1.8. Replacing [[:^space:]] by the equivalent [^[:space]] makes tests pass with ruby1.8 and 1.9.3.

Cheers,

Cédric

@cjheath
Collaborator
cjheath commented Jul 13, 2013

Ruby 1.8 is now EOL.

@cjheath cjheath closed this Jul 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.