Skip to content

Commit

Permalink
docs(ansi): godoc Cmd type reference
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Oct 23, 2024
1 parent 04cef54 commit 87d8e7f
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions ansi/parser_decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ const (
// [Cmd] and [Param] types to unpack command intermediates and markers as well
// as parameters.
//
// Zero [p.Cmd] means the CSI, DCS, or ESC sequence is invalid. Moreover, checking the
// validity of other data sequences, OSC, DCS, etc, will require checking for
// the returned sequence terminator bytes such as ST (ESC \\) and BEL).
// Zero [Cmd] means the CSI, DCS, or ESC sequence is invalid. Moreover,
// checking the validity of other data sequences, OSC, DCS, etc, will require
// checking for the returned sequence terminator bytes such as ST (ESC \\) and
// BEL).
//
// We store the command byte in [p.Cmd] in the most significant byte, the
// marker byte in the next byte, and the intermediate byte in the least
// significant byte. This is done to avoid using a struct to store the command
// and its intermediates and markers. The command byte is always the least
// significant byte i.e. [p.Cmd & 0xff]. Use the [Cmd] type to unpack the
// command, intermediate, and marker bytes. Note that we only collect the last
// marker character and intermediate byte.
// We store the command byte in [Cmd] in the most significant byte, the marker
// byte in the next byte, and the intermediate byte in the least significant
// byte. This is done to avoid using a struct to store the command and its
// intermediates and markers. The command byte is always the least significant
// byte i.e. [Cmd & 0xff]. Use the [Cmd] type to unpack the command,
// intermediate, and marker bytes. Note that we only collect the last marker
// character and intermediate byte.
//
// The [p.Params] slice will contain the parameters of the sequence. Any
// sub-parameter will have the [parser.HasMoreFlag] set. Use the [Param] type
Expand Down Expand Up @@ -94,17 +95,18 @@ func DecodeSequenceInString(s string, state byte, p *Parser) (seq string, width
// [Cmd] and [Param] types to unpack command intermediates and markers as well
// as parameters.
//
// Zero [p.Cmd] means the CSI, DCS, or ESC sequence is invalid. Moreover, checking the
// validity of other data sequences, OSC, DCS, etc, will require checking for
// the returned sequence terminator bytes such as ST (ESC \\) and BEL).
// Zero [Cmd] means the CSI, DCS, or ESC sequence is invalid. Moreover,
// checking the validity of other data sequences, OSC, DCS, etc, will require
// checking for the returned sequence terminator bytes such as ST (ESC \\) and
// BEL).
//
// We store the command byte in [p.Cmd] in the most significant byte, the
// marker byte in the next byte, and the intermediate byte in the least
// significant byte. This is done to avoid using a struct to store the command
// and its intermediates and markers. The command byte is always the least
// significant byte i.e. [p.Cmd & 0xff]. Use the [Cmd] type to unpack the
// command, intermediate, and marker bytes. Note that we only collect the last
// marker character and intermediate byte.
// We store the command byte in [Cmd] in the most significant byte, the marker
// byte in the next byte, and the intermediate byte in the least significant
// byte. This is done to avoid using a struct to store the command and its
// intermediates and markers. The command byte is always the least significant
// byte i.e. [Cmd & 0xff]. Use the [Cmd] type to unpack the command,
// intermediate, and marker bytes. Note that we only collect the last marker
// character and intermediate byte.
//
// The [p.Params] slice will contain the parameters of the sequence. Any
// sub-parameter will have the [parser.HasMoreFlag] set. Use the [Param] type
Expand Down

0 comments on commit 87d8e7f

Please sign in to comment.