test03.spec.js 603 B

123456789101112131415161718192021
  1. import {
  2. IVProgParser
  3. } from './../js/ast/ivprogParser';
  4. import { LanguageService } from '../js/services/languageService';
  5. describe('Expressions which ends with ID terminals', () => {
  6. let input = `funcao inteiro test(real i) {
  7. inteiro a = 5 + i
  8. a = 5 + G[i][6]
  9. }`;
  10. const lexer = LanguageService.getCurrentLexer();
  11. it(`should not result in SyntaxError`, () => {
  12. const as = new IVProgParser(input, lexer);
  13. as.pushVariableStack();
  14. const fun = as.parseFunction.bind(as);
  15. expect(fun).not.toThrow();
  16. as.popVariableStack();
  17. });
  18. });