etng-r2/etng-convert-constant-methods-pass.g
author Tony Garnock-Jones <tonygarnockjones@gmail.com>
Wed, 16 Jan 2019 17:15:58 +0000
changeset 438 1fe179d53161
parent 234 10e62e160cb0
permissions -rw-r--r--
Add missing primitive implementation for the plain interpreter.
-- -*- text -*-

pass = toplevel;

expr =
	  {#object :selfid method*:methods ~_} ->
		(convert-constant-methods `(object ,selfid) methods)
	| {#function method*:methods ~_} ->
		(convert-constant-methods '(function) methods)
;

method =
	  {#constant-method {pattern*}:patterns expr:body ~_} -> `(constant-method ,patterns ,body)
;