]> Cypherpunks repositories - gostls13.git/commit
[dev.cc] cmd/asm: rewrite the macro processor
authorRob Pike <r@golang.org>
Fri, 30 Jan 2015 00:33:36 +0000 (16:33 -0800)
committerRob Pike <r@golang.org>
Fri, 30 Jan 2015 16:38:25 +0000 (16:38 +0000)
commitd6eb21e331ba73d235b9014ce5b710d5e7bde545
tree0b09da696887a8ddbe07648f408c383703b22342
parentb528063099adfbaea3319ca8de57eee3130c5d4c
[dev.cc] cmd/asm: rewrite the macro processor

The previous one was too broken, so just rewrite the code that invokes
a macro. Basically it was evaluating things too early, and mishandling
nested invocations. It's also easier to understand now.

Keep backslash-newline around in macro definitions. They get
processed when the body is evaluated.

Write some golden tests.

Change-Id: I27435f77f258a0873f80932bdc8d13ad39821ac1
Reviewed-on: https://go-review.googlesource.com/3550
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/asm/internal/asm/parse.go
src/cmd/asm/internal/lex/input.go
src/cmd/asm/internal/lex/lex_test.go [new file with mode: 0644]
src/cmd/asm/internal/lex/stack.go