123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164(* Js_of_ocaml compiler
* http://www.ocsigen.org/js_of_ocaml/
* Copyright (C) 2013 Hugo Heuzard
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)open!Stdlibletkeyword=List.fold_left~f:(funaccx->StringSet.addxacc)~init:StringSet.empty[(* keyword *)"break";"case";"catch";"continue";"debugger";"default";"delete";"do";"else";"finally";"for";"function";"if";"in";"instanceof";"new";"return";"switch";"this";"throw";"try";"typeof";"var";"void";"while";"with";(* reserved in ECMAScript 5 *)"class";"enum";"export";"extends";"import";"super";"implements";"interface";"let";"package";"private";"protected";"public";"static";"yield";(* other *)"null";"true";"false";"NaN";"undefined";"this";(* Unexpected eval or arguments in strict mode *)"eval";"arguments";(* also reserved in ECMAScript 3 *)"abstract";"boolean";"byte";"char";"const";"double";"final";"float";"goto";"int";"long";"native";"short";"synchronized";"throws";"transient";"volatile";(* also reserved in ECMAScript 6 *)"await"]letprovided=List.fold_left~f:(funaccx->StringSet.addxacc)~init:StringSet.empty["event";"location";"window";"document";"eval";"navigator";"self";"Array";"Function";"Date";"Math";"JSON";"Object";"globalThis";"RegExp";"String";"Boolean";"Number";"BigInt";"Infinity";"isFinite";"ActiveXObject";"XMLHttpRequest";"XDomainRequest";"DOMException";"Error";"SyntaxError";"TypeError";"arguments";"decodeURI";"decodeURIComponent";"encodeURI";"encodeURIComponent";"escape";"unescape";"isNaN";"parseFloat";"parseInt";"module"(* only available in node *);"require"(* only available in node *);"Symbol";"ArrayBuffer";"Float32Array";"Float64Array";"Int16Array";"Int32Array";"Int8Array";"TextDecoder";"Uint16Array";"Uint32Array";"Uint8Array";"atob";"btoa";"clearInterval";"console";"global"(* only available in node *);"importScripts"(* only available in WebWorker *);"performance"(* Not available in node until v16+ *);"setTimeout"]