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

CSSLexer: lex units in a single state

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.0.2
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: