Commit Graph

7 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
d85225c537 Parse signature and function declarations.
Also add support for parsing call and call_indirect instructions.
2016-10-18 13:19:24 -07:00
Jakob Stoklund Olesen
f66d84fd95 Integer subtraction with borrow flags.
This is the x86-style of borrow flags. ARM uses subtract-with-carry
which inverts the sense of the carry flag.
2016-09-23 15:47:39 -07:00
Jakob Stoklund Olesen
9cb3451432 Integer add with carry instructions.
Integer addition with carry in/out/both.
2016-09-23 13:42:00 -07:00
Jakob Stoklund Olesen
64490a3587 Don't have keywords in the lexer and parser.
Instead of recognizing "function" as a keyword, simply match it as a
context-sensitive keyword in the parser outside functions.
2016-09-20 13:00:37 -07:00
Jakob Stoklund Olesen
af29fee5d2 Wrap FunctionName in a newtype struct.
Function names display differently than normal strings since they need
quotes and escaping.

Move the FunctionName type into its own module.
2016-09-19 15:09:25 -07:00
Jakob Stoklund Olesen
88218440a3 Make the source map available as filecheck variables.
This makes it possible to refer to entities defined in the source file,
using the source names prefixed with $.

For example, $v20 refers to the value by that name in the sources, even
if it was renumbered to 'vx0' in the parsed file.
2016-09-16 12:59:05 -07:00
Jakob Stoklund Olesen
0b7f87b14c Convert parser tests to filetests.
Create a new directory hierarchy under 'filetests' for all the tests
that are run by 'cton-util test'.

Convert the parser tests under 'tests/parser' to use 'test cat' and
filecheck directives.
2016-09-15 15:50:47 -07:00