Skip to content

RailsParser

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/parser-core/src/parsers/backend/rails.parser.ts

Implements: IParser

Methods

MethodSignatureReturns
initializeinitialize(_config: ParserConfig)Promise<void>
canParsecanParse(filePath: string)boolean
parseFileparseFile(filePath: string, content: string)Promise<ParseResult>
parseFilesparseFiles(files: ParseFileInput[])Promise<ParseResult[]>
destroydestroy()Promise<void>

Properties

PropertyType
nameany
versionany
supportedPatternsany

Where it refuses work

  • RailsParser stops the work with an early return when !header, in 2 places.
  • RailsParser stops the work with an early return when !source.trim().
  • RailsParser stops the work with an early return when stack.some((f) => f.kind === 'suppress').
  • RailsParser stops the work with an early return when emitted.has(key).
  • RailsParser stops the work with an early return when !line.

When something fails

  • RailsParser handles failure in 1 place: it turns it into a return value in all 1.

Was this page helpful?

Download as PDF