Comments (7)
Which version of prism are you using? I get:
irb(main):007> (Prism::DSL.methods - Module.methods).length
=> 167
from prism.
I can reproduce the error on 0.30.0
:
irb(main):001> require "prism"
=> true
irb(main):002> puts Prism::VERSION
0.30.0
irb(main):003> (Prism::DSL.methods - Module.methods).length
=> 0
# ...
irb(main):029> Builder.new.build
(irb):10:in `initialize': undefined method `source' for an instance of Builder (NoMethodError)
@default_source = source("[1]")
^^^^^^
from (irb):29:in `new'
from (irb):29:in `<main>'
from <internal:kernel>:187:in `loop'
from /Users/marcoroth/.anyenv/envs/rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/irb-1.14.0/exe/irb:9:in `<top (required)>'
from /Users/marcoroth/.anyenv/envs/rbenv/versions/3.3.0/bin/irb:25:in `load'
from /Users/marcoroth/.anyenv/envs/rbenv/versions/3.3.0/bin/irb:25:in `<main>'
from prism.
Thanks for the quick response.
Which version of prism are you using?
0.30.0
from prism.
Looking at the lib/prism/dsl.rb
file of my prism
gem on version 0.30.0
it shows that it has the old version of the DSL code with the PascalCased methods. Maybe the 0.30.0
version of the gem was published without compiling the dsl.rb.erb
file again?
Here's a snippet:
# ~/.anyenv/envs/rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/prism-0.30.0/lib/prism/dsl.rb
module Prism
# ...
module DSL
private
# Create a new Location object
def Location(source = nil, start_offset = 0, length = 0)
Location.new(source, start_offset, length) # steep:ignore
end
# Create a new AliasGlobalVariableNode node
def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = nil, location = Location())
AliasGlobalVariableNode.new(source, new_name, old_name, keyword_loc, location)
end
# ...
end
from prism.
Ahh shoot sorry that documentation reflects main
, which hasn't been released yet. That'll be out soon.
from prism.
In the meantime you're welcome to point to main
(to use the new APIs) or you can use the old APIs (the documentation that ships with the gem).
from prism.
Gotcha, thanks so much!
from prism.
Related Issues (20)
- Consideration of PM_INDEX_WRITE_NODE HOT 4
- `eval` handles non-standard shebang differently
- `Parser::Translator` is accepting certain regexp flags where `parser` would raise HOT 2
- Allow generating ctags via prism
- Newline Token Handling in Multi-line Literals with `Prism.lex` HOT 1
- Inconsistent return types for `Prism.lex` and `Prism.lex_file` depending on `prism/ffi` requirement HOT 2
- CRuby test failure: TestAllocation HOT 1
- CRuby test failure: unused block warning HOT 1
- CRuby test failure: not setting external encoding on shebang flag
- CRuby test failure: not handling FIFO files
- CRuby test failure: requires investigation
- CRuby test failure: incorrectly parsing `x` option in groups
- CRuby test failure: TestException#test_syntax_error_detailed_message HOT 1
- CRuby test failure: TestCoverage#test_coverage_in_main_script
- CRuby test failure: TestTRICK2015#test_ksk_1
- CRuby test failure: TestIO#test_set_lineno
- String concatenation incorrectly marked as static literal
- Prism accepts invalid usage of `==` with newline that Ruby rejects HOT 1
- Fix issues on default parser PR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prism.