Spec-Zone.ru › Homebrew

Класс: Parser::Source::Comment

Наследует:
Object
  • Object
  • Parser::Source::Comment
показать все
Определен в:
sorbet/rbi/parser@3.3.8.0.rbi

Обзор

Комментарий в исходном коде.

source://parser//lib/parser/source/comment.rb#17

Определено в пространстве имен

Классы: Associator

Краткое описание методов класса свернуть

  • .associate(ast, comments) ⇒ Hash<Parser::AST::Node, Array<Comment>> устарел Устарел.

    Используйте Comment.associate_locations.

  • .associate_by_identity(ast, comments) ⇒ Hash<Parser::Source::Node, Array<Comment>>

    Связывает comments с узлами ast по идентичности.

  • .associate_locations(ast, comments) ⇒ Hash<Parser::Source::Map, Array<Comment>>

    Связывает comments с узлами ast по их расположению в исходном коде.

Краткое описание методов экземпляра свернуть

  • #document? ⇒ Boolean

    source://parser//lib/parser/source/comment.rb#109.

  • #initialize(range) ⇒ Comment конструктор

    source://parser//lib/parser/source/comment.rb#67.

  • #inline? ⇒ Boolean

    source://parser//lib/parser/source/comment.rb#101.

  • #loc ⇒ Parser::Source::Range

    source://parser//lib/parser/source/comment.rb#20.

  • #location ⇒ Parser::Source::Range

    source://parser//lib/parser/source/comment.rb#20.

  • #text ⇒ String

    source://parser//lib/parser/source/comment.rb#18.

  • #type ⇒ Symbol

    Тип этого комментария.

Подробное описание конструкторов

#initialize(range) ⇒ Comment

source://parser//lib/parser/source/comment.rb#67

Параметры:

  • range (Parser::Source::Range)


5365
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5365

def initialize(range); end

Подробное описание методов класса

.associate(ast, comments) ⇒ Hash<Parser::AST::Node, Array<Comment>>

Устарел.

Используйте associate_locations.

Связывает comments с узлами ast по соответствующему узлу.

source://parser//lib/parser/source/comment.rb#32

Параметры:

  • ast (Parser::AST::Node)
  • comments (Array<Comment>)

Возвращает:

  • (Hash<Parser::AST::Node, Array<Comment>>)

См. также:

  • Parser::Source::Comment::Associator#associate


5444
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5444

def associate(ast, comments); end

.associate_by_identity(ast, comments) ⇒ Hash<Parser::Source::Node, Array<Comment>>

Связывает comments с узлами ast по идентичности.

source://parser//lib/parser/source/comment.rb#59

Параметры:

  • ast (Parser::AST::Node)
  • comments (Array<Comment>)

Возвращает:

  • (Hash<Parser::Source::Node, Array<Comment>>)

См. также:

  • Parser::Source::Comment::Associator#associate_by_identity


5455
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5455

def associate_by_identity(ast, comments); end

.associate_locations(ast, comments) ⇒ Hash<Parser::Source::Map, Array<Comment>>

Связывает comments с узлами ast по их расположению в исходном коде.

source://parser//lib/parser/source/comment.rb#46

Параметры:

  • ast (Parser::AST::Node)
  • comments (Array<Comment>)

Возвращает:

  • (Hash<Parser::Source::Map, Array<Comment>>)

См. также:

  • Parser::Source::Comment::Associator#associate_locations


5467
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5467

def associate_locations(ast, comments); end

Подробное описание методов экземпляра

#document? ⇒ Boolean

source://parser//lib/parser/source/comment.rb#109

Возвращает:

  • (Boolean) —

    true, если это блочный комментарий.

См. также:

  • #type


5382
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5382

def document?; end

#inline? ⇒ Boolean

source://parser//lib/parser/source/comment.rb#101

Возвращает:

  • (Boolean) —

    true, если это встроенный комментарий.

См. также:

  • #type


5389
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5389

def inline?; end

#loc ⇒ Parser::Source::Range

source://parser//lib/parser/source/comment.rb#20

Возвращает:

  • (Parser::Source::Range)


5401
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5401

def loc; end

#location ⇒ Parser::Source::Range

source://parser//lib/parser/source/comment.rb#20

Возвращает:

  • (Parser::Source::Range)


5407
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5407

def location; end

#text ⇒ String

source://parser//lib/parser/source/comment.rb#18

Возвращает:

  • (String)


5413
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5413

def text; end

#type ⇒ Symbol

Тип этого комментария.

* Inline comments correspond to `:inline`:

    # whatever

* Block comments correspond to `:document`:

    =begin
    hi i am a document
    =end

source://parser//lib/parser/source/comment.rb#89

Возвращает:

  • (Symbol)


5431
# File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5431

def type; end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/Parser/Source/Comment.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API