i
11 months agoSwap logging level back to Debug main
Mira Ayre [Thu, 12 Mar 2020 16:06:46 +0000 (16:06 +0000)]
Swap logging level back to Debug

11 months agoFinish parsing code
Mira Ayre [Thu, 12 Mar 2020 11:32:20 +0000 (11:32 +0000)]
Finish parsing code

11 months agoAdd Version parsing
Mira Ayre [Thu, 12 Mar 2020 10:30:55 +0000 (10:30 +0000)]
Add Version parsing

11 months agoAdd Debug parsing
Mira Ayre [Thu, 12 Mar 2020 10:05:38 +0000 (10:05 +0000)]
Add Debug parsing

11 months agoAdd StaticForeach parsing
Mira Ayre [Thu, 12 Mar 2020 10:01:41 +0000 (10:01 +0000)]
Add StaticForeach parsing

Also fixed syntax error in test file (oops) and added Mixins to
DeclDefs.

11 months agoComplete StaticIf parsing
Mira Ayre [Thu, 12 Mar 2020 09:49:33 +0000 (09:49 +0000)]
Complete StaticIf parsing

Involved fixing a bug in EqualityEx parsing in which it tried to parse
another EqualityEx which would always require an operator. Changed this
to try and parse an EqualityEx, but if it fails then fall back to a
ShiftEx which has an optional operator and can cascade down to primary
expressions.

11 months agoAdd several new parsing functions
Mira Ayre [Wed, 11 Mar 2020 16:50:19 +0000 (16:50 +0000)]
Add several new parsing functions

Notably added: TypeMixin, TypeDef, EnumDef, UnitTest, and TemplateDef.
StaticIf added, but doesn't seem to be working properly yet.

11 months agoFix handling of EOF and add parsing of AliasDefs
Mira Ayre [Wed, 11 Mar 2020 13:59:45 +0000 (13:59 +0000)]
Fix handling of EOF and add parsing of AliasDefs

11 months agoAdd parsing for FnDefs
Mira Ayre [Tue, 10 Mar 2020 16:26:57 +0000 (16:26 +0000)]
Add parsing for FnDefs

11 months agoComplete expression parsing
Mira Ayre [Tue, 10 Mar 2020 15:34:15 +0000 (15:34 +0000)]
Complete expression parsing

11 months agoWrite considerable disparate parts of the parser
Mira Ayre [Tue, 10 Mar 2020 15:22:21 +0000 (15:22 +0000)]
Write considerable disparate parts of the parser

It currently doesn't successfully parse the test file. There are a slew
of issues with the parsing code that leads it to get caught in
underisable situations that need to be debugged and teased out.

11 months agoStart writing statement parsing code
Mira Ayre [Thu, 5 Mar 2020 10:21:18 +0000 (10:21 +0000)]
Start writing statement parsing code

11 months agoWrite SimpleFnParam parsing
Mira Ayre [Thu, 5 Mar 2020 10:20:30 +0000 (10:20 +0000)]
Write SimpleFnParam parsing

11 months agoWrite additional expression-parsing code
Mira Ayre [Wed, 4 Mar 2020 22:06:50 +0000 (22:06 +0000)]
Write additional expression-parsing code

11 months agoAdd statements module to model
Mira Ayre [Wed, 4 Mar 2020 22:06:37 +0000 (22:06 +0000)]
Add statements module to model

11 months agoAdd FnParamDef class and ParamAccess method
Mira Ayre [Wed, 4 Mar 2020 22:06:05 +0000 (22:06 +0000)]
Add FnParamDef class and ParamAccess method

11 months agoReplace more complicated CoreEx rules with Items
Mira Ayre [Wed, 4 Mar 2020 22:05:21 +0000 (22:05 +0000)]
Replace more complicated CoreEx rules with Items

11 months agoWrite majority of expression parsing code
Mira Ayre [Wed, 4 Mar 2020 16:59:56 +0000 (16:59 +0000)]
Write majority of expression parsing code

11 months agoAdd `list` method that takes a delegate
Mira Ayre [Wed, 4 Mar 2020 16:59:39 +0000 (16:59 +0000)]
Add `list` method that takes a delegate

11 months agoFix issues with syntax spec
Mira Ayre [Wed, 4 Mar 2020 16:59:11 +0000 (16:59 +0000)]
Fix issues with syntax spec

11 months agoReform parser
Mira Ayre [Tue, 3 Mar 2020 21:06:41 +0000 (21:06 +0000)]
Reform parser

`parser` directory removed in favour of single-file module.

Created `util.parsing` module to provide numerous helper functions for
requiring specific tokens and sub-parses as well as making some parses
repeat or be optional.

11 months agoFix small things
Mira Ayre [Tue, 3 Mar 2020 21:01:51 +0000 (21:01 +0000)]
Fix small things

* `util.misc` imported for the `into` function.
* `lexer.data` import removed as it no longer exists.
* `expandEscapes` and `charFromIndex` functions both marked as `pure` in
  order to fix compiler errors being thrown in `Token` constructors.
* `const string numchars` added in `toInteger` function as there is no
  longer a relevant `data` module to provide it.
* Added use of `into` function to make `match` function tidier.

11 months agoAdd logging levels
Mira Ayre [Tue, 3 Mar 2020 20:59:18 +0000 (20:59 +0000)]
Add logging levels

Also add `string file` parameter for methods such as `log.context` as
the `Location` class no longer stores the file name as it isn't needed
there - only in the `CompilerErr` class.

11 months agoMove lexer into single-file module
Mira Ayre [Tue, 3 Mar 2020 20:58:46 +0000 (20:58 +0000)]
Move lexer into single-file module

11 months agoReform class model
Mira Ayre [Tue, 3 Mar 2020 20:54:58 +0000 (20:54 +0000)]
Reform class model

Component-specific model modules have been removed in favour of a
compiler-wide `model` module. Classes themselves provide the core
methods required to lex and parse them.

11 months agoAdd missing import and fix alignment
Mira Ayre [Tue, 3 Mar 2020 20:53:06 +0000 (20:53 +0000)]
Add missing import and fix alignment

11 months agoAdd example of contract to test file
Mira Ayre [Tue, 3 Mar 2020 20:51:21 +0000 (20:51 +0000)]
Add example of contract to test file

11 months agoAdd log levels
Mira Ayre [Tue, 3 Mar 2020 20:47:52 +0000 (20:47 +0000)]
Add log levels

11 months agoMove file variable and add furthestErr tracking
Mira Ayre [Tue, 3 Mar 2020 20:45:49 +0000 (20:45 +0000)]
Move file variable and add furthestErr tracking

11 months agoAdd logging level to main function
Mira Ayre [Tue, 3 Mar 2020 20:44:49 +0000 (20:44 +0000)]
Add logging level to main function

11 months agoWrite syntax spec
Mira Ayre [Tue, 3 Mar 2020 20:34:30 +0000 (20:34 +0000)]
Write syntax spec

11 months agoAdded a useless comment
Mira Ayre [Mon, 17 Feb 2020 14:07:30 +0000 (14:07 +0000)]
Added a useless comment

11 months agoParser now builds and runs but segfaults
Mira Ayre [Mon, 3 Feb 2020 09:20:32 +0000 (09:20 +0000)]
Parser now builds and runs but segfaults

The parser completes and leaves parsing 'use' statements and moves onto
the main decl/defs, however gets stuck in an infinite loop at some point
that recurses infinitely and inevitably overflows the stack.

11 months agoStarted *another* parser rewrite.
Mira Ayre [Thu, 30 Jan 2020 16:20:58 +0000 (16:20 +0000)]
Started *another* parser rewrite.

This one seems to be better in that a lot of things like following the
token counter is done by each method, not by the caller.

11 months agoUuuuhhhhhhhhhh
Mira Ayre [Wed, 29 Jan 2020 16:42:06 +0000 (16:42 +0000)]
Uuuuhhhhhhhhhh

Did loads of stuff tbh. Started rewriting parser, but this second
approach isn't going that well either.

11 months agoWrote parser model.
Mira Ayre [Fri, 24 Jan 2020 12:50:54 +0000 (12:50 +0000)]
Wrote parser model.

parser/model.d now has all type definitions for use by the parser. It is
possible these will be moved into a distinct model file for use
throughout the compiler, but this is not certain yet.

What will need to happen next is for the parser to actually be written,
which - give the relative simplicity of the grammar compared to that of
O - will likely be a recursive descent parser at first, unless
performance issues are found.

11 months agoFinished draft syntax spec.
Mira Ayre [Wed, 22 Jan 2020 12:12:52 +0000 (12:12 +0000)]
Finished draft syntax spec.

11 months agoFirst draft of syntax spec
Mira Ayre [Wed, 22 Jan 2020 11:33:32 +0000 (11:33 +0000)]
First draft of syntax spec

Also split off model into multiple files

11 months agoAdded build file to submit on every push.
Mira Ayre [Mon, 20 Jan 2020 10:36:00 +0000 (10:36 +0000)]
Added build file to submit on every push.

11 months agoWrote more of lexer
Mira Ayre [Fri, 17 Jan 2020 17:02:40 +0000 (17:02 +0000)]
Wrote more of lexer

Now tokenises and data-ifies most tokens. `` strings are not being
recognised properly though.

11 months agoStarted up project
Mira Ayre [Thu, 16 Jan 2020 16:46:14 +0000 (16:46 +0000)]
Started up project

Currently exists as part of a lexer. Notable issue is that the
log.context function doesn't expand tabs properly, meaning the location
marker does not appear in the correct place. As of this commit, running
the test project will have it fail on the (unrecognised) ';' token. The
location will correctly be listed as (4,9), but the marker will land 3
characters early on the second 'r' of 'return'.

11 months agoAdded licence and readme
Mira Ayre [Wed, 15 Jan 2020 14:41:15 +0000 (14:41 +0000)]
Added licence and readme