News for hackers. Stuff that matters.
Re:What can we learn from how compilers are designed? by evmar on Friday March 16, 2018 @09:50PM (#16605201)
Another place where lexing and parsing interact is JavaScript. Consider the lexer encountering the text "/x;".

If it occurs in code like:

   let a = /x;
then it needs to continue lexing a regular expression.

If it occurs in code like:

   let a = b /x;
then it needs to lex it as division sign, identifier x, semicolon.
Re:What can we learn from how compilers are designed? by comex on Saturday March 17, 2018 @06:53AM (#16606378)
At least it's not bad as Perl, where the same code can be parsed as division or a regex depending on the 'type signature' of a function it names:

https://www.perlmonks.org/?node_id=663393