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

rokucommunity / brighterscript / #12196

17 Apr 2024 07:54PM UTC coverage: 87.919% (-0.6%) from 88.473%
#12196

push

web-flow
Upgrade to @rokucommunity/logger (#1137)

* Upgrade to @rokucommunity/logger

* Add original logger class back

* @rokucommunity/logger v0.3.4

6020 of 7320 branches covered (82.24%)

Branch coverage included in aggregate %.

29 of 29 new or added lines in 10 files covered. (100.0%)

54 existing lines in 1 file now uncovered.

8775 of 9508 relevant lines covered (92.29%)

1742.83 hits per line

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

54.55
/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: any): obj is Token {
1✔
43
    return !!(obj.kind && obj.text);
1,685✔
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