Browse files

[contrib] merge: pull request #34 from git://github.com/alokmenghraja…

…ni/opalang
  • Loading branch information...
2 parents 11a55a7 + 2f70b7f commit 14af0abbebb192b300eb096339029398b918e908 @BourgerieQuentin BourgerieQuentin committed Feb 6, 2012
Showing with 482 additions and 183 deletions.
  1. +1 −1 Makefile
  2. +2 −1 build_rules.ml
  3. +43 −1 configure
  4. 0 database/_tags
  5. +12 −1 dependencies/installation_helper.sh
  6. 0 libbase/base.ml
  7. 0 libbase/mlstate_platform.ml
  8. +7 −0 libbase/traverse.ml
  9. +1 −0 libbase/traverse.mli
  10. 0 libnet/folder.ml
  11. +1 −1 libnet/ftpServer.ml
  12. +1 −1 libnet/httpServer.ml
  13. 0 libnet/network.ml
  14. +62 −22 libqmlcompil/dbGen/schema_private.ml
  15. +25 −2 libqmlcompil/qmlAst.ml
  16. +6 −5 libqmlcompil/qmlDbGen.ml
  17. +3 −3 libqmlcompil/qmlDbGen.mli
  18. 0 libqmlcompil/qmlMoreTypes.ml
  19. 0 libqmlcompil/qmlTyper.ml
  20. 0 libqmlcompil/qmlTypesCompare.ml
  21. 0 libqmlcompil/qmlTypesCompare.mli
  22. 0 libqmlcompil/typer_w.ml
  23. 0 libqmlcompil/typer_w/w_Algebra.ml
  24. 0 libqmlcompil/typer_w/w_CoreTypes.ml
  25. 0 libqmlcompil/typer_w/w_CoreTypes.mli
  26. +11 −27 libqmlcompil/typer_w/w_Infer.ml
  27. 0 libqmlcompil/typer_w/w_Infer.mli
  28. 0 libqmlcompil/typer_w/w_OpenRecordDirective.ml
  29. 0 libqmlcompil/typer_w/w_OpenSumsDirective.ml
  30. 0 libqmlcompil/typer_w/w_PatternsProcessing.ml
  31. 0 libqmlcompil/typer_w/w_PrintTypes.ml
  32. 0 libqmlcompil/typer_w/w_PublicExport.ml
  33. 0 libqmlcompil/typer_w/w_SchemeGenAndInst.ml
  34. 0 libqmlcompil/typer_w/w_SchemeGenAndInst.mli
  35. 0 libqmlcompil/typer_w/w_TypingEnv.ml
  36. 0 libqmlcompil/typer_w/w_TypingEnv.mli
  37. 0 libqmlcompil/typer_w/w_Unify.ml
  38. 0 libqmlcompil/typer_w/w_Unify.mli
  39. +2 −0 opa/checkopacapi.ml
  40. +59 −20 opa/pass_MongoAccessGeneration.ml
  41. 0 opabsl/jsbsl/jquery_ext_bslanchor.extern.js
  42. 0 opabsl/jsbsl/selection_ext_bsldom.extern.js
  43. +6 −1 opabsl/mlbsl/bslDispatcher.ml
  44. 0 opadoc/resources/type_icon.png
  45. 0 opadoc/resources/value_icon.png
  46. +49 −4 opalang/classic_syntax/parser_path.trx
  47. +16 −21 opalang/js_syntax/opa_parser.trx
  48. +16 −4 opalang/opaParser.ml
  49. +2 −2 opalang/opaSyntax.ml
  50. +4 −0 plugins/crypto/bslCrypto.ml
  51. 0 stdlib/components/chat/resources/close_icg_16.png
  52. 0 stdlib/components/chat/resources/search_icg_16.png
  53. +3 −3 stdlib/components/table/table.opa
  54. +6 −1 stdlib/core/rpc/core/cell.opa
  55. 0 stdlib/core/rpc/core/client_event.opa
  56. +8 −3 stdlib/core/rpc/core/oparpc.opa
  57. +46 −3 stdlib/core/web/core/reply.opa
  58. +1 −1 stdlib/core/web/server/app_sources.opa
  59. +34 −10 stdlib/core/xhtml/dom.opa
  60. +1 −1 stdlib/core/xhtml/xhtml.opa
  61. +10 −0 stdlib/crypto/crypto.opa
  62. +16 −16 stdlib/database/mongo/db.opa
  63. +1 −1 stdlib/interactions/editable/editable.opa
  64. 0 stdlib/queue/queue.opa
  65. +11 −11 stdlib/widgets/deprecated/hlist/hlist.opa
  66. +11 −11 stdlib/widgets/hlist/hlist.opa
  67. +4 −4 stdlib/widgets/textarea/textarea.opa
  68. 0 tools/jsdoc-toolkit/app/handlers/XMLDOC.js
  69. 0 tools/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js
  70. 0 tools/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js
  71. 0 tools/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js
  72. 0 tools/jsdoc-toolkit/java/src/JsDebugRun.java
  73. +1 −1 utils/vim/syntax/opa.vim
View
2 Makefile
@@ -240,7 +240,7 @@ doc.odocl:
.PHONY: packages-api
packages-api: $(MYOCAMLBUILD)
- OPAOPT="$(OPAOPT) --rebuild --api" $(OCAMLBUILD) opa-packages.stamp
+ OPAOPT="$(OPAOPT) --rebuild --api --parser classic" $(OCAMLBUILD) opa-packages.stamp
.PHONY: opadoc/doc
opadoc/doc: opadoc packages-api
View
3 build_rules.ml
@@ -700,7 +700,7 @@ rule "opacomp: .opack -> .native"
);
build_list build (List.map ((/) dir) (string_list_of_file (env "%.opack.depends")));
opacomp build (env "%.opack") "native"
- (S[ A"-I" ; P stdlib_packages_dir ; A"--project-root" ; P dir]));
+ (S[ A"-I" ; P stdlib_packages_dir ; A"--project-root" ; P dir; A"--parser"; A"classic";]));
rule "opacomp: .opack -> .byte"
~deps: ("%.opack"::"%.opack.depends"::"opa-packages.stamp"::"opacomp-byte.stamp"::[])
@@ -890,6 +890,7 @@ let package_building ~name ~stamp ~stdlib_only ~rebuild =
A"--warn-error"; A"root";
A"--project-root"; P Pathname.pwd; (* because the @static_resource in the stdlib expect this *)
A"--no-stdlib";
+ A"--parser"; A"classic";
opaopt;
S all_files;
] @ rebuild_opt));
View
44 configure
@@ -552,13 +552,55 @@ lib-not-found () {
LIBS_NOT_FOUND[${#LIBS_NOT_FOUND[@]}]="$lib (might be found in package $package)"
}
+check-cryptokit () {
+ local OPTIONAL=""
+ if [ "$1" = "-opt" ]; then OPTIONAL=1; shift; fi
+ local MODULE=$1; shift # one module that the lib contains, to check
+ [ $# -gt 0 ] # remaining args: possible lib names (may be usual_dir/libname)
+
+ echo-check for $(basename $1)
+
+ local LIBDIR=""
+ local VERSION=""
+ local LIB
+ local LIB_NAMES=("$@")
+ while [ $# -gt 0 ] && [ -z "$LIBDIR" ]; do
+ LIB=$(basename $1)
+ USUAL_DIR=$(dirname $1)
+ [ "$USUAL_DIR" = "." ] && USUAL_DIR=$LIB
+ if [ -n "$OCAMLFIND" ] &&
+ LIBDIR=$("$OCAMLFIND" query "$LIB" 2>/dev/null) &&
+ VERSION=$("$OCAMLFIND" query -format %v "$LIB" 2>/dev/null)
+ then
+ LIB=$(check-cmxa $LIBDIR $LIB "${LIB_NAMES[@]}") || return 1
+ echo-ok -n "ocamlfind:$LIBDIR, "
+ else
+ echo-err "We need ocamlfind in order to check cryptokit version"
+ fi
+ shift
+ done
+ if [ -z "$LIBDIR" ]; then
+ echo-err "Not found"
+ return 1
+ elif CHECK_VERSION=$(echo "1.5" | tr -d '.') &&
+ CURRENT_VERSION=$(echo "$VERSION" | tr -d '.') &&
+ [ "$CURRENT_VERSION" -lt "$CHECK_VERSION" ]
+ then
+ echo-err "Invalid cryptokit version, must be >= 1.5"
+ return 1
+ fi
+
+ check-ocaml-lib "$MODULE" "$LIB" "$LIBDIR" || return 1
+ echo "$LIBDIR/$LIB"
+}
+
# - checking ocaml-ssl
if ! CONFIG_LIB_OCAMLSSL=$(locate-ocaml-lib "Ssl" "ssl")
then lib-not-found "ocaml_ssl" "libssl-ocaml-dev"
fi
# - checking cryptokit
-if ! CONFIG_LIB_CRYPTOKIT=$(EXTRA_TAGS="$EXTRA_TAGS -tag use_nums" locate-ocaml-lib "Cryptokit" "cryptokit")
+if ! CONFIG_LIB_CRYPTOKIT=$(EXTRA_TAGS="$EXTRA_TAGS -tag use_nums" check-cryptokit "Cryptokit" "cryptokit")
then lib-not-found "cryptokit" "libcryptokit-ocaml-dev"
fi
View
0 database/_tags 100755 → 100644
File mode changed.
View
13 dependencies/installation_helper.sh
@@ -177,7 +177,7 @@ sources () {
# Sources obtained thanks to "apt-get --print-uris source <package>"
findlib) echo "http://download.camlcity.org/download/findlib-1.2.5.tar.gz";;
ocaml-ssl) echo "http://downloads.sourceforge.net/project/savonet/ocaml-ssl/0.4.5/ocaml-ssl-0.4.5.tar.gz";;
- cryptokit) echo "http://forge.ocamlcore.org/frs/download.php/326/cryptokit-1.3.tar.gz";;
+ cryptokit) echo "http://forge.ocamlcore.org/frs/download.php/639/cryptokit-1.5.tar.gz";;
ocamlgraph) echo "http://ocamlgraph.lri.fr/download/ocamlgraph-1.5.tar.gz";;
camlzip) echo "http://forge.ocamlcore.org/frs/download.php/328/camlzip-1.04.tar.gz";;
camlimages) echo "http://caml.inria.fr/distrib/bazar-ocaml/camlimages-3.0.2.tgz";;
@@ -352,6 +352,17 @@ package_install (){
$SUDO $INSTALLDIR/bin/ocamlfind remove -destdir $INSTALLDIR/lib/ocaml ssl || true
install_generic
;;
+ cryptokit)
+ # very ugly way to uninstall previous cryptokit...
+ msg_yellow "Uninstalling potential previous cryptokit (moving it..)"
+ $SUDO mkdir -pv $INSTALLDIR/lib/ocaml/cryptokit.bak
+ $SUDO mv -v $INSTALLDIR/lib/ocaml/cryptokit.* $INSTALLDIR/lib/ocaml/cryptokit.bak/ || true
+ $SUDO mv -v $INSTALLDIR/lib/ocaml/stublibs/dllcryptokit.so $INSTALLDIR/lib/ocaml/stublibs/dllcryptokit.so.bak || true
+ $SUDO ocaml setup.ml -configure
+ $SUDO ocaml setup.ml -build
+ $SUDO ocaml setup.ml -uninstall
+ $SUDO ocaml setup.ml -install
+ ;;
findlib)
install_generic -sitelib $INSTALLDIR/lib/ocaml
;;
View
0 libbase/base.ml 100755 → 100644
File mode changed.
View
0 libbase/mlstate_platform.ml 100755 → 100644
File mode changed.
View
7 libbase/traverse.ml
@@ -50,6 +50,13 @@ struct
let sub_current e = (function [e] -> e | _ -> assert false), [e]
let sub_ignore x = (function [] -> x | _ -> assert false), []
+ let sub_option sub_e opt =
+ match opt with
+ | None -> (fun x -> assert (List.is_empty x); None), []
+ | Some e ->
+ let usub, l = sub_e e in
+ (fun l -> Some (usub l)), l
+
let wrap cons (unsub,l) = (fun l -> cons (unsub l)), l
end
View
1 libbase/traverse.mli
@@ -69,6 +69,7 @@ module Utils : sig
val sub_3 : ('a1, 'at, 'bt, 'b1) sub -> ('a2, 'at, 'bt, 'b2) sub -> ('a3, 'at, 'bt, 'b3) sub -> ('a1 * 'a2 * 'a3, 'at, 'bt, 'b1 * 'b2 * 'b3) sub
val sub_4 : ('a1, 'at, 'bt, 'b1) sub -> ('a2, 'at, 'bt, 'b2) sub -> ('a3, 'at, 'bt, 'b3) sub -> ('a4, 'at, 'bt, 'b4) sub -> ('a1 * 'a2 * 'a3 * 'a4, 'at, 'bt, 'b1 * 'b2 * 'b3 * 'b4) sub
val sub_list : ('a, 'at, 'bt, 'b) sub -> ('a list, 'at, 'bt, 'b list) sub
+ val sub_option : ('a, 'at, 'bt, 'b) sub -> ('a option, 'at, 'bt, 'b option) sub
val sub_current : ('a, 'a, 'b, 'b) sub
val sub_ignore : ('a, _, _, 'a) sub
View
0 libnet/folder.ml 100755 → 100644
File mode changed.
View
2 libnet/ftpServer.ml
@@ -82,7 +82,7 @@ type options =
opt_name: string;
}
-let initDir = Filename.concat (Lazy.force File.mlstate_dir) "ftp"
+let initDir = "./ftp" (* Filename.concat (Lazy.force File.mlstate_dir) "ftp" *)
let folder = Folder.empty initDir
let default_options =
View
2 libnet/httpServer.ml
@@ -132,7 +132,7 @@ let m2 =
(fun () ->
let mime_types_file_content =
try
- let res = File.content ((Lazy.force File.mlstate_dir)^"/.mime.types") in
+ let res = "./mime.types" (* File.content ((Lazy.force File.mlstate_dir)^"/.mime.types") *)in
Logger.info "Loaded .mime.types file";
res
with Unix.Unix_error _ -> "" in
View
0 libnet/network.ml 100755 → 100644
File mode changed.
View
84 libqmlcompil/dbGen/schema_private.ml
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -827,12 +827,45 @@ let rec dots gamma field ty =
| Some msg -> Format.fprintf fmt "\n@{<bright>Hint@} : %s" msg) ())
)
-let coerce_query_element ~context gamma ty query =
- let rec aux new_annots ty query =
- let coerce wrap ty expr =
- let e = QmlAstCons.UntypedExpr.coerce expr ty in
- Q.QAnnot.expr e::new_annots, wrap e
+let coerce_query_element ~context gamma ty (query, options) =
+ let coerce new_annots wrap ty expr =
+ let e = QmlAstCons.UntypedExpr.coerce expr ty in
+ Q.QAnnot.expr e::new_annots, wrap e
+ in
+ let a, options =
+ let a = [] in
+ let optmap f a o = match o with
+ | None -> a, None
+ | Some o -> let x, y = f a o in x, Some y in
+ let a, limit =
+ optmap
+ (fun a -> coerce a (fun x -> x) (Q.TypeConst Q.TyInt))
+ a options.Db.limit
+ in let a, skip =
+ optmap
+ (fun a -> coerce a (fun x -> x) (Q.TypeConst Q.TyInt))
+ a options.Db.skip
+ in let a, sort =
+ let ty =
+ Q.TypeSum (
+ let void = Q.TypeRecord (QmlAstCons.Type.Row.make []) in
+ QmlAstCons.Type.Col.make [
+ [("down", void)];
+ [("up", void)];
+ ]
+ )
+ in
+ optmap
+ (fun a fields ->
+ List.fold_left_map
+ (fun a (flds, e) -> coerce a (fun e -> (flds, e)) ty e)
+ a fields
+ ) a options.Db.sort
in
+ (a, {Db.limit; skip; sort})
+ in
+ let rec aux new_annots ty query =
+ let coerce = coerce new_annots in
let aux2 wrap ty (q1, q2) =
let new_annots, q1 = aux new_annots ty q1 in
let new_annots, q2 = aux new_annots ty q2 in
@@ -867,7 +900,8 @@ let coerce_query_element ~context gamma ty query =
with Formatted p ->
QmlError.error context "This querying is invalid because %a\n%!" p ()
- in aux [] ty query
+ in let a, query = aux a ty query in
+ a, (query, options)
(** @return (new_annots_list, pppath) *)
let rec convert_dbpath ~context t gamma node kind path0 path =
@@ -952,16 +986,16 @@ let rec convert_dbpath ~context t gamma node kind path0 path =
let new_annots, epath = convert_dbpath ~context t gamma (SchemaGraph.unique_next t node) kind path0 path in
new_annots, Db.NewKey :: epath
- | Db.Query query::[] ->
- let new_annots, query =
+ | Db.Query (query, options)::[] ->
+ let new_annots, (query, options) =
let ty =
match SchemaGraphLib.type_of_node node with
| Q.TypeName ([setparam], name) when Q.TypeIdent.to_string name = "dbset" -> setparam
| _ -> SchemaGraphLib.type_of_key t node
in
- coerce_query_element ~context gamma ty query
+ coerce_query_element ~context gamma ty (query, options)
in
- new_annots, [Db.Query query]
+ new_annots, [Db.Query (query, options)]
| Db.Query _::_path -> QmlError.error context "sub path after query is not handler yet"
@@ -1018,7 +1052,7 @@ let rec find_exprpath_aux ?context t ?(node=SchemaGraphLib.get_root t) ?(kind=Db
QmlPrint.pp#path_elts epath0
in
find_exprpath_aux ~context t ~node:next ~kind ~epath0 vpath epath
- | (Db.Query _q)::epath, C.Multi ->
+ | (Db.Query (_, _))::epath, C.Multi ->
let setty = node.C.ty in
(match setty with
| Q.TypeName ([setparam], name)
@@ -1060,7 +1094,7 @@ let rec find_exprpath_aux ?context t ?(node=SchemaGraphLib.get_root t) ?(kind=Db
(fun acc key -> List.remove_assoc (fst key) acc)
fields tykeys in
Q.TypeRecord (QmlAstCons.Type.Row.make ~extend:false wfields)
- | _ -> internal_error "Wront type on key typing (%a)" QmlPrint.pp#ty setparam in
+ | _ -> internal_error "Wrong type on key typing (%a)" QmlPrint.pp#ty setparam in
node.C.ty, node, `virtualset (tyread, tywrite, partial, Some e)
| _ -> find_exprpath_aux ~context t ~node:(SchemaGraph.unique_next t node) ~kind ~epath0 vpath epath)
| (Db.FldKey fld)::_rp, C.Sum ->
@@ -1142,9 +1176,9 @@ let preprocess_kind ~context gamma kind ty virtual_ =
| Q.TypeName ([_], name) when Q.TypeIdent.to_string name = "list" -> true
| _ -> false
) -> u
- | Db.UPop -> error "" "pop is not avialable on %a" QmlPrint.pp#ty ty
- | Db.UShift -> error "" "shift is not avialable on %a" QmlPrint.pp#ty ty
- | Db.UIncr _ -> error "" "incr is not avialable only on %a" QmlPrint.pp#ty ty
+ | Db.UPop -> error "" "pop is not available on %a" QmlPrint.pp#ty ty
+ | Db.UShift -> error "" "shift is not available on %a" QmlPrint.pp#ty ty
+ | Db.UIncr _ -> error "" "incr is not available on %a (only on int)" QmlPrint.pp#ty ty
in Db.Update (update ty u)
let preprocess_path ~context t gamma prepath kind =
@@ -1296,11 +1330,7 @@ let sort_edges t el =
in
List.sort compare_edges el
-(** Assuming nodes belonging to other packages have already been cleaned up:
- @post All field or sumcase edges going out of a single node hold different indices
- @post The root has id "root"
- @post The numberings are canonical (after cleanup, two equivalent graphs are equal) *)
-let cleanup t =
+let cleanup_nonempty t =
let package_name = ObjectFiles.get_current_package_name() in
(* Create a canonical renumbering of nodes *)
let rec get_ids ids n =
@@ -1325,7 +1355,7 @@ let cleanup t =
(* in *)
(* Copy all edges (renumbered) to the new graph *)
let new_t =
- SchemaGraph0.fold_vertex
+ SchemaGraph0.fold_vertex
(fun n new_t ->
let eid = ref 0 in
let es =
@@ -1349,6 +1379,16 @@ let cleanup t =
(* in *)
new_t
+(** Assuming nodes belonging to other packages have already been cleaned up:
+ @post All field or sumcase edges going out of a single node hold different indices
+ @post The root has id "root"
+ @post The numberings are canonical (after cleanup, two equivalent graphs are equal) *)
+let cleanup t =
+ if SchemaGraph0.is_empty t then
+ t
+ else
+ cleanup_nonempty t
+
(* replace e by e' in t *)
let replace_edge_e t e e' =
let t = SchemaGraph0.remove_edge_e t e in
View
27 libqmlcompil/qmlAst.ml 100755 → 100644
@@ -144,6 +144,12 @@ struct
| QNot of 'expr query
| QFlds of 'expr query fields
+ type 'expr query_options = {
+ limit : 'expr option;
+ skip : 'expr option;
+ sort : 'expr fields option;
+ }
+
type 'expr update =
(* Record updating*)
| UFlds of 'expr update fields
@@ -192,7 +198,7 @@ struct
| FldKey of string
| ExprKey of 'expr
| NewKey
- | Query of 'expr query
+ | Query of 'expr query * 'expr query_options
type 'expr path = 'expr path_elt list
@@ -406,11 +412,28 @@ struct
(fun fields -> QFlds fields)
(TU.sub_list (TU.sub_2 TU.sub_ignore (sub_db_query sub_e sub_ty)) flds)
+ let sub_db_query_options sub_e _sub_ty opt =
+ let (sub_fields: ('a fields, _, _, 'b fields) TU.sub) = fun flds ->
+ TU.wrap
+ (fun fields -> fields)
+ (TU.sub_list (TU.sub_2 TU.sub_ignore sub_e) flds)
+ in
+ TU.wrap
+ (fun (limit, skip, sort) -> {limit; skip; sort})
+ (TU.sub_3 (TU.sub_option sub_e) (TU.sub_option sub_e) (TU.sub_option sub_fields)
+ (opt.limit, opt.skip, (opt.sort : 'expr fields option))
+ )
+
let sub_path_elt sub_e sub_ty = function
| FldKey _
| NewKey as v -> TU.sub_ignore v
| ExprKey e -> TU.wrap (fun x -> ExprKey x) (sub_e e)
- | Query query -> TU.wrap (fun q -> Query q) (sub_db_query sub_e sub_ty query)
+ | Query (q, o) ->
+ TU.wrap
+ (fun (q, o) -> Query (q, o))
+ (TU.sub_2 (sub_db_query sub_e sub_ty) (sub_db_query_options sub_e sub_ty)
+ (q, o)
+ )
let foldmap_expr f acc dbdef =
let cons, subs = sub_db_def TU.sub_current TU.sub_ignore dbdef in
View
11 libqmlcompil/qmlDbGen.ml
@@ -44,7 +44,7 @@ module Schema = struct
package : ObjectFiles.package_name;
}
- type query = QmlAst.expr QmlAst.Db.query
+ type query = QmlAst.expr DbAst.query * QmlAst.expr DbAst.query_options
type set_kind =
| Map of QmlAst.ty * QmlAst.ty
@@ -54,7 +54,7 @@ module Schema = struct
| Compose of (string * string list) list
| Plain
| Partial of bool (* Inside sum*) * string list * string list
- | SetAccess of set_kind * string list * (bool * query) option (*bool == unique*)
+ | SetAccess of set_kind * string list * (bool (*is_unique*) * query) option
type node = {
ty : QmlAst.ty;
@@ -241,7 +241,8 @@ module Schema = struct
match fragment with
| DbAst.ExprKey expr ->
let setkind = get_setkind llschema node in
- let kind = SetAccess (setkind, path, Some (true, DbAst.QEq expr)) in
+ let options = {DbAst.limit = None; skip = None; sort = None} in
+ let kind = SetAccess (setkind, path, Some (true, (DbAst.QEq expr, options))) in
(next, kind, path)
| DbAst.FldKey key ->
@@ -259,10 +260,10 @@ module Schema = struct
| SetAccess _, _ -> raise (Base.NotImplemented "Selection inside a multi node")
in let path = key::path
in (next, kind, path)
- | DbAst.Query query ->
+ | DbAst.Query (query, options) ->
begin match kind with
| SetAccess (_k, path, None) ->
- let kind = SetAccess (get_setkind llschema node, path, Some (false, query)) in
+ let kind = SetAccess (get_setkind llschema node, path, Some (false, (query, options))) in
(next, kind, path)
| SetAccess (_, _path, Some _) ->
raise (Base.NotImplemented "Selection inside a multi node")
View
6 libqmlcompil/qmlDbGen.mli
@@ -16,7 +16,7 @@
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
-(** {6} Command line arguments.*)
+(** {6 Command line arguments } *)
(** Describes different backend that dbgen handle. *)
type engine = [`db3 | `mongo]
@@ -33,7 +33,7 @@ module Args : sig
end
-(** {6} Initialization **)
+(** {6 Initialization } **)
(** Set the translation function beetween string and renamed type
ident.*)
@@ -53,7 +53,7 @@ module Schema: sig
package : ObjectFiles.package_name;
}
- type query = QmlAst.expr QmlAst.Db.query
+ type query = QmlAst.expr QmlAst.Db.query * QmlAst.expr QmlAst.Db.query_options
type set_kind =
| Map of QmlAst.ty * QmlAst.ty
View
0 libqmlcompil/qmlMoreTypes.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/qmlTyper.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/qmlTypesCompare.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/qmlTypesCompare.mli 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_Algebra.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_CoreTypes.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_CoreTypes.mli 100755 → 100644
File mode changed.
View
38 libqmlcompil/typer_w/w_Infer.ml 100755 → 100644
@@ -1015,33 +1015,17 @@ and infer_db_path ~bypass_typer typing_env ~surrounding_path_expr keys kind =
let annotmap' =
List.fold_right
(fun key annotmap_accu ->
- match key with
- | QmlAst.Db.ExprKey e ->
- (* [TODO] check [_e_ty] against something somehow ? *)
- let (_e_ty, e_annotmap) =
- infer_expr_type ~bypass_typer typing_env e in
- QmlAnnotMap.merge annotmap_accu e_annotmap
- | QmlAst.Db.Query q ->
- let rec aux annotmap_accu = function
- | QmlAst.Db.QMod _ -> annotmap_accu
- | QmlAst.Db.QEq e
- | QmlAst.Db.QGt e
- | QmlAst.Db.QLt e
- | QmlAst.Db.QGte e
- | QmlAst.Db.QLte e
- | QmlAst.Db.QNe e
- | QmlAst.Db.QIn e ->
- let (_e_ty, e_annotmap) =
- infer_expr_type ~bypass_typer typing_env e in
- QmlAnnotMap.merge annotmap_accu e_annotmap
- | QmlAst.Db.QOr (q1, q2)
- | QmlAst.Db.QAnd (q1, q2) ->
- aux (aux annotmap_accu q1) q2
- | QmlAst.Db.QNot q -> aux annotmap_accu q
- | QmlAst.Db.QFlds flds ->
- List.fold_left (fun a (_, q) -> aux a q) annotmap_accu flds
- in aux annotmap_accu q
- | _ -> annotmap_accu)
+ let _rebuild, exprs =
+ let open Traverse.Utils in
+ QmlAst.Db.sub_path_elt sub_current sub_current key
+ in
+ List.fold_left
+ (fun annotmap_accu e ->
+ (* [TODO] check [_e_ty] against something somehow ? *)
+ let (_e_ty, e_annotmap) =
+ infer_expr_type ~bypass_typer typing_env e in
+ QmlAnnotMap.merge annotmap_accu e_annotmap)
+ annotmap_accu exprs)
keys W_AnnotMap.empty_annotmap in
(* Typecheck update ast and recover the updated annotation map. *)
let annotmap' = match kind with
View
0 libqmlcompil/typer_w/w_Infer.mli 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_OpenRecordDirective.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_OpenSumsDirective.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_PatternsProcessing.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_PrintTypes.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_PublicExport.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_SchemeGenAndInst.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_SchemeGenAndInst.mli 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_TypingEnv.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_TypingEnv.mli 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_Unify.ml 100755 → 100644
File mode changed.
View
0 libqmlcompil/typer_w/w_Unify.mli 100755 → 100644
File mode changed.
View
2 opa/checkopacapi.ml
@@ -82,6 +82,8 @@ module SA = SurfaceAst
(* -- *)
+let _ = OpaSyntax.Args.r := {!OpaSyntax.Args.r with OpaSyntax.Args.parser = OpaSyntax.Classic}
+
let validation_ok = ref true
(* f *)
View
79 opa/pass_MongoAccessGeneration.ml
@@ -121,10 +121,11 @@ module Generator = struct
| DbAst.QNot (DbAst.QAnd (q1, q2)) ->
DbAst.QOr (prepare_query (DbAst.QNot q1), prepare_query (DbAst.QNot q2))
+ let empty_query gamma annotmap = C.list (annotmap, gamma) []
+
let query_to_expr gamma annotmap query =
- let empty_query annotmap = C.list (annotmap, gamma) [] in
match query with
- | None -> empty_query annotmap
+ | None -> empty_query gamma annotmap
| Some (_todo, query) ->
let query = prepare_query query in
let rec aux annotmap query =
@@ -144,7 +145,7 @@ module Generator = struct
| DbAst.QIn _ -> "$in"
| _ -> assert false
in
- let annotmap, query = empty_query annotmap in
+ let annotmap, query = empty_query gamma annotmap in
add_to_document gamma annotmap name e query
| DbAst.QFlds flds ->
List.fold_left
@@ -156,11 +157,11 @@ module Generator = struct
let annotmap, query = aux annotmap query in
add_to_document gamma annotmap name query acc
)
- (empty_query annotmap)
+ (empty_query gamma annotmap)
flds
| DbAst.QNot query ->
let annotmap, query = aux annotmap query in
- let annotmap, empty = empty_query annotmap in
+ let annotmap, empty = empty_query gamma annotmap in
add_to_document gamma annotmap "$not" query empty
| DbAst.QAnd (q1, q2)
| DbAst.QOr (q1, q2) ->
@@ -176,10 +177,35 @@ module Generator = struct
QmlAnnotMap.find_ty (Annot.annot (QmlAst.Label.expr q1)) annotmap
in
let annotmap, query = C.list ~ty (annotmap, gamma) [q1; q2] in
- let annotmap, empty = empty_query annotmap in
+ let annotmap, empty = empty_query gamma annotmap in
add_to_document gamma annotmap name query empty
in aux annotmap query
+ let query_add_order gamma annotmap order query =
+ match order with
+ | None -> annotmap, query
+ | Some order ->
+ let annotmap, eorder =
+ List.fold_left
+ (fun (annotmap, acc) (fld, expr) ->
+ let name = BaseFormat.sprintf "%a" QmlAst.Db.pp_field fld in
+ let annotmap, expr =
+ let annotmap, up = C.int annotmap 1 in
+ let annotmap, pup =
+ let annotmap, any = QmlAstCons.TypedPat.any annotmap in
+ QmlAstCons.TypedPat.record annotmap ["up", any] in
+ let annotmap, down = C.int annotmap (-1) in
+ let annotmap, pdown =
+ let annotmap, any = QmlAstCons.TypedPat.any annotmap in
+ QmlAstCons.TypedPat.record annotmap ["down", any] in
+ C.match_ annotmap expr [(pup, up); (pdown, down)]
+ in add_to_document gamma annotmap name expr acc)
+ (empty_query gamma annotmap) order
+ in
+ let annotmap, metaquery = empty_query gamma annotmap in
+ let annotmap, metaquery = add_to_document gamma annotmap "$query" query metaquery in
+ add_to_document gamma annotmap "$orderby" eorder metaquery
+
let update_to_expr ?(set=true) gamma annotmap = function
| DbAst.UExpr e ->
let annotmap, uexpr = opa2doc gamma annotmap e () in
@@ -427,16 +453,28 @@ module Generator = struct
| _ -> ()
in
let ty = node.DbSchema.ty in
- let uniq, nb, query =
+ let annotmap, skip, limit, query, order, uniq =
match query0 with
- | None -> false, 0, None
- | Some ((uniq, query) as x) ->
- uniq,
- (if uniq then 1 else 5000),
- Some (
+ | None ->
+ let annotmap, limit = C.int annotmap 1 in
+ let annotmap, skip = C.int annotmap 0 in
+ annotmap, skip, limit, None, None, false
+ | Some ((uniq, (query, opt)) as _x) ->
+ let annotmap, limit =
+ match opt.DbAst.limit with
+ | None -> C.int annotmap 0
+ | Some i -> annotmap, i
+ in let annotmap, skip =
+ match opt.DbAst.skip with
+ | None -> C.int annotmap 0
+ | Some i -> annotmap, i
+ in let query = Some (
match setkind with
| DbSchema.Map _ -> uniq, DbAst.QFlds [(["_id"], query)]
- | _ -> x)
+ | _ -> uniq, query
+ )
+ in
+ annotmap, skip, limit, query, opt.DbAst.sort, uniq
in
(* DbSet.build *)
let (annotmap, build, query, args) =
@@ -448,23 +486,24 @@ module Generator = struct
let dataty =
match setkind with
| DbSchema.DbSet ty -> ty
- | DbSchema.Map _ -> QmlAstCons.Type.next_var () (* Dummy type variable, should never use*)
+ | DbSchema.Map _ -> QmlAstCons.Type.next_var ()
+ (* Dummy type variable, should never use*)
in
(* query *)
- let (annotmap, query) = query_to_expr gamma annotmap query in
- let (annotmap, nb) = C.int annotmap nb in
- let (annotmap, default) = node.DbSchema.default annotmap in
+ let annotmap, query = query_to_expr gamma annotmap query in
+ let annotmap, query = query_add_order gamma annotmap order query in
+ let annotmap, default = node.DbSchema.default annotmap in
begin match kind with
| DbAst.Default | DbAst.Option ->
let annotmap, build =
OpaMapToIdent.typed_val ~label ~ty:[dataty] Api.DbSet.build annotmap gamma in
- (annotmap, build, query, [default; nb])
+ (annotmap, build, query, [default; skip; limit])
| DbAst.Valpath ->
let annotmap, build =
OpaMapToIdent.typed_val ~label ~ty:[dataty; dataty] Api.DbSet.build_vpath annotmap gamma
in
let annotmap, read_map = get_read_map setkind uniq annotmap gamma in
- (annotmap, build, query, [default; nb; read_map])
+ (annotmap, build, query, [default; skip; limit; read_map])
| DbAst.Ref ->
let annotmap, read_map = get_read_map setkind uniq annotmap gamma in
let wty, (annotmap, write_map) =
@@ -487,7 +526,7 @@ module Generator = struct
let annotmap, build =
OpaMapToIdent.typed_val ~label ~ty:[wty; dataty] Api.DbSet.build_rpath annotmap gamma
in
- (annotmap, build, query, [default; nb; read_map; write_map])
+ (annotmap, build, query, [default; skip; limit; read_map; write_map])
| _ -> assert false
end
View
0 opabsl/jsbsl/jquery_ext_bslanchor.extern.js 100755 → 100644
File mode changed.
View
0 opabsl/jsbsl/selection_ext_bsldom.extern.js 100755 → 100644
File mode changed.
View
7 opabsl/mlbsl/bslDispatcher.ml
@@ -46,8 +46,13 @@ let send_json_response winfo json =
send_txt_response winfo txt
let send_error winfo txt =
+ let txt = #<If:PING_DEBUG> txt #<Else>
+ let _ = txt in "Unauthorized request"
+ #<End>
+ in
make_response ~req:winfo.HttpServerTypes.request Requestdef.SC_Unauthorized
- "text/plain" (Http_common.Result txt)
+ "text/plain"
+ (Http_common.Result txt)
winfo.HttpServerTypes.cont
let string2json str =
View
0 opadoc/resources/type_icon.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 opadoc/resources/value_icon.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
53 opalang/classic_syntax/parser_path.trx
@@ -156,12 +156,57 @@ query_double_builder <-
query_expr <- Opa_parser.expr
-query_field <- query_nokeywords Opa_parser.record_long_ident:i query_simple:q
- {{ (List.map undecorate i, q) }}
+query_long_ident <- Opa_parser.record_long_ident:i {{List.map undecorate i}}
-query_fields <- (=list0(query_field, Opa_parser.record_fields_separator)):l Opa_parser.record_fields_separator?
+query_field <- query_nokeywords query_long_ident:i query_simple:q
+ {{ (i, q) }}
+
+query_fields <- (=list1(query_field, Opa_parser.record_fields_separator)):l Opa_parser.record_fields_separator?
{{ QmlAst.Db.QFlds l }}
+query_options_limit <-
+ (=Opa_lexer.exact_keyword("limit")) query_expr:limit
+ {{ fun opt -> {opt with QmlAst.Db.limit = Some limit} }}
+
+query_options_skip <-
+ (=Opa_lexer.exact_keyword("skip")) query_expr:skip
+ {{ fun opt -> {opt with QmlAst.Db.skip = Some skip} }}
+
+query_options_order_label <-
+ / (=Opa_lexer.exact_symbol("-")) {{"down"}}
+ / (=Opa_lexer.exact_symbol("+")) {{"up"}}
+
+query_options_order_field <-
+ / query_long_ident:i (=Opa_lexer.exact_symbol("=")) query_expr:e {{ (i, e) }}
+ / query_options_order_label?:ordlbl (=Opa_lexer.careful_deco(query_long_ident)):i
+ {{
+ let i, label = i in
+ let ordlbl = Option.default "up" ordlbl in
+ (i, (Parser_utils.simple_record ordlbl label, label))
+ }}
+
+query_options_order <-
+ (=Opa_lexer.exact_keyword("order"))
+ (=list1(query_options_order_field, Opa_parser.record_fields_separator)):order
+ {{ fun opt -> {opt with QmlAst.Db.sort = Some order} }}
+
+query_options <-
+ (=list0((query_options_limit / query_options_skip / query_options_order), Opa_parser.separator)):l
+ {{
+ let options = {QmlAst.Db.limit = None; skip = None; sort = None} in
+ List.fold_left (fun opt f -> f opt) options l
+ }}
+
+query_with_options <-
+ / query:q (Opa_parser.separator query_options:o {{o}})?:o
+ {{
+ let options =
+ Option.default {QmlAst.Db.limit = None; skip = None; sort = None} o
+ in
+ QmlAst.Db.Query (q, options)
+ }}
+ / query_options:o {{ QmlAst.Db.Query (QmlAst.Db.QFlds [], o) }}
+
;querytype <- [?] slash_nosp {{ QmlAst.Db.Option }}
/ [!] slash_nosp {{ QmlAst.Db.Valpath }}
@@ -173,7 +218,7 @@ query_fields <- (=list0(query_field, Opa_parser.record_fields_separator)):l Opa_
;path_elem = Opa_parser.careful_deco just_path_elem
;just_path_elem <- slash_nosp ml_identifier_nosp:i {{ QmlAst.Db.FldKey i }}
- / lbracket_nosp query:q rbracket {{ QmlAst.Db.Query q }}
+ / lbracket_nosp query_with_options:q rbracket {{ q }}
/ lbracket_nosp Opa_parser.expr:e rbracket {{ QmlAst.Db.ExprKey e }}
/ lbracket_nosp spacing [?] rbracket {{ QmlAst.Db.NewKey }}
View
37 opalang/js_syntax/opa_parser.trx
@@ -435,32 +435,27 @@ database_network_port <- Opa_lexer.colon_nosp Opa_lexer.int:p {{ p }}
declaration_database <-
/ Opa_lexer.DATABASE database_pathdef:def
{{ List.map (function e -> NewDbDef e) def }}
- / Opa_lexer.DATABASE spacing (ml_identifier:id spacing db_options?:opt {{id, opt}})?:decl
+ / Opa_lexer.DATABASE spacing ml_identifier:id spacing db_options?:opt
spacing database_body:body
{{
- let decl_ = match decl with
- | None -> []
- | Some (id, opt) ->
- let opt = match opt with
- | None -> []
- | Some opt -> opt in
- [Database (id, [], opt)]
+ let decl_ =
+ let opt = match opt with
+ | None -> []
+ | Some opt -> opt in
+ [Database (id, [id], opt)]
in
let bodymap =
let construct e = NewDbDef e in
- match decl with
- | None -> construct
- | Some (id, _) ->
- let prefix p = QmlAst.Db.Decl_fld id :: p in
- function e ->
- construct
- (match e with
- | QmlAst.Db.Db_TypeDecl (p, a) -> QmlAst.Db.Db_TypeDecl (prefix p, a)
- | QmlAst.Db.Db_Default (p, a) -> QmlAst.Db.Db_Default (prefix p, a)
- | QmlAst.Db.Db_Alias (p, a) -> QmlAst.Db.Db_Alias (prefix p, a)
- | QmlAst.Db.Db_Constraint (p, a) -> QmlAst.Db.Db_Constraint (prefix p, a)
- | QmlAst.Db.Db_Virtual (p, a) -> QmlAst.Db.Db_Virtual (prefix p, a)
- )
+ let prefix p = QmlAst.Db.Decl_fld id :: p in
+ function e ->
+ construct
+ (match e with
+ | QmlAst.Db.Db_TypeDecl (p, a) -> QmlAst.Db.Db_TypeDecl (prefix p, a)
+ | QmlAst.Db.Db_Default (p, a) -> QmlAst.Db.Db_Default (prefix p, a)
+ | QmlAst.Db.Db_Alias (p, a) -> QmlAst.Db.Db_Alias (prefix p, a)
+ | QmlAst.Db.Db_Constraint (p, a) -> QmlAst.Db.Db_Constraint (prefix p, a)
+ | QmlAst.Db.Db_Virtual (p, a) -> QmlAst.Db.Db_Virtual (prefix p, a)
+ )
in
decl_ @ List.map bodymap body
}}
View
20 opalang/opaParser.ml
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -172,6 +172,8 @@ let parse_error_flag =
let _ = Str.search_forward search_for lang 0 in ""
with Not_found -> "-->"
+module OA = OpaSyntax.Args
+
(* FIXME, use FilePos for obtaining citations etc. *)
let show_parse_error file_name content error_summary error_details pos =
let n = max 0 (min pos (String.length content-1)) in
@@ -188,6 +190,15 @@ let show_parse_error file_name content error_summary error_details pos =
let line_int, col_int = FilePos.get_pos file_name pos in
string_of_int line_int, string_of_int col_int, string_of_int pos
in
+ let syntax_old = "classical ('old') syntax " in
+ let syntax_new = "revised ('new') syntax" in
+ let option_old = "--parser classic" in
+ let option_new = "--parser js-like" in
+ let used, other, hint_option =
+ match !OA.r.OA.parser with
+ | OpaSyntax.Classic -> syntax_old, syntax_new, option_new
+ | OpaSyntax.Js -> syntax_new, syntax_old, option_old
+ in
(* FIXME: use really format *)
OManager.printf "%s" (
(Printf.sprintf "In %s [%s:%s-%s:%s | global chars=%s-%s]\n%s at line %s, column %s\n"
@@ -198,7 +209,10 @@ let show_parse_error file_name content error_summary error_details pos =
^ (Printf.sprintf "\n<<%s%s>>\n"
(green (String.sub content begin_citation length_citation ))
(red (parse_error_flag^(String.sub content begin_error_zone length_error_zone))))
- ^ (Printf.sprintf "Hint: %s\n" error_details)
+ ^ (Printf.sprintf "%s: %s\n" (red "Hint") error_details)
+ ^ (Printf.sprintf "%s: You are now using the parser for the %s; if the source uses %s syntax then you should compile with %s option\n"
+ (red "Another hint") (red used) (red other) (red hint_option)
+ )
) ;
OManager.error "Syntax error"
(* ====================================================================================== *)
@@ -215,8 +229,6 @@ let hl_factory parser_rule name ?filename contents =
let expr = hl_factory Opa_parser.parse_opa_parser_expr_eoi "Expression"
let ty = hl_factory Opa_parser.parse_opa_parser_ty_eoi "Type"
-module OA = OpaSyntax.Args
-
let code ?(parser_=(!OA.r).OA.parser) ?(cache=false) ?(filename="") content =
(*print_string content;*)
FilePos.add_file filename content;
View
4 opalang/opaSyntax.ml
@@ -10,8 +10,8 @@ module Args = struct
}
let default_options = {
- parser = Classic;
- printer = Classic;
+ parser = Js;
+ printer = Js;
}
let is_default t = if default_options.parser = t then " (default)" else ""
View
4 plugins/crypto/bslCrypto.ml
@@ -42,6 +42,10 @@ let base64_decode2 str =
let hmac_sha1 key text =
Cryptokit.hash_string (Cryptokit.MAC.hmac_sha1 key) text
+##register hmac_sha256 : string, string -> string
+let hmac_sha256 key text =
+ Cryptokit.hash_string (Cryptokit.MAC.hmac_sha256 key) text
+
##register sha2 : string -> string
let sha2 s =
let hashobj = Cryptokit.Hash.sha256 () in
View
0 stdlib/components/chat/resources/close_icg_16.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 stdlib/components/chat/resources/search_icg_16.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 stdlib/components/table/table.opa
@@ -454,7 +454,7 @@ CTable = {{
for_iter(i, max)(f:(int -> void)) = ignore(for(i,(i -> do f(i) (i+1)),_<=max))
@private
- myselect(table_id,s) = Dom.select_raw("#{table_id}_table tbody tr{s}")
+ myselect(table_id,s) = Dom.select_raw_unsafe("#{table_id}_table tbody tr{s}")
@private
refresh_parity(table_id,b)=
@@ -785,7 +785,7 @@ CTable = {{
*/
add_row(row, cols, nb_rows, row_map) =
row_html = gen_row_html(row, cols)
- do Dom.transform([{Dom.select_raw("#{table_id}_table tbody")} +<- row_html])
+ do Dom.transform([{Dom.select_raw_unsafe("#{table_id}_table tbody")} +<- row_html])
// Check if the added row is in the display scope
(bottom,nb_rows) =
row_id = gen_row_id(table_id, config, row)
@@ -848,7 +848,7 @@ CTable = {{
do match config.headers with
| {some=f} ->
h_html = gen_col_header(simple,table_id, config, channel, f, col)
- do Dom.transform([{Dom.select_raw("#{table_id}_table thead tr")} +<- h_html])
+ do Dom.transform([{Dom.select_raw_unsafe("#{table_id}_table thead tr")} +<- h_html])
h_id = gen_col_header_id(table_id,config,col)
if col_page_size > (col_table_size - col_header_size)
then dom_show_cell(0, #{h_id}, simple)
View
7 stdlib/core/rpc/core/cell.opa
@@ -388,7 +388,12 @@ type middle('msg, 'ctx) = external
parser_(winfo) =
forbidden(msg) =
- do reply(winfo, msg, {forbidden})
+ #<Ifstatic:MLSTATE_PING_DEBUG>
+ #<Else>
+ _ = msg
+ msg = "Unauthorized request"
+ #<End>
+ do reply(winfo, msg, {unauthorized})
do Log.error("Cell_Server", msg)
error("Cell_server")
parser
View
0 stdlib/core/rpc/core/client_event.opa 100755 → 100644
File mode changed.
View
11 stdlib/core/rpc/core/oparpc.opa
@@ -397,9 +397,14 @@ type OpaRPC.timeout = {
)
reply_error(winfo, msg) =
+ #<Ifstatic:MLSTATE_PING_DEBUG>
+ #<Else>
+ _ = msg
+ msg = "Unauthorized request"
+ #<End>
winfo.cont(
WebCoreExport.default_make_response(
- {volatile}, winfo.http_request.request, {internal_server_error},
+ {volatile}, winfo.http_request.request, {unauthorized},
"text/plain", msg)
)
@@ -418,7 +423,7 @@ type OpaRPC.timeout = {
do Log.info("OpaRPC", "RPC call identified by {name}")
match get(name) with
| {none} ->
- _ = reply(winfo, "RPC not found", {wrong_address})
+ _ = reply_error(winfo, "RPC not found")
do Log.error("OpaRPC", "Call to the rpc \"{name}\" that doesn't exist")
error("RPC error")
@@ -429,7 +434,7 @@ type OpaRPC.timeout = {
reply(winfo, serial, {success}),
match skeleton(get_requested_post_content(winfo.http_request.request)) with
| {none} ->
- _ = reply(winfo, "Bad formatted rpc request", {forbidden})
+ _ = reply_error(winfo, "Bad formatted rpc request")
do Log.error("OpaRPC", "Call to the rpc \"{name}\" failed")
error("RPC error")
| {some = (ty,result)} ->
View
49 stdlib/core/web/core/reply.opa
@@ -165,11 +165,53 @@ WebCoreExport =
@private ll_cdisp_attachment : string -> WebInfo.private.native_http_header = %%BslNet.ConvertHeader.cdisp_attachment%%
@private ll_location : string -> WebInfo.private.native_http_header = %%BslNet.ConvertHeader.location%%
+/**
+ * Escape header field content.
+ *
+ * @note : According to RFC2616 CTL characters can be escaped if it are
+ * inside quoted string. But in real and cruel world, browsers
+ * doesn't take care CTL escaping. Therefore just remove it from content
+ */
+@private escape_string_header(h) =
+ // Remove CTLS see above note
+ CTL = parser c=. -> if c > 31 && c != 127 then Text.from_character(c)
+ else Text.cons("")
+ LWS = parser x=([\r][\n] ([ ]|[\t])+) -> x
+ TEXT = parser | ~LWS -> LWS
+ | ~CTL -> CTL
+ field_content = parser x=TEXT* -> Text.ltconcat(x)
+ Option.map(Text.to_string, Parser.try_parse(field_content, h))
+ ? "unsafe field content - should never happends"
+
@private add_ll_header(header : Resource.http_header, lst : list(WebInfo.private.native_http_header)) =
+ // /////////////////////////////////////////////////////////////////
+ // /!\ BEWARE - IF YOU ADD AN HEADER CASE KEEP IN MIND THAT VALUE //
+ // /!\ MUST BE ESCAPED //
+ // /////////////////////////////////////////////////////////////////
match header with
- | ~{set_cookie} -> [ ll_setcookie(cookie_def_to_string(set_cookie)) | lst ]
- | ~{location} -> [ ll_location(location) | lst ]
- | {content_disposition = ~{attachment}} -> [ ll_cdisp_attachment(attachment) | lst ]
+ | ~{set_cookie} ->
+ // Escape
+ escape_set_cookie(sc) = { sc with
+ name=escape_string_header(sc.name)
+ value=escape_string_header(sc.value)
+ attributes=List.map(
+ | ~{comment} -> {comment = escape_string_header(comment)}
+ | ~{domain} -> {domain = escape_string_header(domain)}
+ | ~{path} -> {path = escape_string_header(path)}
+ | e -> e
+ , sc.attributes)
+ }
+ set_cookie = escape_set_cookie(set_cookie)
+ [ ll_setcookie(cookie_def_to_string(set_cookie)) | lst ]
+
+ | ~{location} ->
+ // Escape
+ [ ll_location(escape_string_header(location)) | lst ]
+
+ | {content_disposition = ~{attachment}} ->
+ // Escape
+ [ ll_cdisp_attachment(escape_string_header(attachment)) | lst ]
+
| ~{lastm} ->
match lastm with
| {volatile} -> [ ll_cache_control("no-cache") , ll_pragma("no-cache") | lst ]
@@ -188,6 +230,7 @@ WebCoreExport =
[ ll_expires_at({some = te(expiry)}), ll_cache_control("public") ,
ll_lastm(te(now)) | lst ]
end
+ // TODO - WHY THESE CASES ARE IGNORED??
| _ -> lst
@private cookie_def_to_string(cd) =
View
2 stdlib/core/web/server/app_sources.opa
@@ -57,7 +57,7 @@ AppSources =
app_files = %%BslAppSrcCode.get_file_list%%()
init() =
Dom.set_style(
- Dom.select_raw("html, body"),
+ Dom.select_raw_unsafe("html, body"),
css {height: 100%; margin: 0px}
)
files =
View
44 stdlib/core/xhtml/dom.opa
@@ -257,8 +257,19 @@ Dom = {{
/**
* Perform a selection using CSS syntax
*/
- select_raw(selector: string): dom =
- (
+ @deprecated({use = "select_raw_unsafe"}) select_raw(selector: string): dom = (
+ ~{selector}
+ )
+
+ /**
+ * Perform a selection using CSS syntax. This function is unsafe
+ * because doesn't control [selector] argument. You can use [escape_selector] to escape
+ *
+ * {[xss = ", #toto"
+ * select_raw_unsafe(".class_{xss}")
+ * ]}
+ */
+ select_raw_unsafe(selector: string): dom = (
~{selector}
)
@@ -891,7 +902,7 @@ Dom = {{
(scroll_x, scroll_y)
)
- _ = Dom.transition(select_raw("html, body")/*For some reason, it doesn't work with the window itself*/,
+ _ = Dom.transition(select_raw_unsafe("html, body")/*For some reason, it doesn't work with the window itself*/,
Effect.scroll_to_xy(scroll_x, scroll_y))
void
)
@@ -1542,10 +1553,23 @@ Dom = {{
INSERT: Dom.key_code = 45
}}
+ /**
+ * Escaping for jQuery selectors !"#$%&'()*+,./:;<=>?@[\]^`{|}~.
+ * To use for raw selection.
+ * @see http://api.jquery.com/category/selectors/
+ */
+ escape_selector(str) =
+ String.map(c ->
+ match c with
+ | "!" | "\"" | "#" | "$" | "%" | "&" | "'" | "(" | ")" | "*"
+ | "+" | "," | "." | "/" | ":" | ";" | "<" | "=" | ">" | "?"
+ | "@" | "[" | "\\" | "]" | "^" | "`" | "\{" | "|"| "}" | "~" | " " -> "\\\\" ^ c
+ | _ -> c
+ , str)
+
/*
* {2 Select module}
*/
-
@private Select =
{{
@@ -1597,7 +1621,7 @@ Dom = {{
*/
select_id(name: string): Dom.private.element =
(
- %% BslDom.select_id %%(name)
+ %% BslDom.select_id %%(escape_selector(name))
)
/**
@@ -1606,7 +1630,7 @@ Dom = {{
*/
select_class(class: string): Dom.private.element =
(
- %% BslDom.select_class %%(class)
+ %% BslDom.select_class %%(escape_selector(class))
)
/**
@@ -1624,7 +1648,7 @@ Dom = {{
*/
select_tag(tag: string): Dom.private.element =
(
- %% BslDom.select_tag %%(tag)
+ %% BslDom.select_tag %%(escape_selector(tag))
)
/**
@@ -1657,23 +1681,23 @@ Dom = {{
*/
select_id_in(name: string, parent: Dom.private.element) =
(
- %% BslDom.select_id_in %%(name, parent)
+ %% BslDom.select_id_in %%(escape_selector(name), parent)
)
/**
* As [select_class], but among the children of a dom element
*/
select_class_in(class: string, parent: Dom.private.element) =
(
- %% BslDom.select_class_in %%(class, parent)
+ %% BslDom.select_class_in %%(escape_selector(class), parent)
)
/**
* As [select_tag], but among the children of a dom element
*/
select_tag_in(tag: string, parent: Dom.private.element) =
(
- %% BslDom.select_tag_in %%(tag, parent)
+ %% BslDom.select_tag_in %%(escape_selector(tag), parent)
)
/**
View
2 stdlib/core/xhtml/xhtml.opa
@@ -838,7 +838,7 @@ Xhtml =
end
//Now, generate jQuery-specific code in the jsbuffer, as a chain of JS dot calls on the item
do Buf.add(js_buffer,"\n$('#")
- do Buf.add(js_buffer,id)
+ do Buf.add(js_buffer,Dom.escape_selector(id))
do Buf.add(js_buffer,"')")
//Handle style -- generate a call to jQuery function [css]
View
10 stdlib/crypto/crypto.opa
@@ -54,8 +54,18 @@ Crypto = {{
Hash = {{
+ /**
+ * Produces a HMAC_SHA1 for the given key and message. The first argument
+ * is the key, the second is the message.
+ */
hmac_sha1 = %% BslCrypto.hmac_sha1 %% : string, string -> string
+ /**
+ * Produces a HMAC_SHA256 for the given key and message. The first argument
+ * is the key, the second is the message.
+ */
+ hmac_sha256 = %% BslCrypto.hmac_sha256 %% : string, string -> string
+
md5 = %% BslCrypto.md5 %% : string -> string
sha2 = %%BslCrypto.sha2%% : string -> string
View
32 stdlib/database/mongo/db.opa
@@ -415,9 +415,9 @@ type dbset('a) = { reply: Mongo.reply default : 'a}
* {1 Interface}
*/
-@package DbSet = {{
+DbSet = {{
- index(db:DbMongo.t, path:list(string), idx) =
+ @package index(db:DbMongo.t, path:list(string), idx) =
id = List.to_string_using("", "", ".", path)
key = List.map((name -> ~{name value={Int32=1}}), idx)
opt = 0
@@ -430,22 +430,22 @@ type dbset('a) = { reply: Mongo.reply default : 'a}
do Log.error("DbGen/Mongo", "(failure) Error when creating index {idx} at {path}")
error("Error when creating index")
- indexes(db:DbMongo.t, path:list(string), idxs) =
+ @package indexes(db:DbMongo.t, path:list(string), idxs) =
List.iter(index(db, path, _), idxs)
- build(db:DbMongo.t, path:list(string), selector, default:'a, nb):dbset('a) =
+ @package build(db:DbMongo.t, path:list(string), selector, default:'a, skip, limit):dbset('a) =
#<Ifstatic:DBGEN_DEBUG>
do Log.notice("DbGen/Mongo", "DbSet.build : Selector {selector}")
#<End>
id = List.to_string_using("", "", ".", path)
- reply=MongoDriver.query(db.db, 0, "{db.name}.{id}", 0, nb, selector, none)
+ reply=MongoDriver.query(db.db, 0, "{db.name}.{id}", skip, limit, selector, none)
match reply with
| {none} ->
do Log.error("DbGen/Query", "(failure) Read tn {id} set doesn't returns anything")
error("DbSet build error")
| {some=reply} -> ~{reply default}
- update(db:DbMongo.t, path:list(string), selector, update) =
+ @package update(db:DbMongo.t, path:list(string), selector, update) =
id = List.to_string_using("", "", ".", path)
tag = Bitwise.lor(0, MongoCommon.UpsertBit)
tag = Bitwise.lor(tag, MongoCommon.MultiUpdateBit)
@@ -501,7 +501,7 @@ type dbset('a) = { reply: Mongo.reply default : 'a}
to_list(dbset:dbset('a)) = fold([], dbset)(acc, a -> a +> acc)
- to_map(dbset:dbset('a)):map('key, 'value) =
+ @package to_map(dbset:dbset('a)):map('key, 'value) =
fold_doc(Map.empty, dbset, (map:map('key, 'value), doc:Bson.document ->
match List.extract_p(x -> x.name == "_id", doc) with
| ({some=kdoc}, vdoc) ->
@@ -529,7 +529,7 @@ type dbset('a) = { reply: Mongo.reply default : 'a}
)
)
- map_to_uniq(dbset:dbset('a)):option('value) =
+ @package map_to_uniq(dbset:dbset('a)):option('value) =
fold_doc(none, dbset, (opt, doc ->
do @assert(Option.is_none(opt))
match List.extract_p(x -> x.name == "_id", doc) with
@@ -544,37 +544,37 @@ type dbset('a) = { reply: Mongo.reply default : 'a}
)
)
- map_to_uniq_def(dbset:dbset('a)):'value =
+ @package map_to_uniq_def(dbset:dbset('a)):'value =
match map_to_uniq(dbset) with
| {some=v:'value} -> v
| {none} -> @unsafe_cast(dbset.default)
- set_to_uniq(dbset:dbset('a)):option('a) =
+ @package set_to_uniq(dbset:dbset('a)):option('a) =
match to_list(dbset) with
| [] -> none
| [uniq] -> some(uniq)
| _ -> do @assert(false) error("___")
- set_to_uniq_def(dbset:dbset('a)):'a =
+ @package set_to_uniq_def(dbset:dbset('a)):'a =
match set_to_uniq(dbset) with
| {none} -> dbset.default
| {some = uniq} -> uniq
- add_to_document(doc, name, value, ty):Bson.document =
+ @package add_to_document(doc, name, value, ty):Bson.document =
List.append(doc, Bson.opa_to_document(name, value, ty))
- build_vpath(db:DbMongo.t, path:list(string), selector, default:'b, nb,
+ @package build_vpath(db:DbMongo.t, path:list(string), selector, default:'b, skip, limit,
read_map:dbset('a) -> option('b)):DbMongo.private.val_path('b) =
{
id = DbMongo.path_to_id(path)
- read() = read_map(build(db, path, selector, @unsafe_cast(default), nb)):option('b)
+ read() = read_map(build(db, path, selector, @unsafe_cast(default), skip, limit)):option('b)
default = default
more = void
}
// [selector |
- build_rpath(db:DbMongo.t, path:list(string), selector, default:'b, nb,
+ @package build_rpath(db:DbMongo.t, path:list(string), selector, default:'b, skip, limit,
read_map:dbset('a) -> option('b), write_map:'b -> Bson.document):DbMongo.private.ref_path('b) =
- vpath = build_vpath(db, path, selector, default, nb, read_map)
+ vpath = build_vpath(db, path, selector, default, skip, limit, read_map)
write(data) =
do update(db, path, selector,
[{name="$set"; value={Document = write_map(data)}}]
View
2 stdlib/interactions/editable/editable.opa
@@ -235,7 +235,7 @@ IEditable = {{
focus_action(prefix_id:string, _) =
// FIXME: we suppose the son is an input...
- _ = Dom.give_focus(Dom.select_raw("#{editable_id(prefix_id)} > input:first"))
+ _ = Dom.give_focus(Dom.select_raw_unsafe("#{editable_id(prefix_id)} > input:first"))
void
parse_content(prefix_id:string, parse_fun:string->option('a)) =
View
0 stdlib/queue/queue.opa 100755 → 100644
File mode changed.
View
22 stdlib/widgets/deprecated/hlist/hlist.opa
@@ -310,7 +310,7 @@ WHList = {{
*/
current_pos(current_id:string) =
if Dom.length(#{current_id}) > 0 then
- some(Dom.length(Dom.select_inside(Dom.select_previous_several(#{current_id}), Dom.select_raw("li"))) + 1)
+ some(Dom.length(Dom.select_inside(Dom.select_previous_several(#{current_id}), Dom.select_raw_unsafe("li"))) + 1)
else none
/*
@@ -437,34 +437,34 @@ WHList = {{
prefix_class = WCore.compute_prefix_class(config, prefix_id)
// If the item (it's key) already exists, do not insert_item
// TODO: configurable? replace item?
- if Dom.length(#{current_id}) > 0 || Dom.length(Dom.select_raw(father_sel)) == 0 then none
+ if Dom.length(#{current_id}) > 0 || Dom.length(Dom.select_raw_unsafe(father_sel)) == 0 then none
else
xhtml_item = create_item_node(config, prefix_id, key, item)
selected = match sel_key with
| ~{some} -> item_id(prefix_id, config.helper.stringify(some))
| {none} -> "{father_sel} > li.{item_selected_class(prefix_class)}:last"
do match pos with
| {at_begin} ->
- _ = Dom.put_at_start(Dom.select_raw(father_sel),Dom.of_xhtml(xhtml_item))
+ _ = Dom.put_at_start(Dom.select_raw_unsafe(father_sel),Dom.of_xhtml(xhtml_item))
void
| {at_select} ->
- if Dom.length(Dom.select_raw(selected)) == 0 then
- _ = Dom.put_at_start(Dom.select_raw(father_sel),Dom.of_xhtml(xhtml_item))
+ if Dom.length(Dom.select_raw_unsafe(selected)) == 0 then
+ _ = Dom.put_at_start(Dom.select_raw_unsafe(father_sel),Dom.of_xhtml(xhtml_item))
void
else
jq = Dom.of_xhtml(xhtml_item) : dom
- _ = Dom.put_before(Dom.select_raw(selected), jq)
+ _ = Dom.put_before(Dom.select_raw_unsafe(selected), jq)
void
| {after_select} ->
- if Dom.length(Dom.select_raw(selected)) == 0 then
- _ = Dom.put_at_end(Dom.select_raw(father_sel), Dom.of_xhtml(xhtml_item))
+ if Dom.length(Dom.select_raw_unsafe(selected)) == 0 then
+ _ = Dom.put_at_end(Dom.select_raw_unsafe(father_sel), Dom.of_xhtml(xhtml_item))
void
else
jq = Dom.of_xhtml(xhtml_item) : dom
- _ = Dom.put_after(Dom.select_raw(selected), jq)
+ _ = Dom.put_after(Dom.select_raw_unsafe(selected), jq)
void
| {at_end} ->
- _ = Dom.put_at_end(Dom.select_raw(father_sel), Dom.of_xhtml(xhtml_item))
+ _ = Dom.put_at_end(Dom.select_raw_unsafe(father_sel), Dom.of_xhtml(xhtml_item))
void
| { fixed=_ } -> void // TO IMPLEMENT
do if item.state.selected then
@@ -557,7 +557,7 @@ WHList = {{
| {fixed=_} -> ""
if (id != "") && (Dom.length(#{id}) > 0)
then
- _ = Dom.trigger(Dom.select_raw("#{id} > ul > li.{item_content_class(prefix_class)} > a"), {click})
+ _ = Dom.trigger(Dom.select_raw_unsafe("#{id} > ul > li.{item_content_class(prefix_class)} > a"), {click})
current_pos
else
_ = unselect_all(config, prefix_id)
View
22 stdlib/widgets/hlist/hlist.opa
@@ -332,7 +332,7 @@ WHList = {{
*/
current_pos(current_id:string) =
if Dom.length(#{current_id}) > 0 then
- some(Dom.length(Dom.select_inside(Dom.select_previous_several(#{current_id}), Dom.select_raw("li"))) + 1)
+ some(Dom.length(Dom.select_inside(Dom.select_previous_several(#{current_id}), Dom.select_raw_unsafe("li"))) + 1)
else none
/*
@@ -479,7 +479,7 @@ WHList = {{
prefix_class = compute_prefix_class(config)
// If the item (it's key) already exists, do not insert_item
// TODO: configurable? replace item?
- if Dom.length(#{current_id}) > 0 || Dom.length(Dom.select_raw(father_sel)) == 0 then none
+ if Dom.length(#{current_id}) > 0 || Dom.length(Dom.select_raw_unsafe(father_sel)) == 0 then none
else
xhtml_item = create_item_node(config, key, item)
dom_item = Dom.of_xhtml(xhtml_item) : dom
@@ -488,24 +488,24 @@ WHList = {{
| {none} -> "{father_sel} > li.{item_selected_class(prefix_class)}:last"
do match config.insert_pos with
| {at_begin} ->
- _ = Dom.put_at_start(Dom.select_raw(father_sel), dom_item)
+ _ = Dom.put_at_start(Dom.select_raw_unsafe(father_sel), dom_item)
void
| {at_select} ->
- if Dom.length(Dom.select_raw(selected)) == 0 then
- _ = Dom.put_at_start(Dom.select_raw(father_sel), dom_item)
+ if Dom.length(Dom.select_raw_unsafe(selected)) == 0 then
+ _ = Dom.put_at_start(Dom.select_raw_unsafe(father_sel), dom_item)
void
else
- _ = Dom.put_before(Dom.select_raw(selected), dom_item)
+ _ = Dom.put_before(Dom.select_raw_unsafe(selected), dom_item)
void
| {after_select} ->
- if Dom.length(Dom.select_raw(selected)) == 0 then
- _ = Dom.put_at_end(Dom.select_raw(father_sel), dom_item)
+ if Dom.length(Dom.select_raw_unsafe(selected)) == 0 then
+ _ = Dom.put_at_end(Dom.select_raw_unsafe(father_sel), dom_item)
void
else
- _ = Dom.put_after(Dom.select_raw(selected), dom_item)
+ _ = Dom.put_after(Dom.select_raw_unsafe(selected), dom_item)
void
| {at_end} ->
- _ = Dom.put_at_end(Dom.select_raw(father_sel), dom_item)
+ _ = Dom.put_at_end(Dom.select_raw_unsafe(father_sel), dom_item)
void
| { fixed=_ } -> void // TO IMPLEMENT
do if item.state.selected then
@@ -605,7 +605,7 @@ WHList = {{
| {fixed=_} -> ""
if (id != "") && (Dom.length(#{id}) > 0)
then
- _ = Dom.trigger(Dom.select_raw("#{id} > ul > li.{item_content_class(prefix_class)} > a"), {click})
+ _ = Dom.trigger(Dom.select_raw_unsafe("#{id} > ul > li.{item_content_class(prefix_class)} > a"), {click})
current_pos
else
_ = unselect_all(config)
View
8 stdlib/widgets/textarea/textarea.opa
@@ -375,7 +375,7 @@ WTextarea =
/* Return a selector containing the [WTextarea] lines */
@private
get_lines(editor_id: string): dom =
- /*Dom.select_raw(".{get_line_class(editor_id)}")*/
+ /*Dom.select_raw_unsafe(".{get_line_class(editor_id)}")*/
Dom.select_class(get_line_class(editor_id))
/*tmp = Dom.select_class(get_line_class(editor_id))*/
/* |> Dom.select_inside(Dom.select_children(#{editor_id}), _)*/
@@ -434,7 +434,7 @@ WTextarea =
@private
is_current_line(editor_id: string, element: dom): bool =
/*sel_caret =*/
- /*Dom.select_raw(".{get_line_class(editor_id)}")*/
+ /*Dom.select_raw_unsafe(".{get_line_class(editor_id)}")*/
/*Dom.select_class(get_line_class(editor_id))*/
/*|> Dom.select_inside(Dom.select_children(element), _)*/
/* Dom.select_inside(Dom.select_children(element),*/
@@ -600,7 +600,7 @@ WTextarea =
/* Get the line following the one designated by the given selector. */
@private
next_line(_editor_id: string, line: dom): option(dom) =
- /*Dom.select_raw(".{get_line_class(editor_id)}")*/
+ /*Dom.select_raw_unsafe(".{get_line_class(editor_id)}")*/
/*Dom.select_class(get_line_class(editor_id))*/
/* |> Dom.select_inside(_, Dom.select_next_one(line))*/
/* |> sel_opt(_)*/
@@ -610,7 +610,7 @@ WTextarea =
/* Get the line preceding the one designated by the given selector. */
@private
prev_line(_editor_id: string, line: dom): option(dom) =
- /*Dom.select_raw(".{get_line_class(editor_id)}")*/
+ /*Dom.select_raw_unsafe(".{get_line_class(editor_id)}")*/
/*Dom.select_class(get_line_class(editor_id))*/
/* |> Dom.select_inside(Dom.select_previous_one(line), _)*/
/* |> sel_opt(_)*/
View
0 tools/jsdoc-toolkit/app/handlers/XMLDOC.js 100755 → 100644
File mode changed.
View
0 tools/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js 100755 → 100644
File mode changed.
View
0 tools/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js 100755 → 100644
File mode changed.
View
0 tools/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js 100755 → 100644
File mode changed.
View
0 tools/jsdoc-toolkit/java/src/JsDebugRun.java 100755 → 100644
File mode changed.
View
2 utils/vim/syntax/opa.vim
@@ -24,7 +24,7 @@ syn keyword opaCss css
syn region opaCodeinString matchgroup=opaKeywords start=+[^\\]{+ matchgroup=opaKeywords end=+}+ containedin=opaString,opaHtml contains=ALL
syn region opaString start=+"+ skip=+\\"+ end=+"+
-syn region opaHtml start=+<\S+ skip=+->+ end=+>+ contains=opaColor,opaString
+syn region opaHtml start=+<[^:]\S+ skip=+->+ end=+>+ contains=opaColor,opaString
syn match opaConstructor "\[\s*\]"
syn match opaBypass "%%"

0 comments on commit 14af0ab

Please sign in to comment.