1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
//! Variant of PHtml that parses only entities. 
//! 
//! This parser is the default for arguments. 
//! 
//! Created 2000-01-28 by Martin Stjernholm. 
//! 
//! $Id: PEnt.pike,v 1.5 2000/02/11 01:09:13 mast Exp $ 
 
//#pragma strict_types // Disabled for now since it doesn't work well enough. 
 
inherit RXML.PHtml; 
 
// Block these to avoid confusion. 
constant add_tag = 0; 
constant add_tags = 0; 
constant add_container = 0; 
constant add_containers = 0; 
 
this_program clone (RXML.Context ctx, RXML.Type type, RXML.TagSet tag_set) 
{ 
  return [object(this_program)] _low_clone (ctx, type, tag_set); 
} 
 
static void create ( 
  RXML.Context ctx, RXML.Type type, RXML.TagSet tag_set) 
{ 
  _tag_set_parser_create (ctx, type, tag_set); 
 
  array(RXML.TagSet) list = ({tag_set}); 
  for (int i = 0; i < sizeof (list); i++) { 
    array(RXML.TagSet) sublist = list[i]->imported; 
    if (sizeof (sublist)) 
      list = list[..i] + sublist + list[i + 1..]; 
  } 
  for (int i = sizeof (list) - 1; i >= 0; i--) 
    if (list[i]->low_entities) add_entities (list[i]->low_entities); 
 
  mixed_mode (!type->free_text); 
  ignore_tags (1); 
  lazy_entity_end (1); 
  match_tag (0); 
  _set_entity_callback (.utils.p_html_entity_cb); 
  if (!type->free_text) _set_data_callback (.utils.return_empty_array); 
} 
 
// These have no effect since we don't parse tags. 
void add_runtime_tag (RXML.Tag tag) {} 
void remove_runtime_tag (string|RXML.Tag tag) {} 
 
#ifdef OBJ_COUNT_DEBUG 
string _sprintf() {return "RXML.PEnt(" + __count + ")";} 
#else 
string _sprintf() {return "RXML.PEnt";} 
#endif