• Rob Pike's avatar
    [dev.cc] cmd/asm: fix macro definition bug in the lexer · ae2b145d
    Rob Pike authored
    Because text/scanner hides the spaces, the lexer treated
    	#define A(x)
    and
    	#define A (x)
    the same, but they are not: the first is an argument with macros, the
    second is a simple one-word macro whose definition contains parentheses.
    Fix this by noticing the relative column number as we move from A to (.
    Hacky but simple.
    
    Also add a helper to recognize the peculiar ARM shifted register operators.
    
    Change-Id: I2cad22f5f1e11d8dad40ad13955793d178afb3ae
    Reviewed-on: https://go-review.googlesource.com/4872Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    ae2b145d
slice.go 1.13 KB