Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
#[repr(u16)]
pub enum SyntaxKind {
Show 100 variants Whitespace = 0, LineComment = 1, BlockComment = 2, Ident = 3, DelimitedIdent = 4, SingleQuotedString = 5, DoubleQuotedString = 6, TripleQuotedString = 7, Integer = 8, Decimal = 9, LongNumber = 10, Date = 11, DateTime = 12, Time = 13, DollarIdent = 14, MetadataPrefix = 15, LParen = 16, RParen = 17, LBrace = 18, RBrace = 19, LBracket = 20, RBracket = 21, Comma = 22, Semicolon = 23, Colon = 24, Dot = 25, DotDot = 26, Arrow = 27, Eq = 28, EqEq = 29, Neq = 30, Tilde = 31, NotTilde = 32, Lt = 33, Le = 34, Gt = 35, Ge = 36, Shl = 37, Shr = 38, Plus = 39, Minus = 40, Star = 41, Slash = 42, Amp = 43, Pipe = 44, Percent = 45, Unknown = 46, SourceFile = 47, Metadata = 48, ConceptMap = 49, ConceptMapPrefix = 50, ConceptMapUnmapped = 51, ConceptMapEntry = 52, ConceptMapCode = 53, ConceptMapRelation = 54, MapDeclaration = 55, UsesDeclaration = 56, UsesAlias = 57, ImportsDeclaration = 58, ConstantDeclaration = 59, Group = 60, ParameterList = 61, Parameter = 62, TypeAnnotation = 63, ExtendsClause = 64, TypeMode = 65, RuleBlock = 66, Rule = 67, SourceList = 68, Source = 69, Cardinality = 70, DefaultClause = 71, SourceListMode = 72, Alias = 73, WhereClause = 74, CheckClause = 75, LogClause = 76, TargetList = 77, Target = 78, Transform = 79, TargetListMode = 80, Invocation = 81, ArgumentList = 82, DependentClause = 83, IdentityList = 84, RuleName = 85, QualifiedName = 86, Literal = 87, Quantity = 88, NameRef = 89, ExternalConstant = 90, ParenExpr = 91, MemberExpr = 92, CallExpr = 93, IndexExpr = 94, PrefixExpr = 95, BinaryExpr = 96, TypeExpr = 97, NullLiteral = 98, Error = 99,
}
Expand description

Every token and node kind in an FML syntax tree.

FML keywords are contextual: source, group, where and the rest are also valid element names. The lexer therefore produces SyntaxKind::Ident for every word and the parser decides what a word means from where it appears.

Variants§

§

Whitespace = 0

§

LineComment = 1

§

BlockComment = 2

§

Ident = 3

§

DelimitedIdent = 4

`name`

§

SingleQuotedString = 5

'text'

§

DoubleQuotedString = 6

"text"

§

TripleQuotedString = 7

""" … """, used for markdown metadata values.

§

Integer = 8

§

Decimal = 9

§

LongNumber = 10

10L

§

Date = 11

@2024-01-01

§

DateTime = 12

@2024-01-01T10:00:00Z

§

Time = 13

@T10:00

§

DollarIdent = 14

$this, $index, $total

§

MetadataPrefix = 15

/// at the start of a metadata line.

§

LParen = 16

§

RParen = 17

§

LBrace = 18

§

RBrace = 19

§

LBracket = 20

§

RBracket = 21

§

Comma = 22

§

Semicolon = 23

§

Colon = 24

§

Dot = 25

§

DotDot = 26

..

§

Arrow = 27

->

§

Eq = 28

=

§

EqEq = 29

==

§

Neq = 30

!=

§

Tilde = 31

~

§

NotTilde = 32

!~

§

Lt = 33

§

Le = 34

§

Gt = 35

§

Ge = 36

§

Shl = 37

<<

§

Shr = 38

>>

§

Plus = 39

§

Minus = 40

§

Star = 41

§

Slash = 42

§

Amp = 43

§

Pipe = 44

§

Percent = 45

§

Unknown = 46

A character the lexer does not recognise, or an unterminated literal.

§

SourceFile = 47

§

Metadata = 48

/// key = value

§

ConceptMap = 49

conceptmap "url" { … }

§

ConceptMapPrefix = 50

prefix s = "url"

§

ConceptMapUnmapped = 51

unmapped for s = provided

§

ConceptMapEntry = 52

s:code - t:code

§

ConceptMapCode = 53

s:code

§

ConceptMapRelation = 54

The relationship operator between two concept map codes.

§

MapDeclaration = 55

map "url" = "name"

§

UsesDeclaration = 56

uses "url" alias Name as source

§

UsesAlias = 57

alias Name

§

ImportsDeclaration = 58

imports "url"

§

ConstantDeclaration = 59

let name = expression;

§

Group = 60

group Name(…) extends Base <<types>> { … }

§

ParameterList = 61

(source src : Type, target tgt : Type)

§

Parameter = 62

source src : Type

§

TypeAnnotation = 63

: Type

§

ExtendsClause = 64

extends Base

§

TypeMode = 65

<<types>> or <<type+>>

§

RuleBlock = 66

{ rule; rule; }

§

Rule = 67

§

SourceList = 68

The sources of a rule, separated by commas.

§

Source = 69

§

Cardinality = 70

0..*

§

DefaultClause = 71

default (expression)

§

SourceListMode = 72

first, not_first, last, not_last, only_one

§

Alias = 73

as name

§

WhereClause = 74

where (expression)

§

CheckClause = 75

check (expression)

§

LogClause = 76

log (expression)

§

TargetList = 77

The targets of a rule, separated by commas.

§

Target = 78

§

Transform = 79

= transform on a target.

§

TargetListMode = 80

first, last, single, share id, collate

§

Invocation = 81

name(arguments), a transform or a group invocation.

§

ArgumentList = 82

(argument, argument)

§

DependentClause = 83

then Group(a, b) { … }

§

IdentityList = 84

: field, field, in the batch identity rule form.

§

RuleName = 85

"name" after a rule.

§

QualifiedName = 86

a.b.c

§

Literal = 87

A literal value.

§

Quantity = 88

5 'mg', 3 days

§

NameRef = 89

name in an expression.

§

ExternalConstant = 90

%name

§

ParenExpr = 91

(expression)

§

MemberExpr = 92

expression.member or expression.function(…)

§

CallExpr = 93

function(arguments)

§

IndexExpr = 94

expression[index]

§

PrefixExpr = 95

-expression

§

BinaryExpr = 96

left op right

§

TypeExpr = 97

expression is Type, expression as Type

§

NullLiteral = 98

{}

§

Error = 99

Tokens the parser could not place.

Implementations§

Source§

impl SyntaxKind

Source

pub fn is_trivia(self) -> bool

Whitespace and comments.

Source

pub fn is_comment(self) -> bool

Trait Implementations§

Source§

impl Clone for SyntaxKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SyntaxKind

Source§

impl Debug for SyntaxKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SyntaxKind

Source§

impl From<SyntaxKind> for SyntaxKind

Source§

fn from(kind: SyntaxKind) -> Self

Converts to this type from the input type.
Source§

impl Hash for SyntaxKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for SyntaxKind

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for SyntaxKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for SyntaxKind

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for SyntaxKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.