diff --git a/test/corpus/declarations.txt b/test/corpus/declarations.txt index 5e1f6bd5..32c82635 100644 --- a/test/corpus/declarations.txt +++ b/test/corpus/declarations.txt @@ -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 =========================== diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 87b9fdec..5ed1f4d0 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -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 =========================================== diff --git a/test/corpus/literals.txt b/test/corpus/literals.txt index 8f571621..1e9348d3 100644 --- a/test/corpus/literals.txt +++ b/test/corpus/literals.txt @@ -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 =================================