automata/ical/lexer

Types

pub type LexError {
  EmptyInput
  MalformedLine(line: Int, raw: String)
  MalformedParameter(line: Int, raw: String)
}

Constructors

  • EmptyInput
  • MalformedLine(line: Int, raw: String)
  • MalformedParameter(line: Int, raw: String)

物理行を unfold した後の論理行。 text: unfold 済みの 1 論理行の生テキスト line: 論理行の開始物理行番号 (1-origin)

pub type LogicalLine {
  LogicalLine(text: String, line: Int)
}

Constructors

  • LogicalLine(text: String, line: Int)

Values

pub fn tokenize_line(
  line: LogicalLine,
) -> Result(ast.RawProperty, LexError)

論理行を name / parameters / raw_value に分解した RawProperty にする。

pub fn unfold(
  input: String,
) -> Result(List(LogicalLine), LexError)

入力文字列を RFC 5545 §3.1 に従って unfold し、 空行を除いた LogicalLine のリストを返す。

Search Document