fan icon indicating copy to clipboard operation
fan copied to clipboard

Fixes issue #8

Open ngunn opened this issue 11 years ago • 5 comments

let f x = x * x let f x = x ** x ** x let f x = +. x all work

cold/ files built by running fan on main/ files

main/lex_fan: add "+." as keyword so it can be used as either a prefix or infix (like "-.")

main/parse_fan: add missing(?) keywords to the parser. make "**" right associative add trivial unary "+" rule where the unary minus one is (handles "let f x = +. x" for the only reason that OCaml already permits it)

ngunn avatar Feb 19 '14 18:02 ngunn

Thanks! sorry for the delay, I would take a look this weekend

bobzhang avatar Feb 28 '14 01:02 bobzhang

No problem. Thanks for letting me know.

ngunn avatar Feb 28 '14 01:02 ngunn

Thanks for you good catch, I merged your patch in commit 1b6530aa2d5a3704f5362e06958fad6c2780a2e0 and 817f7f89f4221ccfea0021342c3ec52beed88790 I did not add "+." as keyword yet, need to check with ocaml manual.

You seems to have a really good understanding on how Fan works, I can grant your write access if you like.

bobzhang avatar Mar 03 '14 02:03 bobzhang

Thanks!

I did not add "+." as keyword yet, need to check with ocaml manual.

I didn't check the manual (just tested against the compiler). From my version of OCaml, in parsing/parser.mly, it's obvious that unary plus is at least intended: expression parsing (line 1043-4): | additive expr %prec prec_unary_plus { mkuplus $1 $2 }

where additive is "+" | "+.", mkuplus is defined on line 114

You seems to have a really good understanding on how Fan works, I can grant your write access if you like.

I'm pleased to be working with Fan. I would prefer to push changes through you for now, if possible. I don't yet have a good grasp of the overall design and data flow.

I also have a cosmetic commit renaming util to utilf (js_of_ocaml also has util.ml and my project includes both). Are you interested in it?

ngunn avatar Mar 04 '14 22:03 ngunn

yes, renaming is fine. Could you send me a patch, I would merge that directly

bobzhang avatar Mar 05 '14 02:03 bobzhang