mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-11-30 04:40:47 +01:00
more consistant quote handling
This commit is contained in:
parent
c79166cd03
commit
acf70c03d4
11 changed files with 131 additions and 109 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::common::{split_once, Team};
|
||||
use crate::{Error, IResult, Result};
|
||||
use crate::{Error, Result};
|
||||
use crate::{SubjectError, SubjectId};
|
||||
use chrono::{NaiveDate, NaiveDateTime};
|
||||
use logos::{Lexer, Logos};
|
||||
|
|
@ -109,8 +109,13 @@ fn test_split_player_subject() {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn against_subject_parser(input: &str) -> IResult<RawSubject> {
|
||||
subject_parser(input).map_err(|_| Error::Incomplete)
|
||||
pub fn against_subject_parser(input: &str) -> Result<RawSubject> {
|
||||
// "against" fields are always players, and unquoted
|
||||
if input.ends_with("e>") {
|
||||
Ok(RawSubject::Console)
|
||||
} else {
|
||||
Ok(RawSubject::Player(input))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn subject_parser(input: &str) -> Result<(&str, RawSubject)> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue