-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
Description
While we should namespace Gobra's keywords in the midterm future (cf. #118), the parser should provide better error message for the time being.
E.g., the following bitLen function from the Go standard library (crypto/internal/fips140/bigmod) produces a "no viable alternative at input 'len :=' error message, which is fine. However, having (not even verifying!) the very same function in a larger file, produces the following error at a completely unrelated portion of the file
unexpected ==, expecting arguments
assert reveal n.AnnouncedLen() == 0
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package test
func bitLen(n uint) int {
len := 0
// We assume, here and elsewhere, that comparison to zero is constant time
// with respect to different non-zero values.
for n != 0 {
len++
n >>= 1
}
return len
}
Reactions are currently unavailable