about summary refs log tree commit diff stats
path: root/subx/066allocate.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-12-30 20:24:37 -0800
committerKartik Agaram <vc@akkartik.com>2018-12-30 20:24:37 -0800
commit901ae474300d70bcc00e7e0b420ca87c8cbf6f55 (patch)
treeaf60b1c8c92bfc10a6bb6bd1082a765fcc718004 /subx/066allocate.subx
parent0474ec865af12cff08dd255954fbccf6d38085e6 (diff)
downloadmu-901ae474300d70bcc00e7e0b420ca87c8cbf6f55.tar.gz
4899
Bug in my linkify tool introduced in commit 4891.
Diffstat (limited to 'subx/066allocate.subx')
0 files changed, 0 insertions, 0 deletions
hlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
exclusive-container event [
  # update the ASSUME_EVENTS handler if you add more variants
  keyboard:keyboard-event
  mouse:mouse-event
]

container keyboard-event [
  key:character
]

container mouse-event [
  type:character
  row:number
  column:number
]

container events [
  index:number
  data:address:array:event  
]

recipe read-event [
  default-space:address:array:location <- new location:type, 30:literal
  x:address:events <- next-ingredient
  {
    break-unless x:address:events
    idx:address:number <- get-address x:address:events/deref, index:offset
    buf:address:array:event <- get x:address:events/deref, data:offset
    {
      max:number <- length buf:address:array:event/deref
      done?:boolean <- greater-or-equal idx:address:number/deref, max:number
      break-unless done?:boolean
      dummy:address:event <- new event:type
      reply dummy:address:event/deref, x:address:events/same-as-ingredient:0
    }
    result:event <- index buf:address:array:event/deref, idx:address:number/deref
    idx:address:number/deref <- add idx:address:number/deref, 1:literal
    reply result:event, x:address:events/same-as-ingredient:0
  }
  # real event source
  result:event <- read-keyboard-or-mouse-event
  reply result:event
]