Skip to content

Commit

Permalink
[fix] bsljsparse: whitespace regexp.
Browse files Browse the repository at this point in the history
Tags were being read as ["c"; "p"; "s"] instead of ["cps"].
  • Loading branch information
arthuraa committed Aug 28, 2012
1 parent 8a117e7 commit dadc616
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions compiler/libbsl/bslJsParse.ml
Expand Up @@ -37,8 +37,6 @@ type parsed_file = {
code: JsAst.code; code: JsAst.code;
} }


let whitespace = Str.regexp "[ \t]*"

(** When trying to interpret a comment as a bsl directive, we do the (** When trying to interpret a comment as a bsl directive, we do the
following: following:
Expand Down Expand Up @@ -78,7 +76,7 @@ let collect_bsl_tags tags =
let strings tag update bsl_tags = let strings tag update bsl_tags =
let aux (_, tag', args) = let aux (_, tag', args) =
if tag = tag' then if tag = tag' then
let attributes = Str.split whitespace args in let attributes = Str.split (Str.regexp "[ \t]+") args in
Some attributes Some attributes
else else
None None
Expand All @@ -96,7 +94,7 @@ let collect_bsl_tags tags =
| (_, tag', args) :: rest -> | (_, tag', args) :: rest ->
if tag <> tag' then if tag <> tag' then
aux rest aux rest
else if Str.string_match whitespace args 0 then else if Str.string_match (Str.regexp "[ \t]*") args 0 then
Some (update bsl_tags) Some (update bsl_tags)
else else
None None
Expand Down

0 comments on commit dadc616

Please sign in to comment.