Skip to content

Commit

Permalink
Write down why token_id starts from 256
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Oct 12, 2023
1 parent 31bfb4e commit 375f671
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/lrama/grammar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,9 @@ def collect_symbols

# Fill #number and #token_id
def fill_symbol_number
# TODO: why start from 256
# Character literal in grammar file has
# token id corresponding to ASCII code by default,
# so start token_id from 256.
token_id = 256

# YYEMPTY = -2
Expand Down

0 comments on commit 375f671

Please sign in to comment.