-
Notifications
You must be signed in to change notification settings - Fork 17.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
‘loadsys’ undeclared at building #626
Labels
Comments
yerr.h is generated by the script bisonerrors from go.errors. It sounds like, for whatever reason, that script is not replacing the % lines in go.errors with their translation on the way to being yerr.h. I haven't seen this on any systems here. If you'd like to investigate, cd $GOROOT/src/cmd/gc make -B yerr.h and then try to figure out why that command (make -B yerr.h, which runs bisonerrors) doesn't translate the % lines. Owner changed to r...@golang.org. Status changed to Accepted. |
yerr.h is supposed to begin: // Copyright 2010 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. // Example-based syntax error messages. // See bisonerrors, Makefile, go.y. static struct { int yystate; int yychar; char *msg; } yymsg[] = { // Each line of the form % token list // is converted by bisonerrors into the yystate and yychar caused // by that token list. 76, ',', "unexpected comma during import block", 479, ';', "unexpected semicolon or newline before {", but in your case I expect that lines 17-18 say % loadsys package LIMPORT '(' LLITERAL import_package import_there ',' "unexpected comma during import block", I don't know why it says that. Perhaps you can help debug what is going on. The awk script bisonerrors says # First // comment marks the beginning of the pattern file. /^\/\// { bison = 0; grammar = 0; state = 0 } bison { next } # Treat % as first field on line as introducing a pattern (token sequence). # Run it through the LR machine and print the induced "yystate, yychar," # at the point where the error happens. $1 == "%" { ... processing of % line here ... } { print } We know that the bison rule is not firing, because that would keep the script from printing anything, and lines are being printed. So the question is why $1 == "%" is not matching the % lines. Status changed to WaitingForReply. |
yerr.h is a bit strange : yystate is always 0, and yychar is always loadsys. I print it here, free of its comments : static struct { int yystate; int yychar; char *msg; } yymsg[] = { 0, loadsys, "unexpected comma during import block", 0, loadsys, "unexpected semicolon or newline before {", 0, loadsys, "unexpected semicolon or newline before {", 0, loadsys, "unexpected semicolon or newline before {", 0, loadsys, "unexpected semicolon or newline before {", 0, loadsys, "unexpected semicolon or newline before {", 0, loadsys, "unexpected semicolon or newline in type declaration", 0, loadsys, "unexpected semicolon or newline before else", 0, loadsys, "name list not allowed in interface type", 0, loadsys, "var declaration not allowed in for initializer", }; |
Here it is. Attachments:
|
Comment 9 by patrick@sinz.fr: The bug is related to bison. The y.output file is generated with messages depending on the current locale. So using a mandriva version in "french" I get: aller à l'état instead of "goto state" so the "grammar" in bisonerror being "english centric" is "wrong". running bison in an "english" environnement is a work around. |
In response to #9, the Makefile tries to run bison in the C environment to work around the problem of translated error messages. In particular, the bison action says: LANG=C bison -v -y $(YFLAGS) $(YFILES) Does your copy of bison still print French with LANG=C? If so, do you know what environment variable is supposed to be used to get the English messages? |
Comment 11 by patrick@sinz.fr: Applying this change fixes the problem (adds the LANGUAGE during the execution of bison). 52c52 < LANG=C bison -v -y $(YFLAGS) $(YFILES) --- > LANG=C LANGUAGE="en_US.UTF8" bison -v -y $(YFLAGS) $(YFILES) |
This issue was closed by revision eaf45f2. Status changed to Fixed. |
@ENG.KHALED.LELA: Install bison. http://golang.org/doc/install.html |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by erevfall:
The text was updated successfully, but these errors were encountered: