Commit Graph

32 Commits

Author SHA1 Message Date
jesopo 14d38192cf truncate on \r and \n too 2022-01-28 17:36:45 +00:00
jesopo e2f7c1eb84 merge tokenise() and tokenise_b() - using Union[str,bytes] 2020-09-30 20:00:36 +00:00
jesopo b9a2b6c1de raise ValueError when trying to tokenise without a command 2020-07-24 10:38:37 +00:00
jesopo c84509618f split tokenise.py to line.py and hostmask.py, rename hostmask parse
Line.hostmake now throws ValueError if source was None
2020-07-03 23:07:04 +01:00
jesopo 05be06a29c better test name for TokenTestNul 2020-05-15 16:46:01 +01:00
jesopo cbeb39628d truncate tokenisations at null byte 2020-05-15 16:41:12 +01:00
jesopo 0ce64137af always decode tags as utf8, use fallbacks for rest of line 2020-04-19 14:08:33 +01:00
jesopo c168ce00b5 add test cases for formatting from github:ircdocs/parser-tests 2020-03-23 16:59:56 +00:00
jesopo 5b998e816f don't force formatted commands to uppercase 2020-03-23 16:59:27 +00:00
jesopo a3b55f6292 add test/parser_tests.py, from github:ircdocs/parser-tests 2020-03-23 16:48:47 +00:00
jesopo 31ab81741e update tag tests for empty value being "", not None 2020-03-23 16:48:22 +00:00
jesopo 572c1e9b98 change Hostmask __init__, move tokenisation to Hostmask.from_source( 2020-03-15 19:46:33 +00:00
jesopo 89a2a6c131 replace irctokens.format() with irctokens.build().format() 2020-03-12 13:53:10 +00:00
jesopo 27058522b8 non-last params can't start with colon, support last param starting with colon 2020-03-12 08:28:44 +00:00
jesopo 3ae207aa05 lone backslashes at the end of escaped tag values should be removed 2020-03-11 23:56:53 +00:00
jesopo 38b98a15e3 don't gracefully handle spaces in non-last param, throw ValueError 2020-03-11 23:38:36 +00:00
jesopo e523f03d4f prevent tag replacements overlapping each other 2020-03-11 23:32:52 +00:00
jesopo a82105e09f gracefully handle spaces in non-last params (split them) 2020-03-11 23:05:11 +00:00
jesopo e41a58842b don't try to parse Line.source from Line.hostmask when it is None 2020-03-11 22:57:49 +00:00
jesopo 9cd39ddcdc add Line.hostmask property to lazy-parse .source in to a Hostmask 2020-03-11 20:17:56 +00:00
jesopo 2bc35c57f7 add hostmask parsing (irctokens.Hostmask("n!u@h")) 2020-03-11 18:04:50 +00:00
jesopo 86fad88f92 allow suppling encoding to StatefulEncoder and StatefulDecoder (and tests!) 2020-03-11 17:38:30 +00:00
jesopo 36225abd0c fix test/stateful_encode.py typos 2020-03-11 17:13:10 +00:00
jesopo 11834debff inclde test/stateful_encode.py in test/__init__.py 2020-03-11 17:11:38 +00:00
jesopo 53d056c3e0 add .clear() to StatefulDecoder too (and tests for .clear() on both statefuls) 2020-03-11 17:09:54 +00:00
jesopo 8773240c0c return Line objects successfully sent with StatefulEncoder.pop() 2020-03-11 16:30:44 +00:00
jesopo 49d2e78475 add a stateful encoder (irctokens.StatefulEncoder()) 2020-03-11 15:17:17 +00:00
jesopo 3cdc163b87 StatefulDecoder.push() should return None when given b"" (disconnect) 2020-03-11 15:16:49 +00:00
jesopo 949b10945e implement a stateful decoder (irctokens.StatefulDecoder()) 2020-03-11 14:50:31 +00:00
jesopo 33716efc22 add tests for Line formatting 2020-03-11 13:43:13 +00:00
jesopo cc8ebbe790 remove __name__==__main__ in test.tokenise 2020-03-11 13:42:57 +00:00
jesopo 972a1a3632 make tests.py a package 2020-03-11 12:21:11 +00:00