/**
   * Keywords from IEEE 1800-2012
   */

/** Operators from IEEE 1800-2012
     unary_operator ::=
       + | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~
     binary_operator ::=
       + | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | **
       | < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<<
       | -> | <->
     inc_or_dec_operator ::= ++ | --
     unary_module_path_operator ::=
       ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~
     binary_module_path_operator ::=
       == | != | && | || | & | | | ^ | ^~ | ~^
  */

/***/

//      Search through the context to see if we are already in an assignment.

//   - M4 tokens

//   - Statement delimitation (enabled by tlvTrackStatements)

//   - TLV scope indentation

//   comment start with preceding symbols.

//   is legal within a statement.  (E.g., !$reset).  It also enables detection of

//   o Auto indentation on next line

//   o Indentation scope styles

//   which are statements themselves)

// "disable fork;" and "wait fork;" (trailing semicolon)

// '<=' could be nonblocking assignment or lessthan-equals (which shouldn't cause indent)

// '=' could be inside port declaration with comma or ')' afterward, or inside for(;;) block.

// Anything after comment is assumed to be real statement content.

// Begin scope.

// Block comment.

// Check if this is a block

// Clear out deeper indentation levels unless line is blank.

// CodeMirror, copyright (c) by Marijn Haverbeke and others

// Comments

// CommonJS

// Compute indentation state:

// Contact: steve.hoover@redwoodeda.com

// Correct indentation in the face of a line prefix char.

// Distributed under an MIT license: https://codemirror.net/5/LICENSE

// Eat the next char w/ no formatting.

// Event

// Exit block comment.

// For example, `ifdef nested inside another `ifndef will be indented,

// Fork can be a statement instead of block in cases of:

// Handle closing macros, assuming they could have a semicolon or begin/end block inside.

// Highlight as TLV.

// Highlight tabs, which are illegal.

// In a block comment.

// Indentation

// Interface

// Just swallow one character and try again.

// Keywords / plain variables

// Keywords which open statements that are ended with a semi-colon

// Line comment.

// Lines starting with these characters define scope (result in indentation).

// Macros (especially if they have parenthesis) potentially have a semicolon

// Macros (tick-defines)

// Macros that end in _begin, are start of block and end with _end

// Move the stream back before the spaces

// Need to choose a style for this.

// Next line gets indented one level.

// Note that sign is not treated separately, so "+/-" versions of numeric identifiers

// Numeric literals

// Operators

// Place a class before a scope identifier.

// Process region.

// Regex to force current line to reindent

// Region line.

// Reindentation should occur on any bracket char: {}()[]

// Return true if the next thing in the stream is an identifier with a mnemonic.

// Return undefined for verilog tokenizing, or style for TLV token (null not used).

// Return value of pattern matches.

// Returns a style specific to the scope at the given indentation column.

// See the mode in action at makerchip.com.

// See tl-x.org for language spec.

// Set highlighting mode based on code region (TLV or SV).

// Set next level of indentation.

// Should condition this off for > TLV 1c.

// Skip over spaces.

// Standard CM styles are used for most formatting, but some TL-Verilog-specific highlighting

// Start comment.

// Strings

// Style the line prefix character.

// Style the next level of indentation (except non-region keyword identifiers,

// Styles to use for each level of indentation.

// System calls

// TL-Verilog mode.

// TLV Identifier prefixes.

// TODO: Pass this in instead.

// The number of spaces to autoindent the next line if tlvCodeActive.

// This enables subsequent identifier match with preceding symbol character, which

// This line begins scope.

// This starts a statement if the position is at the scope level

// Time literals

// Trailing spaces.

// True inside /**/ comment.

// True when we're in a TLV region (and at beginning of file).

// Type is one of: "indent", "scope-ident", "before-scope-ident".

// [:], (), {}, ;.

// alpha-numeric token.

// and style it

// and we're not within a statement leading comment.

// are included.

// but a `ifdef inside a function block may not be indented.

// can be enabled with the definition of cm-tlv-* styles, including highlighting for:

// codemirror from combining spans

// compilerDirectivesUseRegularIndentation - If set, Compiler directive

// contextClosing may be multiple keywords separated by ;

// false, compiler directives will track their own indentation.

// has mnemonic or we're at the end of the line (maybe it hasn't been typed yet)

// indentation follows the same rules as everything else. Otherwise if

// is identifier prefix

// looks like an identifier (or identifier prefix)

// m4 pre proc

// make this style distinct from the previous one to prevent

// not a region identifier

// not a space

// not deeper than current scope

// not in block comment

// or complete statement/block inside, and should be treated as such.

// or on a match of any of the block closing keywords, at

// statement already started by comment

// the end of a line

//!stream.match(tlvCommentMatch, false) && // not comment start
