Commit graph

136 commits

Author SHA1 Message Date
Evan Czaplicki
3a072982ac Get generation working
move `makeSafe` over and make floats work
2013-08-31 13:22:00 -07:00
Evan Czaplicki
4e8898bef1 Remove unused references to Unique 2013-08-31 02:59:43 -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
1a093ac53a Properly turn off custom OpTables
oops!
2013-08-29 02:57:01 -07:00
Evan Czaplicki
65dcc0b57e Turn off custom OpTables for now 2013-08-29 02:55:49 -07:00
Evan Czaplicki
d7c89ee07c support cross-module OpTables 2013-08-29 02:53:20 -07:00
Evan Czaplicki
f1a88975d2 Add iParse that takes a table 2013-08-29 00:55:32 -07:00
Evan Czaplicki
6d27c5eee7 Move OpTable into IParser user state 2013-08-29 00:54:54 -07:00
Evan Czaplicki
7785eb8e48 Remove dead code 2013-08-25 19:24:45 -07:00
Evan Czaplicki
d3dc74325d Remove dead code 2013-08-25 19:23:45 -07:00
Evan Czaplicki
082e6a20c0 Throw proper parse errors, stop using error 2013-08-25 19:22:41 -07:00
Evan Czaplicki
40ea6df24b Make sure that generated JS does not use JS's reserved words as variables 2013-08-24 15:00:23 -07:00
Evan Czaplicki
5fd85cd9c5 Permit single line comments intermingled with types 2013-08-15 23:29:29 -07:00
Evan Czaplicki
9ec51f558d deprime on parsing, not on JS generation 2013-08-14 00:42:26 -07:00
Evan Czaplicki
d9918e0ac2 Convince parser to commit to lists, records, and tuples 2013-08-13 23:41:44 -07:00
Evan Czaplicki
61b5d8fbfa Nicer messages on specific parse failures 2013-08-13 23:11:23 -07:00
Evan Czaplicki
ab83c78d8d Remove dead code 2013-08-13 23:09:46 -07:00
Evan Czaplicki
cd84e06695 Make pattern exhaustive, giving parse error when someone uses binops with different associativity 2013-08-13 22:20:00 -07:00
Evan Czaplicki
9821e12a4c Strip \r from multiline strings 2013-08-07 09:12:53 -07:00
Evan Czaplicki
ed6b255ba5 Properly parse out module names, defaulting to Main if no name is given. 2013-08-06 21:20:08 -07:00
Evan Czaplicki
9f2b81e4a9 Unhide thing that does not exist 2013-08-02 16:09:06 -07:00
Evan Czaplicki
51ba512914 Parse qualified infix functions
It is okay to say

    4 `Time.since` Mouse.clicks
2013-08-01 15:38:19 -07:00
Evan Czaplicki
66e2a97d2a Allow prefixes on FFI types 2013-08-01 15:37:34 -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
66515259cf Only deprime when generating JavaScript, better to preserve information 2013-07-29 23:19:16 +02:00
Evan Czaplicki
ac450ae944 restrict exports to def and term 2013-07-29 19:49:09 +02:00
Evan Czaplicki
1418bde44d Remove use of SourceSyntax.Rename, which no longer exists 2013-07-29 11:54:50 +02:00
Evan Czaplicki
760ad905cf Add record constructors, begin using lists to represent fields in record types to maintain ordering from the source program 2013-07-26 18:20:57 +02:00
Evan Czaplicki
938675110d Fix parser for "import List" which before was not importing anything. 2013-07-26 12:31:49 +02:00
Evan Czaplicki
2609f5dda7 Add support for let (==>) = Lambda in … 2013-07-23 17:00:05 +02:00
Evan Czaplicki
6f94400f2d Begin parsing types and patterns such as A.B.C 2013-07-22 14:40:32 +02:00
Evan Czaplicki
97bd68a796 Make parse errors print more nicely 2013-07-22 14:40:00 +02:00
Evan Czaplicki
22f7f8a43a Create a serializable interface for a module's type information
Also add a flag to print out top-level types
2013-07-21 06:08:08 +02:00
Evan Czaplicki
5cb82c6891 Add support for "(,,) a b c" as a valid type annotation 2013-07-20 18:53:41 +02:00
Evan Czaplicki
0cfae2e43b More specific imports 2013-07-16 21:38:43 +02:00
Evan Czaplicki
640f98e7d5 Rename functions and modules 2013-07-16 21:38:20 +02:00
Evan Czaplicki
1ffaad1f5c Create an isOp function for strings. 2013-07-16 21:37:48 +02:00
Evan Czaplicki
91be5a0c03 Rename the parser. 2013-07-16 16:02:04 +02:00
Evan Czaplicki
1c9da4bf9c Force whitespace between number and operator in infix declarations. 2013-07-16 14:50:35 +02:00
Evan Czaplicki
8590c6bd18 Add parsing for infix declarations. No support for actually using this
information though.
2013-07-16 14:39:58 +02:00
Evan Czaplicki
72bd5cb8eb Clean out this file, getting rid of dead code and adding some types. 2013-07-16 14:39:26 +02:00
Evan Czaplicki
18adffc06d Turn unary negation back on. 2013-07-16 00:36:34 +02:00
Evan Czaplicki
90d50dbb13 Turn off unary negation parsing for now. It has weird behavior when
paired with function calls:

  (- sqrt 9)   -- parse error
  (-sqrt 9)    -- type error, cannot negate function
  -(sqrt 9)    -- this works
  - (sqrt 9)   -- parse error
  - sqrt 9     -- parse error
2013-07-15 12:22:04 +02:00
Evan Czaplicki
2b9886336f Fix parsing of unary negation when it is the first thing in parentheses. 2013-07-15 11:53:53 +02:00
Evan Czaplicki
343dcf2250 Add support for unary negation with the '-' symbol. Makes the use of
'-' whitespace sensitive, as in the unary negation proposal in
elm-discuss.

f -1  == f (0-1)
x - 1 == (x-1)
x-1   == (x-1)
2013-07-14 17:55:38 +02:00
Evan Czaplicki
08ff939174 Be more flexible with the position of the closing bracket of a record type. 2013-07-14 14:55:29 +02:00
Evan Czaplicki
87d2f8d57d Get declarations parsing properly. The definition parser needs to be
the last option.
2013-07-14 01:41:03 +02:00
Evan Czaplicki
0ed72056b6 Add pretty printing for type constraints.
Convert source-syntax types into type-checker types and print them
with pretty type variables.

Generate constraints for let-expressions using type annotations.

Build test function to turn strings into type constraints.
2013-07-08 16:47:44 +02:00
Evan Czaplicki
96fd5bfd78 Update program parser to use Parse.Declarations 2013-07-07 22:11:16 +02:00
Evan Czaplicki
d29ca3beeb Create a Parse.Declaration file for all declarations. Get rid of special
purpose Parse.Foreign library.
2013-07-07 22:06:56 +02:00
Evan Czaplicki
e4ca96731d Create a source syntax for types that will get converted into the internal type representation during type checking. 2013-07-07 18:13:40 +02:00
Evan Czaplicki
f2b3ed7027 Start using the PrettyPrint library to show expressions, literals, and patterns. 2013-07-07 12:56:34 +02:00
Evan Czaplicki
69ed7631fe Start switching over to an AST that uses patterns in lambdas and
pulls the arguments out of Definitions (placing them in lambdas).
2013-07-04 11:36:08 +02:00
Evan Czaplicki
9d68c10683 Add support for triple-quoted multi-line strings 2013-06-27 18:55:01 +02:00
Evan Czaplicki
e80ea9e430 Add support for pattern matching on literals. 2013-06-23 01:36:23 -07:00
Evan Czaplicki
cd83c4c8ed Allow full expressions as the last member of binary expressions (t + t + e) 2013-06-23 01:31:34 -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
c7dce08193 Parameterized the AST for type annotations and variable types. Also rename Guid.hs to Unique.hs which reads a lot nicer. 2013-06-13 20:25:00 -07:00
evancz
459cf8ec73 Switch parsers over to new AST 2013-06-13 19:15:40 -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
0d96f82208 Add type constructor for extensible records. 2013-06-07 10:16:38 -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
evancz
ba5cd880d4 Merge branch 'master' of https://github.com/evancz/Elm 2013-06-06 22:30:07 -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
evancz
44fecefde6 Merge branch 'master' of https://github.com/evancz/Elm 2013-06-05 14:22:51 -07:00
evancz
f5bdb2ca7e Minor code changes to help allow custom infix precedence and associativity. 2013-06-05 14:22:11 -07: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
f49b8ba1d2 Correct the list of the acceptable JSTypes. 2013-05-23 12:45:31 +02:00
evancz
0f76e1643c Actually show error message for bad FFI imports and exports. 2013-05-22 16:08:05 +02:00
evancz
868e71e58b Add JSObject to the FFI parser. 2013-05-22 15:59:47 +02:00
evancz
1f1187cc74 Add open keyword to import everything. Default is now to just import the module, not to open it into local scope. 2013-05-21 10:02:59 +02:00
evancz
dab4b7c7b8 Switch from ($) to (|>) and (<|). 2013-04-24 22:26:01 -07:00
evancz
ac67dbd87f Take out the F# inspired composition operators. I think this needs to wait until type-classes / monads / arrows are more figured out. 2013-04-22 10:24:37 -07:00
evancz
29384b771a Add some operators from F#: |>, <|, <<, and >> 2013-04-21 13:59:12 -07:00
evancz
bef646a3f1 Cosmetic changes 2013-04-07 06:46:56 -07:00
evancz
87fa86c7e8 Get type dealiasing working. 2013-04-05 09:55:30 -07:00
evancz
82f888cb3d Get the type-checker running based on docs.json information. Also add rules for Nil and Tuple0, Tuple2, etc. 2013-04-04 01:09:35 -07:00
evancz
294fdfdaa5 Add prelude in compiler with flag. Re-add the hiding option for modules internally. 2013-04-03 00:32:21 -07:00
evancz
2ee23724f9 Fix nested pattern matching in let expressions. 2013-03-29 19:26:50 -07:00
evancz
96ef98417c Change such that import imports all by default. Too annoying the other way. Write a linter for that.
Also make imports a bit more concise in generated JS.
2013-03-16 13:02:01 -07:00
evancz
1822ebc160 Move the compiler down a directory, mostly. 2013-03-16 12:04:05 -07:00