1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Move token string length from magic number to constant.

This commit is contained in:
Ivan Sharavuev 2019-07-03 10:14:10 +03:00 committed by Alexander Medvednikov
parent b3e5c89ba9
commit 290e1df893

View File

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