Commit graph

97 commits

Author SHA1 Message Date
Evan Czaplicki
37878528bf Check for variable shadowing
When this code was originally written, all variables were given unique
names, making it unnecessary to check for shadowing.
2013-10-13 17:36:21 -04:00
Evan Czaplicki
76b2e56981 Add Strings as a primitive in the compiler 2013-10-02 15:56:43 -07:00
Evan Czaplicki
11f5f5263c Actually use infixes in parser 2013-09-15 14:39:55 -07:00
Evan Czaplicki
37f1be6d79 Add fixities to module interfaces 2013-09-15 14:39:55 -07:00
Evan Czaplicki
5f7fcaa92d Fix issue #241 2013-09-08 12:26:07 -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
6ba2d70365 Revert 95ec3a8..1a093ac
This rolls back to commit 95ec3a822e.
2013-08-29 16:43: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
Evan Czaplicki
d7c89ee07c support cross-module OpTables 2013-08-29 02:53:20 -07:00
Evan Czaplicki
fea6e5d408 Add fixities to module interfaces 2013-08-29 00:06:37 -07:00
Evan Czaplicki
9346d2e516 Remove two unused modules 2013-08-25 01:39:12 -07:00
Evan Czaplicki
9e58bdbc54 Canonicalize patterns in lambda expressions 2013-08-10 15:48:18 -07:00
Evan Czaplicki
5b6773c3ec Fix extra space in error message 2013-08-08 18:05:21 -07:00
Evan Czaplicki
0b9317124d Give more specific errors when a variable cannot be found during canonicalization 2013-08-07 09:38:30 -07:00
Evan Czaplicki
a56efd851b Check that imports actually exist in the known interfaces 2013-07-31 12:12:30 -07:00
Evan Czaplicki
a400ab140a Get compling 2013-07-31 07:42:21 -07:00
Evan Czaplicki
a4c4cf0493 Use Location.none less 2013-07-30 11:55:41 -07:00
Evan Czaplicki
b26edcc46e Simplify representation of source locations 2013-07-30 11:43:42 -07:00
Evan Czaplicki
fda1d2f979 Add canonicalization for aliases and ADTs 2013-07-29 19:25:24 +02:00
Evan Czaplicki
0f3910d59e Make SortDefinitions aware of ADT constructors, gave incorrect sorts before 2013-07-29 15:29:23 +02:00
Evan Czaplicki
3f96acf1f1 Get rid of logging and add Int, Float, Char, Bool to the global environment 2013-07-29 13:23:02 +02:00
Evan Czaplicki
2f5639c4fb Introduce Transform.Canonicalize
Run this to create a properly formatted ModuleInterface
2013-07-29 11:59:55 +02:00
Evan Czaplicki
7b90975dad Simplify code to check for structural errors 2013-07-23 16:15:56 +02:00
Evan Czaplicki
621a9c2d2e Add a way to flatten lets that have become nested 2013-07-16 21:40:11 +02:00
Evan Czaplicki
ce357b3d0d Switch to reporting errors with [Doc] for prettier layout. 2013-07-16 14:52:50 +02:00
Evan Czaplicki
93a948cd67 Add back in checks for duplicate and out-of-order definitions. 2013-07-15 01:06:00 +02:00
Evan Czaplicki
fe7357a0b5 Export boundVars function, which is currently reeded to generate JS. 2013-07-14 01:41:52 +02:00
Evan Czaplicki
7f433922ed Create module to sort let-blocks into "strongly connected components".
This does two things:

  * makes it possible to automatically generalize functions without
    bothering the programmer about managing dependencies.

  * sorts values such that they'll be defined in the appropriate order
    when they are mapped down to JavaScript.
2013-07-12 22:24:12 +02:00
Evan Czaplicki
078692ad8c Get Optimize.hs updated for the newer AST. 2013-07-07 12:55:08 +02:00
Evan Czaplicki
5c68f6bb73 Convert more files to the new Expression format that relies more on
patterns. Seems to clean things up so far.

Also, begin adding a module that resorts definitions to make sure
that each definition comes after the ones it depends on. This will
also make it possible to disallow recursive values statically.
2013-07-04 17:24:04 +02:00
Evan Czaplicki
74d3c35131 Fix optimization bug with > sign. 2013-07-02 16:58:19 +02:00
Evan Czaplicki
d700acfeac Fix substitutions for ExplicitList. 2013-07-01 20:00:37 +02:00
Evan Czaplicki
98eceb5496 Clean up Transform/Replace.hs. Switch the environment from a (String -> String) to a (Map String String). 2013-06-23 01:33:33 -07:00
evancz
9a40249e05 Fix the confusion with "Cons" and "Nil" in issue #176.
Also add the ExplicitList expression.
2013-06-20 21:25:10 -07:00
evancz
721ce4f192 Continue reorganizing the code-base.
Remove uses of uniplate, introduces a regression in testing the ordering of Defs in let-expressions.
2013-06-13 22:45:08 -07:00
evancz
339ad77c46 Begin getting the parser to match the new SourceSyntax modules. 2013-06-13 18:35:37 -07:00
evancz
73317ed123 Switch to using MultiIf for all if expressions. Simplifies AST. 2013-06-13 16:01:35 -07:00
evancz
28db384691 Fix parsing bug in as patterns that would fully commit if any spaces were seen.
Also add `as` variables to reported variables in patterns.
2013-06-06 23:16:46 -07:00
Andrew Miller
f8547cf4be Update 'at patterns' to use the as notation per mailing list discussion 2013-06-07 12:53:50 +12:00
Andrew Miller
3c71ee1c4d Support @ patterns as in Haskell 2013-06-06 21:27:20 +12:00
Andrew Miller
6a34482849 Add support for type annotations in let 2013-06-03 19:44:45 +12:00
evancz
6b28feaa2b Switch name of Context to Located. Whoo static types :) 2013-05-29 16:20:38 -07:00
evancz
b4bf8e9810 Get rid of ($)...
http://www.youtube.com/watch?v=a1Y73sPHKxw
2013-05-28 17:03:48 -07:00
evancz
ce51a0e39f Add type-class for lists in LetBoundVars.hs 2013-05-21 22:11:23 +02:00
evancz
4eb973a206 Update Optimize.hs to use some of the newer infix operators. 2013-05-21 22:09:08 +02:00
evancz
1d04b342d8 Permit pattern matching on records in case-expressions. 2013-04-07 06:46:46 -07:00
evancz
99ae5c6ba0 Finish moving the compiler down a directory. 2013-03-16 12:07:32 -07:00