summaryrefslogtreecommitdiff
path: root/AK/GenericLexer.h
AgeCommit message (Collapse)Author
2020-10-02AK+Format: Do some housekeeping in the format implementation.asynts
2020-09-27AK: Remove the ctype adapters and use the actual ctype functions insteadBenoît Lormeau
This finally takes care of the kind-of excessive boilerplate code that were the ctype adapters. On the other hand, I had to link `LibC/ctype.cpp` to the Kernel (for `AK/JsonParser.cpp` and `AK/Format.cpp`). The previous commit actually makes sense now: the `string.h` includes in `ctype.{h,cpp}` would require to link more LibC stuff to the Kernel when it only needs the `_ctype_` array of `ctype.cpp`, and there wasn't any string stuff used in ctype. Instead of all this I could have put static derivatives of `is_any_of()` in the concerned AK files, however that would have meant more boilerplate and workarounds; so I went for the Kernel approach.
2020-09-27AK: Use templates instead of Function for Conditions in the GenericLexerBenoit Lormeau
Since commit 1ec59f28cea56f1afced0994127e2df62300e618 turns the ctype macros into functions we can now feed them directly to a GenericLexer! This will lead to removing the ctype adapters that were kind-of excessive boilerplate, but needed as the Kernel doesn't compile with the LibC.
2020-09-26AK: Enhance GenericLexer's string consumptionBenoit Lormeau
The `consume_quoted_string()` can now take an escape character. This allows it (for example) to capture a string's enclosing quotes. The escape character is optional by default. You can also consume and unescape a quoted string with the eponymous method `consume_and_unescape_string()`. It takes an escape character as parameter (backslash by default). It builds a String in which common escape sequences get... unescaped :^) (e.g. \n, \r, \t...).
2020-09-26AK: Added explanatory comments in GenericLexer.hBenoit Lormeau
2020-09-26AK: Add GenericLexer::remaining.asynts
This is useful for debugging with printf :^).
2020-08-31AK: Add is_any_of(StringView) to GenericLexerAnotherTest
2020-08-21LibWeb: Use GenericLexer in WrapperGeneratorNico Weber
2020-08-09AK: Add a GenericLexer and extend the JsonParser with it (#2696)Benoît Lormeau