Skip to content

Commit f6e0f6d

Browse files
committed
Update to new [!NOTE] syntax
1 parent 46a2e08 commit f6e0f6d

File tree

5 files changed

+95
-127
lines changed

5 files changed

+95
-127
lines changed

doc/1.2/language.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,10 @@ inside the method must be enclosed in a `try` block. A `throw`
569569
statement counts as throwing, as does a `call` or `inline`
570570
statement, unless the method it invokes is declared `nothrow`.
571571

572-
<div class="note">
573-
574-
**Note:** In DML 1.4, `nothrow` is the default, and methods that
575-
*can* throw an exception must be explicitly declare that with
576-
a `throws` annotation.
577-
578-
</div>
572+
> [!NOTE]
573+
> In DML 1.4, `nothrow` is the default, and methods that
574+
> *can* throw an exception must be explicitly declare that with
575+
> a `throws` annotation.
579576
580577
### Default Methods
581578

doc/1.2/libraries.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,13 +1348,9 @@ validate\_port(conf\_object\_t \*obj, const char \*port) -> (bool valid)
13481348
Called before updating the value. If the return value is false,
13491349
the attribute assignment will fail.
13501350

1351-
<div class="note">
1352-
1353-
**Note:** `validate` should be used instead, since `validate_port` is removed
1354-
in DML 1.4.
1355-
1356-
</div>
1357-
1351+
> [!NOTE]
1352+
> `validate` should be used instead, since `validate_port` is removed
1353+
> in DML 1.4.
13581354
13591355
</dd><dt>
13601356

doc/1.4/language.md

Lines changed: 62 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,23 +1332,21 @@ Also note that a parameter declaration without definition is redundant if a
13321332
[typed parameter declaration](#typed-parameters) for that parameter already
13331333
exists, as that already enforces that the parameter must be defined.
13341334

1335-
<div class="note">
1336-
1337-
**Note:** You may see the following special form in some standard library files:
1338-
1339-
<pre>
1340-
param <em>name</em> auto;
1341-
</pre>
1342-
1343-
for example,
1344-
1345-
```
1346-
param parent auto;
1347-
```
1348-
1349-
This is used to explicitly declare the built-in automatic parameters,
1350-
and should never be used outside the libraries.
1351-
</div>
1335+
> [!NOTE]
1336+
> You may see the following special form in some standard library files:
1337+
>
1338+
> <pre>
1339+
> param <em>name</em> auto;
1340+
> </pre>
1341+
>
1342+
> for example,
1343+
>
1344+
> ```
1345+
> param parent auto;
1346+
> ```
1347+
>
1348+
> This is used to explicitly declare the built-in automatic parameters,
1349+
> and should never be used outside the libraries.
13521350
13531351
## Data types
13541352
@@ -1712,16 +1710,13 @@ handled:
17121710
* A method can only be overridden by another method if it is declared
17131711
`default`.
17141712
1715-
<div class="note">
1716-
1717-
**Note:** An overridable built-in method is defined by a template
1718-
named as the object type. So, if you want to write a template that
1719-
overrides the `read` method of a register, and want to make
1720-
your implementation overridable, then your template must explicitly
1721-
instantiate the `register` template using a statement `is
1722-
register;`.
1723-
1724-
</div>
1713+
> [!NOTE]
1714+
> An overridable built-in method is defined by a template
1715+
> named as the object type. So, if you want to write a template that
1716+
> overrides the `read` method of a register, and want to make
1717+
> your implementation overridable, then your template must explicitly
1718+
> instantiate the `register` template using a statement `is
1719+
> register;`.
17251720
17261721
### Calling Methods
17271722
@@ -1911,12 +1906,9 @@ session struct_t s = { .y = { .i = 2, ... }, ... }
19111906
Also unlike C, designator lists are not supported, and designated initializers
19121907
for arrays are not supported.
19131908
1914-
<div class="note">
1915-
1916-
**Note:** Previously `session` variables were known as `data`
1917-
variables.
1918-
1919-
</div>
1909+
> [!NOTE]
1910+
> Previously `session` variables were known as `data`
1911+
> variables.
19201912
19211913
## Saved variables
19221914
@@ -1970,14 +1962,11 @@ restricted to primitive data types, or structs or arrays containing
19701962
only data types that could be saved. Such types are called
19711963
[*serializable*](#serializable-types).
19721964
1973-
<div class="note">
1974-
1975-
**Note:** Saved variables are primarily intended for making checkpointable
1976-
state easier. For configuration, `attribute` objects should
1977-
be used instead. Additional data types for saved declarations are planned to
1978-
be supported.
1979-
1980-
</div>
1965+
> [!NOTE]
1966+
> Saved variables are primarily intended for making checkpointable
1967+
> state easier. For configuration, `attribute` objects should
1968+
> be used instead. Additional data types for saved declarations are planned to
1969+
> be supported.
19811970
19821971
## Hook Declarations
19831972
<pre>
@@ -2070,31 +2059,30 @@ arguments or return values. In fact, hook references are even
20702059
Two hook references of the same hook reference type can be compared for
20712060
equality, and are considered equal when they both reference the same hook.
20722061
2073-
<div class="note">
2074-
<b>Note:</b> Hooks have a notable shortcoming in their lack of configurability;
2075-
for example, there is no way to configure a hook to log an error when a message
2076-
is sent through the hook and there is no computation suspended on the hook to
2077-
act upon the message. Proper hook configurability is planned to be added by the
2078-
time or together with coroutines being introduced to DML. Until then, the
2079-
suggested approach is to create wrappers around usages of <tt>send_now()</tt>.
2080-
Hook reference types can be leveraged to cut down on the needed number of such
2081-
wrappers, for example:
2082-
<pre>
2083-
method send_now_checked_no_data(hook() h) {
2084-
local uint64 resumed = h.send_now();
2085-
if (resumed == 0) {
2086-
log error: "Unhandled message to hook";
2087-
}
2088-
}
2089-
2090-
method send_now_checked_int(hook(int) h, int x) {
2091-
local uint64 resumed = h.send_now(x);
2092-
if (resumed == 0) {
2093-
log error: "Unhandled message to hook";
2094-
}
2095-
}
2096-
</pre>
2097-
</div>
2062+
> [!NOTE]
2063+
> Hooks have a notable shortcoming in their lack of configurability;
2064+
> for example, there is no way to configure a hook to log an error when a message
2065+
> is sent through the hook and there is no computation suspended on the hook to
2066+
> act upon the message. Proper hook configurability is planned to be added by the
2067+
> time or together with coroutines being introduced to DML. Until then, the
2068+
> suggested approach is to create wrappers around usages of <tt>send_now()</tt>.
2069+
> Hook reference types can be leveraged to cut down on the needed number of such
2070+
> wrappers, for example:
2071+
> <pre>
2072+
> method send_now_checked_no_data(hook() h) {
2073+
> local uint64 resumed = h.send_now();
2074+
> if (resumed == 0) {
2075+
> log error: "Unhandled message to hook";
2076+
> }
2077+
> }
2078+
>
2079+
> method send_now_checked_int(hook(int) h, int x) {
2080+
> local uint64 resumed = h.send_now(x);
2081+
> if (resumed == 0) {
2082+
> log error: "Unhandled message to hook";
2083+
> }
2084+
> }
2085+
> </pre>
20982086
20992087
## Object Declarations
21002088
@@ -3504,13 +3492,10 @@ cancel all suspended method calls associated with an object through that
35043492
object's `cancel_after()` method, as provided by the [`object`
35053493
template](dml-builtins.html#object).
35063494
3507-
<div class="note">
3508-
3509-
**Note:** We plan to extend the `after` statement to allow for users to
3510-
explicitly state what objects the suspended method call is to be associated
3511-
with.
3512-
3513-
</div>
3495+
> [!NOTE]
3496+
> We plan to extend the `after` statement to allow for users to
3497+
> explicitly state what objects the suspended method call is to be associated
3498+
> with.
35143499
35153500
#### After Delay Statements
35163501
<pre>
@@ -3913,13 +3898,10 @@ the selected case.
39133898
DML currently only supports `#select` iteration on [compile-time list
39143899
constants](#list-expressions).
39153900
3916-
<div class="note">
3917-
3918-
**Note:** The `select` statement has been temporarily removed from DML 1.4 due
3919-
to semantic issues, and only the `#select` form may currently be used.
3920-
The `select` statement will be reintroduced in the near future.
3921-
3922-
</div>
3901+
> [!NOTE]
3902+
> The `select` statement has been temporarily removed from DML 1.4 due
3903+
> to semantic issues, and only the `#select` form may currently be used.
3904+
> The `select` statement will be reintroduced in the near future.
39233905
39243906
### #if and #else Statements
39253907
<a id="if-else-statements"/>

doc/1.4/port-dml.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@ applied. The `port-dml` will detect this and emit a warning.
6363
You can choose to either port the code manually, or perform an analysis of
6464
an additional device that does use the code, and append that to the tagfile.
6565

66-
<div class="note">
67-
68-
**Note:** The `port-dml` script might fail because of a bug in the
69-
script. When this kind of bug is encountered, the script will normally
70-
print a traceback and point out a line in the tag file that it failed
71-
to apply; you can get further in your conversion by manually removing
72-
this line and re-running the script. After the script has succeeded,
73-
you can look up the failed tags in the [list of porting
74-
tags](changes-auto.html) and apply the change manually.
66+
> [!NOTE]
67+
> The `port-dml` script might fail because of a bug in the
68+
> script. When this kind of bug is encountered, the script will normally
69+
> print a traceback and point out a line in the tag file that it failed
70+
> to apply; you can get further in your conversion by manually removing
71+
> this line and re-running the script. After the script has succeeded,
72+
> you can look up the failed tags in the [list of porting
73+
> tags](changes-auto.html) and apply the change manually.
7574
7675
</div>
7776

lib/1.4/dml-builtins.dml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,14 @@ side-effects within `destroy()` such as logging will not be visible upon
449449
program exit unless deletion is explicitly performed beforehand &mdash; hence
450450
why `destroy` should *only* be used to ensure resources get cleaned up.
451451

452-
<div class="note">
453-
454-
**Note:** the `destroy` template can't be instantiated for
455-
`event` objects. This is because `event` objects, through the
456-
`custom_time_event` or `custom_cycle_event` template, may already require
457-
defining a method named `destroy` whose purpose is different from the one
458-
required by the `destroy` template. To work around this limitation, you may
459-
declare a `group` within the `event` object that instantiates the `destroy`
460-
template instead.
461-
462-
</div>
452+
> [!NOTE]
453+
> the `destroy` template can't be instantiated for
454+
> `event` objects. This is because `event` objects, through the
455+
> `custom_time_event` or `custom_cycle_event` template, may already require
456+
> defining a method named `destroy` whose purpose is different from the one
457+
> required by the `destroy` template. To work around this limitation, you may
458+
> declare a `group` within the `event` object that instantiates the `destroy`
459+
> template instead.
463460
*/
464461
template destroy {
465462
param _each_destroy : sequence(destroy);
@@ -1463,19 +1460,16 @@ a private helper object.
14631460
The `init_as_subobj` template accepts one parameter,
14641461
`classname`. This defines the class of the automatically created object.
14651462

1466-
<div class="note">
1467-
1468-
**Note:** The subobject class defined by the `classname` parameter is looked up
1469-
using `SIM_get_class` while the module of the device class is being
1470-
loaded.
1471-
This may cause problems if the subobject class is defined within the
1472-
same module as the device class:
1473-
if the device class is defined before the subobject class, then the subobject
1474-
class will not yet be defined, and the `SIM_get_class` call will fail.
1475-
This problem can be resolved by moving the subobject class to
1476-
a separate module.
1477-
1478-
</div>
1463+
> [!NOTE]
1464+
> The subobject class defined by the `classname` parameter is looked up
1465+
> using `SIM_get_class` while the module of the device class is being
1466+
> loaded.
1467+
> This may cause problems if the subobject class is defined within the
1468+
> same module as the device class:
1469+
> if the device class is defined before the subobject class, then the subobject
1470+
> class will not yet be defined, and the `SIM_get_class` call will fail.
1471+
> This problem can be resolved by moving the subobject class to
1472+
> a separate module.
14791473

14801474
The template also overrides the `configuration` parameter to
14811475
`"none"` by default, which makes the connect invisible to the end-user.

0 commit comments

Comments
 (0)