From 75ea815ba51587dccb3fc70b416152d90ecb9897 Mon Sep 17 00:00:00 2001 From: xqtc Date: Fri, 12 Jul 2024 19:04:15 +0200 Subject: [PATCH] Docs --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index e35631a..5c4e59f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,6 +61,16 @@ pub struct Lexer { /// Instantiates Lexer and retrieves Tokens of given source. /// Returns Arc<[Token]> +/// # Example: +/// ``` +/// let lexed: Arc<[Token]> = lex!(r#" +/// #version 440 +/// uniform float time; +/// void main() { +/// gl_FragColor = vec4(1.0, 0.5, 0.2, 1.0); +/// } +/// "#); +/// ``` /// Equivalent to: /// ``` /// let source = "some source";