• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Camelcade / Perl5-IDEA / #525521567

03 Jun 2025 07:42AM UTC coverage: 82.347% (+0.008%) from 82.339%
#525521567

push

github

hurricup
Localization Perl plugin

4 of 11 new or added lines in 5 files covered. (36.36%)

96 existing lines in 21 files now uncovered.

30852 of 37466 relevant lines covered (82.35%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.74
/mason/framework/src/main/java/com/perl5/lang/perl/parser/MasonParserUtil.java
1
/*
2
 * Copyright 2015-2025 Alexandr Evstigneev
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.perl5.lang.perl.parser;
18

19
import com.intellij.lang.PsiBuilder;
20
import com.intellij.lang.parser.GeneratedParserUtilBase;
21
import com.intellij.openapi.util.NlsContexts;
22
import com.intellij.psi.tree.IElementType;
23
import com.perl5.lang.MasonFrameworkBundle;
24
import org.jetbrains.annotations.NotNull;
25

26

UNCOV
27
public class MasonParserUtil {
×
28

29
  public static boolean parsePerlBlock(@NotNull PsiBuilder b, int l, @NotNull IElementType closeToken, @NotNull IElementType blockToken) {
30
    PsiBuilder.Marker abstractBlockMarker = b.mark();
1✔
31
    b.advanceLexer();
1✔
32

33
    while (!b.eof() && b.getTokenType() != closeToken) {
1✔
34
      if (!PerlParserProxy.file_item(b, l)) {
1✔
35
        break;
1✔
36
      }
37
    }
38
    boolean r = endOrRecover(b, closeToken);
1✔
39
    abstractBlockMarker.done(blockToken);
1✔
40
    return r;
1✔
41
  }
42

43
  public static boolean endOrRecover(@NotNull PsiBuilder b, @NotNull IElementType toElement) {
44
    return endOrRecover(b, toElement, MasonFrameworkBundle.message("parsing.error.error"));
1✔
45
  }
46

47
  public static boolean endOrRecover(@NotNull PsiBuilder b,
48
                                     @NotNull IElementType toElement,
49
                                     @NlsContexts.ParsingError @NotNull String errorMessage) {
50
    return GeneratedParserUtilBase.consumeToken(b, toElement) || recoverToGreedy(b, toElement, errorMessage);
1✔
51
  }
52

53
  public static boolean recoverToGreedy(@NotNull PsiBuilder b,
54
                                        @NotNull IElementType toElement,
55
                                        @NlsContexts.ParsingError @NotNull String errorMessage) {
56
    boolean r = recoverTo(b, toElement, errorMessage);
1✔
57
    r = r || GeneratedParserUtilBase.consumeToken(b, toElement);
1✔
58
    return r;
1✔
59
  }
60

61
  public static boolean recoverTo(@NotNull PsiBuilder b, @NotNull IElementType toElement,
62
                                  @NlsContexts.ParsingError @NotNull String errorMessage) {
63
    // recover bad code
64
    PsiBuilder.Marker errorMarker = b.mark();
1✔
65
    while (!b.eof() && b.getTokenType() != toElement) {
1✔
66
      b.advanceLexer();
1✔
67
    }
68
    errorMarker.error(errorMessage);
1✔
69
    return b.eof();
1✔
70
  }
71
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc