1
0

test02.spec.js 594 B

123456789101112131415161718192021222324252627282930
  1. import Lexers from './../grammar/';
  2. import {
  3. IVProgParser
  4. } from './../js/ast/ivprogParser';
  5. import { LanguageService } from './../js/services/languageService';
  6. describe('Legal newline syntax', () => {
  7. const input = `programa
  8. {
  9. const inteiro val = 5
  10. funcao p (
  11. inteiro a,
  12. inteiro b
  13. )
  14. {
  15. teste = a + b
  16. }
  17. }
  18. `;
  19. const lexer = LanguageService.getCurrentLexer();
  20. it(`should not result in SyntaxError`, () => {
  21. const as = new IVProgParser(input, lexer);
  22. const fun = as.parseTree.bind(as);
  23. expect(fun).not.toThrow();
  24. });
  25. });