From 24d12be3b95421f31d73a8355fb815ae8617b6c2 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 5 Jul 2021 20:11:55 -0400 Subject: [PATCH] Add TOKEN enum entries for EOF, decode error, drop, and none --- assets/parser.d.erb | 4 ++++ lib/imbecile.rb | 3 +++ 2 files changed, 7 insertions(+) diff --git a/assets/parser.d.erb b/assets/parser.d.erb index d371d06..956a641 100644 --- a/assets/parser.d.erb +++ b/assets/parser.d.erb @@ -78,6 +78,10 @@ class <%= classname %> TOKEN_<%= token.c_name %> = <%= index %>, <% end %> <% end %> + TOKEN_EOF = <%= TOKEN_EOF %>, + TOKEN_DECODE_ERROR = <%= TOKEN_DECODE_ERROR %>, + TOKEN_DROP = <%= TOKEN_DROP %>, + TOKEN_NONE = <%= TOKEN_NONE %>, } static immutable string TokenNames[] = [ diff --git a/lib/imbecile.rb b/lib/imbecile.rb index bd23dcb..1473025 100644 --- a/lib/imbecile.rb +++ b/lib/imbecile.rb @@ -17,6 +17,9 @@ require_relative "imbecile/version" module Imbecile + # EOF. + TOKEN_EOF = 0xFFFFFFFC + # Decoding error. TOKEN_DECODE_ERROR = 0xFFFFFFFD