From 6d9c02aea3e902633ca62b220686580705bdcaf8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 11 Nov 2011 14:56:49 -0500 Subject: [PATCH] 6a, 8a: allow $(-1) for consistency with $1, $(1), $-1. R=ken2 CC=golang-dev https://golang.org/cl/5373074 --- src/cmd/6a/a.y | 6 ++++++ src/cmd/8a/a.y | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/cmd/6a/a.y b/src/cmd/6a/a.y index c0fa4106e7..8459ff3233 100644 --- a/src/cmd/6a/a.y +++ b/src/cmd/6a/a.y @@ -429,6 +429,12 @@ imm: $$.type = D_FCONST; $$.dval = $3; } +| '$' '(' '-' LFCONST ')' + { + $$ = nullgen; + $$.type = D_FCONST; + $$.dval = -$4; + } | '$' '-' LFCONST { $$ = nullgen; diff --git a/src/cmd/8a/a.y b/src/cmd/8a/a.y index 96976089de..f1881808fe 100644 --- a/src/cmd/8a/a.y +++ b/src/cmd/8a/a.y @@ -392,6 +392,12 @@ imm: $$.type = D_FCONST; $$.dval = $3; } +| '$' '(' '-' LFCONST ')' + { + $$ = nullgen; + $$.type = D_FCONST; + $$.dval = -$4; + } | '$' '-' LFCONST { $$ = nullgen;