Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions test/corpus/declarations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,50 @@ lambda parameters with block-locals
locals: (identifier))
body: (block)))

============================
binary operator method names
============================

def !=(other)
self.n != other.n
end

def ==(other)
true
end

def <=>(other)
0
end

---

(program
(method
name: (operator)
parameters: (method_parameters
(identifier))
body: (body_statement
(binary
left: (call
receiver: (self)
method: (identifier))
right: (call
receiver: (identifier)
method: (identifier)))))
(method
name: (operator)
parameters: (method_parameters
(identifier))
body: (body_statement
(true)))
(method
name: (operator)
parameters: (method_parameters
(identifier))
body: (body_statement
(integer))))

===========================
unary operator method names
===========================
Expand Down
27 changes: 27 additions & 0 deletions test/corpus/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,33 @@ a...b
(identifier)
(identifier)))

=================================
dot call syntax
=================================

x.(123)
x.()

---

(program
(call
receiver: (identifier)
arguments: (argument_list
(integer)))
(call
receiver: (identifier)
arguments: (argument_list)))

===================================================
dot call syntax rejects a second argument list
:error
===================================================

x.(123)(456)

---

===========================================
newline after range operator continues range
===========================================
Expand Down
19 changes: 19 additions & 0 deletions test/corpus/literals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,25 @@ un-terminated heredocs
(heredoc_content)
(heredoc_end)))

==========================================
un-terminated heredoc identifier does not crash the scanner
==========================================

<<~"BASH
if the string inside is too short it doesn't crash
but I haven't found exactly how many chars is the problem

if the string inside is too short it doesn't crash
but I haven't found exactly how many chars is the problem

it needs this line
BASH

---

(program
(heredoc_beginning))

=================================
no interpolation or escape sequences in single quoted heredoc
=================================
Expand Down
Loading