Skip to content

Instantly share code, notes, and snippets.

@Papierkorb
Created February 28, 2016 20:42
Show Gist options
  • Save Papierkorb/1c7d0841b5c1ca6c7143 to your computer and use it in GitHub Desktop.
Save Papierkorb/1c7d0841b5c1ca6c7143 to your computer and use it in GitHub Desktop.
WIP foo.method(:bar) == foo->bar shorthand
diff --git a/defs/id.def b/defs/id.def
index e186725..b603fe6 100644
--- a/defs/id.def
+++ b/defs/id.def
@@ -39,6 +39,7 @@ firstline, predefined = __LINE__+1, %[\
bt
bt_locations
call
+ method
mesg
exception
diff --git a/parse.y b/parse.y
index a4a57e2..c740bbd 100644
--- a/parse.y
+++ b/parse.y
@@ -3728,6 +3728,13 @@ method_call : fcall paren_args
$$ = method_optarg($$, $4);
%*/
}
+ | primary_value tLAMBDA operation3
+ {
+ /*%%%*/
+ $$ = NEW_CALL($1, idMethod, NEW_LIST(NEW_LIT(ID2SYM($3))));
+ /*%
+ %*/
+ }
| primary_value tCOLON2
{
/*%%%*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment