From fb546f376eee1c955a7c69b20bd3f2c00196d480 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 5 Dec 2019 01:27:04 +0300 Subject: [PATCH] set max module depth to 5 --- vlib/compiler/parser.v | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vlib/compiler/parser.v b/vlib/compiler/parser.v index dc3f906947..4a20e5d751 100644 --- a/vlib/compiler/parser.v +++ b/vlib/compiler/parser.v @@ -80,8 +80,8 @@ pub: } const ( - MaxModuleDepth = 4 - Reserved_Types = { + max_module_depth = 5 + reserved_types = { 'i8' : true, 'i16' : true, 'int' : true, 'i64' : true, 'i128' : true, 'byte' : true, 'u16' : true, 'u32' : true, 'u64' : true, 'u128' : true, 'f32' : true, 'f64' : true, @@ -608,8 +608,8 @@ fn (p mut Parser) import_statement() { mod_alias = submodule mod += '.' + submodule depth++ - if depth > MaxModuleDepth { - p.error('module depth of $MaxModuleDepth exceeded: $mod') + if depth > max_module_depth { + p.error('module depth of $max_module_depth exceeded: $mod') } } // aliasing (import encoding.base64 as b64) @@ -807,7 +807,7 @@ fn (p mut Parser) check_string() string { } fn (p mut Parser) check_not_reserved () { - if Reserved_Types[p.lit] { + if reserved_types[p.lit] { p.error('`$p.lit` can\'t be used as name') } }