legacy icon indicating copy to clipboard operation
legacy copied to clipboard

HTML4 parser - lexer reached a stuck state

Open Skyb0rg007 opened this issue 7 months ago • 1 comments

Version

110.99.5 (Latest)

Operating System

  • [X] Any
  • [ ] Linux
  • [ ] macOS
  • [ ] Windows
  • [ ] Other Unix

OS Version

No response

Processor

  • [X] Any
  • [ ] Arm (using Rosetta)
  • [ ] PowerPC
  • [ ] Sparc
  • [ ] x86 (32-bit)
  • [ ] x86-64 (64-bit)
  • [ ] Other

System Component

SML/NJ Library

Severity

Minor

Description

The HTML4 lexer does not specify rules for all inputs

Transcript

- HTML4Parser.fromString "<";
uncaught exception Fail [Fail: lexer reached a stuck state]
  raised at: smlnj-lib/HTML4/html4.l.sml:94.46-94.80
             ml-lpt/lib/err-handler.sml:261.63

Expected Behavior

- HTML4Parser.fromString "<";
val it = NONE : html option

Note that this is what happens when you pass an incomplete tag such as "<x"

Steps to Reproduce

See transcript

Additional Information

The issue is in html4.l. There needs to be a case that handles "<" and "</" that are not followed by an alpha character or "!--".

Email address

skyler DOT soss AT gmail.com

Skyb0rg007 avatar Jul 07 '24 17:07 Skyb0rg007