-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing syntax warning for using undefined gvar
We normally issue a warning when code is parsed that uses a variable identifier which has not yet been defined, which GAP then resolves as the name of a gvar. However, we suppress this warning if it is for the assignment to a global variable. But in some rare cases, this suppressed too much: if the very next line after such an assignment wasn't an assignment itself, and accessed the gvar, we did not print a warning.
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This always produced a warning" | ||
gap> Unbind(string); | ||
gap> for i in [ 1 .. 10 ] do | ||
> string := "aaaabbbb"; | ||
> xxx := List( [], x -> string ); | ||
> od; | ||
Syntax warning: Unbound global variable in stream:3 | ||
xxx := List( [], x -> string ); | ||
^ | ||
|
||
# ... but this did not; now it does | ||
gap> Unbind(string); | ||
gap> for i in [ 1 .. 10 ] do | ||
> string := "aaaabbbb"; | ||
> List( [], x -> string ); | ||
> od; | ||
Syntax warning: Unbound global variable in stream:3 | ||
List( [], x -> string ); | ||
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters