Improvements to the lezer grammar for BibTeX GitOrigin-RevId: 33ece6f3c6a34380aa7b2a46ff624aff3ccf8a10
22 lines
412 B
JavaScript
22 lines
412 B
JavaScript
import {
|
|
stringKeyword,
|
|
preambleKeyword,
|
|
commentKeyword,
|
|
} from './bibtex.terms.mjs'
|
|
|
|
/**
|
|
* @param {string} identifier
|
|
*/
|
|
export function specializeEntryType(identifier) {
|
|
const lowercased = identifier.toLowerCase()
|
|
switch (lowercased) {
|
|
case 'string':
|
|
return stringKeyword
|
|
case 'preamble':
|
|
return preambleKeyword
|
|
case 'comment':
|
|
return commentKeyword
|
|
}
|
|
return -1
|
|
}
|