Skip to content

Commit 7c66769

Browse files
committed
Docs: Drop inline callouts from painless book (#40805)
Drops the inline callouts from the painless reference book. These callouts are incompatible with Asciidoctor and we'd very much like to switch to Asciidoctor for building this book, partially because Asciidoctor is actively developed and AsciiDoc is not, and partially because it builds the book three times faster.
1 parent 40dd85f commit 7c66769

9 files changed

+487
-487
lines changed

docs/painless/painless-casting.asciidoc

+48-48
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ cast: '(' TYPE ')' expression
2828
+
2929
[source,Painless]
3030
----
31-
<1> int i = (int)5L;
32-
<2> Map m = new HashMap();
33-
<3> HashMap hm = (HashMap)m;
31+
int i = (int)5L; <1>
32+
Map m = new HashMap(); <2>
33+
HashMap hm = (HashMap)m; <3>
3434
----
3535
+
3636
<1> declare `int i`;
@@ -75,10 +75,10 @@ following table:
7575
+
7676
[source,Painless]
7777
----
78-
<1> int a = 1;
79-
<2> long b = a;
80-
<3> short c = (short)b;
81-
<4> double e = (double)a;
78+
int a = 1; <1>
79+
long b = a; <2>
80+
short c = (short)b; <3>
81+
double e = (double)a; <4>
8282
----
8383
+
8484
<1> declare `int a`;
@@ -101,9 +101,9 @@ following table:
101101
+
102102
[source,Painless]
103103
----
104-
<1> int a = 1.0; // error
105-
<2> int b = 2;
106-
<3> byte c = b; // error
104+
int a = 1.0; // error <1>
105+
int b = 2; <2>
106+
byte c = b; // error <3>
107107
----
108108
+
109109
<1> declare `int i`;
@@ -132,11 +132,11 @@ or the target type is a descendant of the original type.
132132
+
133133
[source,Painless]
134134
----
135-
<1> List x;
136-
<2> ArrayList y = new ArrayList();
137-
<3> x = y;
138-
<4> y = (ArrayList)x;
139-
<5> x = (List)y;
135+
List x; <1>
136+
ArrayList y = new ArrayList(); <2>
137+
x = y; <3>
138+
y = (ArrayList)x; <4>
139+
x = (List)y; <5>
140140
----
141141
+
142142
<1> declare `List x`;
@@ -161,9 +161,9 @@ or the target type is a descendant of the original type.
161161
+
162162
[source,Painless]
163163
----
164-
<1> List x = new ArrayList();
165-
<2> ArrayList y = x; // error
166-
<3> Map m = (Map)x; // error
164+
List x = new ArrayList(); <1>
165+
ArrayList y = x; // error <2>
166+
Map m = (Map)x; // error <3>
167167
----
168168
+
169169
<1> declare `List x`;
@@ -201,11 +201,11 @@ based on the current type value the `def` type value represents.
201201
+
202202
[source,Painless]
203203
----
204-
<1> def d0 = 3;
205-
<2> d0 = new ArrayList();
206-
<3> Object o = new HashMap();
207-
<4> def d1 = o;
208-
<5> int i = d1.size();
204+
def d0 = 3; <1>
205+
d0 = new ArrayList(); <2>
206+
Object o = new HashMap(); <3>
207+
def d1 = o; <4>
208+
int i = d1.size(); <5>
209209
----
210210
+
211211
<1> declare `def d0`;
@@ -236,12 +236,12 @@ based on the current type value the `def` type value represents.
236236
+
237237
[source,Painless]
238238
----
239-
<1> def d = 1.0;
240-
<2> int i = (int)d;
241-
<3> d = 1;
242-
<4> float f = d;
243-
<5> d = new ArrayList();
244-
<6> List l = d;
239+
def d = 1.0; <1>
240+
int i = (int)d; <2>
241+
d = 1; <3>
242+
float f = d; <4>
243+
d = new ArrayList(); <5>
244+
List l = d; <6>
245245
----
246246
+
247247
<1> declare `def d`;
@@ -274,10 +274,10 @@ based on the current type value the `def` type value represents.
274274
+
275275
[source,Painless]
276276
----
277-
<1> def d = 1;
278-
<2> short s = d; // error
279-
<3> d = new HashMap();
280-
<4> List l = d; // error
277+
def d = 1; <1>
278+
short s = d; // error <2>
279+
d = new HashMap(); <3>
280+
List l = d; // error <4>
281281
----
282282
<1> declare `def d`;
283283
implicit cast `int 1` to `def` -> `def`;
@@ -314,8 +314,8 @@ Use the cast operator to convert a <<string-type, `String` type>> value into a
314314
+
315315
[source,Painless]
316316
----
317-
<1> char c = (char)"C";
318-
<2> c = (char)'c';
317+
char c = (char)"C"; <1>
318+
c = (char)'c'; <2>
319319
----
320320
+
321321
<1> declare `char c`;
@@ -328,8 +328,8 @@ Use the cast operator to convert a <<string-type, `String` type>> value into a
328328
+
329329
[source,Painless]
330330
----
331-
<1> String s = "s";
332-
<2> char c = (char)s;
331+
String s = "s"; <1>
332+
char c = (char)s; <2>
333333
----
334334
<1> declare `String s`;
335335
store `String "s"` to `s`;
@@ -368,10 +368,10 @@ value and vice versa.
368368
+
369369
[source,Painless]
370370
----
371-
<1> List l = new ArrayList();
372-
<2> l.add(1);
373-
<3> Integer I = Integer.valueOf(0);
374-
<4> int i = l.get(i);
371+
List l = new ArrayList(); <1>
372+
l.add(1); <2>
373+
Integer I = Integer.valueOf(0); <3>
374+
int i = l.get(i); <4>
375375
----
376376
+
377377
<1> declare `List l`;
@@ -399,10 +399,10 @@ value and vice versa.
399399
+
400400
[source,Painless]
401401
----
402-
<1> Integer x = 1; // error
403-
<2> Integer y = (Integer)1; // error
404-
<3> int a = Integer.valueOf(1); // error
405-
<4> int b = (int)Integer.valueOf(1); // error
402+
Integer x = 1; // error <1>
403+
Integer y = (Integer)1; // error <2>
404+
int a = Integer.valueOf(1); // error <3>
405+
int b = (int)Integer.valueOf(1); // error <4>
406406
----
407407
+
408408
<1> declare `Integer x`;
@@ -437,9 +437,9 @@ based on the type the `def` value represents.
437437
+
438438
[source,Painless]
439439
----
440-
<1> double d = 2 + 2.0;
441-
<2> def x = 1;
442-
<3> float f = x + 2.0F;
440+
double d = 2 + 2.0; <1>
441+
def x = 1; <2>
442+
float f = x + 2.0F; <3>
443443
----
444444
<1> declare `double d`;
445445
promote `int 2` and `double 2.0 @0`: result `double`;

docs/painless/painless-literals.asciidoc

+11-11
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ HEX: '-'? '0' [xX] [0-9a-fA-F]+ [lL]?;
3030
+
3131
[source,Painless]
3232
----
33-
<1> 0
34-
<2> 0D
35-
<3> 1234L
36-
<4> -90f
37-
<5> -022
38-
<6> 0xF2A
33+
0 <1>
34+
0D <2>
35+
1234L <3>
36+
-90f <4>
37+
-022 <5>
38+
0xF2A <6>
3939
----
4040
+
4141
<1> `int 0`
@@ -67,11 +67,11 @@ EXPONENT: ( [eE] [+\-]? [0-9]+ );
6767
+
6868
[source,Painless]
6969
----
70-
<1> 0.0
71-
<2> 1E6
72-
<3> 0.977777
73-
<4> -126.34
74-
<5> 89.9F
70+
0.0 <1>
71+
1E6 <2>
72+
0.977777 <3>
73+
-126.34 <4>
74+
89.9F <5>
7575
----
7676
+
7777
<1> `double 0.0`

docs/painless/painless-operators-array.asciidoc

+28-28
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ expression_list: expression (',' expression);
2929
+
3030
[source,Painless]
3131
----
32-
<1> int[] x = new int[] {1, 2, 3};
32+
int[] x = new int[] {1, 2, 3}; <1>
3333
----
3434
+
3535
<1> declare `int[] x`;
@@ -44,12 +44,12 @@ expression_list: expression (',' expression);
4444
+
4545
[source,Painless]
4646
----
47-
<1> int i = 1;
48-
<2> long l = 2L;
49-
<3> float f = 3.0F;
50-
<4> double d = 4.0;
51-
<5> String s = "5";
52-
<6> def array = new def[] {i, l, f*d, s};
47+
int i = 1; <1>
48+
long l = 2L; <2>
49+
float f = 3.0F; <3>
50+
double d = 4.0; <4>
51+
String s = "5"; <5>
52+
def array = new def[] {i, l, f*d, s}; <6>
5353
----
5454
+
5555
<1> declare `int i`;
@@ -114,12 +114,12 @@ brace_access: '[' expression ']'
114114
+
115115
[source,Painless]
116116
----
117-
<1> int[] x = new int[2];
118-
<2> x[0] = 2;
119-
<3> x[1] = 5;
120-
<4> int y = x[0] + x[1];
121-
<5> int z = 1;
122-
<6> int i = x[z];
117+
int[] x = new int[2]; <1>
118+
x[0] = 2; <2>
119+
x[1] = 5; <3>
120+
int y = x[0] + x[1]; <4>
121+
int z = 1; <5>
122+
int i = x[z]; <6>
123123
----
124124
+
125125
<1> declare `int[] x`;
@@ -149,12 +149,12 @@ brace_access: '[' expression ']'
149149
+
150150
[source,Painless]
151151
----
152-
<1> def d = new int[2];
153-
<2> d[0] = 2;
154-
<3> d[1] = 5;
155-
<4> def x = d[0] + d[1];
156-
<5> def y = 1;
157-
<6> def z = d[y];
152+
def d = new int[2]; <1>
153+
d[0] = 2; <2>
154+
d[1] = 5; <3>
155+
def x = d[0] + d[1]; <4>
156+
def y = 1; <5>
157+
def z = d[y]; <6>
158158
----
159159
+
160160
<1> declare `def d`;
@@ -199,9 +199,9 @@ brace_access: '[' expression ']'
199199
+
200200
[source,Painless]
201201
----
202-
<1> int[][][] ia3 = new int[2][3][4];
203-
<2> ia3[1][2][3] = 99;
204-
<3> int i = ia3[1][2][3];
202+
int[][][] ia3 = new int[2][3][4]; <1>
203+
ia3[1][2][3] = 99; <2>
204+
int i = ia3[1][2][3]; <3>
205205
----
206206
+
207207
<1> declare `int[][][] ia`;
@@ -230,8 +230,8 @@ from an array type value.
230230
+
231231
[source,Painless]
232232
----
233-
<1> int[] x = new int[10];
234-
<2> int l = x.length;
233+
int[] x = new int[10]; <1>
234+
int l = x.length; <2>
235235
----
236236
<1> declare `int[] x`;
237237
allocate `1-d int array` instance with `length [2]`
@@ -269,10 +269,10 @@ new_array: 'new' TYPE ('[' expression ']')+;
269269
+
270270
[source,Painless]
271271
----
272-
<1> int[] x = new int[5];
273-
<2> x = new int[10];
274-
<3> int y = 2;
275-
<4> def z = new def[y][y*2];
272+
int[] x = new int[5]; <1>
273+
x = new int[10]; <2>
274+
int y = 2; <3>
275+
def z = new def[y][y*2]; <4>
276276
----
277277
+
278278
<1> declare `int[] x`;

0 commit comments

Comments
 (0)