summaryrefslogtreecommitdiff
path: root/src/parse/parse.h
Commit message (Collapse)AuthorAgeFilesLines
* Add end-block-content parse eventDaniel Silverstone2019-12-011-0/+1
| | | | | | | | | | | | | | | In order to cope with a situation where a block ends with a selector which has no ruleset, add an end-block-content event and in handling it, pop any intermediate states off the language stack so that we're in block mode by the time the event is completed. This fixes an assert situation caused by a ruleset such as: @media screen { dodgy } .outer { top: 10px; } Which has been encountered in the wild (likely a typo). Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* HACKS for testing Media Queries parsing.Michael Drake2019-03-101-0/+2
| | | | | | | | | | | Top level stylesheets need to have their media query passed in. So we need a way to parse standalone media queries. This was hacked together to explore doing that. However, it encounteded an issue where it seems the parseAtRule() function in src/parse/parse.c doesn't handle the full grammar for media queries.
* Strip trailing whitespace.Michael Drake2017-09-041-4/+4
|
* Various changes which modify API and ABI:Michael Drake2013-12-131-3/+1
| | | | | | | | | - Remove client allocation function. - Change node_classes callback not to yield array ownership to libcss. - Node bloom filters now built by, during selection libcss. - Added selection callbacks to get and set data on document nodes. Test suite, example, and documentation updated to match.
* Rename all css_[^_] internal symbols to css__ so that they're nicely namespacedDaniel Silverstone2011-01-261-7/+7
| | | | svn path=/trunk/libcss/; revision=11492
* Fix renaming of css_parser_parse_chunk from css_parser_css__parse_chunk to ↵Daniel Silverstone2011-01-261-1/+1
| | | | | | css__parser_parse_chunk svn path=/trunk/libcss/; revision=11491
* Ensure there are zero global symbols without css_ or css__ in front of them. ↵Daniel Silverstone2011-01-201-3/+3
| | | | | | This helps prevent confusion if someone else wants a function called parse_background or similar svn path=/trunk/libcss/; revision=11416
* Fix libcss to use new libwapcaplet behaviour.Daniel Silverstone2010-03-271-2/+2
| | | | | | | TODO: update the tests to include a refcounting proof svn path=/trunk/libcss/; revision=10162
* Support for parsing inline stylesJohn Mark Bell2009-06-261-0/+3
| | | | svn path=/trunk/libcss/; revision=8024
* A bunch of c89.John Mark Bell2009-04-151-2/+2
| | | | | | | Lose trailing commas. GCC 2.95 compatibility. svn path=/trunk/libcss/; revision=7099
* Quirks mode parsingJohn Mark Bell2009-02-151-0/+1
| | | | svn path=/trunk/libcss/; revision=6519
* Port libcss to libwapcaplet.Daniel Silverstone2009-02-141-5/+3
| | | | | | | | | It passes the tests, perhaps we need more of them. Lifetimes of lwc_string objects really need attention before we can consider this finished. svn path=/trunk/libcss/; revision=6517
* Drop css_error_handler and rename css_alloc to css_allocator_fnDaniel Silverstone2009-02-141-1/+1
| | | | svn path=/trunk/libcss/; revision=6482
* Retain pointer to dictionary entries so we don't have to rediscover it later.John Mark Bell2008-12-011-1/+1
| | | | svn path=/trunk/libcss/; revision=5862
* Use parserutils_hash instead of parserutils_dict.John Mark Bell2008-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | This approximately halves the size of the interned string table. We now have the following for allzengarden.css: 5507 slots used (of 8192 => 67.224121%) Data: 3 full blocks: 12288 bytes 10 partial blocks: 38946 bytes (of 40960 => 95.083008%) Total: 53488 (4112) (32) Entries: 21 full blocks: 86016 bytes 1 partial blocks: 2096 bytes (of 4096 => 51.171875%) Total: 90496 (4112) (32) Hash structures: 65592 Which gives a total dictionary size of 209,576 bytes. Note that 43% of this is parserutils_hash_entry structures (length-pointer pairs). It would be good, therefore, to be able to purge these. svn path=/trunk/libcss/; revision=5852
* css_string is now the same as a parserutils_dict_entry. This allows us to ↵John Mark Bell2008-11-271-1/+3
| | | | | | | | | | use dict entries directly as strings. iChange the way in which selectors are represented. This significantly reduces memory requirements -- reducing the approximate usage count (excludes the string dictionary, which is about 360k) of allzengarden.css from 4,535,400 bytes to 2,414,312 bytes on a 64bit platform. The string dictionary is now created and owned by the stylesheet object. The parser is just given access to this so that it can store strings in it. svn path=/trunk/libcss/; revision=5809
* Port libcss to new lpu API.John Mark Bell2008-11-091-3/+3
| | | | | | Make lexer, core parser, and css21 parser constructors&destructors return errors svn path=/trunk/libcss/; revision=5674
* Make selector token vector be associated with the ruleset, rather than ↵John Mark Bell2008-08-051-1/+0
| | | | | | | | | having its own event type. Store details about the current construct on the context stack. Document block-content, selector, and declaration stuff. svn path=/trunk/libcss/; revision=4921
* Beginnings of a mechanism to intern known strings and compare pointers ↵John Mark Bell2008-08-041-0/+3
| | | | | | effectively. svn path=/trunk/libcss/; revision=4903
* Change API of event callback to return css_error (this is more useful than bool)John Mark Bell2008-08-041-1/+1
| | | | | | Implement all the context-related event handlers in the stage 2 parser. svn path=/trunk/libcss/; revision=4898
* Stub out a CSS 2.1 stage 2 parser.John Mark Bell2008-08-011-2/+3
| | | | | | Parser core doesn't need to know about css_stylesheet, so change its API. svn path=/trunk/libcss/; revision=4854
* Generate and emit eventsJohn Mark Bell2008-07-301-0/+28
| | | | svn path=/trunk/libcss/; revision=4828
* Implement the first-stage parser.John Mark Bell2008-07-301-0/+45
Things missing: 1) Recovery after parse errors 2) Event emission (the locations of DEBUG_EVENTS are about right for this) 3) A second-stage parser 4) Any kind of testsuite svn path=/trunk/libcss/; revision=4825