Skip to content

Commit

Permalink
Java: Added missing :: operator (#2101)
Browse files Browse the repository at this point in the history
This adds the `::` operator and removes the backreference for better performance.
  • Loading branch information
RunDevelopment authored Oct 25, 2019
1 parent 2108c60 commit ee7fdbe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/prism-java.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
'operator': {
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|([-+&|])\2|[?:~]|[-+*/%&|^!=<>]=?)/m,
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
lookbehind: true
}
});
Expand Down
2 changes: 1 addition & 1 deletion components/prism-java.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions tests/languages/java/function_featrue.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ Bar::foo;
["punctuation", ";"],

["class-name", "Bar"],
["operator", ":"],
["operator", ":"],
["operator", "::"],
["function", "foo"],
["punctuation", ";"]
]
Expand Down
4 changes: 2 additions & 2 deletions tests/languages/java/operator_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* *=
/ /=
% %=
->
-> ::

----------------------------------------------------

Expand All @@ -29,7 +29,7 @@
["operator", "*"], ["operator", "*="],
["operator", "/"], ["operator", "/="],
["operator", "%"], ["operator", "%="],
["operator", "->"]
["operator", "->"], ["operator", "::"]
]

----------------------------------------------------
Expand Down

0 comments on commit ee7fdbe

Please sign in to comment.