Evan Czaplicki
53389ffbf8
Make instanceof check safer, check if it's an object before using instance of
2014-01-14 11:46:17 +01:00
Evan Czaplicki
c9310cc4d5
cosmetic: simplify traversal of maybe
2014-01-14 11:45:40 +01:00
Evan Czaplicki
32fbbca5b2
Generate conversion code for ports
2014-01-13 19:32:54 +01:00
Evan Czaplicki
63243ca457
Minor changes to checks for ports
2014-01-13 19:24:39 +01:00
Evan Czaplicki
329077f1ef
Get rid of input handlers for now
2014-01-13 19:24:17 +01:00
Max New
0e40a32adc
Style fixes and -Walls for a couple files.
2014-01-13 09:21:39 -06:00
Evan Czaplicki
fe3b3439b7
Make port checks more permissive
2014-01-13 13:52:18 +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
9dda928ac4
make conversion functions for input ports optional
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
8cadc4d92c
Remove comment for things that no longer exist
2014-01-12 13:06:50 +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
cca69cf8e7
Fix Char literal printing bug.
2014-01-07 15:52:19 -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
8bea3f073d
cosmetic: make a block of code more whitespace friendly
2014-01-06 08:07:24 +01:00
Evan Czaplicki
96f55fceab
Take ports out of MetadataModule, where it is no longer needed
2014-01-06 08:06:56 +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
7e2deceb9a
Add Native.Ports to prelude for user defined modules
2014-01-06 07:48:22 +01:00
Evan Czaplicki
3d7c8d2754
Add -W flag
2014-01-06 07:47:14 +01:00
Evan Czaplicki
a97b9951d0
Add checks for port types to ensure that only JS values go through ports and that type annotations are correct and consistent
2014-01-05 10:41:40 +01:00
Evan Czaplicki
dc3bba714c
Capture the entire type of the handler for incoming ports
2014-01-05 10:40:27 +01:00
Evan Czaplicki
5dd7b6b1bb
Extend expression crawler to do checks on ports as well as on let expressions
2014-01-05 10:15:37 +01:00
Evan Czaplicki
9ea98549bc
Actually fill in a type variable when generating PortIn expressions
2014-01-05 10:15:23 +01:00
Evan Czaplicki
3b9862ab4e
Switch from Types to Variables in the representation of PortIn
2014-01-05 09:29:00 +01:00
Evan Czaplicki
39eb4c6bc8
Use one fewer variable for PortIn constraints
2014-01-05 07:54:16 +01:00
Evan Czaplicki
6eb84d82d7
Make error message prettier
2014-01-04 16:46:38 +01:00
Evan Czaplicki
eed8fa1061
Add type annotations and make some -W recommendations
2014-01-04 16:16:21 +01:00
Evan Czaplicki
c03049a960
Simplify Build.Interface API, do not read "interfaces.data" when the --no-prelude flag is used
2014-01-04 15:59:24 +01:00
Evan Czaplicki
170006534d
Rename InterfaceSerialization file and change the function names in it
2014-01-04 15:19:30 +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
defb47db75
Get rid of warnings
2014-01-04 11:34:09 +01: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
270dbf8722
Add -Wall to a bunch of SourceSyntax files and get them warning free
2014-01-04 10:14:36 +01:00
Evan Czaplicki
863d31b38f
Switch name of qualified import
2014-01-04 09:45:20 +01:00
Evan Czaplicki
9ff26223d8
Handle --no-prelude flag in the Metadata.Prelude module rather than distributed across many modules
...
Good in case the meaning of —no-prelude changes
2014-01-04 09:35:26 +01:00
Evan Czaplicki
9ccc707594
properly rename expressions in port declarations, add -Wall
2014-01-04 08:20:52 +01:00
Evan Czaplicki
33a95f4aa6
get rid of unused dependency
2014-01-04 08:00:56 +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
ade03397df
Fix another copy-paste error
2014-01-03 12:15:49 +01:00
Evan Czaplicki
bdeb36eb6f
Fix port parser! Copy paste error on the operator.
2014-01-03 12:12:43 +01:00
Evan Czaplicki
6f75310a49
Get rid of redundant code that collapses ParseDefs
2014-01-03 10:33:17 +01:00
Evan Czaplicki
06503fef33
Switch to using new Def representation, get rid of getPDefs
function which used to collect annotations and definitions.
2014-01-03 01:07:13 -08:00
Evan Czaplicki
5e3f94ce60
Update for new type of module (no t v)
2014-01-02 23:53:30 -08:00
Evan Czaplicki
41dd0c8742
Update for new def and port formats
2014-01-02 23:52:27 -08:00
Evan Czaplicki
acce931530
Update for new def and ports format
2014-01-02 23:50:49 -08:00
Evan Czaplicki
c883b55255
Get rid of badOrder
check, which is handled elsewhere. Update for new def and port formats
2014-01-02 23:50:20 -08:00
Evan Czaplicki
3d780425fb
Update for ports and defs, switch to using <$> and <*> a lot
2014-01-02 23:48:42 -08:00
Evan Czaplicki
c04c4385ff
Update for new defs and ports format
2014-01-02 23:46:37 -08:00
Evan Czaplicki
1a06be5992
Get rid of "t v" type variables, which are no longer needed
2014-01-02 23:45:40 -08:00
Evan Czaplicki
7422c95f4c
Update to match new names in SourceSyntax.Declaration
2014-01-02 23:45:10 -08:00
Evan Czaplicki
ed4be06a6a
Update to match new port and decl format
2014-01-02 23:44:42 -08:00
Evan Czaplicki
98f7be328b
Make "combineAnnotations" a part of parsing a program
2014-01-02 23:42:54 -08:00
Evan Czaplicki
49fc0b6378
Create way to crawl over all lets in a program, transforming defs and ports
...
Used to combine type annotations with definitions and find ordering
problems with Definitions and Ports
2014-01-02 23:39:34 -08:00
Evan Czaplicki
3af5c2a652
Switch to new format for Expr, Def, and Module
2014-01-02 23:37:52 -08:00
Evan Czaplicki
e8389ac78a
Update to match new Module type
2014-01-02 23:23:26 -08:00
Evan Czaplicki
3c65b5c69d
Move boundVars
function into SourceSyntax.Pattern
2014-01-02 23:23:11 -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
bd4d76ecae
Chenge representation of Expr, add ports representation
...
Get rid of the unused t and v type variables. Add the def type
variable, which models the fact that type annotations and definitions
start separate, but need to be combined before most stuff goes down.
Ports have the same structure as definitions in that annotations and
definitions are separate at the source level and need to be combined.
The same technique used in Expr is now used in Decl as well.
2014-01-02 23:18:42 -08:00
Evan Czaplicki
600e65ca43
Get rid of Transform.Optimize, which is currently unused
2014-01-02 23:13:37 -08:00
Evan Czaplicki
5c509f2f1e
Make Binary serialization code nicer
2014-01-02 17:42:27 -08:00
Evan Czaplicki
662fd7669a
Add JS as a possible Derivation, correct binary serialization, add error when serialization goes wrong.
2014-01-02 13:38:41 -08:00
Evan Czaplicki
578dfb8358
Merge branch 'js-integration' into dev
2014-01-02 12:29:08 -08:00
Max New
cf9d21b0c8
Recompile modules when their dependencies have changed.
2013-12-30 16:09:41 -06:00
Max New
6511fc0e97
Refactor Build.File using monad transformers
2013-12-30 16:09:41 -06:00
Evan Czaplicki
b0a856eb5f
Merge pull request #421 from maxsnew/test
...
Test Re-org and Start Property Testing
2013-12-30 00:27:50 -08:00
Max New
d003062586
Pattern pretty printer prints syntactically correct code.
...
Include auto-generated test case that was previously broken.
2013-12-29 20:46:20 -06:00
Max New
2da9009512
Setup QuickCheck and add Literal Parse/Print test
...
Currently fails the prop tests: https://github.com/evancz/Elm/issues/420
Also ignore emacs backup files.
2013-12-29 16:50:41 -06:00
Evan Czaplicki
e34245ae3a
Cosmetic: add a space
2013-12-29 13:22:54 -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
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
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
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
7b20993869
Get rid of dependency on uniplate so AST does not need to derive Data or Typeable
...
This is motivated by wanting to add things to the AST that cannot
derive Data or Typeable
2013-12-20 16:41:06 -08:00
Evan Czaplicki
3686c82738
Add note about no sharing between top-level and let-bound type variables
2013-12-19 15:04:41 -08:00
Evan Czaplicki
2874797ddb
Go to original error style. I think it's nicer.
2013-12-19 14:45:52 -08: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
ac6c5bc04a
Get rid of check on how many exposed modules. That's for validation elsewhere
2013-12-19 01:48:26 -08:00
Evan Czaplicki
16aef1ea0c
Switch away from using Text.Blaze.Html.Renderer.Utf8 because it scrambles some things.
2013-12-17 17:43:06 -08:00
Evan Czaplicki
82d3d88d01
Get syntax highlighting on code blocks working again.
2013-12-17 16:19:42 -08:00
Evan Czaplicki
a3cb09a0c1
Add instances for generating JSON
2013-12-17 12:16:40 -08:00
Evan Czaplicki
26a8c82b6f
Get rid of Build.Info file, move compiler version to Elm.Internal.Version and use Elm's version conventions
2013-12-17 11:36:05 -08:00
Evan Czaplicki
b9056797ec
Add link to example program.
2013-12-17 10:59:45 -08:00
Evan Czaplicki
16e6654af8
Require minimal deps file when just building things locally
2013-12-16 14:41:05 -08:00
Evan Czaplicki
87bf14f268
Switch to using elm_dependencies.json to search for additional src-dirs
2013-12-16 03:03:52 -08:00
Evan Czaplicki
8a46ead147
Add dependencies field to Deps
2013-12-16 03:03:04 -08:00
Evan Czaplicki
3c1b9f7171
Adopt "model" code from elm-get so that dependencies can be crawled from the compiler.
2013-12-15 23:55:36 -08:00
Evan Czaplicki
61ff49067f
Guard against issue #387
2013-12-15 19:14:00 -08:00
Evan Czaplicki
fe7e3195fa
Automatically look in elm_dependencies/ and use the latest version available
2013-12-15 01:37:51 -08:00