tokens.mjs 412 B

123456789101112131415161718192021
  1. import {
  2. stringKeyword,
  3. preambleKeyword,
  4. commentKeyword,
  5. } from './bibtex.terms.mjs'
  6. /**
  7. * @param {string} identifier
  8. */
  9. export function specializeEntryType(identifier) {
  10. const lowercased = identifier.toLowerCase()
  11. switch (lowercased) {
  12. case 'string':
  13. return stringKeyword
  14. case 'preamble':
  15. return preambleKeyword
  16. case 'comment':
  17. return commentKeyword
  18. }
  19. return -1
  20. }