Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn comments around 'Syntax' into docstrings #803

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ use crate::uint::UInt;
#[cfg(not(target_arch = "wasm32"))]
use proptest::prelude::*;

// Lurk syntax
/// Lurk's syntax for parsing
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Syntax<F: LurkField> {
/// An element of the finite field `F`
Num(Pos, Num<F>),
// A u64 integer: 1u64, 0xffu64
/// A u64 integer: 1u64, 0xffu64
UInt(Pos, UInt),
// A hierarchical symbol foo, foo.bar.baz or keyword :foo
/// A hierarchical symbol: foo, foo.bar.baz or keyword :foo
Symbol(Pos, SymbolRef),
// A string literal: "foobar", "foo\nbar"
/// A string literal: "foobar", "foo\nbar"
String(Pos, String),
// A character literal: #\A #\λ #\u03BB
/// A character literal: 'A', 'λ'
Char(Pos, char),
// A quoted expression: 'a, '(1 2)
/// A quoted expression: 'a, '(1 2)
Quote(Pos, Box<Syntax<F>>),
// A nil-terminated cons-list of expressions: (1 2 3)
/// A nil-terminated cons-list of expressions: (1 2 3)
List(Pos, Vec<Syntax<F>>),
// An improper cons-list of expressions: (1 2 . 3)
/// An improper cons-list of expressions: (1 2 . 3)
Improper(Pos, Vec<Syntax<F>>, Box<Syntax<F>>),
}

Expand Down
Loading