Rust 1.7.0 Syntax base identifier (ident) and delimiter constraints

Source: Internet
Author: User
First, identifiers

Identifier is an identifier, abbreviated in the rust syntax ident .
Ident is made up of any non-empty Unicode characters.

Example:

In the attribute syntax, there are

meta_item : ident [ ‘=‘ literal  | ‘(‘ meta_seq ‘)‘ ] ? ;

The actual use is as follows:

#![crate_type = "lib"]#![allow(dead_code)]#![feature(intrinsics, lang_items)]#[test]

The above Crate_type, allow, feature, and test are all ident.

See Rust 1.7.0 Grammar Basics attribute

Second, delimiter constraints

The rust syntax specifies which characters cannot be used as delimiters, rather than what characters can be used as delimiters.

The constraint rules are as follows:

non_nullRepresents any single Unicode character, but excludes u+0000 (that is, excludes null)
non_eolIndicates a restricted non_null , excluding carriage return u+000a (' \ n ')
non_single_quoteRepresents a restricted non_null exclusion single quote u+0027 (')
non_double_quoteRepresents non_null a restricted exclusion of double quotes u+0022 (")

Rust 1.7.0 Syntax base identifier (ident) and delimiter constraints

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.