Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8128964

CSSLexer: lex units in a single state

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.1
    • fx2.0.2
    • javafx
    • None

      The CSS lexer uses a map to figure out the next state. When it comes to lexing a number with units, after the final digits state, there is a state for each possible starting character for a unit, and then a state for each subsequent character. To lex 'grad', for example would require 4 separate states, each state with its own Map for next state. This has bothered me from the beginning since you end up with a lot of little states where really you just want a "units state" and the state machine stays in the units state as long as the input is valid. I didn't have time do address this before. Cleaning this up will make the lexer a little more compact and a little bit faster, and will help me sleep at night.

            dgrieve David Grieve
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: