Class: CodeRay::Scanners::C

Inherits:
Scanner show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/coderay-1.1.3/lib/coderay/scanners/c.rb

Overview

Scanner for C.

Constant Summary collapse

KEYWORDS =
[
  'asm', 'break', 'case', 'continue', 'default', 'do',
  'else', 'enum', 'for', 'goto', 'if', 'return',
  'sizeof', 'struct', 'switch', 'typedef', 'union', 'while',
  'restrict',  # added in C99
]
PREDEFINED_TYPES =

:nodoc:

[
  'int', 'long', 'short', 'char',
  'signed', 'unsigned', 'float', 'double',
  'bool', 'complex',  # added in C99
]
PREDEFINED_CONSTANTS =

:nodoc:

[
  'EOF', 'NULL',
  'true', 'false',  # added in C99
]
DIRECTIVES =

:nodoc:

[
  'auto', 'extern', 'register', 'static', 'void',
  'const', 'volatile',  # added in C89
  'inline',  # added in C99
]
IDENT_KIND =

:nodoc:

WordList.new(:ident).
add(KEYWORDS, :keyword).
add(PREDEFINED_TYPES, :predefined_type).
add(DIRECTIVES, :directive).
add(PREDEFINED_CONSTANTS, :predefined_constant)
ESCAPE =

:nodoc:

/ [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x
UNICODE_ESCAPE =

:nodoc:

/ u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x

Constants inherited from Scanner

Scanner::DEFAULT_OPTIONS, Scanner::KINDS_NOT_LOC, Scanner::ScanError

Instance Attribute Summary

Attributes inherited from Scanner

#state

Attributes included from Plugin

#plugin_id

Method Summary

Methods inherited from Scanner

#binary_string, #column, #each, encoding, file_extension, #file_extension, #initialize, #lang, lang, #line, normalize, #reset, #string=, #tokenize, #tokens

Methods included from Plugin

#aliases, #plugin_host, #register_for, #title

Methods included from Enumerable

#as_json, #compact_blank, #exclude?, #excluding, #in_order_of, #including, #index_by, #index_with, #many?, #maximum, #minimum, #pick, #pluck, #sole, #sum

Constructor Details

This class inherits a constructor from CodeRay::Scanners::Scanner