Skip to content

Commit

Permalink
[fix] syntax,js-like: no keyword restriction on db path
Browse files Browse the repository at this point in the history
  • Loading branch information
OpaOnWindowsNow committed Dec 13, 2011
1 parent e00455e commit a076852
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions opalang/js_syntax/parser_path.trx
Expand Up @@ -17,9 +17,9 @@
*) *)
(* shorcuts to other files *) (* shorcuts to other files *)
;slash_nosp <- Opa_lexer.slash_nosp ;slash_nosp <- Opa_lexer.slash_nosp
;deco_ml_identifier_nosp <- Opa_parser.deco_ml_identifier_nosp ;deco_field_identifier_nosp <- Opa_parser.deco_field_identifier_nosp
;ml_identifier_nosp <- Opa_lexer.ml_identifier_nosp ;field_identifier_nosp <- Opa_lexer.field_identifier_nosp
;ml_identifier <- Opa_lexer.ml_identifier ;field_identifier <- Opa_lexer.field_identifier
;underscore_nosp <- Opa_lexer.underscore_nosp ;underscore_nosp <- Opa_lexer.underscore_nosp
;lbracket <- Opa_lexer.lbracket ;lbracket <- Opa_lexer.lbracket
;lbracket_nosp <- Opa_lexer.lbracket_nosp ;lbracket_nosp <- Opa_lexer.lbracket_nosp
Expand All @@ -33,16 +33,16 @@
;semic <- Opa_lexer.semic ;semic <- Opa_lexer.semic


(* path definition, ie for [db pathdef : typ] or [db pathdef = expr] *) (* path definition, ie for [db pathdef : typ] or [db pathdef = expr] *)
;pathdef_nosp <-slash_nosp ml_identifier_nosp:i ;pathdef_nosp <-slash_nosp field_identifier_nosp:i
(slash_nosp ml_identifier_nosp:i {{QmlAst.Db.Decl_fld i}} (slash_nosp field_identifier_nosp:i {{QmlAst.Db.Decl_fld i}}
/ "[]" {{ QmlAst.Db.Decl_set [] }} / "[]" {{ QmlAst.Db.Decl_set [] }}
/ "[_]" {{ QmlAst.Db.Decl_set [] }})*:l / "[_]" {{ QmlAst.Db.Decl_set [] }})*:l
{{ (QmlAst.Db.Decl_fld i)::l }} {{ (QmlAst.Db.Decl_fld i)::l }}
;/** todo: extend to multiple index **/ ;/** todo: extend to multiple index **/
setindex_def <- lbrace (=list1(ml_identifier,semic)):i rbrace setindex_def <- lbrace (=list1(field_identifier,semic)):i rbrace
{{ QmlAst.Db.Decl_set [List.sort String.compare i] }} {{ QmlAst.Db.Decl_set [List.sort String.compare i] }}
;pathdef_type_nosp <- slash_nosp ml_identifier_nosp:i ;pathdef_type_nosp <- slash_nosp field_identifier_nosp:i
(slash_nosp ml_identifier_nosp:i {{QmlAst.Db.Decl_fld i}} (slash_nosp field_identifier_nosp:i {{QmlAst.Db.Decl_fld i}}
/ lbracket setindex_def:i rbracket {{i}})*:l / lbracket setindex_def:i rbracket {{i}})*:l
{{ (QmlAst.Db.Decl_fld i)::l }} {{ (QmlAst.Db.Decl_fld i)::l }}
;/** database path definition without type **/ ;/** database path definition without type **/
Expand All @@ -65,10 +65,10 @@ path_write <- slash_nosp path:p {{ p }}
/ slash_nosp {{ QmlAst.Db.Default }} / slash_nosp {{ QmlAst.Db.Default }}


;path = Opa_parser.careful_deco just_path ;path = Opa_parser.careful_deco just_path
;just_path <- deco_ml_identifier_nosp:i path_elem*:l {{ let (s,label) = i in ((FldKey s),label) :: l }} ;just_path <- deco_field_identifier_nosp:i path_elem*:l {{ let (s,label) = i in ((FldKey s),label) :: l }}


;path_elem = Opa_parser.careful_deco just_path_elem ;path_elem = Opa_parser.careful_deco just_path_elem
;just_path_elem <- slash_nosp ml_identifier_nosp:i {{ FldKey i }} ;just_path_elem <- slash_nosp field_identifier_nosp:i {{ FldKey i }}
/ lbracket_nosp Opa_parser.expr:e rbracket {{ ExprKey e }} / lbracket_nosp Opa_parser.expr:e rbracket {{ ExprKey e }}
/ lbracket_nosp spacing [?] rbracket {{ NewKey }} / lbracket_nosp spacing [?] rbracket {{ NewKey }}


Expand Down

0 comments on commit a076852

Please sign in to comment.