lang.js 781 B

123456789101112131415161718192021222324252627282930313233
  1. import { Comma, String as StringToken, Ident, RightParenthesis } from '../../tokenizer/index.js';
  2. export function parseLanguageRangeList() {
  3. const children = this.createList();
  4. this.skipSC();
  5. loop: while (!this.eof) {
  6. switch (this.tokenType) {
  7. case Ident:
  8. children.push(this.Identifier());
  9. break;
  10. case StringToken:
  11. children.push(this.String());
  12. break;
  13. case Comma:
  14. children.push(this.Operator());
  15. break;
  16. case RightParenthesis:
  17. break loop;
  18. default:
  19. this.error('Identifier, string or comma is expected');
  20. }
  21. this.skipSC();
  22. }
  23. return children;
  24. }