Mercurial > urweb
comparison src/scriptcheck.sml @ 970:8371d12ae63f
Hopefully complete refactoring of Jscomp to output ASTs; partial implementation of interpreter in runtime system (demo/alert works)
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 22 Sep 2009 12:23:21 -0400 |
parents | 346cf1908a17 |
children | 217eb87dde31 |
comparison
equal
deleted
inserted
replaced
969:001edfbe2561 | 970:8371d12ae63f |
---|---|
65 "select", | 65 "select", |
66 "submit", | 66 "submit", |
67 "unload"] | 67 "unload"] |
68 | 68 |
69 val scriptWords = "<script" | 69 val scriptWords = "<script" |
70 :: map (fn s => "on" ^ s ^ " ='") events | 70 :: map (fn s => " on" ^ s ^ "='") events |
71 | 71 |
72 val pushWords = ["rv("] | 72 val pushWords = ["rv("] |
73 | 73 |
74 fun classify (ds, ps) = | 74 fun classify (ds, ps) = |
75 let | 75 let |
76 val proto = Settings.currentProtocol () | 76 val proto = Settings.currentProtocol () |
77 | 77 |
78 fun inString {needle, haystack} = | 78 fun inString {needle, haystack} = String.isSubstring needle haystack |
79 let | |
80 val (_, suffix) = Substring.position needle (Substring.full haystack) | |
81 in | |
82 not (Substring.isEmpty suffix) | |
83 end | |
84 | 79 |
85 fun hasClient {basis, words, onload} csids = | 80 fun hasClient {basis, words, onload} csids = |
86 let | 81 let |
87 fun hasClient e = | 82 fun hasClient e = |
88 case #1 e of | 83 case #1 e of |