]> gitweb.factorcode.org Git - factor.git/blob - basis/xml/errors/debugger/debugger.factor
Switch to https urls
[factor.git] / basis / xml / errors / debugger / debugger.factor
1 ! Copyright (C) 2005, 2006 Daniel Ehrenberg
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors debugger io kernel prettyprint sequences
4 xml.errors xml.writer ;
5 IN: xml.errors.debugger
6
7 M: xml-error error.
8     "XML parsing error" print
9     "Line: " write dup line>> .
10     "Column: " write column>> . ;
11
12 M: expected error.
13     dup call-next-method
14     "Token expected: " write dup should-be>> print
15     "Token present: " write was>> print ;
16
17 M: unexpected-end error.
18     call-next-method
19     "File unexpectedly ended." print ;
20
21 M: missing-close error.
22     call-next-method
23     "Missing closing token." print ;
24
25 M: disallowed-char error.
26     dup call-next-method
27     "Disallowed character in XML document: " write
28     char>> write1 nl ;
29
30 M: multitags error.
31     drop "XML document contains multiple main tags" print ;
32
33 M: pre/post-content error.
34     "The text string:" print
35     dup string>> .
36     "was used " write
37     pre?>> "before" "after" ? write
38     " the main tag." print ;
39
40 M: no-entity error.
41     dup call-next-method
42     "Entity does not exist: &" write thing>> write ";" print ;
43
44 M: mismatched error.
45     dup call-next-method
46     "Mismatched tags" print
47     "Opening tag: <" write dup open>> print-name ">" print
48     "Closing tag: </" write close>> print-name ">" print ;
49
50 M: unclosed error.
51     dup call-next-method
52     "Unclosed tags" print
53     "Tags: " print
54     tags>> [ "  <" write print-name ">" print ] each ;
55
56 M: bad-uri error.
57     dup call-next-method
58     "Bad URI:" print string>> . ;
59
60 M: nonexist-ns error.
61     dup call-next-method
62     "Namespace " write name>> write " has not been declared" print ;
63
64 M: unopened error.
65     call-next-method
66     "Closed an unopened tag" print ;
67
68 M: not-yes/no error.
69     dup call-next-method
70     "standalone must be either yes or no, not \"" write
71     text>> write "\"." print ;
72
73 M: extra-attrs error.
74     dup call-next-method
75     "Extra attributes included in xml version declaration:" print
76     attrs>> . ;
77
78 M: bad-version error.
79     "XML version must be \"1.0\" or \"1.1\". Version here was " write
80     num>> . ;
81
82 M: notags error.
83     drop "XML document lacks a main tag" print ;
84
85 M: bad-prolog error.
86     dup call-next-method
87     "Misplaced XML prolog" print
88     prolog>> write-xml nl ;
89
90 M: capitalized-prolog error.
91     dup call-next-method
92     "XML prolog name was partially or totally capitalized, using" print
93     "<?" write name>> write "...?>" write
94     " instead of <?xml...?>" print ;
95
96 M: versionless-prolog error.
97     call-next-method
98     "XML prolog lacks a version declaration" print ;
99
100 M: bad-directive error.
101     dup call-next-method
102     "Unknown directive:" print
103     dir>> print ;
104
105 M: bad-decl error.
106     call-next-method "Extra content in directive" print ;
107
108 M: bad-external-id error.
109     call-next-method "Bad external ID" print ;
110
111 M: misplaced-directive error.
112     dup call-next-method
113     "Misplaced directive:" print
114     dir>> write-xml nl ;
115
116 M: bad-name error.
117     dup call-next-method
118     "Invalid name: " write name>> print ;
119
120 M: unclosed-quote error.
121     call-next-method
122     "XML document ends with quote still open" print ;
123
124 M: quoteless-attr error.
125     call-next-method "Attribute lacks quotes around value" print ;
126
127 M: attr-w/< error.
128     call-next-method
129     "Attribute value contains literal <" print ;
130
131 M: text-w/]]> error.
132     call-next-method
133     "Text node contains ']]>'" print ;
134
135 M: duplicate-attr error.
136     call-next-method "Duplicate attribute" print ;
137
138 M: bad-cdata error.
139     call-next-method "CDATA occurs before or after main tag" print ;
140
141 M: not-enough-characters error.
142     call-next-method
143     "Not enough characters" print ;
144
145 M: bad-doctype error.
146     call-next-method "DTD contains invalid object" print ;
147
148 M: bad-encoding error.
149     call-next-method
150     "Encoding in XML document does not exist" print ;