diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-01-28 07:51:49 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-01-28 07:51:49 +0000 |
commit | efadcf715862a2d96af0f57d2b53bfa325390779 (patch) | |
tree | 6e930103a8b9e74041bf0e6e9f7c7e696d481afd /src/lexer | |
parent | 6d3caf58ca042cf6b5707822e51619adf511acd0 (diff) | |
parent | 50b9012e10d2fa74294547c25642b4a69fed4bda (diff) |
Merge #15
15: Add minimal docs to most public symbols r=matklad a=CAD97
Also sticks a safety on some warnings that rustc provides.
If you're just stubbing out a module and don't want rustc refusing to compile it because you haven't documented it yet, stick `#![allow(missing_docs)]` at the top.
Diffstat (limited to 'src/lexer')
-rw-r--r-- | src/lexer/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs index 2f8d3a402..65a994327 100644 --- a/src/lexer/mod.rs +++ b/src/lexer/mod.rs | |||
@@ -17,6 +17,7 @@ use self::strings::{is_string_literal_start, scan_byte_char_or_string, scan_char | |||
17 | mod comments; | 17 | mod comments; |
18 | use self::comments::{scan_comment, scan_shebang}; | 18 | use self::comments::{scan_comment, scan_shebang}; |
19 | 19 | ||
20 | /// Break a string up into its component tokens | ||
20 | pub fn tokenize(text: &str) -> Vec<Token> { | 21 | pub fn tokenize(text: &str) -> Vec<Token> { |
21 | let mut text = text; | 22 | let mut text = text; |
22 | let mut acc = Vec::new(); | 23 | let mut acc = Vec::new(); |
@@ -28,6 +29,7 @@ pub fn tokenize(text: &str) -> Vec<Token> { | |||
28 | } | 29 | } |
29 | acc | 30 | acc |
30 | } | 31 | } |
32 | /// Get the next token from a string | ||
31 | pub fn next_token(text: &str) -> Token { | 33 | pub fn next_token(text: &str) -> Token { |
32 | assert!(!text.is_empty()); | 34 | assert!(!text.is_empty()); |
33 | let mut ptr = Ptr::new(text); | 35 | let mut ptr = Ptr::new(text); |