mirror of
https://github.com/golang/go
synced 2024-10-02 04:18:33 -06:00
[dev.cc] cmd/asm: accept #define A /* nothing */
Was rejected but should be legal. Change-Id: I0189e3bef6b67c6ba390c75a48a8d9d8f39b7636 Reviewed-on: https://go-review.googlesource.com/5286 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
d7eb51e70e
commit
f60fb5c5ad
@ -206,7 +206,7 @@ func (in *Input) macroDefinition(name string) ([]string, []Token) {
|
|||||||
prevCol := in.Stack.Col()
|
prevCol := in.Stack.Col()
|
||||||
tok := in.Stack.Next()
|
tok := in.Stack.Next()
|
||||||
if tok == '\n' || tok == scanner.EOF {
|
if tok == '\n' || tok == scanner.EOF {
|
||||||
in.Error("no definition for macro:", name)
|
return nil, nil // No definition for macro
|
||||||
}
|
}
|
||||||
var args []string
|
var args []string
|
||||||
// The C preprocessor treats
|
// The C preprocessor treats
|
||||||
|
@ -36,6 +36,11 @@ var lexTests = []lexTest{
|
|||||||
),
|
),
|
||||||
"1234.\n",
|
"1234.\n",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"define without value",
|
||||||
|
"#define A",
|
||||||
|
"",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"macro without arguments",
|
"macro without arguments",
|
||||||
"#define A() 1234\n" + "A()\n",
|
"#define A() 1234\n" + "A()\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user