Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ run-dyno-linters: run-frontend-linters FORCE
SPECTEST_DIR = ./test/release/examples/spec
spectests: FORCE
rm -rf $(SPECTEST_DIR)
doc/util/extract-rst-tests.py doc/rst/language/spec/ --output $(SPECTEST_DIR)
doc/util/extract-rst-tests.py doc/rst/language/spec/ --output $(SPECTEST_DIR) --report $(SPECTEST_DIR)/report.json
4 changes: 4 additions & 0 deletions doc/rst/language/spec/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ as described by its domain. A loop of the form:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

[for|forall|coforall] a in A do
Expand All @@ -576,6 +577,7 @@ is semantically equivalent to:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

[for|forall|coforall] i in A.domain do
Expand Down Expand Up @@ -1111,6 +1113,7 @@ set manipulations. The supported set operators are:

Consider the following code where ``A`` and ``B`` are associative arrays:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

var C = A op B;
Expand All @@ -1122,6 +1125,7 @@ There are also ``op=`` variants that store the result into the first operand.

Consider the following code where ``A`` and ``B`` are associative arrays:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

A op= B;
Expand Down
6 changes: 6 additions & 0 deletions doc/rst/language/spec/data-parallelism.rst
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,14 @@ Consider a function ``f`` with formal arguments ``s1``, ``s2``, ... that
are promoted and formal arguments ``a1``, ``a2``, ... that are not
promoted. The call

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

f(s1, s2, ..., a1, a2, ...)

is equivalent to

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

[(e1, e2, ...) in zip(s1, s2, ...)] f(e1, e2, ..., a1, a2, ...)
Expand All @@ -726,12 +728,14 @@ the promoted actuals must have the same shape.
Formal arguments that are not promoted are evaluated once and stored in a
temporary variable. If formal ``a1`` is an expression, then the call

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

f(s1, s2, ..., a1, a2, ...)

is equivalent to

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

var tmp = a1;
Expand Down Expand Up @@ -785,12 +789,14 @@ rather than functions.
Whole array assignment is one example. It is is implicitly parallel. The
array assignment statement:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

LHS = RHS;

is equivalent to

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

forall (e1,e2) in zip(LHS,RHS) do
Expand Down
21 changes: 17 additions & 4 deletions doc/rst/language/spec/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ Unary Plus Operators

The unary plus operators are predefined as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator +(a: int(8)): int(8)
Expand Down Expand Up @@ -637,6 +638,7 @@ Unary Minus Operators

The unary minus operators are predefined as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator -(a: int(8)): int(8)
Expand Down Expand Up @@ -673,6 +675,7 @@ Addition Operators

The addition operators are predefined as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator +(a: int(8), b: int(8)): int(8)
Expand Down Expand Up @@ -731,6 +734,7 @@ Subtraction Operators

The subtraction operators are predefined as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator -(a: int(8), b: int(8)): int(8)
Expand Down Expand Up @@ -786,6 +790,7 @@ Multiplication Operators

The multiplication operators are predefined as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator *(a: int(8), b: int(8)): int(8)
Expand Down Expand Up @@ -842,6 +847,7 @@ Division Operators

The division operators are predefined as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator /(a: int(8), b: int(8)): int(8)
Expand Down Expand Up @@ -904,6 +910,7 @@ Modulus Operators

The modulus operators are predefined as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator %(a: int(8), b: int(8)): int(8)
Expand Down Expand Up @@ -1182,8 +1189,7 @@ The Logical Negation Operator
The logical negation operator is predefined for booleans and integers as
follows:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator !(a: bool): bool
Expand Down Expand Up @@ -1296,6 +1302,7 @@ Ordered Comparison Operators
The “less than” comparison operators are predefined over numeric types
as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator <(a: int(8), b: int(8)): bool
Expand All @@ -1320,6 +1327,7 @@ the result is false.
The “greater than” comparison operators are predefined over numeric
types as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator >(a: int(8), b: int(8)): bool
Expand All @@ -1344,6 +1352,7 @@ otherwise the result is false.
The “less than or equal to” comparison operators are predefined over
numeric types as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator <=(a: int(8), b: int(8)): bool
Expand All @@ -1368,6 +1377,7 @@ The result of ``a <= b`` is true if ``a`` is less than or equal to
The “greater than or equal to” comparison operators are predefined over
numeric types as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator >=(a: int(8), b: int(8)): bool
Expand All @@ -1392,6 +1402,7 @@ The result of ``a >= b`` is true if ``a`` is greater than or equal to
The ordered comparison operators are predefined over strings as follows:


.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator <(a: string, b: string): bool
Expand Down Expand Up @@ -1422,6 +1433,7 @@ Equality Comparison Operators
The equality comparison operators ``==`` and ``!=`` are predefined
over bool and the numeric types as follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator ==(a: int(8), b: int(8)): bool
Expand Down Expand Up @@ -1475,6 +1487,7 @@ equivalent to ``!(a == b)``.
The equality comparison operators are predefined over classes as
follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator ==(a: RootClass, b: RootClass): bool
Expand All @@ -1491,6 +1504,7 @@ in :ref:`Record_Comparison_Operators`.
The equality comparison operators are predefined over strings as
follows:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator ==(a: string, b: string): bool
Expand Down Expand Up @@ -1537,8 +1551,7 @@ The string concatenation operator ``+`` is predefined for string
arguments and returns a new string that is the concatenation of its
arguments:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator +(s0: string, s1: string): string
Expand Down
1 change: 1 addition & 0 deletions doc/rst/language/spec/locales.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ contains definitions for the array of locales on which the program is
executing (``Locales``), a domain for that array (``LocaleSpace``), and
the number of locales (``numLocales``).

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

config const numLocales: int;
Expand Down
1 change: 1 addition & 0 deletions doc/rst/language/spec/methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ Operators may be overloaded (see :ref:`Function_Overloading`) to support new
behavior on one or more types using the ``operator`` keyword. Such overloads
may be defined as standalone functions, e.g.

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator +(lhs: t1, rhs: t2) { ... }
Expand Down
1 change: 1 addition & 0 deletions doc/rst/language/spec/ranges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ Arithmetic Operators
The following arithmetic operators are defined on ranges and integral
types:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

proc +(r: range, s: integral): range
Expand Down
2 changes: 1 addition & 1 deletion doc/rst/language/spec/records.rst
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ records if none are explicitly defined. ``==`` and ``!=`` functions have the
following signatures for a record ``R``:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

operator ==(lhs:R, rhs:R) : bool where lhs.type == rhs.type;
Expand Down
2 changes: 1 addition & 1 deletion doc/rst/language/spec/statements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ For all other compound assignments, Chapel provides a completely generic
catch-all implementation defined in the obvious way. For example:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

inline proc +=(ref lhs, rhs) {
Expand Down
6 changes: 4 additions & 2 deletions doc/rst/language/spec/tuples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ and ``coforall`` loops. These loops iterate over all of the tuple’s
elements. A loop of the form:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

[for|forall|coforall] e in t do
Expand All @@ -271,7 +271,7 @@ where t is a homogeneous tuple of size ``n``, is semantically equivalent
to:



.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

[for|forall|coforall] i in 0..n-1 do
Expand All @@ -288,6 +288,7 @@ elements, giving each iteration its own index variable that is a
future to include ``const`` or ``ref`` index variables). Thus, a
loop of the form:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

for e in t do
Expand All @@ -296,6 +297,7 @@ loop of the form:
where t is a heterogeneous tuple of size ``n`` is semantically
equivalent to:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

{ // iteration 0
Expand Down
9 changes: 7 additions & 2 deletions doc/rst/technotes/dsi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class ``GlobalDomain``
.. class:: GlobalDomain


.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

class GlobalDomain: BaseRectangularDom {
Expand Down Expand Up @@ -231,6 +232,7 @@ class ``GlobalDomain``

The same as the other ``dsiSetIndices``. Could be implemented like this:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

{ dsiSetIndices([(...rangesArg)]); }
Expand Down Expand Up @@ -426,6 +428,7 @@ class ``GlobalArray``
The DSI requirements apply to each of those classes.
Here ``GlobalArray`` refers to each such class.

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

class GlobalArray ... {
Expand Down Expand Up @@ -727,6 +730,7 @@ class that chooses to support privatization.
NOTE: do not specify the return type (due to a bug in the compiler).


.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

class Global ... {
Expand Down Expand Up @@ -845,9 +849,10 @@ the former needs to reference a privatized copy of the latter.
To obtain a privatized copy of an object, e.g. for use within
``dsiPrivatize()``, use the following procedure:

.. code-block:: chapel
.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

proc chpl_getPrivatizedCopy(type objectType, objectPid:int): objectType
proc chpl_getPrivatizedCopy(type objectType, objectPid:int): objectType

Notes:

Expand Down
6 changes: 6 additions & 0 deletions doc/rst/technotes/subquery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Functions Supported on Array and Domain Types
hasSingleLocalSubdomain
-----------------------

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

proc array.hasSingleLocalSubdomain() : bool;
Expand All @@ -44,6 +45,7 @@ To support this function on a custom domain map, write a param function named
localSubdomain
--------------

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

proc array.localSubdomain(loc: locale = here) : domain;
Expand All @@ -60,13 +62,15 @@ used to modify the index set owned by the locale.
To support this function on a custom domain map, write a function named
``dsiLocalSubdomain``. For example:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

proc BlockArr.dsiLocalSubdomain(loc: locale) : domain;

localSubdomains
---------------

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

iter array.localSubdomains(loc: locale = here) : domain;
Expand All @@ -83,6 +87,7 @@ Currently, this is a serial iterator.
To support this iterator on a custom domain map, write an iterator named
``dsiLocalSubdomains``. For example:

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

iter BlockCyclicArr.dsiLocalSubdomains(loc: locale) : domain;
Expand All @@ -93,6 +98,7 @@ Functions Supported on Arrays, Domains, and Distributions
targetLocales
-------------

.. BLOCK-test-allowCodeBlock
.. code-block:: chapel

proc array.targetLocales() : [] locale;
Expand Down
Loading
Loading