Skip to content

Commit

Permalink
- Added support for method calls to expand over two or more lines.
Browse files Browse the repository at this point in the history
Exaple:
	var arr = [1,2,3,4,5,6];

	say arr.grep{ _ %% 2}
	       .map { _ + 1}
  • Loading branch information
trizen committed Oct 21, 2015
1 parent 2b196b5 commit c1dc82f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Math::BigRat" : "0",
"Math::Complex" : "0",
"Math::Trig" : "0",
"Memoize" : "0",
"POSIX" : "0",
"Scalar::Util" : "0",
"Socket" : "0",
Expand Down
1 change: 1 addition & 0 deletions META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ requires:
Math::BigRat: '0'
Math::Complex: '0'
Math::Trig: '0'
Memoize: '0'
POSIX: '0'
Scalar::Util: '0'
Socket: '0'
Expand Down
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ WriteMakefile
'Math::BigRat' => 0,
'Math::Complex' => 0,
'Math::Trig' => 0,
'Memoize' => 0,
'POSIX' => 0,
'Scalar::Util' => 0,
'Socket' => 0,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Sidef2
Sidef
======

*Sidef2 is a faster implementation of the Sidef Programming Language.*
*Sidef is a modern object-oriented programming language, implemented in Perl.*

To learn about Sidef, check out the following links:

Expand All @@ -23,7 +23,7 @@ To learn about Sidef, check out the following links:

**LICENSE AND COPYRIGHT**

* Copyright (C) 2015 Daniel Șuteu
* Copyright (C) 2013-2015 Daniel Șuteu, Ioana Fălcușan

This program is free software; you can redistribute it and/or modify it
under the terms of the the *Artistic License (2.0)*. You may obtain a
Expand Down
4 changes: 2 additions & 2 deletions lib/Sidef/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ package Sidef::Parser {
local *_ = $opt{code};

{
if ((/\G(?![-=]>)/ && /\G(?=$self->{operators_re})/o) || /\G\./goc) {
if ((/\G(?![-=]>)/ && /\G(?=$self->{operators_re})/o) || /\G(\.|\s*(?!\.\.)\.)/gc) {
my ($method, $req_arg, $op_type) = $self->get_method_name(code => $opt{code});

if (defined($method)) {
Expand Down Expand Up @@ -2147,7 +2147,7 @@ package Sidef::Parser {
}

{
if (/\G(?=\.(?:$self->{method_name_re}|[(\$]))/o) {
if (/\G\h*(?=\.\h*(?:$self->{method_name_re}|[(\$]))/ogc) {
my $methods = $self->parse_methods(code => $opt{code});
push @{$struct{$self->{class}}[-1]{call}}, @{$methods};
}
Expand Down

0 comments on commit c1dc82f

Please sign in to comment.