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

rokucommunity / brighterscript / #11418

08 Jan 2024 02:59PM UTC coverage: 88.089% (+0.02%) from 88.072%
#11418

push

web-flow
Prevent publishing of empty files (#997)

* Added file exclusion for empty files

* Added unit tests

* address comments

* fix unit tests for windows

* change use of verb from publish to prune and invert logic

* ensure uriAttributeValue is a string

* add test case for empty brs file

* Apply suggestions from code review

---------

Co-authored-by: Bronley Plumb <bronley@gmail.com>

5752 of 7005 branches covered (0.0%)

Branch coverage included in aggregate %.

8610 of 9299 relevant lines covered (92.59%)

1657.91 hits per line

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

58.33
/src/lexer/Token.ts
1
import { TokenKind } from './TokenKind';
1✔
2
import type { Range } from 'vscode-languageserver';
3

4
/**
5
 * Represents a chunk of BrightScript scanned by the lexer.
6
 */
7
export interface Token {
8
    /** The type of token this represents. */
9
    kind: TokenKind;
10
    /** The text found in the original BrightScript source, if any. */
11
    text: string;
12
    /** True if this token's `text` is a reserved word, otherwise `false`. */
13
    isReserved?: boolean;
14
    /** Where the token was found. */
15
    range: Range;
16
    /**
17
     * Any leading whitespace found prior to this token. Excludes newline characters.
18
     */
19
    leadingWhitespace?: string;
20
}
21

22
/**
23
 * Any object that has a range
24
 */
25
export interface Locatable {
26
    range: Range;
27
    [key: string]: any;
28
}
29

30
/**
31
 * Represents an identifier as scanned by the lexer.
32
 */
33
export interface Identifier extends Token {
34
    kind: TokenKind.Identifier;
35
}
36

37
/**
38
 * Determines whether or not `obj` is a `Token`.
39
 * @param obj the object to check for `Token`-ness
40
 * @returns `true` is `obj` is a `Token`, otherwise `false`
41
 */
42
export function isToken(obj: Record<string, any>): obj is Token {
1✔
43
    return !!(obj.kind && obj.text && obj.range);
1,601✔
44
}
45

46
/**
47
 * Is this a token that has the `TokenKind.Identifier` kind?
48
 */
49
export function isIdentifier(obj: any): obj is Identifier {
1✔
50
    return obj?.kind === TokenKind.Identifier;
×
51
}
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

© 2025 Coveralls, Inc