Re: [PATCH 5/7] jit,docs: use list-table instead of fixed table

2022-07-25 Thread David Malcolm via Gcc-patches
On Mon, 2022-07-25 at 12:35 +0200, Martin Liska wrote:
> Use rather list-table that is easible to maintainer and one
> does not have to wrap lines. Moreover, it provides great
> attribute :widths: that correctly works (tested for HTML and PDF).
> 
> gcc/jit/ChangeLog:
> 
> * docs/cp/intro/tutorial04.rst: Use list-table.
> * docs/intro/tutorial04.rst: Likewise.
> * docs/intro/tutorial05.rst: Likewise.
> * docs/topics/compilation.rst: Likewise.
> * docs/topics/expressions.rst: Likewise.
> * docs/topics/types.rst: Likewise.

OK; thanks
Dave




[PATCH 5/7] jit,docs: use list-table instead of fixed table

2022-07-25 Thread Martin Liska
Use rather list-table that is easible to maintainer and one
does not have to wrap lines. Moreover, it provides great
attribute :widths: that correctly works (tested for HTML and PDF).

gcc/jit/ChangeLog:

* docs/cp/intro/tutorial04.rst: Use list-table.
* docs/intro/tutorial04.rst: Likewise.
* docs/intro/tutorial05.rst: Likewise.
* docs/topics/compilation.rst: Likewise.
* docs/topics/expressions.rst: Likewise.
* docs/topics/types.rst: Likewise.
---
 gcc/jit/docs/cp/intro/tutorial04.rst |  73 --
 gcc/jit/docs/intro/tutorial04.rst|  73 --
 gcc/jit/docs/intro/tutorial05.rst|  37 +
 gcc/jit/docs/topics/compilation.rst  |  22 --
 gcc/jit/docs/topics/expressions.rst  |  97 ++-
 gcc/jit/docs/topics/types.rst| 111 +--
 6 files changed, 270 insertions(+), 143 deletions(-)

diff --git a/gcc/jit/docs/cp/intro/tutorial04.rst 
b/gcc/jit/docs/cp/intro/tutorial04.rst
index 45198ce3d7a..66dcce903c6 100644
--- a/gcc/jit/docs/cp/intro/tutorial04.rst
+++ b/gcc/jit/docs/cp/intro/tutorial04.rst
@@ -50,30 +50,55 @@ Naturally, a real interpreter would be much more 
complicated that this.
 
 The following operations are supported:
 
-==  === ==
-Operation  Meaning  Old Stack   New Stack
-==  === ==
-DUPDuplicate top of stack.  ``[..., x]````[..., x, x]``
-ROTSwap top two elements``[..., x, y]`` ``[..., y, x]``
-   of stack.
-BINARY_ADD Add the top two elements ``[..., x, y]`` ``[..., 
(x+y)]``
-   on the stack.
-BINARY_SUBTRACTLikewise, but subtract.  ``[..., x, y]`` ``[..., 
(x-y)]``
-BINARY_MULTLikewise, but multiply.  ``[..., x, y]`` ``[..., 
(x*y)]``
-BINARY_COMPARE_LT  Compare the top two  ``[..., x, y]`` ``[..., 
(x``  ``idx += 1``
-``<``  ``idx -= 1``
-``+``  ``data[idx] += 1``
-``-``  ``data[idx] -= 1``
-``.``  ``output (data[idx])``
-``,``  ``data[idx] = input ()``
-``[``  loop until ``data[idx] == 0``
-``]``  end of loop
-Anything else  ignored
-== =
+.. list-table::
+   :header-rows: 1
+
+   * - Character
+ - Meaning
+
+   * - ``>``
+ - ``idx += 1``
+   * - ``<``
+ - ``idx -= 1``
+   * - ``+``
+ - ``data[idx] += 1``
+   * - ``-``
+ - ``data[idx] -= 1``
+   * - ``.``
+ - ``output (data[idx])``
+   * - ``,``
+ - ``data[idx] = input ()``
+   * - ``[``
+ - loop until ``data[idx] == 0``
+   * - ``]``
+ - end of loop
+   * - Anything else
+ - ignored
 
 Unlike the previous example, we'll implement an ahead-of-time compiler,
 which reads ``.bf`` scripts and outputs executables (though it would
diff --git a/gcc/jit/docs/topics/compilation.rst 
b/gcc/jit/docs/topics/compilation.rst
index 91b9c2533cf..adcde8d8eb9 100644
--- a/gcc/jit/docs/topics/compilation.rst
+++ b/gcc/jit/docs/topics/compilation.rst
@@ -169,14 +169,20 @@ For linking in object files, use 
:c:func:`gcc_jit_context_add_driver_option`.
 
 The available kinds of output are:
 
-==  ==
-Output kind Typical suffix
-==  ==
-:c:macro:`GCC_JIT_OUTPUT_KIND_ASSEMBLER`.s
-:c:macro:`GCC_JIT_OUTPUT_KIND_OBJECT_FILE`  .o
-:c:macro:`GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY`  .so or .dll
-:c:macro:`GCC_JIT_OUTPUT_KIND_EXECUTABLE`   None, or .exe
-==  ==
+.. list-table::
+   :header-rows: 1
+
+   * - Output kind
+ - Typical suffix
+
+   * - :c:macro:`GCC_JIT_OUTPUT_KIND_ASSEMBLER`
+ - .s
+   * - :c:macro:`GCC_JIT_OUTPUT_KIND_OBJECT_FILE`
+ - .o
+   * - :c:macro:`GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY`
+ - .so or .dll
+   * - :c:macro:`GCC_JIT_OUTPUT_KIND_EXECUTABLE`
+ - None, or .exe
 
 .. c:macro:: GCC_JIT_OUTPUT_KIND_ASSEMBLER
 
diff --git a/gcc/jit/docs/topics/expressions.rst 
b/gcc/jit/docs/topics/expressions.rst
index 00e2ec8cfeb..ff1eec800ce 100644
--- a/gcc/jit/docs/topics/expressions.rst
+++ b/gcc/jit/docs/topics/expressions.rst
@@ -313,14 +313,20 @@ Unary Operations
 
 The available unary operations are:
 
-==  
-Unary Operation C equivalent
-==  
-:c:macro:`GCC_JIT_UNARY_OP_MINUS`   `-(EXPR)`
-:c:macro:`GCC_JIT_UNARY_OP_BITWISE_NEGATE`  `~(EXPR)`
-:c:macro:`GCC_JIT_UNARY_OP_LOGICAL_NEGATE`  `!(EXPR)`
-:c:macro:`GCC_JIT_UNARY_OP_ABS`