1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
Commit Graph

105 Commits

Author SHA1 Message Date
Witold Filipczyk
2bb62d3a58 [dom] enum sgml_token_type -> unsigned int 2022-01-26 19:11:13 +01:00
Witold Filipczyk
9bed733621 [dom] enum dom_stack_flag -> unsigned int 2022-01-26 19:06:38 +01:00
Witold Filipczyk
6d227f98a2 [dom] enum scanner_state -> unsigned int 2022-01-26 19:02:56 +01:00
Witold Filipczyk
12e09622eb [dom] enum sgml_parser_flag -> unsigned int 2022-01-26 18:58:23 +01:00
Witold Filipczyk
2764b531ea [dom] return enum not int 2022-01-26 18:54:02 +01:00
Witold Filipczyk
d822b6af9c [dom] casts 2022-01-24 20:24:44 +01:00
Witold Filipczyk
f359d8e97b [dom] cast 2022-01-24 19:52:46 +01:00
Witold Filipczyk
8999a19593 [cast] Explicit casts for narrowing conversions 2022-01-17 17:07:46 +01:00
Witold Filipczyk
881f896e85 [mem_calloc] Cast 2022-01-16 21:08:50 +01:00
Witold Filipczyk
0fea79cc8f [cflags] Removed -Wno-pointer-sign
Likely some new bugs were introduced by this change.
The long term goal is clean compilation by g++.
2021-01-02 16:20:27 +01:00
Witold Filipczyk
1f57e72212 [mozjs24] Allow build elinks with g++
SpiderMonkey was updated to mozjs24. If you want to build elinks
with ecmascript support, you must compile using g++ with -fpermissive .
There is a lot of warnings.
There are some memleaks in ecmascript code, especially related to JSAutoCompartment.
I don't know yet, where and how to free it.

Debian does not support mozjs24, so I'm going to gradually update SpiderMonkey version.
2020-10-05 20:14:55 +02:00
Witold Filipczyk
5f87bdbcb2 [meson] meson build scripts.
Not finished yet, but I added to motivate myself and others.
The goal is to get a few seconds faster builds.

autotools still will be available.
2020-09-05 22:06:01 +02:00
Jonas Fonseca
1d62835148 Make non-standard pluginspage attribute to embed hyperlinkable
Appears on page reachable from links on
http://www.gilbertogil.com.br/sec_discografia_view.php?id=17
2007-04-27 16:25:36 +02:00
Jonas Fonseca
93e9cf089e DOM: Change code documentation to be Doxygen "compliant" 2006-12-10 01:17:35 +01:00
Jonas Fonseca
4d248638be Remove empty first lines; a remnant from when CVS Id tags was in play 2006-12-09 22:54:22 +01:00
Laurent MONIN
5acb5e6663 Trim trailing whitespaces. 2006-05-31 19:34:49 +02:00
Jonas Fonseca
a983603863 DOM: Rename src/dom/dom.h src/dom/code.h
Additionally, add API doc mark.
2006-01-31 23:30:55 +01:00
Jonas Fonseca
92a9cafb6e DOM: Replace various DOM status/error/exception codes with dom_code enum
Replaces sgml_parser_code, dom_stack_code, and dom_exception_code and
generally tries to simplify things and remove redundant codes.
2006-01-31 22:01:35 +01:00
Jonas Fonseca
f8a86a26c4 DOM: Add simple stack context based utility for dumping DOM trees to SGML 2006-01-30 06:07:16 +01:00
Jonas Fonseca
a3dcc7d5e5 DOM: Change the attribute node's quoted member to be unsigned char
It can hold NUL, ', or " depending on not quoted, single quoted or double
quoted.
2006-01-30 06:05:32 +01:00
Jonas Fonseca
9fe0608bd2 DOM: Fix checking of out-of-bound access to scanned strings 2006-01-29 12:12:41 +01:00
Jonas Fonseca
2918e3f595 DOM: Add STATIC_DOM_STRING macro and make INIT_DOM_STRING cleaner 2006-01-28 22:55:15 +01:00
Jonas Fonseca
b6b6d3c67e DOM: Allocate all node strings when doing incremental rendering
This changes init_dom_node_() to take an allocated argument saying whether
to allocate or not. If the value is -1, node->allocated will be set to the
value of node->parent->allocated. This way the value is inherited like we
do it in the menu code. It should be a sane default since we eventually
want not to rely on the 'underlying' source of the document and there will
be less variables to pass around.
2006-01-28 04:51:25 +01:00
Jonas Fonseca
95c1de2315 Fix handling of incomplete processing instructions
When doing incremental rendering we now require the whole thing to be there
and that there is room for two tokens in the scanner token table.  This is
necessary because we have to generate both a processing target token and a
processing data token to make life simpler for the parser.

Remove processing instruction data case label from the main parser loop. It
is safer this way since it already assumes that the processing target token
has been stored.
2006-01-28 03:35:36 +01:00
Jonas Fonseca
823c594524 Use ssize_t instead of size_t for length since it must carry a signed value 2006-01-28 03:24:16 +01:00
Jonas Fonseca
00c4e0bfa2 Do not attempt to read *string when string == scanner->end
There might be other places that needs to be reviewd for this.
2006-01-28 03:23:06 +01:00
Jonas Fonseca
d92a074e40 Fix parsing of '<a< b>' where the scanner didn't rewind to the proper place
Add test for this tag soup combo.
2006-01-28 03:21:27 +01:00
Jonas Fonseca
e5e06764c4 Improve checks for incompleteness when parsing attributes
Check whether there are '=' and value tokens before handling them. If there
is any doubt the whole attribute structure is 'pushed back' into the
stream. That way incremental parsing will not add the value as a new
attribute because the name token was handled in the previous parsing run.
2006-01-28 01:40:56 +01:00
Jonas Fonseca
4ab1dde874 Preserve the scanner state when it is not the 'default' state
This is necessary to make it possible to resume parsing of element
attributes. Allows the incomplete string in the parsing state struct to
be unset.
2006-01-28 01:24:30 +01:00
Jonas Fonseca
c6e83d1d9c Assert parsing depth >= parser stack depth
Like the comment says popping parsing nodes during incremental parsing
might trigger this.
2006-01-28 01:12:03 +01:00
Jonas Fonseca
9e7b0d4fa3 Remove assertion logic from parse_sgml_attributes()
They are getting out of hand and making it hard to use the function in
'unusual' situations (like when resuming parsing inside elements).
2006-01-28 01:09:05 +01:00
Jonas Fonseca
1e104afbba Improve error checking when adding nodes
Fail with SGML_PARSER_CODE_MEM_ALLOC.
2006-01-28 01:05:42 +01:00
Jonas Fonseca
74728cab05 Also set the node subtype for <?xml-stylesheet?> 2006-01-28 01:00:28 +01:00
Jonas Fonseca
bccf5512d6 Force an incomplete token for quoted attribute values when there's no end 2006-01-28 00:56:48 +01:00
Jonas Fonseca
b25cd27232 Add support incremental parsing
That is, add the last parts that saves and resumes previous incomplete
parsing states. Now the parsing stack push handler checks if the parent has
a resume flag set. When set, the incomplete fragment to resume is restored
and the new source fragment appended and parsing is continued.
2006-01-27 07:47:17 +01:00
Jonas Fonseca
9d91994f3c Propone updating the scanner->state until incompleteness has been checked
That way the scanner state is meaningful when resuming during incremental
parsing.
2006-01-27 07:41:42 +01:00
Jonas Fonseca
afb45aace5 Add support for scanning comment endings such as '--!>' correctly 2006-01-25 18:18:01 +01:00
Jonas Fonseca
126ae8c764 #include dom/node.h instead of dom/stack.h 2006-01-19 04:50:10 +01:00
Jonas Fonseca
eecc22751d Use dom_stack_code enum for dom_stack_callback_T 2006-01-16 00:55:58 +01:00
Jonas Fonseca
4a2cde1c00 Introduce dom_stack_code enum and use it for push_dom_node() 2006-01-16 00:40:51 +01:00
Jonas Fonseca
2748d043f9 Autogenerate .vimrc files and put the master in config/vimrc
This changes the init target to be idempotent: most importantly it will now
never overwrite a Makefile if it exists. Additionally 'make init' will
generate the .vimrc files. Yay, no more stupid 'added fairies' commits! ;)
2006-01-15 18:38:58 +01:00
Jonas Fonseca
c8aa6c2360 Move struct sgml_parsing_state near the parsing state managing 2006-01-14 12:11:35 +01:00
Jonas Fonseca
e70b779366 Add code member to struct sgml_parser and simplify parsing state setup
parse_sgml() now just pushes a text node on the parsing state and the push
handler will now call parse_sgml_plain() and save the return code in
parser->code so parse_sgml() can return it. Much simpler.
2006-01-14 12:09:17 +01:00
Jonas Fonseca
0950996dd8 Change parse_sgml() to take buf+bufsize instead of DOM string 2006-01-14 11:32:11 +01:00
Jonas Fonseca
aecfb28711 Cleanup SGML info backends #includes and description 2006-01-14 08:07:00 +01:00
Laurent MONIN
5685221512 Trim trailing whitespaces. 2006-01-13 00:11:39 +01:00
Jonas Fonseca
2d80258f72 Mark doc'd headers with: /* API Doc :: <api-name> */ 2006-01-11 11:03:59 +01:00
Jonas Fonseca
938c8a80b4 Support more implicit markup of source files 2006-01-09 11:01:36 +01:00
Jonas Fonseca
db11b6452f Fix a typo and a ref:[] 2006-01-09 01:20:03 +01:00
Jonas Fonseca
5b818b20ba Use the new asciidoc code markup to document the DOM sgml parser 2006-01-08 23:36:07 +01:00