Commit cd767e425d1eb154cfb831ab5dee39da7ac48fb7

Authored by David RENE
1 parent eef3fb16

Fix cookies value parsing.

Fix some path concerning jQuery files
web/CXM_cookies.anubis
@@ -141,7 +141,31 @@ define Bool @@ -141,7 +141,31 @@ define Bool
141 if c +< 124 then false else 141 if c +< 124 then false else
142 if c = 124 then true else 142 if c = 124 then true else
143 c = 126. 143 c = 126.
144 - 144 +
  145 + value char are token added of =, (, )
  146 +
  147 +define Bool
  148 + is_value_char
  149 + (
  150 + Word8 c
  151 + ) =
  152 + if c +< 33 then false else
  153 + if c +< 34 then true else
  154 + if c +< 35 then false else
  155 + if c +< 44 then true else
  156 + if c +< 45 then false else
  157 + if c +< 47 then true else
  158 + if c +< 48 then false else
  159 + if c +< 58 then true else
  160 + if c +< 61 then false else
  161 + if c +< 62 then true else
  162 + if c +< 65 then false else
  163 + if c +< 91 then true else
  164 + if c +< 94 then false else
  165 + if c +< 123 then true else
  166 + if c +< 124 then false else
  167 + if c = 124 then true else
  168 + c = 126.
145 169
146 From the grammar, it is clear that atomic entities (called 'tokens' by YACC) are: 170 From the grammar, it is clear that atomic entities (called 'tokens' by YACC) are:
147 171
@@ -215,14 +239,15 @@ define One @@ -215,14 +239,15 @@ define One
215 define Atom 239 define Atom
216 read_token 240 read_token
217 ( 241 (
218 - List(Word8) so_far // contains at least 1 character 242 + List(Word8) so_far, // contains at least 1 character
  243 + (Word8) -> Bool is_valid_char
219 ) = 244 ) =
220 if next_char is 245 if next_char is
221 { 246 {
222 - failure then recognize_keyword(implode(reverse(so_far))),  
223 - success(c) then  
224 - if is_token_char(c)  
225 - then read_token([c . so_far]) 247 + failure then recognize_keyword(implode(reverse(so_far))),
  248 + success(c) then
  249 + if is_valid_char(c)
  250 + then read_token([c . so_far], is_valid_char)
226 else unput_char; recognize_keyword(implode(reverse(so_far))) 251 else unput_char; recognize_keyword(implode(reverse(so_far)))
227 }. 252 }.
228 253
@@ -260,7 +285,7 @@ define Atom @@ -260,7 +285,7 @@ define Atom
260 failure then end_of_input, 285 failure then end_of_input,
261 success(c) then 286 success(c) then
262 if is_blank(c) then read_atom else // skip blanks 287 if is_blank(c) then read_atom else // skip blanks
263 - if is_token_char(c) then read_token([c]) else 288 + if is_token_char(c) then read_token([c], is_token_char) else
264 if c = '\"' then read_quoted_string([]) else 289 if c = '\"' then read_quoted_string([]) else
265 if c = '=' then equals else 290 if c = '=' then equals else
266 if c = ':' then colon else 291 if c = ':' then colon else
@@ -271,7 +296,26 @@ define Atom @@ -271,7 +296,26 @@ define Atom
271 unput_atoms <- t; h 296 unput_atoms <- t; h
272 }. 297 }.
273 298
274 - 299 +define Atom
  300 + read_value
  301 + =
  302 + if *unput_atoms is
  303 + {
  304 + [ ] then
  305 + if next_char is
  306 + {
  307 + failure then end_of_input,
  308 + success(c) then
  309 + if is_blank(c) then read_value else // skip blanks
  310 + if is_value_char(c) then read_token([c], is_value_char) else
  311 + if c = '\"' then read_quoted_string([]) else
  312 + if c = ';' then semi_colon else
  313 + error
  314 + },
  315 + [h . t] then
  316 + unput_atoms <- t; h
  317 + }.
  318 +
275 Reading an attribute-value pair. 319 Reading an attribute-value pair.
276 320
277 type AttrVal: 321 type AttrVal:
@@ -422,7 +466,8 @@ define Maybe(Cookie) @@ -422,7 +466,8 @@ define Maybe(Cookie)
422 ) = 466 ) =
423 if read_attr_val is 467 if read_attr_val is
424 { 468 {
425 - failure then success(cookie( 469 + failure then
  470 + success(cookie(
426 *server_name, 471 *server_name,
427 name, 472 name,
428 value, 473 value,
@@ -442,7 +487,8 @@ define Maybe(Cookie) @@ -442,7 +487,8 @@ define Maybe(Cookie)
442 ( 487 (
443 String name 488 String name
444 ) = 489 ) =
445 - with a = read_atom, 490 + with a = read_value,
  491 +
446 if a is token(value) then read_cookie_n_e_v(name,value,[]) else 492 if a is token(value) then read_cookie_n_e_v(name,value,[]) else
447 if a is quoted_string(value) then read_cookie_n_e_v(name,value,[]) else 493 if a is quoted_string(value) then read_cookie_n_e_v(name,value,[]) else
448 unput_atom(a); failure. 494 unput_atom(a); failure.
web/CXM_making_a_web_site.anubis
@@ -1836,7 +1836,6 @@ define (String state_name) -&gt; PreviousState($State) @@ -1836,7 +1836,6 @@ define (String state_name) -&gt; PreviousState($State)
1836 ) = 1836 ) =
1837 (String state_name) |-> 1837 (String state_name) |->
1838 with file_path = state_directory+"/s"+state_name, 1838 with file_path = state_directory+"/s"+state_name,
1839 - //println("Retreive state ["+file_path+"]");  
1840 if (RetrieveResult((Int,$State)))retrieve(file_path) is ok(d) 1839 if (RetrieveResult((Int,$State)))retrieve(file_path) is ok(d)
1841 then ( 1840 then (
1842 if d is (time_stamp,s) then 1841 if d is (time_stamp,s) then
web/jQuery/CXM_jquery_button.anubis
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 9
10 read calexium_lib/web/CXM_making_a_web_site.anubis 10 read calexium_lib/web/CXM_making_a_web_site.anubis
11 read calexium_lib/web/CXM_jquery.anubis 11 read calexium_lib/web/CXM_jquery.anubis
12 -read calexium_lib/web/CXM_jquery_icons.anubis 12 +read calexium_lib/web/jQuery/CXM_jquery_icons.anubis
13 read tools/basis.anubis 13 read tools/basis.anubis
14 read system/string.anubis 14 read system/string.anubis
15 15
web/jQuery/CXM_jquery_datatable.anubis
@@ -9,8 +9,8 @@ @@ -9,8 +9,8 @@
9 9
10 read calexium_lib/web/CXM_making_a_web_site.anubis 10 read calexium_lib/web/CXM_making_a_web_site.anubis
11 read calexium_lib/web/CXM_jquery.anubis 11 read calexium_lib/web/CXM_jquery.anubis
12 -read calexium_lib/web/CXM_jquery_datatable_types.anubis  
13 -read calexium_lib/web/jquery/CXM_jquery_datatable_translation.anubis 12 +read calexium_lib/web/jQuery/CXM_jquery_datatable_types.anubis
  13 +read calexium_lib/web/jQuery/CXM_jquery_datatable_translation.anubis
14 read tools/basis.anubis 14 read tools/basis.anubis
15 read system/string.anubis 15 read system/string.anubis
16 read system/convert.anubis 16 read system/convert.anubis
web/jQuery/CXM_jquery_eudock.anubis
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 9
10 read calexium_lib/web/CXM_making_a_web_site.anubis 10 read calexium_lib/web/CXM_making_a_web_site.anubis
11 read calexium_lib/web/CXM_jquery.anubis 11 read calexium_lib/web/CXM_jquery.anubis
12 -read calexium_lib/web/CXM_jquery_eudock_types.anubis 12 +read calexium_lib/web/jQuery/CXM_jquery_eudock_types.anubis
13 read tools/basis.anubis 13 read tools/basis.anubis
14 read system/string.anubis 14 read system/string.anubis
15 read system/convert.anubis 15 read system/convert.anubis