Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RubyParse

A parser for Ruby.

export
class

RubyParse

extends

{BaseParse}

Hierarchy

Index

Constructors

constructor

  • new RubyParse(documentText: string, docType: string): RubyParse

Properties

Protected allRegex

allRegex: ILanguage

The regular expressions and syntaxes for a language.

type

{ILanguage}

memberof

BaseParse

blockStartIndex

blockStartIndex: number = 0

The index of when the contructor's block start. This is used for when a cunstructor spans multiple lines.

type

{number}

memberof

BaseParse

Private blockStarts

blockStarts: string[]

The block starts that ruby supports.

type

{string[]}

memberof

RubyParse

Protected documentText

documentText: string

The document text.

type

{string}

memberof

BaseParse

Protected regex

regex: RegExp

The regular expression of what to match.

type

{RegExp}

memberof

BaseParse

Methods

Protected escapeComments

  • escapeComments(newlineRows: string[]): string
  • Escape every character in a string by returning a copy of the input string with the comments replaced with only hashes.

    memberof

    BaseParse

    Parameters

    • newlineRows: string[]

      The input text to replace every comment in.

    Returns string

    Return a copy of the input string with every character inside the comments with hashes.

Protected escapeStrings

  • escapeStrings(newlineRows: string[]): string
  • Escape every character in a string by returning a copy of the input string with the strings replaced with only hashes.

    memberof

    BaseParse

    Parameters

    • newlineRows: string[]

      The input text to replace every string in.

    Returns string

    Return a copy of the input string with every character inside the strings with hashes.

parse

  • parse(rows: string[]): object
  • Parse the regex.

    memberof

    BaseParse

    Parameters

    • rows: string[]

      The rows to parse from.

    Returns object

    The regex match groups.

    • [key: string]: string

parseBlock

  • parseBlock(newlineRows: string[]): string[]

parseParams

  • parseParams(params: string): IParams

parseParent

  • parseParent(childIndex: number): object
  • The parsed information gathered from the parent node.

    memberof

    RubyParse

    Parameters

    • childIndex: number

      The function's start index.

    Returns object

    A regular expression group consisting of the name of the parent and what constructor it is.

    • [key: string]: string

Private splitLines

  • splitLines(rows: string[]): string[]
  • Split the lines to what the language actually represents.

    memberof

    RubyParse

    Parameters

    • rows: string[]

      The rows to split.

    Returns string[]

    The real representation of the rows.

Generated using TypeDoc