Fix java commenting issues
This commit is contained in:
parent
35a370626f
commit
73e2f15232
@ -35,20 +35,20 @@ public class Java implements ProgrammingLanguage {
|
||||
|
||||
private static final Map<Pattern, String> pattern =
|
||||
Map.ofEntries(
|
||||
e("\"([^\"\\\\]|\\\\.)*\"", "string"),
|
||||
e("\\bthis\\b", "this"),
|
||||
e("\\btrue\\b", "true"),
|
||||
e("\\bfalse\\b", "false"),
|
||||
e("(?<=\\.?)\\w+(?=\\()", "method"),
|
||||
e("\\(|\\)", "paranthesis"),
|
||||
e("\\{|\\}", "curlyBrackets"),
|
||||
e("\\[|\\]", "squareBrackets"),
|
||||
e(";", "semicolon"),
|
||||
e("\\.\\w+\\b(?!\\()", "property"),
|
||||
e("\\b[A-Z]\\w+\\b", "identifier"),
|
||||
e("\"([^\"\\\\]|\\\\.)*\"", "string"),
|
||||
e("\\bthis\\b", "this"),
|
||||
e("\\btrue\\b", "true"),
|
||||
e("\\bfalse\\b", "false"),
|
||||
e("(?<=\\.?)\\w+(?=\\()", "method"),
|
||||
e("\\(|\\)", "paranthesis"),
|
||||
e("\\{|\\}", "curlyBrackets"),
|
||||
e("\\[|\\]", "squareBrackets"),
|
||||
e(";", "semicolon"),
|
||||
e("\\.\\w+\\b(?!\\()", "property"),
|
||||
e("\\b[A-Z]\\w+\\b", "identifier"),
|
||||
e("\\b(" + String.join("|", keywords) + ")\\b",
|
||||
"keyword"),
|
||||
e("(?://.*)|/\\*(?:\\n|.)*\\*/", "comment")
|
||||
"keyword"),
|
||||
e("(?://.*)|/\\*(?:\\n|.)*?\\*/", "comment")
|
||||
);
|
||||
|
||||
public String getName() {
|
||||
@ -113,8 +113,7 @@ public class Java implements ProgrammingLanguage {
|
||||
lines.length < 2 ||
|
||||
Arrays.asList(Arrays.copyOfRange(lines, 1, lines.length - 1))
|
||||
.stream()
|
||||
.map(l -> l.startsWith(" * "))
|
||||
.allMatch(b -> b);
|
||||
.allMatch(l -> l.startsWith(" * "));
|
||||
|
||||
return
|
||||
Stream.of(
|
||||
|
Loading…
Reference in New Issue
Block a user