From 6a2afa1cfe17bb21896793f86d269e478e40ede0 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 26 Jun 2019 01:03:41 +0200 Subject: [PATCH] Parser.error(): information about what to do when V doesn't compile --- compiler/parser.v | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/parser.v b/compiler/parser.v index 99005a8717..370e818b93 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -657,6 +657,17 @@ fn (p mut Parser) error(s string) { println('pass=$p.run fn=`$p.cur_fn.name`') } p.cgen.save() + // V git pull hint + cur_path := os.getwd() + if p.file_path.contains('v/compiler') || cur_path.contains('v/compiler') { + println('\n====================') + println('It looks like you are building V. It is being frequently updated every day.' + + ' Most likely there was a change that lead to this error. ') + println('Try to run `git pull`, that will most likely fix it.') + println('If `git pull` doesn\'t help, re-install V from source or download a precompiled' + + ' binary from https://vlang.io') + println('====================\n') + } // p.scanner.debug_tokens() // Print `[]int` instead of `array_int` in errors p.scanner.error(s.replace('array_', '[]').replace('__', '.'))