| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/prism/commit/c8e1b11120
|
|
https://github.com/ruby/prism/commit/d1d2161219
|
|
https://github.com/ruby/prism/commit/d2d9a1f1a7
|
|
https://github.com/ruby/prism/commit/ed8f6307c1
|
|
The purpose of this commit is to fix Bug #21188. We need to detect when
stdin has run in to an EOF case. Unfortunately we can't _call_ the eof
function on IO because it will block.
Here is a short script to demonstrate the issue:
```ruby
x = STDIN.gets
puts x
puts x.eof?
```
If you run the script, then type some characters (but _NOT_ a newline),
then hit Ctrl-D twice, it will print the input string. Unfortunately,
calling `eof?` will try to read from STDIN again causing us to need a
3rd Ctrl-D to exit the program.
Before introducing the EOF callback to Prism, the input loop looked
kind of like this:
```ruby
loop do
str = STDIN.gets
process(str)
if str.nil?
p :DONE
end
end
```
Which required 3 Ctrl-D to exit. If we naively changed it to something
like this:
```ruby
loop do
str = STDIN.gets
process(str)
if STDIN.eof?
p :DONE
end
end
```
It would still require 3 Ctrl-D because `eof?` would block. In this
patch, we're wrapping the IO object, checking the buffer for a newline
and length, and then using that to simulate a non-blocking eof? method.
This commit wraps STDIN and emulates a non-blocking `eof` function.
[Bug #21188]
|
|
Fixes [Bug #21165]
https://github.com/ruby/prism/commit/3f0acf7560
|
|
Introduce StringQuery to provide methods to access some metadata
about the Ruby lexer.
https://github.com/ruby/prism/commit/d3f55b67b9
|
|
https://github.com/ruby/prism/commit/53b2866487
|
|
https://github.com/ruby/prism/commit/578a4f983e
|
|
https://github.com/ruby/prism/commit/af0204a8ab
|
|
https://github.com/ruby/prism/commit/592128de4d
|
|
https://github.com/ruby/prism/commit/f0a2ce1c0e
|
|
https://github.com/ruby/prism/commit/efdc2b7222
|
|
https://github.com/ruby/prism/commit/3e10c46c14
|
|
https://github.com/ruby/prism/commit/9137226a52
|
|
|
|
https://github.com/ruby/prism/commit/a6a552411c
|
|
https://github.com/ruby/prism/commit/d3a149efc5
|
|
https://github.com/ruby/prism/commit/851f2571ff
|
|
https://github.com/ruby/prism/commit/a35b8e45ee
|
|
https://github.com/ruby/prism/commit/27985b0e7e
|
|
|
|
https://github.com/ruby/prism/commit/d7fbc09345
|
|
https://github.com/ruby/prism/commit/e838eaff6f
|
|
This reverts commit 9b76c7fc89460ed8e9be40e4037c1d68395c0f6d.
|
|
Enable Prism using either --prism
ruby --prism test.rb
or via env var
RUBY_PRISM=1 ruby test.rb
|
|
A lot of tools use Ripper/RubyVM::AbstractSyntaxTree to determine
if a source is valid. These tools both create an AST instead of
providing an API that will return a boolean only.
This new API only creates the C structs, but doesn't bother
reifying them into Ruby/the serialization API. Instead it only
returns true/false, which is significantly more efficient.
https://github.com/ruby/prism/commit/7014740118
|
|
https://github.com/ruby/prism/commit/98e218d989
|
|
https://github.com/ruby/prism/commit/4f3a3e3ec1
|
|
https://github.com/ruby/prism/commit/13fa262669
|
|
https://github.com/ruby/prism/commit/5a2252e3ac
|
|
https://github.com/ruby/prism/commit/f0aa8ad93b
|
|
https://github.com/ruby/prism/commit/99e81619de
|
|
https://github.com/ruby/prism/commit/77d4056766
|
|
https://github.com/ruby/prism/commit/e327449db6
|
|
https://github.com/ruby/prism/commit/9c648ce615
|
|
https://github.com/ruby/prism/commit/26934263b7
|
|
https://github.com/ruby/prism/commit/bd4d248fd6
|
|
https://github.com/ruby/prism/commit/5b72f84480
|
|
https://github.com/ruby/prism/commit/6d8358c083
|
|
pm_scope_node_init is only used for CRuby, so should not live in the
ruby/prism repo. We will merge the changes here first so they're
not breaking, and will then remove from ruby/prism
|
|
This reverts commit fd87372a7482cbf7672c44ef95bc1dc3b00bab7c.
|
|
This reverts commit 67a987f82bc8a2b7ec15581306873530821fcf9e.
|
|
Amend ScopeNode to point to previous ScopeNode, and to have void*
pointers to constants and index_lookup_table
https://github.com/ruby/prism/commit/0534324312
|
|
|
|
|
|
|