Commit Graph

64 Commits

Author SHA1 Message Date
Andrew Kelley
3239b3cb69 use size_t for indexes
protect against incorrect copies in debug mode
2016-09-19 11:54:01 -04:00
Andrew Kelley
2ed949a6ae add zeroes value 2016-08-08 20:43:38 -07:00
Andrew Kelley
d0b11af2bd new multiline string syntax
This patch also moves a bunch of the parser code into the tokenizer.

Closes #162.
2016-08-04 22:52:38 -07:00
Andrew Kelley
8552d7fd19 explicit wrapping integer operations
instead of wrapping integer types

closes #159
2016-07-27 23:08:27 -07:00
Andrew Kelley
d908afe105 add array multiplication operator 2016-04-28 18:03:44 -07:00
Andrew Kelley
46ab981787 add skeleton for union support 2016-04-24 11:24:04 -07:00
Andrew Kelley
e144ddab24 add multiline string literal
and make multiple lines in normal string literals an error
2016-04-03 18:59:43 -07:00
Andrew Kelley
f1d338194e rewrite how importing works
* Introduce the concept of packages. Closes #3
 * Add support for error notes.
 * Introduce `@import` and `@c_import` builtin functions and
   remove the `import` and `c_import` top level declarations.
 * Introduce the `use` top level declaration.
 * Add `--check-unused` parameter to perform semantic
   analysis and codegen on all top level declarations, not
   just exported ones and ones referenced by exported ones.
 * Delete the root export node and add `--library` argument.
2016-03-01 03:13:40 -07:00
Andrew Kelley
6a2ede5a6e parsing code for defer and more
* disable goto and label support see #44
 * refactor the way block contexts work
2016-02-05 23:20:34 -07:00
Andrew Kelley
06f6acb4b1 inline is a keyword instead of a directive 2016-02-01 17:25:38 -07:00
Andrew Kelley
3c2093fec6 parseh understands types better and handles some situations better
See #88

Also, includes partial implementation of typedef top level declaration.
See #95

Also, fix function types. Previously the way we were deduping function type
pointers was incorrect.
2016-01-31 01:20:47 -07:00
Andrew Kelley
a94ad9e89c parseh defines can reference other defines 2016-01-29 02:17:51 -07:00
Andrew Kelley
9b2ed1fac5 parseh understands simple character literal macro 2016-01-29 00:28:52 -07:00
Andrew Kelley
474340a003 parseh recognizes C enums 2016-01-28 11:03:44 -07:00
Andrew Kelley
a73453a268 add c_import top level decl
see #88
2016-01-26 16:00:39 -07:00
Andrew Kelley
a3e288ab5b implement compile time string concatenation
See #76
2016-01-25 21:56:29 -07:00
Andrew Kelley
6db6609df8 implement %% operator
See #23
2016-01-25 13:53:40 -07:00
Andrew Kelley
5c18826240 introduce the error keyword and type
See #23
2016-01-24 01:34:57 -07:00
Andrew Kelley
72fa03bada add undefined reserved word 2016-01-22 16:05:29 -07:00
Andrew Kelley
5e212db29c parsing error value decls and error value literals
and return with '?' or '%' prefix
2016-01-20 18:18:50 -07:00
Andrew Kelley
c17309dbc5 add switch statement support to parser 2016-01-19 20:29:36 -07:00
Andrew Kelley
fbbef14013 add for loop which can iterate over arrays
See #51
2016-01-18 07:00:45 -07:00
Andrew Kelley
dc162c7f83 rename "use" to "import" 2016-01-15 18:45:52 -07:00
Andrew Kelley
5f9ecb8566 instead of 'as' to cast, call type as function 2016-01-14 02:52:33 -07:00
Andrew Kelley
d121ed961a fix noalias codegen
also make some parsing error messages better
2016-01-13 22:18:10 -07:00
Andrew Kelley
b28b7f63d1 all types are now expressions
See #22
2016-01-13 18:15:51 -07:00
Andrew Kelley
d4b8852d78 parsing enum declarations 2016-01-10 11:48:54 -07:00
Andrew Kelley
0c24ed8a81 rename restrict to noalias 2016-01-08 23:48:24 -07:00
Andrew Kelley
b7dd88ad68 suport checked arithmetic operations via intrinsics
closes #32
2016-01-08 23:41:40 -07:00
Andrew Kelley
14b9cbd43c add restrict qualifier on pointer arguments 2016-01-08 20:59:47 -07:00
Andrew Kelley
a3c97081ca add ?? maybe unwrapping binary operator
add null literal
fix number literal / maybe interactions
2016-01-07 03:23:38 -07:00
Andrew Kelley
968b85ad77 closer to guess number example working 2016-01-02 03:38:45 -07:00
Andrew Kelley
1f8e3871ee parse if maybe expression 2015-12-26 15:05:27 -07:00
Andrew Kelley
a030b60aeb add while loop 2015-12-24 14:37:43 -07:00
Josh Wolfe
f2a9b40231 more number literal syntax is supported. floats still need work 2015-12-15 04:05:53 -07:00
Josh Wolfe
cf88fcb2ad tokenizer parses all number literal types 2015-12-15 04:05:53 -07:00
Andrew Kelley
3049410260 const and var instead of let and let mut
closes #34
2015-12-14 18:51:07 -07:00
Andrew Kelley
f17e20d5fe instead of *mut and *const, & and &const
closes #33
2015-12-14 18:10:25 -07:00
Josh Wolfe
eb1542c102 tokenizing assignment operators 2015-12-12 18:17:27 -07:00
Andrew Kelley
a10277bd94 prepare codebase for struct and string support
parsing code for structs, strings, and c string literals
partial semantic analyzing code for structs, strings, and c string literals
2015-12-12 00:10:37 -07:00
Andrew Kelley
0dbee2300e add inline assembly support 2015-12-10 15:34:38 -07:00
Josh Wolfe
6a48c007a6 fix typo 2015-12-09 01:08:18 -07:00
Andrew Kelley
dfda85e870 ability to call external variadic functions 2015-12-09 01:03:04 -07:00
Josh Wolfe
f6eecfe5f4 getting started on array types 2015-12-07 08:29:19 -07:00
Josh Wolfe
f1aaf1353e add bool literals 2015-12-03 12:15:07 -07:00
Andrew Kelley
f8ca6c70c7 add labels and goto 2015-12-03 00:47:35 -07:00
Josh Wolfe
c89f77dd8e parsing variable declaration 2015-12-02 16:33:06 -07:00
Andrew Kelley
08a2311efd support if conditionals 2015-12-01 21:19:38 -07:00
Josh Wolfe
1ed926c321 implicit void statements and all tests pass with type checking 2015-12-01 15:54:46 -07:00
Andrew Kelley
257cf09472 colored error messages that tell the source file 2015-12-01 00:50:11 -07:00