test04.spec.js 680 B

12345678910111213141516171819202122232425262728
  1. import Lexers from './../grammar/';
  2. import {
  3. IVProgParser
  4. } from './../js/ast/ivprogParser';
  5. import { LanguageService } from '../js/services/languageService';
  6. describe('Literal arrays that have more than 2 dimensions', () => {
  7. let input = `programa {
  8. const inteiro a[1][1] = {
  9. {
  10. {1,2},
  11. {3,4}
  12. }
  13. }
  14. funcao inicio() {
  15. retorna
  16. }
  17. }`;
  18. const lexer = LanguageService.getCurrentLexer();
  19. it(`should result in SyntaxError`, () => {
  20. const as = new IVProgParser(input, lexer);
  21. const fun = as.parseTree.bind(as);
  22. expect(fun).toThrow();
  23. });
  24. });