Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

80
Vistas
Nearley Postprocessing is removing valid whitespaces

New to Nearley grammar, not sure what is going wrong here. Here is my grammar to get whatever is placed inside an opening and closing parenthesis.

@builtin "whitespace.ne"

with_in_brackets ->
    "(" _ args _ ")" {% d => ({
      type: 'inside_brackets',
      argumentstring: d[2]
    })%}
    
args -> .:* {% d => d[0].join("") %}
  • Test Input - (hello, " ", world)
  • Expected Result - {type: "inside_brackets", argumentstring: "hello, " ", world"}
  • Actual Result - {type: "inside_brackets", argumentstring: "hello, " ", world"}

Notice - the actual result is compacting 4 whitespaces to 1 whitespace. Not sure why this is happening.

Any thoughts? FYI - I am using Nearley Playground to test my grammer on Safari v15 browser.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda