test01.spec.js 532 B

1234567891011121314151617181920212223
  1. import Lexers from './../grammar/';
  2. import { IVProgParser } from './../js/ast/ivprogParser';
  3. import { LanguageService } from './../js/services/languageService';
  4. describe('Illegal newline syntax', () => {
  5. const input = `programa
  6. {
  7. const
  8. inteiro a = 1, b
  9. real
  10. PI = 5.6, c;
  11. }
  12. `;
  13. const lexer = LanguageService.getCurrentLexer();
  14. it(`should result in SyntaxError`, () => {
  15. const as = new IVProgParser(input, lexer);
  16. const fun = as.parseTree.bind(as);
  17. expect(fun).toThrow();
  18. });
  19. });