Git Product home page Git Product logo

Comments (6)

cjheath avatar cjheath commented on August 31, 2024

Sorry, insufficient clues. I cant see a problem with any of that. How about sending a stack trans and a copy of your rails_helper.rb, at least?

from treetop.

bonflintstone avatar bonflintstone commented on August 31, 2024
     Failure/Error: Treetop.load(Rails.root.join('app', 'grammars', 'document.treetop').to_s)

     ArgumentError:
       negative argument
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/ruby_extensions/string.rb:25:in `tabto'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/ruby_builder.rb:17:in `<<'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/inline_module.rb:18:in `block in compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/ruby_builder.rb:26:in `indented'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/ruby_builder.rb:38:in `module_declaration'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/inline_module.rb:17:in `compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/parsing_rule.rb:12:in `block in compile_inline_module_declarations'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/parsing_rule.rb:11:in `each'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/parsing_rule.rb:11:in `each_with_index'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/parsing_rule.rb:11:in `compile_inline_module_declarations'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/parsing_rule.rb:6:in `compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/declaration_sequence.rb:14:in `block in compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/declaration_sequence.rb:13:in `each'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/declaration_sequence.rb:13:in `compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/grammar.rb:11:in `block in compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/ruby_builder.rb:26:in `indented'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/ruby_builder.rb:38:in `module_declaration'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/node_classes/grammar.rb:7:in `compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/metagrammar.rb:39:in `compile'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/grammar_compiler.rb:24:in `ruby_source_from_string'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/grammar_compiler.rb:42:in `load_from_string'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/grammar_compiler.rb:35:in `block in load'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/grammar_compiler.rb:32:in `open'
     # /home/bonflintstone/.rvm/gems/ruby-2.3.0/gems/treetop-1.4.12/lib/treetop/compiler/grammar_compiler.rb:32:in `load'
     # ./spec/grammars/document_treetop.spec.rb:5:in `block (2 levels) in <top (required)>'
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'spec_helper'
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
# run as spec files by default. This means that files in spec/support that end
# in _spec.rb will both be required and run as specs, causing the specs to be
# run twice. It is recommended that you do not name files matching this glob to
# end with _spec.rb. You can configure this pattern with the --pattern
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
#
# The following line is provided for convenience purposes. It has the downside
# of increasing the boot-up time by auto-requiring all files in the support
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

# Checks for pending migration and applies them before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  # If you're not using ActiveRecord, or you'd prefer not to run each of your
  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = true

  # RSpec Rails can automatically mix in different behaviours to your tests
  # based on their file location, for example enabling you to call `get` and
  # `post` in specs under `spec/controllers`.
  #
  # You can disable this behaviour by removing the line below, and instead
  # explicitly tag your specs with their type, e.g.:
  #
  #     RSpec.describe UsersController, :type => :controller do
  #       # ...
  #     end
  #
  # The different available types are documented in the features, such as in
  # https://relishapp.com/rspec/rspec-rails/docs
  config.infer_spec_type_from_file_location!

  # Filter lines from Rails gems in backtraces.
  config.filter_rails_from_backtrace!
  # arbitrary gems may also be filtered via:
  # config.filter_gems_from_backtrace("gem name")
end

from treetop.

bonflintstone avatar bonflintstone commented on August 31, 2024

There is nothing particular special going on in my app, I will try to repeat the error with some minimal rails app I can send you

from treetop.

bonflintstone avatar bonflintstone commented on August 31, 2024

https://github.com/bonflintstone/treetop-issue

There you go, tell me if you need any more information. All I did for this app was installing treetop and rspec, initializing rspec and creating the files under app/grammars and spec/grammars

Thanks a lot!

from treetop.

cjheath avatar cjheath commented on August 31, 2024

Treetop is now version 1.6.8. You are using treetop version 1.4.12.
Update, and you'll find that this error does not occur.
For what it's worth, the error occurs in a previous version of this line.
(* is the method which gets a negative argument)

https://github.com/cjheath/treetop/blob/master/lib/treetop/ruby_extensions/string.rb#L28

This problem was fixed years ago. Thanks for checking before you bother me to debug your outdated application.

from treetop.

bonflintstone avatar bonflintstone commented on August 31, 2024

I see, sorry for bothering you. Thank you for checking!

On Fri, Aug 12, 2016 at 8:31 AM, Clifford Heath [email protected]
wrote:

Treetop is now version 1.6.8. You are using treetop version 1.4.12.
Update, and you'll find that this error does not occur.
For what it's worth, the error occurs in a previous version of this line.
(* is the method which gets a negative argument)

https://github.com/cjheath/treetop/blob/master/lib/
treetop/ruby_extensions/string.rb#L28

This problem was fixed years ago. Thanks for checking before you bother me
to debug your outdated application.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#43 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AOdD9iVodMt0h5AYWkS9yF4WqyjrW2GLks5qfBNdgaJpZM4JiN45
.

from treetop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.