@adaycuestacorrea/lexer-generator-solution

4.2.2 • Public • Published

Lexer Generator Lab

https://ull-esit-gradoii-pl.github.io/practicas/lexer-generator.html

Rúbrica

El paquete está publicado en GitHub Registry y se instala correctamente

El módulo exporta los generadores léxicos y funcionan correctamente

lex

El manejo de errores con el token ERROR es correcto

error

Manejo de "tokens skip"

if (!validTokens.get(type).skip) {
  let value = match.groups[type];
  if (validTokens.get(type).value) value = validTokens.get(type).value(value);
  result.push({type, value, line, col, length: regexp.lastIndex - start});
}

Contiene tests comprobando el atributo de transformación value

test('Assignment to string', () => {
  const str = 'const varName = "value"';
  const result = lexer(str);
  const expected = [
    {
      type: 'RESERVEDWORD',
      value: 'const',
      col: 1,
      line: 1,
      length: 5,
    },
    {
      type: 'ID',
      value: 'varName',
      col: 7,
      line: 1,
      length: 7,
    },
    {
      type: 'OP',
      value: '=',
      col: 15,
      line: 1,
      length: 1,
    },
    {
      type: 'STRING',
      value: '"value"',
      col: 17,
      line: 1,
      length: 7,
    },
  ];
  expect(result).toEqual(expected);
});

Contiene tests comprobando la compatibilidad del lexer generado con Nearley.JS (egg-parser)

compatibility

Estudio de covering

cov

Se ha hecho CI con GitHub Actions

actions

Publicar la documentación de la API usando GitHub Pages en la carpeta docs/

doc

GitHub Page

Link a la page para ver el coverage

Readme

Keywords

Package Sidebar

Install

npm i @adaycuestacorrea/lexer-generator-solution

Weekly Downloads

5

Version

4.2.2

License

none

Unpacked Size

1.22 MB

Total Files

92

Last publish

Collaborators

  • adaycuestacorrea