/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-â
âvi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8                                :viâ
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¡
â Copyright 2022 Justine Alexandra Roberts Tunney                              â
â                                                                              â
â Permission to use, copy, modify, and/or distribute this software for         â
â any purpose with or without fee is hereby granted, provided that the         â
â above copyright notice and this permission notice appear in all copies.      â
â                                                                              â
â THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL                â
â WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED                â
â WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE             â
â AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL         â
â DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR        â
â PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER               â
â TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR             â
â PERFORMANCE OF THIS SOFTWARE.                                                â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ*/
#include "tool/plinko/lib/plinko.h"

pureconst int Symbolize(int x) {
  if (literally) return -1;
  if (x == TERM) return -1;
  DCHECK_LT(x, TERM);
  switch (LO(Get(x))) {
    case L'A':
      if (x == kAtom) return L'Î±';
      if (x == kAnd) return L'â§';
      if (x == kAppend) return L'â';
      return -1;
    case L'B':
      if (x == kBeta) return L'Î²';
      if (x == kBecause) return L'âµ';
      return -1;
    case L'C':
      if (x == kCar) return L'â';
      if (x == kCdr) return L'â';
      if (x == kClosure) return L'â';
      if (x == kCond) return L'Î¶';
      if (x == kCons) return L'â¶';
      if (x == kCmp) return L'â·';
      if (x == kCycle) return L'â³';
      return -1;
    case L'D':
      if (x == kDefine) return L'â';
      if (x == kDefmacro) return L'Î¨';
      if (x == kDefun) return L'Î';
      return -1;
    case L'E':
      if (x == kEq) return L'â¡';
      if (x == kExpand) return L'É';
      return -1;
    case L'F':
      if (x == kFunction) return L'ð';
      if (x == kFork) return L'â';
      return -1;
    case L'P':
      if (x == kPartial) return L'â';
      return -1;
    case L'I':
      if (x == kIff) return L'âº';
      if (x == kImplies) return L'â¶';
      if (x == kIntegrate) return L'â«';
      if (x == kIntersection) return L'â©';
      return -1;
    case L'L':
      if (x == kLambda) return L'Î»';
      if (x == kList) return L'â';
      return -1;
    case L'M':
      if (x == kMacro) return L'Ï';
      if (x == kMember) return L'â';
      return -1;
    case L'N':
      if (!x) return L'â¥';
      if (x == kNand) return L'â¼';
      if (x == kNor) return L'â½';
      if (x == kNot) return L'Â¬';
      return -1;
    case L'O':
      if (x == kOr) return L'â¨';
      if (x == kOrder) return L'â';
      return -1;
    case L'Q':
      if (x == kQuote) return L'â¦';
      return -1;
    case L'R':
      if (x == kReverse) return L'Ð¯';
      return -1;
    case L'S':
      if (x == kSqrt) return L'â';
      if (x == kSubset) return L'â';
      if (x == kSuperset) return L'â';
      return -1;
    case L'T':
      if (x == 1) return L'â¤';
      if (x == kTherefore) return L'â´';
      return -1;
    case L'U':
      if (x == kUnion) return L'âª';
      if (x == kImpossible) return L'â';
      return -1;
    case L'X':
      if (x == kXor) return L'â»';
      return -1;
    case L'Y':
      if (x == kYcombinator) return L'ð';
      return -1;
    default:
      return -1;
  }
}
