Struct sourcemap::Token [] [src]

pub struct Token<'a> { /* fields omitted */ }

Represents a token from a sourcemap

Methods

impl<'a> Token<'a>
[src]

get the destination (minified) line number

get the destination (minified) column number

get the destination line and column

get the source line number

get the source column number

get the source line and column

Return the source ID of the token

get the source if it exists as string

Is there a source for this token?

get the name if it exists as string

returns true if a name exists, false otherwise

Return the name ID of the token

Given some minified source this returns the most likely minified name.

Note that this scans for identifiers in the source file so in some cases it can happen that values are returned that are not actually names. For instance a token that points to a keyword will return the keyword. This is done because it is not always possible to tell keywords from non keywords without parsing the entire source.

Converts the token into a debug tuple in the form (source, src_line, src_col, name)

Get the underlying raw token

Trait Implementations

impl<'a> Copy for Token<'a>
[src]

impl<'a> Clone for Token<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> PartialEq for Token<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Eq for Token<'a>
[src]

impl<'a> PartialOrd for Token<'a>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> Ord for Token<'a>
[src]

This method returns an Ordering between self and other. Read more

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the maximum of two values. Read more

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the minimum of two values. Read more

impl<'a> Debug for Token<'a>
[src]

Formats the value using the given formatter.

impl<'a> Display for Token<'a>
[src]

Formats the value using the given formatter. Read more