Commit graph

79 commits

Author SHA1 Message Date
Evan Czaplicki
efdc7a7744 Start using strict mode for everything
V8 engineer said it is always faster, so that’s probably reliable info
:)
2014-02-13 09:31:19 +01:00
Evan Czaplicki
9dd5dff279 Make AST more general and try to give its phases better names
Also change the constructors for the Pattern ADT
2014-02-10 00:17:33 +01:00
Max New
53c2ab1531 Move splitDots and prevent a non-exhaustive pattern match warning 2014-01-18 17:44:11 -06:00
Max New
4a25c165a4 Hack to make imported names safe.
This fixes a bug where imported identifiers with reserved names were
not being changed during codegen.
2014-01-18 17:36:09 -06:00
Evan Czaplicki
32fbbca5b2 Generate conversion code for ports 2014-01-13 19:32:54 +01:00
Evan Czaplicki
9dda928ac4 make conversion functions for input ports optional 2014-01-13 11:01:10 +01:00
Evan Czaplicki
8bea3f073d cosmetic: make a block of code more whitespace friendly 2014-01-06 08:07:24 +01:00
Evan Czaplicki
da033e3696 Filter out duplicate imports, generate code using new Native.Ports module 2014-01-06 07:49:49 +01:00
Evan Czaplicki
7cf5a564e5 Add Expressions for ports to check and validate types nicely 2014-01-04 11:39:38 +01:00
Evan Czaplicki
c04c4385ff Update for new defs and ports format 2014-01-02 23:46:37 -08:00
Evan Czaplicki
578dfb8358 Merge branch 'js-integration' into dev 2014-01-02 12:29:08 -08:00
Evan Czaplicki
f26610b718 Properly handle pattern matching on non-tuple ADTs in let-expressions, esolving issue #417 2013-12-27 16:14:21 -08:00
Evan Czaplicki
71bb1c8bf9 Add basics of properly handling ports 2013-12-24 10:13:19 -08:00
Evan Czaplicki
740702c0d7 Begin switch from current FFI syntax to "port" syntax 2013-12-23 23:53:54 -08:00
Evan Czaplicki
51ee065e6b Cosmetic: give function a more descriptive name 2013-12-23 17:02:47 -08:00
Max New
647cf279a1 Optimize True branch in multi-way if code generation. 2013-12-23 18:57:23 -06:00
Evan Czaplicki
e119d8ef62 Get rid of SourceSyntax.Everything module 2013-12-22 15:18:16 -08:00
Evan Czaplicki
f8bf89b48d Make sure that all names in a program are safe for use in JS code 2013-12-22 15:00:29 -08:00
Evan Czaplicki
61ff49067f Guard against issue #387 2013-12-15 19:14:00 -08:00
Evan Czaplicki
dac51abc88 Finish refactoring code into Build/ directory, make some names more consistent and remove unneeded dependencies 2013-12-14 23:29:39 -08:00
Evan Czaplicki
e32eab0e62 Merge branch 'master' into dev
Conflicts:
	compiler/Generate/JavaScript.hs
	compiler/Generate/Noscript.hs
	compiler/Parse/Expression.hs
	compiler/SourceSyntax/Expression.hs
2013-11-22 12:22:29 -08:00
Evan Czaplicki
c8643484be Abstract out the code for markdown parsing, making it easier to switch out the implementation 2013-11-22 12:12:22 -08:00
Evan Czaplicki
934e590a7b Be sure to avoid variable shadowing when generating temporary variables, fix for # 318 2013-11-02 19:05:07 +01:00
Evan Czaplicki
d1cee239d3 Add a couple type annotations 2013-11-01 13:58:18 +01:00
Evan Czaplicki
56ecbbc70a Implement markdown interpolation 2013-10-25 17:36:30 +02:00
Evan Czaplicki
f1b1bcd5fd Fix pattern matching on characters 2013-10-22 07:02:51 +02:00
Evan Czaplicki
2c080b6b0d Mark Char and Text values to distinguish them from Strings
Also get rid of the unwords and unlines functions which are confusing
and can more easily be reproduced with (join " ") and (join "\n")
2013-10-10 13:57:33 -07:00
Evan Czaplicki
e85c8f18dc Fix issue #286
That was a silly one :) Thanks for the report @mgold.
2013-10-08 20:06:26 -07:00
Evan Czaplicki
ea38376358 Cosmetic: import the prefixed version of Generate.Cases 2013-10-08 20:06:26 -07:00
Evan Czaplicki
88680c8bc9 Generate native JS strings for Elm Strings 2013-10-02 16:56:14 -07:00
Evan Czaplicki
b40f2958d4 New convention for storing module values, fixes bug
Before it was not possible to add values to anything except leafs of
the namespace structure.
2013-09-30 01:32:27 -07:00
Evan Czaplicki
dcbe2fc245 Change the format of module instantiation
Currently, it's only possible to create modules at the leafs of the
namespace structure. This CL lifts that restriction.

Get rid of "use strict" in many cases.
2013-09-30 00:44:31 -07:00
Evan Czaplicki
017f96b522 Fix issue with imported reserved names from #214 2013-09-22 17:40:10 -04:00
Max New
3783f2646c Fix function application code gen bug for >=10 arguments. 2013-09-16 23:47:15 -07:00
Evan Czaplicki
d94e218fd1 Fix JS generation for infix ops with dots 2013-09-15 18:53:13 -07:00
Evan Czaplicki
ec8e787f0d Correct optimization of if expressions 2013-09-13 01:05:35 -07:00
Evan Czaplicki
bdd8213e6d Fix generation of infix ops 2013-09-03 01:30:21 -07:00
Evan Czaplicki
e2d2c45228 Revert "Add names to functions in generated JS."
This reverts commit a4fdf0664c.
2013-09-02 15:18:44 -07:00
Evan Czaplicki
a4fdf0664c Add names to functions in generated JS. 2013-09-01 22:20:08 -07:00
Evan Czaplicki
aed6d9547a Merge branch 'experimental' into dev
Conflicts:
	compiler/Generate/JavaScript.hs
2013-09-01 01:43:51 -07:00
Evan Czaplicki
6b855f932e Fix problem with overlapping variable names in generated code 2013-09-01 01:25:10 -07:00
Evan Czaplicki
1f48a279eb Properly generate infix ops not in Basics 2013-08-31 21:12:11 -07:00
Evan Czaplicki
3a072982ac Get generation working
move `makeSafe` over and make floats work
2013-08-31 13:22:00 -07:00
Evan Czaplicki
966e725f5e Finish converting the JS generator, still needs testing 2013-08-31 12:14:23 -07:00
Evan Czaplicki
10734a1b0b get jsImport working 2013-08-31 04:41:36 -07:00
Evan Czaplicki
5b263aa124 Add markdown and make . notation nicer 2013-08-31 04:19:18 -07:00
Evan Czaplicki
394d398512 Get case expressions working 2013-08-31 04:01:00 -07:00
Evan Czaplicki
bd445c4e22 Get closer to full conversion to language-ecmascript 2013-08-31 01:56:17 -07:00
Evan Czaplicki
8c50652e09 Begin conversion to language-ecmascript 2013-08-30 23:18:54 -07:00
Evan Czaplicki
7c159b294a Enable parsing of basic markdown interpolation
No interpolated values are actually used, but they are type checked.
2013-08-29 13:00:38 -07:00