From: Graydon Hoare Date: Mon, 17 Sep 2001 19:34:08 +0000 (+0000) Subject: 2001-09-17 graydon hoare X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f0940d5183e2d5d023b38b5f52ec42b7d7975f11;p=cgen.git 2001-09-17 graydon hoare * insn.scm (syntax-break-out): Change $ escape specifier from \$ to $$, to reduce interactions with scheme and C escaping conventions. * doc/rtl.texi (Instructions): Document change. --- diff --git a/ChangeLog b/ChangeLog index 7221faa..f3bbf4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-09-17 graydon hoare + + * insn.scm (syntax-break-out): Change $ escape specifier + from \$ to $$, to reduce interactions with scheme and C escaping + conventions. + * doc/rtl.texi (Instructions): Document change. + 2001-07-12 Jeff Johnston * opc-itab.scm (@arch@_cgen_init_opcode_table): Unconditionally diff --git a/doc/rtl.texi b/doc/rtl.texi index a781b09..d9dceb0 100644 --- a/doc/rtl.texi +++ b/doc/rtl.texi @@ -1806,7 +1806,7 @@ This is a character string consisting of raw characters and operands. Fields are denoted by @code{$operand} or @code{$@{operand@}}@footnote{Support for @code{$@{operand@}} is work-in-progress.}. If a @samp{$} is required in the syntax, it is -specified with @samp{\$}. At most one white-space character may be +specified with @samp{$$}. At most one white-space character may be present and it must be a blank separating the instruction mnemonic from the operands. This doesn't restrict the user's assembler, this is @c Is this reasonable? diff --git a/insn.scm b/insn.scm index bef0995..c0fb420 100644 --- a/insn.scm +++ b/insn.scm @@ -848,9 +848,10 @@ (begin (cond ; Handle escaped syntax metacharacters - ((char=? #\\ (string-ref syntax 0)) - (set! result (cons (substring syntax 0 1) result)) - (set! result (cons (substring syntax 1 1) result)) + ((and + (char=? #\$ (string-ref syntax 0)) + (char=? #\$ (string-ref syntax 1))) + (set! result (cons "$" result)) (set! syntax (string-drop 2 syntax))) ; Handle operand reference ((char=? #\$ (string-ref syntax 0))