Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue #8 #9

Open
wants to merge 1 commit into
base: derive
Choose a base branch
from
Open

Fixes issue #8 #9

wants to merge 1 commit into from

Conversation

ngunn
Copy link
Contributor

@ngunn ngunn commented Feb 19, 2014

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)

  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)
@bobzhang
Copy link
Owner

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

@ngunn
Copy link
Contributor Author

ngunn commented Feb 28, 2014

No problem. Thanks for letting me know.

@bobzhang
Copy link
Owner

bobzhang commented Mar 3, 2014

Thanks for you good catch, I merged your patch in commit 1b6530a
and
817f7f8
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.

@ngunn
Copy link
Contributor Author

ngunn commented Mar 4, 2014

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?

@bobzhang
Copy link
Owner

bobzhang commented Mar 5, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants