Skip to content

Commit 367ace6

Browse files
committed
1)Adding annotation token for Java
2)Aliasing java annotation to punctuation 3)Aliasing grovy annotation to punctuation 4)Adding in sample code
1 parent 9c1a970 commit 367ace6

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

components/prism-groovy.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Prism.languages.insertBefore('groovy', 'punctuation', {
2222

2323
Prism.languages.insertBefore('groovy', 'function', {
2424
'annotation': {
25+
alias: 'punctuation',
2526
pattern: /(^|[^.])@\w+/,
2627
lookbehind: true
2728
}

components/prism-groovy.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-java.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ Prism.languages.java = Prism.languages.extend('clike', {
55
pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,
66
lookbehind: true
77
}
8-
});
8+
});
9+
10+
Prism.languages.insertBefore('java','function', {
11+
'annotation': {
12+
alias: 'punctuation',
13+
pattern: /(^|[^.])@\w+/,
14+
lookbehind: true
15+
}
16+
});

components/prism-java.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/prism-java.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ <h2>Full example</h2>
2525
<pre><code>import java.util.Scanner;
2626

2727
public class Life {
28-
public static void show(boolean[][] grid){
28+
29+
@Override @Bind("One")
30+
public void show(boolean[][] grid){
2931
String s = "";
3032
for(boolean[] row : grid){
3133
for(boolean val : row)
@@ -73,4 +75,4 @@ <h2>Known failures</h2>
7375
</p>
7476

7577
<h3>Comment-like substrings</h3>
76-
<pre><code>"foo /* bar */ baz"; "foo // bar";</code></pre>
78+
<pre><code>"foo /* bar */ baz"; "foo // bar";</code></pre>

0 commit comments

Comments
 (0)