Commit graph

140 commits

Author SHA1 Message Date
Evan Czaplicki
05c8e0e30a Add support for exponent notation for floating point numbers
Brought to my attention by this thread:
https://groups.google.com/forum/#!topic/elm-discuss/jQXmaqLHcIA
2014-02-19 08:57:08 -05:00
Evan Czaplicki
080eb0875c Switch from "open" keyword to (..) to import everything 2014-02-17 17:55:51 +01:00
Evan Czaplicki
22bd40534e cosmetic: use better style in a do block 2014-02-17 17:55:30 +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
DanDanDan
8d41059658 also improve the interpolation parser 2014-01-29 09:04:16 +01:00
DanDanDan
a5a6f2beb1 fix bad markdown performance 2014-01-29 02:25:26 +01:00
Evan Czaplicki
6ba394c9cb Get rid of experimental code for handling "deriving" 2014-01-20 01:09:50 +01:00
Evan Czaplicki
329077f1ef Get rid of input handlers for now 2014-01-13 19:24:17 +01:00
Evan Czaplicki
2a0a0e6e3c Simplify SourceSyntax.Type AST, making record extension more restrictive as discussed with @maxsnew 2014-01-13 11:01:10 +01:00
Evan Czaplicki
828c2c7372 Give more reasonable names to incoming and outgoing ports 2014-01-13 11:01:10 +01:00
Evan Czaplicki
62bd720882 Make the char parser more restrictive to try to get better errors.
Before it permitted sequences of unescaped chars.
2014-01-08 11:36:51 +01:00
Evan Czaplicki
61dd68bcd3 Cosmetic: make some style changes to make it look more like the rest of the compiler
@maxsnew, I really want to make this more transparent and clear, sorry
for the total lack of clarity. Right now this is mostly “I prefer it
this way” and it’d be good to write down a set of rules and then
actually assess of that is a good way to write code.
2014-01-08 11:18:13 +01:00
Max New
6b255fed59 Fix multiline string handling and add more tests. 2014-01-07 17:01:29 -06:00
Max New
5ea3ec7f80 Call out to stringLiteral/charLiteral for string/char literal parsing 2014-01-07 15:44:12 -06:00
Evan Czaplicki
c966776788 Add -W flag to many files, mostly getting rid of dead imports 2014-01-04 10:54:46 +01:00
Evan Czaplicki
6a8db4c230 Get rid of dead dependencies and add -Wall for some files 2014-01-03 12:33:56 +01:00
Evan Czaplicki
bdeb36eb6f Fix port parser! Copy paste error on the operator. 2014-01-03 12:12:43 +01:00
Evan Czaplicki
98f7be328b Make "combineAnnotations" a part of parsing a program 2014-01-02 23:42:54 -08:00
Evan Czaplicki
e3b8ea7d09 Update basic parsers to use the new formats for Expr, Declaration, and Port 2014-01-02 23:20:25 -08:00
Evan Czaplicki
740702c0d7 Begin switch from current FFI syntax to "port" syntax 2013-12-23 23:53:54 -08:00
Evan Czaplicki
fcbd7fd73b Improve some parser code by adding type annotations, removing unused dependencies, and using prefixed imports 2013-12-23 23:26:03 -08:00
Evan Czaplicki
0486c90bd3 Merge branch 'dev' into deriving 2013-12-23 17:03:05 -08:00
Evan Czaplicki
83e8bad84f Add basics of "deriving" for ADTs and type aliases. Only parse it for type aliases at the moment. 2013-12-23 16:51:15 -08:00
Max New
254d71f4e5 Expand else to True instead of otherwise.
Makes `if` syntax independent of the value of `otherwise`.
Includes test case.
2013-12-23 18:31:55 -06:00
Evan Czaplicki
32c78efe7d Begin process of allowing "deriving" on type aliases. 2013-12-23 14:42:43 -08: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
e690c427b7 Add deriving as a reserved word 2013-12-21 23:55:33 -08:00
Timothy Vladimír Hobbs
cbbd42d3f3 Fix bug in parser
34913d5 broke the parser in the following case:

f = '\"'

This commit fixes that.
2013-12-21 23:21:10 +01:00
Evan Czaplicki
34913d5340 Fix issue #397. Core issue was that scanning for infix declarations was not clever about strings. 2013-12-19 10:41:31 -08:00
Evan Czaplicki
6768b0ef7a Get rid of dependency on Text.Read.readMaybe to resolve #382 2013-12-11 18:57:56 -08:00
Evan Czaplicki
4452e4e138 Turn off markdown interpolation for now.
This will of course get turned back on! I don’t want to do it in the
very next release though.
2013-12-10 23:04:27 -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
07187bd811 Better error when bad backslashing is used in strings 2013-11-11 15:40:51 +01:00
Evan Czaplicki
90e007730d introduce the padded function to use fewer whitespace markers 2013-11-02 19:21:26 +01:00
Evan Czaplicki
56ecbbc70a Implement markdown interpolation 2013-10-25 17:36:30 +02:00
Evan Czaplicki
c685c8b91b cosmetic changes on fix for #305
I felt weird about the previous style where things were more
intermingled. Does everything still look okay?
2013-10-19 22:14:34 -04:00
John P Mayer Jr
e75f5388fb can have zero fields if no extension could be parsed 2013-10-20 01:28:52 +00:00
Evan Czaplicki
5ad0ec5b7a Parse documentation and infix declarations more safely 2013-10-17 13:40:28 -04:00
Evan Czaplicki
03cf56d8ec cosmetic: make it simpler to get locations for parses 2013-10-14 22:38:38 -04:00
Evan Czaplicki
11a60de544 Disallow extended record types with no fields, resolves #280 2013-10-14 17:42:26 -04:00
Evan Czaplicki
115b139774 fix #279 2013-10-14 16:59:37 -04:00
Evan Czaplicki
958fb1c896 Treat strings like any other pattern literal 2013-10-02 16:55:46 -07:00
Evan Czaplicki
c2eecc2084 Properly parse all user-defined infix declarations 2013-09-15 14:39:56 -07:00
Evan Czaplicki
11f5f5263c Actually use infixes in parser 2013-09-15 14:39:55 -07:00
Evan Czaplicki
fb64557f75 Switch format of OpTables, and add iParse that takes a table 2013-09-15 14:39:55 -07:00
Evan Czaplicki
a7bb2b7ac3 Fix issue in which type expressions eat trailing whitespace. 2013-09-06 12:22:01 -07:00
Evan Czaplicki
eb2a032e54 Remove unused import 2013-09-05 16:55:24 -07:00
Evan Czaplicki
8a913451c7 Add more helper functions
Ensure that comment parsers return the full body.
Add functions for skipping over characters.
Add function to extract the corresponding source text of a parse.
2013-09-04 17:17:48 -07:00