Move token string length from magic number to constant.

pull/962/head
Ivan Sharavuev 2019-07-03 10:14:10 +03:00 committed by Alexander Medvednikov
parent b3e5c89ba9
commit 290e1df893
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,7 @@ fn build_keys() map_int {
}
fn build_token_str() []string {
mut s := [''; 140]// TODO define a const
mut s := [''; NrTokens]
s[keyword_beg] = ''
s[keyword_end] = ''
s[EOF] = 'EOF'
@ -217,6 +217,7 @@ fn build_token_str() []string {
}
const (
NrTokens = 140
TOKENSTR = build_token_str()
KEYWORDS = build_keys()
)