MCPcopy
hub / github.com/formatjs/formatjs / tryParseArgumentClose

Method tryParseArgumentClose

packages/icu-messageformat-parser/parser.ts:868–881  ·  view source on GitHub ↗
(
    openingBracePosition: Position
  )

Source from the content-addressed store, hash-verified

866 }
867
868 private tryParseArgumentClose(
869 openingBracePosition: Position
870 ): Result<true, ParserError> {
871 // Parse: {value, number, ::currency/GBP }
872 //
873 if (this.isEOF() || this.char() !== 125 /* `}` */) {
874 return this.error(
875 ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,
876 createLocation(openingBracePosition, this.clonePosition())
877 )
878 }
879 this.bump() // `}`
880 return {val: true, err: null}
881 }
882
883 /**
884 * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659

Callers 2

parseArgumentOptionsMethod · 0.95

Calls 6

isEOFMethod · 0.95
charMethod · 0.95
errorMethod · 0.95
clonePositionMethod · 0.95
bumpMethod · 0.95
createLocationFunction · 0.85

Tested by

no test coverage detected