lib-ruby-parser (C++ bindings)  4.0.1+ruby-3.1.1
C++ bindings for lib-ruby-parser library
lib_ruby_parser Namespace Reference

Classes

class  Alias
 Represents alias to from statement. More...
 
class  AliasNthRef
 
class  AmbiguousFirstArgument
 
class  AmbiguousOperator
 
class  AmbiguousRegexp
 
class  AmbiguousTernaryOperator
 
class  AmpersandInterpretedAsArgPrefix
 
class  And
 Represents foo && bar (or foo and bar) statement. More...
 
class  AndAsgn
 Represents a &&= 1 statement. More...
 
class  Arg
 
class  Args
 
class  Array
 Represents an array literal. More...
 
class  ArrayPattern
 Represents an array pattern used in pattern matching. More...
 
class  ArrayPatternWithTail
 
class  BackRef
 
class  Begin
 
class  BeginNotAtTopLevel
 
class  Block
 Represents a Ruby block that is passed to a method (proc { |foo| bar }) More...
 
class  BlockAndBlockArgGiven
 
class  Blockarg
 Represents a &blk argument in the method definition (but not in the method call, see BlockPass) More...
 
class  BlockGivenToYield
 
class  BlockPass
 Represents a &blk argument of the method call (but not of the method definition, see BlockArg) More...
 
class  Break
 Represents a break keyword (with optional argument) More...
 
class  ByteList
 
struct  ByteListBlob
 
class  Bytes
 Rerpresentation of Bytes struct from lib-ruby-parser. More...
 
class  CantAssignToEncoding
 
class  CantAssignToFalse
 
class  CantAssignToFile
 
class  CantAssignToLine
 
class  CantAssignToNil
 
class  CantAssignToNumparam
 
class  CantAssignToSelf
 
class  CantAssignToTrue
 
class  CantSetVariable
 
class  Case
 Represents a case statement (for pattern matching see CaseMatch node) More...
 
class  CaseMatch
 Represents a case statement used for pattern matching (for regular case see Case node) More...
 
class  Casgn
 Represents a constant assignment (i.e. A = 1) More...
 
class  Cbase
 Represents leading :: part of the constant access/assignment that is used to get/set on a global namespace. More...
 
class  CircularArgumentReference
 
class  Class
 Represents a class definition (using a class keyword, Class.new is just a method call) More...
 
class  ClassDefinitionInMethodBody
 
class  ClassOrModuleNameMustBeConstant
 
class  Comment
 Equivalent of lib_ruby_parser::source::Comment More...
 
class  CommentList
 Equivalent of Vec<lib_ruby_parser::source::Comment> More...
 
class  ComparisonAfterComparison
 
class  Complex
 Represents a Complex literal (that returns an Complex number) More...
 
class  Const
 Represents constant access (i.e. Foo::Bar) More...
 
class  ConstArgument
 
class  ConstPattern
 Const pattern used in pattern matching (e.g. in A(1, 2)) More...
 
class  CSend
 Represents conditional method call using &. operator. More...
 
class  CsendInsideMasgn
 
class  Cvar
 Represents access to class variable (i.e. @@var) More...
 
class  CvarArgument
 
class  CvarWithoutId
 
class  Cvasgn
 Represents class variable assignment (i.e. @@var = 42) More...
 
class  DecodedInput
 Equivalent of lib_ruby_parser::source::DecodedInput More...
 
class  Decoder
 
struct  DecoderResult
 
struct  DecoderResultBlob
 
class  Def
 Represents method definition using def keyword (not on a singleton, see Defs node). More...
 
class  Defined
 Represents a defined?(foo) expression. More...
 
class  Defs
 Represents a singleton method definition (i.e. def self.foo; end) More...
 
class  Diagnostic
 Equivalent of lib_ruby_parser::Diagnostic More...
 
class  DiagnosticList
 Equivalent of Vec<lib_ruby_parser::Diagnostic More...
 
class  DiagnosticMessage
 
class  DiagnosticMessageList
 
class  DStarInterpretedAsArgPrefix
 
class  Dstr
 Represents a string with interpolation (i.e. "#{foo}") More...
 
class  Dsym
 Represents a symbol with interpolation (i.e. :"#{foo}") More...
 
class  DuplicatedArgumentName
 
class  DuplicateHashKey
 
class  DuplicateKeyName
 
class  DuplicateVariableName
 
class  DynamicConstantAssignment
 
class  EFlipFlop
 Represents exclusive flip-flop (i.e. in if foo...bar; end) More...
 
class  ElseWithoutRescue
 
class  EmbeddedDocumentMeetsEof
 
class  EmptyElse
 
class  Encoding
 Represents a special __ENCODING__ keyword. More...
 
class  EncodingError
 
class  EndInMethod
 
class  EndlessSetterDefinition
 
class  Ensure
 Represents a block of code with ensure (i.e. begin; ensure; end) More...
 
class  Erange
 Represents range literal with excluded end (i.e. 1...3) More...
 
class  False
 Represents a false literal. More...
 
class  File
 Represents a special __FILE__ literal. More...
 
class  FindPattern
 
class  Float
 Represents a float literal (i.e. 42.5) More...
 
class  For
 Represents a for loop. More...
 
class  ForwardArg
 Represents a special ... argument that forwards positional/keyword/block arguments. More...
 
class  ForwardArgAfterRestarg
 
class  ForwardedArgs
 Represents a ... operator that contains forwarded argument (see ForwardArg) More...
 
class  FractionAfterNumeric
 
class  Gvar
 Represents access to global variable (i.e. $foo) More...
 
class  GvarArgument
 
class  GvarWithoutId
 
class  Gvasgn
 Represents global variable assignment (i.e. $foo = 42) More...
 
class  Hash
 Represents a hash literal (i.e. { foo: 42 }) More...
 
class  HashPattern
 Represents a hash pattern used in pattern matching (i.e. in { a: 1 }) More...
 
class  Heredoc
 
class  If
 Represents an if statement (i.e. if foo; bar; else; baz; end) More...
 
class  IfGuard
 Represents an if guard used in pattern matching (i.e. case foo; in pattern if guard; end) More...
 
class  IFlipFlop
 Represents inclusive flip-flop (i.e. in if foo..bar; end) More...
 
class  IfMod
 Represents an if/unless modifier (i.e. stmt if cond) More...
 
class  IfTernary
 Represents ternary if statement (i.e. cond ? if_true : if_false) More...
 
class  IncompleteCharacterSyntax
 
class  Index
 Represents indexing operation (i.e. foo[1,2,3]) More...
 
class  IndexAsgn
 Represents assignment using indexing operation (i.e. foo[1, 2, 3] = bar) More...
 
class  InPattern
 Represents an in pattern branch of the pattern matching. More...
 
class  InputError
 
class  Int
 Represents an integer literal (i.e. 42) More...
 
class  InvalidChar
 
class  InvalidCharacterSyntax
 
class  InvalidCvarName
 
class  InvalidEscapeCharacter
 
class  InvalidGvarName
 
class  InvalidHexEscape
 
class  InvalidIdToGet
 
class  InvalidIvarName
 
class  InvalidMultibyteChar
 
class  InvalidOctalDigit
 
class  InvalidReturnInClassOrModuleBody
 
class  InvalidSymbol
 
class  InvalidUnicodeCodepoint
 
class  InvalidUnicodeEscape
 
class  Irange
 Represents inclusive range (i.e. 2..4) More...
 
class  Ivar
 Represents access to instance variable (i.e. @foo) More...
 
class  IvarArgument
 
class  IvarWithoutId
 
class  Ivasgn
 Represents instance variable assignment (i.e @foo = 42) More...
 
class  KeyMustBeValidAsLocalVariable
 
class  Kwarg
 Represents required keyword argument (i.e. foo in def m(foo:); end) More...
 
class  Kwargs
 Represents kwargs that are given to a method call, super or yield (i.e. foo(bar: 1)) More...
 
class  KwBegin
 
class  Kwnilarg
 Represents an special argument that rejects all keyword arguments (i.e. def m(**nil); end) More...
 
class  Kwoptarg
 Represents an optional keyword argument (i.e. foo in def m(foo: 42); end) More...
 
class  Kwrestarg
 Represents a keyword rest argument (i.e. foo in def m(**foo); end) More...
 
class  Kwsplat
 Represents a keyword arguments splat (i.e. **bar in a call like foo(**bar)) More...
 
class  Lambda
 
class  LexStateAction
 
class  Line
 Represents a special __LINE__ literal. More...
 
class  Loc
 Loc struct from lib-ruby-parser More...
 
class  Lvar
 
class  Lvasgn
 Represents local variable assignment (i.e. foo = 42) More...
 
class  MagicComment
 Equivalent of lib_ruby_parser::source::MagicComment More...
 
class  MagicCommentList
 Equivalent of Vec<lib_ruby_parser::source::MagicComment> More...
 
class  Masgn
 Represents mass-assignment (i.e. foo, bar = 1, 2) More...
 
class  MatchAlt
 Represents pattern matching using one of the given patterns (i.e. foo in 1 | 2) More...
 
class  MatchAs
 Represents matching with renaming into specified local variable (i.e. case 1; in Integer => a; end) More...
 
class  MatchCurrentLine
 
class  MatchNilPattern
 Represents empty hash pattern that is used in pattern matching (i.e. in **nil) More...
 
class  MatchPattern
 Represents a one-line pattern matching that can throw an error (i.e. foo => pattern) More...
 
class  MatchPatternP
 Represents a one-line pattern matching that never throws but returns true/false (i.e. foo in pattern) More...
 
class  MatchRest
 Represents a wildcard pattern used in pattern matching (i.e. in *foo) More...
 
class  MatchVar
 Represents matching with assignment into a local variable (i.e. pattern => var) More...
 
class  MatchWithLvasgn
 
class  MaybeDecoder
 
class  MaybeLoc
 Equivalent of Option<Loc> More...
 
class  MaybeString
 
class  MaybeTokenRewriter
 
class  Mlhs
 Represents left hand statement of the mass-assignment (i.e. foo, bar in foo, bar = 1, 2) More...
 
class  Module
 Represents module declaration using module keyword. More...
 
class  ModuleDefinitionInMethodBody
 
class  MultipleCodepointAtSingleChar
 
class  Next
 Represents next keyword. More...
 
class  Nil
 Represents nil literal. More...
 
class  NoAnonymousBlockarg
 
class  Node
 
class  NodeList
 
class  NoDigitsAfterDot
 
class  NoSuchLocalVariable
 
class  NthRef
 Represents numeric global variable (e.g. $1) More...
 
class  NthRefIsTooBig
 
class  Numblock
 Represents a block that takes numbered parameters (i.e. proc { _1 }) More...
 
class  NumericLiteralWithoutDigits
 
class  NumparamUsed
 
class  OpAsgn
 Represents an operation with assignment (e.g. a += 1) More...
 
class  Optarg
 Represents optional positional argument (i.e. foo in m(foo = 1)) More...
 
class  Or
 Represents foo || bar (or foo or bar) statement. More...
 
class  OrAsgn
 Represents lhs ||= rhs assignment. More...
 
class  OrdinaryParamDefined
 
class  Pair
 Represents a key/value pair (e.g. a part of the Hash node) More...
 
class  ParenthesesIterpretedAsArglist
 
class  ParserOptions
 Equivalent of lib_ruby_parser::ParserOptions More...
 
class  ParserResult
 Equivalent of lib_ruby_parser::ParserResult More...
 
class  Pin
 Represents a pattern based on a "pinned" variable (e.g. ^foo) More...
 
class  Postexe
 Represents END { .. } statement. More...
 
class  Preexe
 Represents BEGIN { ... } statement. More...
 
class  Procarg0
 
class  Rational
 Represents rational literal (e.g. 1r) More...
 
class  Redo
 Represents redo keyword. More...
 
class  RegexError
 
class  Regexp
 Represents regex literal (e.g. /foo/) More...
 
class  RegOpt
 Represents flags of the regex literal (i.e. mix for /foo/mix) More...
 
class  Rescue
 Represents a rescue block. More...
 
class  RescueBody
 Represents a single rescue handler (i.e. rescue E => e ...) More...
 
class  ReservedForNumparam
 
class  Restarg
 Represents positional rest argument (i.e. *foo in def m(*foo); end) More...
 
class  Retry
 Represents retry keyword. More...
 
class  Return
 Represents return keyword. More...
 
class  SClass
 Represents opening a singleton class (i.e. class << foo; ... end;) More...
 
class  Self_
 Represents self keyword. More...
 
class  Send
 Represents a method call (e.g. foo.bar(42)) More...
 
class  Shadowarg
 Represents a special block argument that "shadows" outer variable (i.e. |;foo|) More...
 
class  SharedByteList
 
class  SingletonLiteral
 
class  SlashRAtMiddleOfLine
 
class  SourceLine
 SourceLine struct from lib-ruby-parser More...
 
class  SourceLineList
 Equivalent of Vec<SourceLine> More...
 
class  Splat
 Represents an arguments splat (i.e. *bar in a call like foo(*bar)) More...
 
class  StarInterpretedAsArgPrefix
 
class  Str
 Represents a plain non-interpolated string literal (e.g. "foo") More...
 
class  String
 
struct  StringBlob
 
class  Super
 Represents a super keyword. More...
 
class  Sym
 
class  SymbolLiteralWithInterpolation
 
class  TokAtEolWithoutExpression
 
class  Token
 Equivalent of lib_ruby_parser::Token More...
 
class  TokenList
 Equivalent of Vec<lib_ruby_parser::Token> More...
 
class  TokenRewriter
 
class  TokenRewriterResult
 
class  TooLargeUnicodeCodepoint
 
class  TrailingCharInNumber
 
class  TripleDotAtEol
 
class  True
 Represents a true literal. More...
 
class  Undef
 Represents an undef keyword (e.g. undef foo, :bar) More...
 
class  UnexpectedToken
 Emitted for any code that produces invalid sequence of tokens. More...
 
class  UnknownRegexOptions
 
class  UnknownTypeOfPercentString
 
class  UnlessGuard
 Represents an unless guard used in pattern matching (i.e. in pattern unless guard) More...
 
class  UnterminatedHeredoc
 
class  UnterminatedHeredocId
 
class  UnterminatedList
 
class  UnterminatedQuotedString
 
class  UnterminatedRegexp
 
class  UnterminatedString
 
class  UnterminatedUnicodeEscape
 
class  Until
 Represents until loop. More...
 
class  UntilPost
 
class  VoidValueExpression
 
class  When
 Represents a branch of the case statement (i.e. when foo) More...
 
class  While
 Represents while loop. More...
 
class  WhilePost
 
class  XHeredoc
 
class  Xstr
 Represents an executable string (i.e. `sh #{script_name}`) More...
 
class  Yield
 Represents an yield keyword. More...
 
class  ZSuper
 

Typedefs

typedef DecoderResultBlob(* DecoderFunction) (void *, StringBlob, ByteListBlob)
 
typedef TokenRewriterResult(* TokenRewriterFunction) (Token *, SharedByteList)
 

Enumerations

enum  CommentType { CommentType::INLINE, CommentType::DOCUMENT, CommentType::UNKNOWN }
 Equivalent of lib_ruby_parser::source::CommentType More...
 
enum  ErrorLevel { ErrorLevel::WARNING, ErrorLevel::ERROR }
 Equivalent of lib_ruby_parser::ErrorLevel More...
 
enum  MagicCommentKind { MagicCommentKind::ENCODING, MagicCommentKind::FROZEN_STRING_LITERAL, MagicCommentKind::WARN_INDENT, MagicCommentKind::SHAREABLE_CONSTANT_VALUE }
 Equivalent of lib_ruby_parser::source::MagicCommentKind More...
 
enum  RewriteAction { RewriteAction::DROP, RewriteAction::KEEP }
 

Functions

ParserResult parse (ByteList input, ParserOptions options)
 
String string_from_string_blob (StringBlob blob)
 
ByteList byte_list_from_byte_list_blob (ByteListBlob blob)
 
DecoderResultBlob decoder_result_to_blob (DecoderResult decoder_result)
 

Typedef Documentation

◆ DecoderFunction

typedef DecoderResultBlob(* lib_ruby_parser::DecoderFunction) (void *, StringBlob, ByteListBlob)

◆ TokenRewriterFunction

typedef TokenRewriterResult(* lib_ruby_parser::TokenRewriterFunction) (Token *, SharedByteList)

Enumeration Type Documentation

◆ CommentType

Equivalent of lib_ruby_parser::source::CommentType

Enumerator
INLINE 
DOCUMENT 
UNKNOWN 

◆ ErrorLevel

Equivalent of lib_ruby_parser::ErrorLevel

Enumerator
WARNING 
ERROR 

◆ MagicCommentKind

Equivalent of lib_ruby_parser::source::MagicCommentKind

Enumerator
ENCODING 
FROZEN_STRING_LITERAL 
WARN_INDENT 
SHAREABLE_CONSTANT_VALUE 

◆ RewriteAction

Enumerator
DROP 
KEEP 

Function Documentation

◆ byte_list_from_byte_list_blob()

ByteList lib_ruby_parser::byte_list_from_byte_list_blob ( ByteListBlob  blob)

◆ decoder_result_to_blob()

DecoderResultBlob lib_ruby_parser::decoder_result_to_blob ( DecoderResult  decoder_result)

◆ parse()

ParserResult lib_ruby_parser::parse ( ByteList  input,
ParserOptions  options 
)

Parses given input according to option. This is the main entrypoint API.

◆ string_from_string_blob()

String lib_ruby_parser::string_from_string_blob ( StringBlob  blob)