Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/udb_helpers/backend_helpers.rb

Overview

Add to standard String class.

Instance Method Summary collapse

Instance Method Details

#sanitizeString

Should be called on all RISC-V extension, instruction, CSR, and CSR field names. Parameters never have periods in their names so they don’t need to be sanitized.

Parameters:

  • name (String)

    Some RISC-V name which might have periods in it or ampersand

Returns:

  • (String)

    New String with periods replaced with underscores and ampersands replaced with “and



20
# File 'lib/udb_helpers/backend_helpers.rb', line 20

def sanitize = String.new(self).gsub(".", "_").gsub("&", "_and_")