Skip to content

Commit 0fdd19f

Browse files
authored
Fix README code block language highlighting
1 parent bfad44c commit 0fdd19f

File tree

1 file changed

+67
-63
lines changed

1 file changed

+67
-63
lines changed

README.md

+67-63
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,28 @@ For more information, see the [Reflection Framework](https://github.com/mstrobel
2121

2222
#### Example
2323

24-
:::java
25-
final Type<Map> map = Type.of(Map.class);
26-
final Type<?> rawMap = map.getErasedType();
27-
final Type<Map<String, Integer>> boundMap = map.makeGenericType(Types.String, Types.Integer);
28-
29-
System.out.println(map.getDeclaredMethods().get(1));
30-
System.out.println(rawMap.getDeclaredMethods().get(1));
31-
System.out.println(boundMap.getDeclaredMethods().get(1));
32-
33-
System.out.println(boundMap.getGenericTypeParameters());
34-
System.out.println(boundMap.getTypeArguments());
24+
```java
25+
final Type<Map> map = Type.of(Map.class);
26+
final Type<?> rawMap = map.getErasedType();
27+
final Type<Map<String, Integer>> boundMap = map.makeGenericType(Types.String, Types.Integer);
28+
29+
System.out.println(map.getDeclaredMethods().get(1));
30+
System.out.println(rawMap.getDeclaredMethods().get(1));
31+
System.out.println(boundMap.getDeclaredMethods().get(1));
32+
33+
System.out.println(boundMap.getGenericTypeParameters());
34+
System.out.println(boundMap.getTypeArguments());
35+
```
3536

3637
#### Output
3738

38-
:::text
39-
public abstract V put(K, V)
40-
public abstract Object put(Object, Object)
41-
public abstract Integer put(String, Integer)
42-
[K, V]
43-
[java.lang.String, java.lang.Integer]
39+
```text
40+
public abstract V put(K, V)
41+
public abstract Object put(Object, Object)
42+
public abstract Integer put(String, Integer)
43+
[K, V]
44+
[java.lang.String, java.lang.Integer]
45+
```
4446

4547
### Expressions Framework
4648

@@ -53,56 +55,58 @@ almost a direct port of `System.Linq.Expressions` from .NET's Dynamic Language R
5355
minus the dynamic callsite support (and with more relaxed rules regarding type conversions).
5456

5557
#### Example
56-
:::java
57-
//
58-
// This lambda closes over a complex constant (a String array).
59-
//
60-
61-
final ConstantExpression items = constant(
62-
new String[] { "one", "two", "three", "four", "five" }
63-
);
64-
65-
//
66-
// If written in Java, the constructed expression would look something like this:
67-
//
68-
// () -> {
69-
// for (String item : <closure>items)
70-
// System.out.printf("Got item: %s\n", item);
71-
// }
72-
//
73-
74-
final ParameterExpression item = variable(Types.String, "item");
75-
76-
final LambdaExpression<Runnable> runnable = lambda(
77-
Type.of(Runnable.class),
78-
forEach(
79-
item,
80-
items,
81-
call(
82-
field(null, Types.System.getField("out")),
83-
"printf",
84-
constant("Got item: %s\n"),
85-
item
86-
)
58+
```java
59+
//
60+
// This lambda closes over a complex constant (a String array).
61+
//
62+
63+
final ConstantExpression items = constant(
64+
new String[] { "one", "two", "three", "four", "five" }
65+
);
66+
67+
//
68+
// If written in Java, the constructed expression would look something like this:
69+
//
70+
// () -> {
71+
// for (String item : <closure>items)
72+
// System.out.printf("Got item: %s\n", item);
73+
// }
74+
//
75+
76+
final ParameterExpression item = variable(Types.String, "item");
77+
78+
final LambdaExpression<Runnable> runnable = lambda(
79+
Type.of(Runnable.class),
80+
forEach(
81+
item,
82+
items,
83+
call(
84+
field(null, Types.System.getField("out")),
85+
"printf",
86+
constant("Got item: %s\n"),
87+
item
8788
)
88-
);
89-
90-
System.out.println(runnable);
91-
92-
final Runnable delegate = runnable.compile();
89+
)
90+
);
91+
92+
System.out.println(runnable);
93+
94+
final Runnable delegate = runnable.compile();
9395

94-
delegate.run();
96+
delegate.run();
97+
```
9598

9699
#### Output
97-
:::text
98-
() => for (String item : [one, two, three, four, five])
99-
System.out.printf("Got item: %s\n", new Object[] { item })
100-
101-
Got item: one
102-
Got item: two
103-
Got item: three
104-
Got item: four
105-
Got item: five
100+
```text
101+
() => for (String item : [one, two, three, four, five])
102+
System.out.printf("Got item: %s\n", new Object[] { item })
103+
104+
Got item: one
105+
Got item: two
106+
Got item: three
107+
Got item: four
108+
Got item: five
109+
```
106110

107111
### Compiler Toolset
108112

0 commit comments

Comments
 (0)