Class: Rouge::Lexers::Veryl

Inherits:
RegexLexer show all
Defined in:
lib/rouge/lexers/veryl.rb

Constant Summary collapse

WHITE_SPACE =

Characters

/\s+/
NEWLINE =
/\n/
LINE_COMMENT =

Comments

/\/\/(?:(?!#{NEWLINE}).)*/
GENERAL_COMMENT =
/\/\*(?:(?!\*\/).)*\*\//m
COMMENT =
/#{LINE_COMMENT}|#{GENERAL_COMMENT}/
EXPONENT =

Numeric literals

/[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)*/
FIXED_POINT =
/[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*/
BASED =
/(?:[0-9]+(?:_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(?:_[0-9a-fA-FxzXZ]+)*/
ALL_BIT =
/(?:[0-9]+(?:_[0-9]+)*)?'[01xzXZ]/
BASE_LESS =
/[0-9]+(?:_[0-9]+)*/
OPERATOR =

Operators and delimiters

/ -:     | ->     | \+:    | \+=    | -=
| \*=    | \/=    | %=     | &=     | \|=
| \^=    | <<=    | >>=    |<<<=    |>>>=
| <>     | \*\*   | \/     | \|     | %
| \+     | -      | <<<    | >>>    | <<
| >>     | <=     | >=     | <:     | >:
| ===    | ==\?   | \!==   | \!=\?  | ==
| \!=    | &&     | \|\|   | &      | \^~
| \^     | ~\^    | \|     | ~&     | ~\|
| \!     | ~
/x
SEPARATOR =
/ ::<    | ::     | :      | ,      | \.\.=
| \.\.   | \.     | =      | \#     | <
| \?     | '      | '\{    | \{     | \[
| \(     | >      | \}     | \]     | \)
| ;      | \*
/x
DOLLAR_IDENTIFIER =

Identifiers

/\$[a-zA-Z_][0-9a-zA-Z_$]*/
IDENTIFIER =
/(?:r#)?[a-zA-Z_][0-9a-zA-Z_$]*/

Constants inherited from RegexLexer

RegexLexer::MAX_NULL_SCANS

Constants included from Token::Tokens

Token::Tokens::Num, Token::Tokens::Str

Instance Attribute Summary

Attributes inherited from Rouge::Lexer

#options

Class Method Summary collapse

Methods inherited from RegexLexer

append, #delegate, #fallthrough!, get_state, #get_state, #goto, #group, #groups, #in_state?, #pop!, prepend, #push, #recurse, replace_state, #reset!, #reset_stack, #stack, start, start_procs, state, #state, #state?, state_definitions, states, #step, #stream_tokens, #token

Methods inherited from Rouge::Lexer

aliases, all, #as_bool, #as_lexer, #as_list, #as_string, #as_token, assert_utf8!, #bool_option, continue_lex, #continue_lex, debug_enabled?, demo, demo_file, desc, detect?, detectable?, disable_debug!, eager_load!, #eager_load!, enable_debug!, filenames, find, find_fancy, guess, guess_by_filename, guess_by_mimetype, guess_by_source, guesses, #hash_option, #initialize, lazy, lex, #lex, #lexer_option, #list_option, lookup_fancy, mimetypes, option, option_docs, #reset!, skip_auto_load?, #stream_tokens, #string_option, tag, #tag, title, #token_option, #with

Methods included from Token::Tokens

token

Constructor Details

This class inherits a constructor from Rouge::Lexer

Class Method Details

.keywordsObject

Keywords



60
61
62
63
64
65
66
67
68
# File 'lib/rouge/lexers/veryl.rb', line 60

def self.keywords
  @keywords ||= Set.new %w(
    embed enum function include interface modport module package proto pub struct union unsafe
    alias always_comb always_ff assign as bind block connect const final import initial inst let param return break type var
    converse inout input output same
    case default else if_reset if inside outside switch
    for in repeat rev step
  )
end

.keywords_typeObject



70
71
72
73
74
# File 'lib/rouge/lexers/veryl.rb', line 70

def self.keywords_type
  @keywords_type ||= Set.new %w(
    bit bbool lbool clock clock_posedge clock_negedge f32 f64 i8 i16 i32 i64 logic reset reset_async_high reset_async_low reset_sync_high reset_sync_low signed string tri u8 u16 u32 u64
  )
end