test04.spec.js 654 B

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