File: concrete-syntax/core/pattern/unit.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: Umu#6
  module: ConcreteSyntax#8
  module: Core#10
  module: Pattern#12
has properties
function: make_unit / 1 #46
  class: Unit#14
inherits from
  Abstract ( Umu::ConcreteSyntax::Core::Pattern )
has properties
method: to_s #15
method: exported_vars #20
method: __desugar_value__ / 3 #27
method: __desugar_lambda__ / 3 #34

Class Hierarchy

Code

   1  # coding: utf-8
   2  # frozen_string_literal: true
   3 
   4 
   5 
   6  module Umu
   7 
   8  module ConcreteSyntax
   9 
  10  module Core
  11 
  12  module Pattern
  13 
  14  class Unit < Abstract
  15      def to_s
  16          '()'
  17      end
  18 
  19 
  20      def exported_vars
  21          [].freeze
  22      end
  23 
  24 
  25  private
  26 
  27      def __desugar_value__(expr, _env, _event)
  28          ASSERT.kind_of expr, ASCE::Abstract
  29 
  30          ASCD.make_value self.loc, WILDCARD, expr, :Unit
  31      end
  32 
  33 
  34      def __desugar_lambda__(_seq_num, _env, _event)
  35          CSCP.make_result(
  36              ASCE.make_identifier(self.loc, WILDCARD),
  37              [],
  38              :Unit
  39          )
  40      end
  41  end
  42 
  43 
  44  module_function
  45 
  46      def make_unit(loc)
  47          ASSERT.kind_of loc, LOC::Entry
  48 
  49          Unit.new(loc).freeze
  50      end
  51 
  52  end # Umu::ConcreteSyntax::Core::Pattern
  53 
  54  end # Umu::ConcreteSyntax::Core
  55 
  56  end # Umu::ConcreteSyntax
  57 
  58  end # Umu