-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathgedcom.js
37 lines (36 loc) · 984 Bytes
/
gedcom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// @ts-nocheck
gedcom.displayName = 'gedcom'
gedcom.aliases = []
/** @type {import('../core.js').Syntax} */
export default function gedcom(Prism) {
Prism.languages.gedcom = {
'line-value': {
// Preceded by level, optional pointer, and tag
pattern:
/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,
lookbehind: true,
inside: {
pointer: {
pattern: /^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,
alias: 'variable'
}
}
},
record: {
// Preceded by level and optional pointer
pattern:
/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,
lookbehind: true,
alias: 'tag'
},
level: {
pattern: /(^[\t ]*)\d+/m,
lookbehind: true,
alias: 'number'
},
pointer: {
pattern: /@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,
alias: 'variable'
}
}
}