implement-modules #43

Closed
sashakoshka wants to merge 502 commits from implement-modules into main

502 Commits

Author SHA1 Message Date
7f4e23fb71 Merge branch 'main' into implement-modules 2024-02-21 18:26:44 +00:00
Sasha Koshka
7d530772bf Updated compiler to use Resolver 2024-02-21 13:21:58 -05:00
Sasha Koshka
24a7995819 Add a "Resolver" that resolves unit addresses 2024-02-21 13:21:41 -05:00
Sasha Koshka
1ba6afef23 Compiler understands compiling to . 2024-02-20 01:48:18 -05:00
Sasha Koshka
bfee5ecc92 Compiler now only parses module files that end in .fspl 2024-02-20 01:39:07 -05:00
Sasha Koshka
c49e963310 cli package now prints out usage correctly 2024-02-20 01:27:26 -05:00
Sasha Koshka
6f429571ff Compiler is a bit more adaptable now 2024-02-20 01:23:00 -05:00
Sasha Koshka
3ef8ecca66 Oops haha, print statement. 2024-02-20 00:52:30 -05:00
Sasha Koshka
2cedeb9c0d The compiler now compiles 2024-02-20 00:52:23 -05:00
Sasha Koshka
12bf91d010 Updated generator tests 2024-02-19 23:05:30 -05:00
Sasha Koshka
49b6264ba4 Fixed generator map sorting 2024-02-19 21:57:21 -05:00
Sasha Koshka
c4873915bb Types are given proper link names in the generator 2024-02-19 21:09:21 -05:00
Sasha Koshka
66ee370f23 Generator now has module support 2024-02-19 21:00:20 -05:00
Sasha Koshka
34c6fcbd57 Documented how methods are named 2024-02-19 12:09:21 -05:00
Sasha Koshka
b6edaa0814 entity.Key now has an optional method field 2024-02-19 12:05:13 -05:00
Sasha Koshka
33b6414647 Move Key to Entity 2024-02-19 11:41:36 -05:00
Sasha Koshka
abb326bffc Fixed wording issue in design/units.md 2024-02-19 11:18:17 -05:00
Sasha Koshka
74c6d93151 Analyzer does not allow operations on restricted types 2024-02-17 00:19:13 -05:00
Sasha Koshka
dd09b86cb8 Analyzer does not allow literals to be assigned to restricted types 2024-02-17 00:12:32 -05:00
Sasha Koshka
f5bae2c231 Analyzer does not allow value casting of restricted types 2024-02-16 23:52:52 -05:00
Sasha Koshka
f0d42f996c Analyzer does not allow subscripting, slicing of restricted types 2024-02-16 23:10:38 -05:00
Sasha Koshka
a9522b5c20 Add more multi-unit test cases 2024-02-16 22:50:29 -05:00
Sasha Koshka
3039bdbaf7 Analyzer does not allow marking functions/methods as restricted 2024-02-16 22:31:38 -05:00
Sasha Koshka
6ea10c3783 Analyzer does not allow member access on restricted types 2024-02-16 22:26:22 -05:00
Sasha Koshka
ac56be4468 Analyzer does not allow calling behaviors of restricted iface 2024-02-16 22:19:47 -05:00
Sasha Koshka
e0cb31a85b Analyzer no longer thinks String is private 2024-02-16 22:13:30 -05:00
Sasha Koshka
ef2a2ab059 Analyzer now fills out this information 2024-02-16 13:51:11 -05:00
Sasha Koshka
1c6e179f0a Entity now stores unit and access information for types 2024-02-16 13:30:15 -05:00
Sasha Koshka
3ef9f404b1 Should also make sure ~ only applies to types 2024-02-16 13:09:48 -05:00
Sasha Koshka
e38c185042 Add more test cases for restricted typedefs in units 2024-02-16 13:06:40 -05:00
Sasha Koshka
745e79157c When analyzing a typedef, update the unit information first 2024-02-16 12:54:34 -05:00
Sasha Koshka
f6eeb011bf This is mega silly 2024-02-16 12:49:47 -05:00
Sasha Koshka
95db63b1b8 Pass TestUnitPrivateMethod Err 2024-02-16 12:48:25 -05:00
Sasha Koshka
d2cb1f78c4 Fix behavior of Tree.analyzeMethodOrBehavior() 2024-02-16 12:43:42 -05:00
Sasha Koshka
6dc958742b Real quick add unicode test to parser 2024-02-15 12:43:09 -05:00
Sasha Koshka
0684410631 Ok so maybe that one commit wasn't entirely true 2024-02-15 01:12:51 -05:00
Sasha Koshka
e2367b26c2 Analyzer checks access permissions when using named types 2024-02-15 01:08:21 -05:00
Sasha Koshka
8019a11826 Parser properly unions position of named types 2024-02-15 01:07:25 -05:00
Sasha Koshka
9178e55a20 Parser does *not* actually discard private toplevels while skimming
And it shouldn't! Because it doesn't, the analyzer can say "this is
private" instead of "this doesn't exist".
2024-02-15 01:06:21 -05:00
Sasha Koshka
78fa0f703d Add some initial analyzer tests for units 2024-02-14 23:20:01 -05:00
Sasha Koshka
afe3683c2a I ohasdhjklashf dslkfj ksdl 2024-02-14 23:10:43 -05:00
Sasha Koshka
699ef84bef Forgot about the nickname map haha 2024-02-14 22:48:55 -05:00
Sasha Koshka
75d89e9c2a Should be able to write tests for units now.
Haha unit tests. Surely this won't get confusing.
2024-02-14 22:39:08 -05:00
Sasha Koshka
49493fe7d0 Improved analyzer testing infrastructure 2024-02-14 22:06:10 -05:00
Sasha Koshka
7a4b9850df Parser now actually skims files 2024-02-14 18:49:59 -05:00
Sasha Koshka
5940d47ad7 Improved the skim test case 2024-02-14 17:40:37 -05:00
Sasha Koshka
736f117fac Add parser test case for skimming 2024-02-14 17:35:44 -05:00
Sasha Koshka
ee4dfc3e4a All analyzer tests pass 2024-02-14 17:24:00 -05:00
Sasha Koshka
7420fac2bd I mispelled stream 2024-02-14 13:49:06 -05:00
Sasha Koshka
bc5f435ea6 Made analyzer error testing 20% cooler 2024-02-14 13:48:23 -05:00
Sasha Koshka
06b1cc0cb6 Use stram0.fspl so I don't have to rewrite every test 2024-02-14 13:41:24 -05:00
Sasha Koshka
953e9336db Analyzer does not crash 2024-02-14 13:40:26 -05:00
Sasha Koshka
04a94a2dc9 Analyzer compiles 2024-02-14 13:35:50 -05:00
Sasha Koshka
ab1f25785b Add section about uniqueness and UUIDs to units design doc 2024-02-14 13:00:11 -05:00
Sasha Koshka
940346eecf Begin implemeting my better idea in the analyzer 2024-02-14 10:38:03 -05:00
Sasha Koshka
832e9232aa Made wording in entity even better 2024-02-14 10:22:33 -05:00
Sasha Koshka
2985d13131 Add a file with my better idea in it 2024-02-14 10:22:08 -05:00
Sasha Koshka
f30e6d839d So I have a better idea 2024-02-14 10:06:20 -05:00
Sasha Koshka
b27d5fe006 treeParser.lookupUnit returns the current unit UUID on empty string 2024-02-14 02:04:28 -05:00
Sasha Koshka
98789cf779 Parser and entity now refer to units as units instead of modules 2024-02-14 02:01:01 -05:00
Sasha Koshka
8ad421b1e1 Parser now translates names to unit UUIDs 2024-02-14 01:55:51 -05:00
Sasha Koshka
794d44787d Entity now deals in UUIDs 2024-02-14 01:48:47 -05:00
Sasha Koshka
c69091898a Parser now has something of a concept of modules 2024-02-14 01:44:25 -05:00
Sasha Koshka
89500ec5ef Add module names to top level entities 2024-02-13 21:36:08 -05:00
Sasha Koshka
1636fa0172 Mini-analysis of metadata in Compiler.ParseModule 2024-02-13 21:24:13 -05:00
Sasha Koshka
a46939b3f8 Break compiler out into its own package 2024-02-13 21:01:13 -05:00
Sasha Koshka
87fa994f27 Break out ParseModule and ParseSourceFile from CompileUnit 2024-02-13 20:55:59 -05:00
Sasha Koshka
a4b60a5eff Metadata is now an entity 2024-02-13 20:53:15 -05:00
Sasha Koshka
a9d470d46a Metadata is now an entity 2024-02-13 20:52:25 -05:00
Sasha Koshka
50cbf25c1e Compiler CLI can drive internals 2024-02-13 19:15:40 -05:00
Sasha Koshka
0bcd41c873 Module compilation stub in compiler command 2024-02-13 19:10:46 -05:00
Sasha Koshka
a240e26776 Add method of entity.Address to generate a nickname 2024-02-13 19:10:24 -05:00
Sasha Koshka
81bef17d6f Add some utility methods to entity.Address 2024-02-13 17:29:42 -05:00
Sasha Koshka
fb374c5420 Auto-nicknaming should happen at the analysis stage 2024-02-13 17:08:48 -05:00
Sasha Koshka
87d5ca4cee Add test cases for metadata parser 2024-02-13 16:33:15 -05:00
Sasha Koshka
a837577217 Add metaParser test-common.go 2024-02-13 16:32:59 -05:00
Sasha Koshka
211a6d358a Implemented metadata file parsing 2024-02-13 16:22:10 -05:00
Sasha Koshka
9598890aa4 Changed wording in fsplParser.treeParser.bug() 2024-02-13 16:21:50 -05:00
Sasha Koshka
b4adef7a1c Nickname is no longer a type 2024-02-13 16:20:45 -05:00
Sasha Koshka
24961269f2 Flesh out meta.Tree and meta.treeParser with more methods 2024-02-13 16:03:22 -05:00
Sasha Koshka
c68b3ab4c1 Add Directive interface 2024-02-13 16:03:07 -05:00
bda19ccdcf Minor readme fixes 2024-02-13 19:58:28 +00:00
f06ca0250a Add information (or lack thereof) of learning the language 2024-02-13 19:57:22 +00:00
b184056a9d Update roadmap 2024-02-13 19:40:51 +00:00
f3df9ce15a License under GPLv3 2024-02-13 19:16:11 +00:00
Sasha Koshka
364141ad0d Add metadata entities 2024-02-13 13:29:30 -05:00
Sasha Koshka
27947f7ca4 Updated compiler command 2024-02-13 13:16:03 -05:00
Sasha Koshka
6bc5cc8766 I blame debian for this 2024-02-13 13:14:45 -05:00
Sasha Koshka
b6bd81a244 Updated generator 2024-02-13 13:12:53 -05:00
Sasha Koshka
ce6ca856ee Updated analyzer 2024-02-13 13:12:45 -05:00
Sasha Koshka
6bb5846427 Improve doc comments for Parser 2024-02-13 13:07:37 -05:00
Sasha Koshka
548c8c4de1 Separated parser into two packages 2024-02-13 13:03:22 -05:00
Sasha Koshka
7093e65aed Extracted re-usable parsing utilities from parser.parser 2024-02-13 12:31:52 -05:00
Sasha Koshka
76d71cd1e8 Asajkdhaskldj 2024-02-13 00:50:30 -05:00
Sasha Koshka
64e5adcf41 Rename module design doc to unit design doc 2024-02-13 00:27:51 -05:00
Sasha Koshka
4385b4cf75 Add future work section 2024-02-13 00:10:14 -05:00
Sasha Koshka
c76711cd02 Revised module design, cleared up wording 2024-02-13 00:01:39 -05:00
Sasha Koshka
66d618a6fc Add design document for modules 2024-02-12 23:37:04 -05:00
2c127c5170 Merge pull request 'fix-nil-void-type' (#36) from fix-nil-void-type into main
Reviewed-on: sashakoshka/fspl#36
2024-02-12 19:49:57 +00:00
Sasha Koshka
83b58c1ef6 Analyzer makes use of entity.FormatType 2024-02-12 14:47:49 -05:00
Sasha Koshka
f77f341c3d Add test cases for formatting nil type as Void 2024-02-12 14:47:09 -05:00
Sasha Koshka
3662bda3a8 Add entity.FormatType() 2024-02-12 14:34:49 -05:00
f2f522645f Merge pull request 'polish-compiler' (#35) from polish-compiler into main
Reviewed-on: sashakoshka/fspl#35
2024-02-11 18:06:08 +00:00
Sasha Koshka
eb7a34115b Compiler now takes in a format override parameter 2024-02-11 12:55:43 -05:00
Sasha Koshka
58a15d3da0 Add cli.NewValueSet() to validate against several values 2024-02-11 12:38:46 -05:00
Sasha Koshka
928bf64d9d Fix some issues with cli related to argument values 2024-02-11 12:37:08 -05:00
Sasha Koshka
385657a5c1 Better documentation for cli package 2024-02-11 12:32:53 -05:00
Sasha Koshka
f6b25c8543 Broke cli into a separate package 2024-02-11 12:13:49 -05:00
Sasha Koshka
f90364697c Compiler now parses CLI argument values correctly 2024-02-11 03:40:47 -05:00
Sasha Koshka
8bf97af763 Compiler prints a special error if output path has no extension 2024-02-11 03:40:00 -05:00
Sasha Koshka
20ed736823 errors.Format does not crash when formatting normal error 2024-02-11 03:35:27 -05:00
Sasha Koshka
a68633f061 Created a new argument parsing system 2024-02-11 03:33:16 -05:00
Sasha Koshka
ac16322860 Break fsplc Compiler type into a different file 2024-02-11 01:55:07 -05:00
e8b8139b20 Merge pull request 'fix-chained-methods' (#32) from fix-chained-methods into main
Reviewed-on: sashakoshka/fspl#32
2024-02-11 02:35:37 +00:00
Sasha Koshka
fce7595126 New test for generator confirmed to work, filled out 2024-02-10 21:31:10 -05:00
Sasha Koshka
6bb61b294b testcommon last column no longer has trailing spaces 2024-02-10 21:24:09 -05:00
Sasha Koshka
5026576878 Add same test as stub to generator 2024-02-10 21:20:24 -05:00
Sasha Koshka
6aa75b80c5 Fixed crash in analyzer that caused #31 2024-02-10 21:16:22 -05:00
Sasha Koshka
4425823404 Test case code was wrong, methods need to return Number 2024-02-10 21:15:56 -05:00
Sasha Koshka
6e4494e7ba Analyzer test-common now formats errors properly 2024-02-10 21:14:30 -05:00
Sasha Koshka
cbbccea64a Add #31 as test case 2024-02-10 21:10:49 -05:00
Sasha Koshka
547b625a3f Add .editorconfig 2024-02-10 19:03:38 -05:00
Sasha Koshka
813a95bc8c OOPS 2024-02-10 18:57:53 -05:00
Sasha Koshka
2c6623e763 Unexported parser 2024-02-10 18:56:25 -05:00
8c6b7a96af Merge pull request 'document-packages' (#30) from document-packages into main
Reviewed-on: sashakoshka/fspl#30
2024-02-10 23:52:17 +00:00
Sasha Koshka
9ca1483f82 Updated spec a little 2024-02-10 18:49:10 -05:00
Sasha Koshka
c78deebcc6 Fix small issues with generator readme 2024-02-10 18:32:35 -05:00
Sasha Koshka
9d48bcb868 Add generator README.md 2024-02-10 18:26:51 -05:00
Sasha Koshka
803923b3d2 Bring over better doc on assignment modes to the source file 2024-02-10 14:50:43 -05:00
Sasha Koshka
bb77db4c80 Add analyzer README.md 2024-02-10 14:47:47 -05:00
Sasha Koshka
5f804c71da HHHHHHHHH 2024-02-09 22:36:21 -05:00
Sasha Koshka
341bbb9a6e God 2024-02-09 20:23:22 -05:00
Sasha Koshka
877b6d669a Fix mistake in parser readme 2024-02-09 20:22:05 -05:00
Sasha Koshka
a230c5d77b Add parser README.md 2024-02-09 20:18:21 -05:00
Sasha Koshka
2dacebefae DESIGN.md -> README.md
Want this to show up in git web interfaces
2024-02-09 18:02:03 -05:00
Sasha Koshka
1804cbbd98 I need to sleep 2024-02-09 04:44:09 -05:00
Sasha Koshka
2e9f5ee11e Enhanced lexer/DESIGN.md 2024-02-09 04:42:03 -05:00
Sasha Koshka
6e85c6ae19 Add DESIGN.md to lexer 2024-02-09 04:37:39 -05:00
d10eb4e41e Merge pull request 'dont-create-lexer' (#27) from dont-create-lexer into main
Reviewed-on: sashakoshka/fspl#27
2024-02-09 09:14:29 +00:00
Sasha Koshka
194617dd34 Update fsplc command 2024-02-09 04:05:44 -05:00
Sasha Koshka
5d09926d30 Updated generator's test-common 2024-02-09 04:02:55 -05:00
Sasha Koshka
a8a74ec31f Updated analyzer's test-common 2024-02-09 04:01:41 -05:00
Sasha Koshka
7d2831109c Udpated parser's test-common 2024-02-09 03:59:00 -05:00
Sasha Koshka
727ccf3660 Remedy #25 2024-02-09 03:48:44 -05:00
Sasha Koshka
ce66fc879a Change parser constructor, tree's parsing methods
Now accept lexers instead of io.Readers
2024-02-09 03:44:29 -05:00
5e3ef3f57c Merge pull request 'document-packages' (#26) from document-packages into main
Reviewed-on: sashakoshka/fspl#26
2024-02-09 08:39:46 +00:00
Sasha Koshka
361c4f7289 Remove llvm/README.md
The information in that file is now a doc comment
2024-02-09 03:37:10 -05:00
Sasha Koshka
d59703aa5d Add package level doc comment to llvm 2024-02-09 03:35:42 -05:00
Sasha Koshka
229c88b58a Add module level doc comment to analyzer 2024-02-09 03:30:24 -05:00
Sasha Koshka
503b692104 Add documentation for fsplc command 2024-02-09 03:22:36 -05:00
Sasha Koshka
9bb10ef00d Completed doc comments in entity 2024-02-09 01:11:24 -05:00
Sasha Koshka
097d7dfbe3 Add module level doc comment to testcommon 2024-02-09 01:03:02 -05:00
Sasha Koshka
206a9804dd Add doc comments to integer 2024-02-09 01:00:54 -05:00
Sasha Koshka
cd419cb12d Added module-level doc comments to generator and generator/native 2024-02-09 00:57:06 -05:00
Sasha Koshka
3cd512cefb Complete parser doc comments 2024-02-09 00:44:26 -05:00
Sasha Koshka
862e6b1e25 Note for later 2024-02-09 00:44:18 -05:00
Sasha Koshka
5c2df7f837 Added extensive doc comments to errors package 2024-02-08 23:42:04 -05:00
Sasha Koshka
b6c7a0482a Complete doc comments in lexer 2024-02-08 23:20:07 -05:00
Sasha Koshka
678f1f15ab Removed lexer.Symbols 2024-02-08 23:06:58 -05:00
Sasha Koshka
2f4522cc6c Added module overview doc comment to lexer 2024-02-08 23:05:36 -05:00
Sasha Koshka
567c59559f Compiler outputs formatted errors 2024-02-08 17:01:38 -05:00
8ff47a3076 Merge pull request 'error-interface' (#23) from error-interface into main
Reviewed-on: sashakoshka/fspl#23
2024-02-08 21:55:47 +00:00
Sasha Koshka
fbcc1f14d2 Brought analyzer up to date 2024-02-08 16:53:15 -05:00
Sasha Koshka
93061188e8 Brought parser up to date 2024-02-08 16:51:48 -05:00
Sasha Koshka
df9b96eefc Brought lexer up to date 2024-02-08 16:50:42 -05:00
Sasha Koshka
85788fca25 Line and column numbers are entirely handled by errors.Format 2024-02-08 16:48:52 -05:00
Sasha Koshka
d2a4d785f6 errors.Error and errors.Position are in two different files 2024-02-08 16:24:46 -05:00
Sasha Koshka
29012110f8 errors.Error is now an interface, implementation is hidden 2024-02-08 16:23:05 -05:00
Sasha Koshka
e60a6e246f Unexport generator.resultMode 2024-02-08 16:06:00 -05:00
4089765633 Merge pull request 'remove-participle' (#10) from remove-participle into main
Reviewed-on: sashakoshka/fspl#10
2024-02-08 18:34:18 +00:00
993416d3d8 Merge pull request 'remove-participle-refit-generator' (#9) from remove-participle-refit-generator into remove-participle
Reviewed-on: sashakoshka/fspl#9
2024-02-08 18:33:37 +00:00
Sasha Koshka
24f1044b8f Fixed commaList 2024-02-08 13:32:15 -05:00
Sasha Koshka
ee90077f90 Fixed all generator tests 2024-02-08 13:32:04 -05:00
Sasha Koshka
0a87781445 Generator compiles and runs 2024-02-08 13:14:21 -05:00
Sasha Koshka
da4d21a87b Go mod tidy. No more participle, officially! 2024-02-08 13:12:42 -05:00
16317a9eb8 Merge pull request 'remove-particple-refit-analyzer' (#8) from remove-particple-refit-analyzer into remove-participle
Reviewed-on: sashakoshka/fspl#8
2024-02-08 18:08:31 +00:00
Sasha Koshka
807732b460 Parser now accepts multiplication operations 2024-02-08 13:05:47 -05:00
Sasha Koshka
5fa787dc64 Fix TestTypeInterfaceBehaviorUniqueErr 2024-02-08 12:57:20 -05:00
Sasha Koshka
775671442b Signature positions are stored properly 2024-02-08 12:54:31 -05:00
Sasha Koshka
498df4fad8 Parser now includes positional information in toplevels 2024-02-08 12:52:47 -05:00
Sasha Koshka
19ba849e4b Bring analyzer tests up to date as much as possible 2024-02-08 12:49:17 -05:00
Sasha Koshka
ba52a2df2e Change interface prefix from ? to ~
? will eventually be used in place of * to denote an optional
pointer, and ~ already means "approximation", which works well for
a polymorphic data structure.
2024-02-08 04:10:11 -05:00
Sasha Koshka
cb7180fa1c Remove rouge println in parser 2024-02-08 04:00:25 -05:00
Sasha Koshka
c9fa465430 Off by one error oh my god 2024-02-08 03:58:29 -05:00
Sasha Koshka
9e815d0bea Updated analyzer's test-common.go 2024-02-08 03:56:09 -05:00
Sasha Koshka
5bb9508a76 Rework analyzer code to fit new parser 2024-02-08 03:51:21 -05:00
090d52b8f8 Merge pull request 'parser-remove-participle' (#7) from parser-remove-participle into remove-participle
Reviewed-on: sashakoshka/fspl#7
2024-02-08 08:29:23 +00:00
Sasha Koshka
95e12d6d19 Parse namespaced function calls 2024-02-08 03:28:09 -05:00
Sasha Koshka
202fd1f0bc Bring most tests up to date 2024-02-08 03:13:40 -05:00
Sasha Koshka
ef7be1f7e8 Parse member access, assignment, method calls 2024-02-08 03:10:02 -05:00
Sasha Koshka
68b144a2df Loll oops 2024-02-08 02:22:57 -05:00
Sasha Koshka
be314a1b79 Unify entity.Statement and entity.Expression 2024-02-08 02:22:19 -05:00
Sasha Koshka
95118a183b Relaxed unneeded rules on AST 2024-02-08 02:19:00 -05:00
Sasha Koshka
227a329538 Parse bit and value casts 2024-02-08 01:54:29 -05:00
Sasha Koshka
e1ae32278f Parse reference operations 2024-02-08 01:37:36 -05:00
Sasha Koshka
335060ce84 Parse length operations 2024-02-08 01:33:55 -05:00
Sasha Koshka
99d4799883 Parse slice operations 2024-02-08 01:29:16 -05:00
Sasha Koshka
de1f873929 Struct literals print correctly 2024-02-08 00:56:43 -05:00
Sasha Koshka
b715dbcce3 Parse operations 2024-02-08 00:50:54 -05:00
Sasha Koshka
e9348ea58f Added string constructor for entity.Operator 2024-02-08 00:29:24 -05:00
Sasha Koshka
5fad8a79dd Re-organize the position of parsing functions in expression.go 2024-02-08 00:16:39 -05:00
Sasha Koshka
a0a155c7e6 Parse dereferences and subscripts 2024-02-08 00:14:52 -05:00
Sasha Koshka
1cdc14a313 Lowercased entity descriptions 2024-02-07 22:58:58 -05:00
Sasha Koshka
e4c8268e18 Moved parser expression decision tree diagram to expression.go
Because having ASCII flowcharts in comments makes any code base at
least 20% cooler.
2024-02-07 22:53:10 -05:00
Sasha Koshka
1bf47a9ebe Parse function calls 2024-02-07 22:49:11 -05:00
Sasha Koshka
78786f4ea2 Parse break and return expressions 2024-02-07 22:33:33 -05:00
Sasha Koshka
116a687099 Decision tree infrastructure for LBracket branch 2024-02-07 20:03:18 -05:00
Sasha Koshka
e0c62e40bf Parse struct literals 2024-02-07 19:48:01 -05:00
Sasha Koshka
1a4bade4dd Parse blocks 2024-02-07 19:24:57 -05:00
Sasha Koshka
b17ffdc6d9 Update expression-decision-tree 2024-02-07 19:17:25 -05:00
Sasha Koshka
30d479565b Fix parsing integer 0 2024-02-07 19:16:05 -05:00
Sasha Koshka
f997254270 Parse array literals 2024-02-07 19:14:39 -05:00
Sasha Koshka
2882a28621 Update expression-decision-tree 2024-02-07 18:27:10 -05:00
Sasha Koshka
ac83753c56 Parse if/else expressions 2024-02-07 18:25:42 -05:00
Sasha Koshka
be35cda999 Parse loops 2024-02-07 18:11:12 -05:00
Sasha Koshka
161ee28e7b Move literal parsing routines to a separate file 2024-02-07 18:01:14 -05:00
Sasha Koshka
c1df3f5ae5 Add stars in expression-decision-tree to mark what isn't done 2024-02-07 17:57:39 -05:00
Sasha Koshka
8cd0871939 Fix expression parsing control flow 2024-02-07 17:51:44 -05:00
Sasha Koshka
ea8d5e6b3a Add parsing boolean and nil literals 2024-02-07 17:25:00 -05:00
Sasha Koshka
87c6490183 Fix commaList 2024-02-07 17:09:35 -05:00
Sasha Koshka
4a3e06362d What crack was I smoking when I made LiteralNil.Value 2024-02-07 15:46:42 -05:00
Sasha Koshka
ed239aabb9 Remove entity.Boolean because I have overcome my haters 2024-02-07 15:41:48 -05:00
Sasha Koshka
854abfed1c Broke out Parser.parseVariable() for consistency 2024-02-07 15:36:33 -05:00
Sasha Koshka
d445743200 Add parsing int, float, and string literals 2024-02-07 14:15:06 -05:00
Sasha Koshka
a47023fc95 Declaration and variable expression parsing 2024-02-07 13:26:25 -05:00
Sasha Koshka
16f27cd2ee Parser panic information is now more detailed 2024-02-07 13:01:25 -05:00
Sasha Koshka
cc8426bf85 Add tokens to startTokensExpression 2024-02-07 12:50:19 -05:00
Sasha Koshka
531d3ca22b Created an expression decision tree plan 2024-02-07 12:44:54 -05:00
Sasha Koshka
51ef3682f1 Function headings are now parsed correctly 2024-02-07 11:38:15 -05:00
Sasha Koshka
0762d72486 Allow arbitrary integer width 2024-02-07 11:22:37 -05:00
Sasha Koshka
02ec77b855 Updated TestType test case for parser 2024-02-07 03:39:37 -05:00
Sasha Koshka
97605d8c2a Parse integer, word, and float types 2024-02-07 03:37:02 -05:00
Sasha Koshka
424b621bae Fix function parsing 2024-02-07 03:22:00 -05:00
Sasha Koshka
48fe20b472 Parse interface types 2024-02-07 03:18:02 -05:00
Sasha Koshka
1529e591e8 Parse signatures 2024-02-07 03:17:50 -05:00
Sasha Koshka
19910b77a9 Parse struct types 2024-02-07 03:02:43 -05:00
Sasha Koshka
f8399612f6 De-ambiguify interface and struct type syntax 2024-02-07 03:02:16 -05:00
Sasha Koshka
cb7734afe6 Array type parsing 2024-02-07 00:32:18 -05:00
Sasha Koshka
23362b058d Normalize parsing of access control symbols 2024-02-07 00:23:10 -05:00
Sasha Koshka
59e3185500 Parse pointers/slices 2024-02-07 00:22:58 -05:00
Sasha Koshka
6ad56ed4ee Add some convenience methods to parser, fix appendCopy 2024-02-07 00:21:44 -05:00
Sasha Koshka
8adaa0e053 Added parsing named types 2024-02-06 23:48:25 -05:00
Sasha Koshka
9dab29f5cb Token.Is and Token.ValueIs work properly 2024-02-06 23:16:48 -05:00
Sasha Koshka
39d8ed088d Lexer now records the width of tokens 2024-02-06 23:08:25 -05:00
Sasha Koshka
84d88a7644 I want to look at my juicy error formatting even when it passes 2024-02-06 22:33:18 -05:00
Sasha Koshka
100986327e FINALLY errors and lexer agree on row/col positions properly 2024-02-06 22:11:46 -05:00
Sasha Koshka
6924d39dcb Fixed error test cases 2024-02-06 21:59:41 -05:00
Sasha Koshka
6fc16c7045 Lexer saves error lines 2024-02-06 21:54:20 -05:00
Sasha Koshka
e6043effe0 Lexer tests check for line content, print formatted errors 2024-02-06 19:08:21 -05:00
Sasha Koshka
f3f8b324dc Parser errors make more sense 2024-02-06 18:58:09 -05:00
Sasha Koshka
c2d9b4d40f Added Token.String() 2024-02-06 18:56:04 -05:00
Sasha Koshka
ef14fc2219 Parser is incomplete but compiles 2024-02-06 18:29:37 -05:00
Sasha Koshka
825e71a720 Created a plan for expression parsing 2024-02-06 17:04:59 -05:00
Sasha Koshka
77783c1004 Add a guide to writing parser methods so I don't forget 2024-02-06 16:56:10 -05:00
Sasha Koshka
c1c2ab5124 Further normalize expectation responsibilities of parsing methods 2024-02-06 16:39:15 -05:00
Sasha Koshka
a09a0ce34c Typedef parsing complete, without detail 2024-02-06 16:32:14 -05:00
Sasha Koshka
76c129f91c Add type parsing stub 2024-02-06 16:31:53 -05:00
Sasha Koshka
f4e5e1ea3d Appended -Core to parsing methods that only partially parse things 2024-02-06 16:30:53 -05:00
Sasha Koshka
bca9de4106 Parsing functions *always* begin on current token, leave trailing one 2024-02-06 16:22:49 -05:00
Sasha Koshka
1b50c8f879 Method and function parsing complete, without detail 2024-02-06 16:13:05 -05:00
Sasha Koshka
3c67cf576c Expression parsing stub 2024-02-06 16:12:51 -05:00
Sasha Koshka
79f51ce4c6 Parser.expectValue() and Parser.expectValueDesc() take in a kind parameter now 2024-02-06 15:57:27 -05:00
Sasha Koshka
3e89953d07 Add parser.Tree.AddDeclaration() 2024-02-06 15:54:21 -05:00
Sasha Koshka
08f1027834 Added commaList function 2024-02-06 12:20:13 -05:00
Sasha Koshka
118e7672bd Why did I name a prepend function appendr?? 2024-02-06 11:45:08 -05:00
Sasha Koshka
4a2671c601 askl;d;sldkf 2024-02-06 02:55:39 -05:00
Sasha Koshka
ac433f07ec Rename typeStartTokens to startTokensType 2024-02-06 02:41:45 -05:00
Sasha Koshka
3d1bef3a32 Move top-level expect from Parser.parseTopLevel into Parser.parse() 2024-02-06 02:40:19 -05:00
Sasha Koshka
eafc834ef3 Parser.parseSignature stub 2024-02-06 02:36:51 -05:00
Sasha Koshka
8cfb4f3e6d Parser top-level entity base 2024-02-06 02:32:29 -05:00
Sasha Koshka
cce8c756fc Parser now remembers last token 2024-02-06 02:28:23 -05:00
Sasha Koshka
66f0e2d8d9 Un-participle-ify entity.Access 2024-02-06 02:27:09 -05:00
Sasha Koshka
5fe6e32f92 Add Dot and DoubleDot as separate tokens 2024-02-06 02:23:15 -05:00
Sasha Koshka
7db231a945 Add ValueIs method to lexer.Token 2024-02-06 02:19:09 -05:00
Sasha Koshka
ec3907d841 Add TokenKind.String 2024-02-06 01:52:29 -05:00
Sasha Koshka
b6a920af58 Added expect functions to parser 2024-02-06 01:45:30 -05:00
Sasha Koshka
ff9c275980 Add Token.Is() to check if token is any of a set of kinds 2024-02-06 01:31:52 -05:00
Sasha Koshka
04e5ead3db Go mod tidy 2024-02-06 01:14:38 -05:00
Sasha Koshka
0d79482568 Define basic parser structure 2024-02-06 01:12:07 -05:00
Sasha Koshka
dc6a36b548 Cleared particple code from parser 2024-02-06 00:52:31 -05:00
Sasha Koshka
57d1ab9b2a Parser test-common uses testcommon package 2024-02-06 00:49:28 -05:00
Sasha Koshka
50ec220d08 Remove entity participle struct tags 2024-02-05 15:17:59 -05:00
Sasha Koshka
187ed48c4f Remove entity dependency on participle 2024-02-05 15:16:11 -05:00
031f7008fa Merge pull request 'lexer-remove-participle' (#3) from lexer-remove-participle into remove-participle
Reviewed-on: sashakoshka/fspl#3
2024-02-05 20:06:38 +00:00
Sasha Koshka
d2ecd7a266 Lexer has no dependency on participle now 2024-02-05 15:04:54 -05:00
Sasha Koshka
6bfc073608 Added new Errorf function, added row/column offset 2024-02-05 15:03:13 -05:00
Sasha Koshka
db2b7e5f90 Error package now formats tabs correctly 2024-02-05 11:44:34 -05:00
Sasha Koshka
3e9f3553fe TODO message in errors package 2024-02-01 03:21:23 -05:00
Sasha Koshka
7c29d552f2 Wrote tests for and fixed errors package 2024-02-01 03:20:17 -05:00
Sasha Koshka
e3f5ffa5c5 Added erros package 2024-02-01 02:51:04 -05:00
Sasha Koshka
554fc1f7a7 Put functionality from generator/test-common.go in its own package 2024-02-01 01:59:17 -05:00
Sasha Koshka
b95df4c23c Fix crash when using int literals as floats 2024-01-29 13:29:53 -05:00
Sasha Koshka
8340dbe7c2 Update tests 2024-01-29 03:30:54 -05:00
Sasha Koshka
0d20f1cbc0 Slice length fields are properly stored as Index values 2024-01-29 03:11:43 -05:00
Sasha Koshka
af79419809 Update tests 2024-01-29 02:20:16 -05:00
Sasha Koshka
0c1382896e Updated test cases for literals 2024-01-29 00:30:48 -05:00
Sasha Koshka
1e827a9ea1 Array literals and string literals now exhibit identical behavior
They both fill unspecified data with zeros, and add a null
terminator when directly assigned to a pointer.
2024-01-29 00:25:34 -05:00
Sasha Koshka
06a183c7af String generation now uses correct type names, data length, and nulls 2024-01-28 17:10:03 -05:00
Sasha Koshka
9b80c29a15 Fix tests 2024-01-28 16:44:34 -05:00
Sasha Koshka
044e73efda Add source code printout for tests 2024-01-28 14:46:47 -05:00
Sasha Koshka
8107f82531 Broke up the monolithic TestLiteral 2024-01-28 14:36:04 -05:00
Sasha Koshka
e42c292433 Increased the coverage of TestLiteralArray 2024-01-28 14:15:54 -05:00
Sasha Koshka
c71cc43a47 *Greatly* reduced the amount of excess IR related to string literals 2024-01-28 14:11:41 -05:00
Sasha Koshka
0d4a86ef02 Struct literals now support irDestLoc 2024-01-28 04:50:18 -05:00
Sasha Koshka
82c05039b7 Added the ability for array literals to be undersized 2024-01-28 04:43:01 -05:00
Sasha Koshka
86df537ece Added test for nested array literals
Who knew it would work first try?
2024-01-28 04:24:15 -05:00
Sasha Koshka
f057f3b4a4 Array literals now support irDestLoc 2024-01-28 04:18:33 -05:00
Sasha Koshka
85703f6059 Add more tests for loops 2024-01-28 03:29:49 -05:00
Sasha Koshka
fe85582088 Fixed extra lines after IR blocks 2024-01-28 03:18:39 -05:00
Sasha Koshka
5940e540b3 Fix some issues with control flow, add tests 2024-01-28 03:16:05 -05:00
Sasha Koshka
3c7565861d Add test case for comparisons on defined types 2024-01-28 02:18:18 -05:00
Sasha Koshka
cd6ed93b98 FCmp and ICmp now accept defined types 2024-01-28 00:18:37 -05:00
Sasha Koshka
56ae34c297 Updated all tests except for literal_test.go
You Will See Why
2024-01-27 23:24:19 -05:00
Sasha Koshka
57ef5933ee Well it would help if it generated well formed IR 2024-01-27 23:00:03 -05:00
Sasha Koshka
f35f3e0df0 Assignment coercions are much more IR efficient 2024-01-27 22:45:28 -05:00
Sasha Koshka
773e718592 Complete TestInterfaceInStruct (no longer segfaults somehow) 2024-01-27 19:49:22 -05:00
Sasha Koshka
41c9f57063 More using qualified names in IR 2024-01-27 18:16:30 -05:00
Sasha Koshka
d9c6bd644b Oh my god I swapped the columns 2024-01-27 18:09:51 -05:00
Sasha Koshka
954f6c877e Added cool output to failed tests 2024-01-27 18:07:49 -05:00
Sasha Koshka
05e75cb746 Literal generation now uses qualified type names when possible 2024-01-27 17:16:23 -05:00
Sasha Koshka
3a4a5683b5 Remove redundant val variable/declaration generation 2024-01-27 14:17:52 -05:00
Sasha Koshka
f994c4dc08 Rename some routines in data 2024-01-27 14:03:38 -05:00
15541b8675 Merge pull request 'generator-reduce-redundant-ir' (#2) from generator-reduce-redundant-ir into main
Reviewed-on: sashakoshka/fspl#2
2024-01-27 17:40:37 +00:00
Sasha Koshka
805a9a110f Updated more tests (cutting out extra load insts) 2024-01-27 17:35:33 +00:00
Sasha Koshka
91d4b92e6b Fix more names and orgaization of statement generation 2024-01-27 17:33:15 +00:00
Sasha Koshka
021a289623 Added -Any suffix to appropriate generation routines 2024-01-27 17:24:47 +00:00
Sasha Koshka
5085ea8502 Fixed segfault relating to break and return statements 2024-01-27 17:11:44 +00:00
Sasha Koshka
b13130db8e Introducing ResultMode! time to got to bed. 2024-01-27 10:43:27 +00:00
Sasha Koshka
21fd6a4130 Update some tests 2024-01-27 10:06:17 +00:00
Sasha Koshka
706e2e0286 Updated control flow generation 2024-01-27 10:03:15 +00:00
Sasha Koshka
6d28d52cdf Void functions/methods no longer request a value 2024-01-27 09:22:19 +00:00
Sasha Koshka
fc5dda739e Made generic block generation routine 2024-01-27 09:18:41 +00:00
Sasha Koshka
8bf3938842 Made panic messages in expression-multiplex.go more informative 2024-01-27 09:15:39 +00:00
Sasha Koshka
43130fd0da Add Val onto value expressions 2024-01-27 09:09:27 +00:00
Sasha Koshka
cc5ed3c2ee Update block generation routines 2024-01-27 09:06:17 +00:00
Sasha Koshka
b1799c25e1 Add generateStatement routine 2024-01-27 08:53:29 +00:00
Sasha Koshka
1f653be8cc Renamed generateStatement to generateStatementVal 2024-01-27 08:49:25 +00:00
Sasha Koshka
43aae56b37 Add generateExpression function 2024-01-27 08:48:00 +00:00
Sasha Koshka
f9d53d7ab7 Rename expression source files 2024-01-27 08:40:02 +00:00
Sasha Koshka
fbaec1efdb Rename generateExpression to generateExpressionVal 2024-01-27 08:39:05 +00:00
Sasha Koshka
10fb780e50 Nitpick 2024-01-27 08:26:46 +00:00
Sasha Koshka
6de2a9d37d Change restricted access modifier to tilde (~) 2024-01-27 07:42:13 +00:00
Sasha Koshka
8606c761e8 Same thing for bit casts 2024-01-27 07:05:34 +00:00
Sasha Koshka
b56dceb3e1 Generator now no longer generates ineffectual value casts 2024-01-27 07:03:13 +00:00
Sasha Koshka
7318bfbc88 Added a way to test IR type equality 2024-01-27 06:49:30 +00:00
ca6be75cf0 Merge pull request 'llvm-implement-globals' (#1) from llvm-implement-globals into main
Reviewed-on: sashakoshka/fspl#1
2024-01-27 04:33:39 +00:00
Sasha Koshka
9ac9af8bcb Add IsConstant to Global 2024-01-27 04:16:41 +00:00
Sasha Koshka
ed350f94b8 Add basic globals implementation 2024-01-27 01:49:18 +00:00
Sasha Koshka
709ec56873 Move addrspace to attribute file, will put more things in there 2024-01-27 01:48:29 +00:00
Sasha Koshka
6b9c165d14 Add function to encode global identifier 2024-01-27 01:47:52 +00:00
Sasha Koshka
b0c62642f5 Add more tests to generator 2024-01-27 01:00:07 +00:00
Sasha Koshka
4c66ad4b44 Replace bugs section with caveats in README 2024-01-26 22:11:35 +00:00
Sasha Koshka
35dbbebb8b Updated stuff to use the new routines in data.go 2024-01-26 05:35:47 +00:00
Sasha Koshka
098248da19 More routines in data.go 2024-01-26 05:35:22 +00:00
Sasha Koshka
a80cd600b5 Added a test case for a Writer interface
I really need to cut out a lot of the unnecessary IR that the
generator emits
2024-01-26 04:32:55 +00:00
Sasha Koshka
ea32fcc7d5 Added a test case for casting slices to pointers 2024-01-26 04:21:30 +00:00
Sasha Koshka
d28bfbac16 Fix conversion of slices to pointers 2024-01-26 04:07:58 +00:00
Sasha Koshka
34b9812db4 Same thing as last commit 2024-01-26 04:05:58 +00:00
Sasha Koshka
85a582e349 Add more comments to explain casting rules in analyzer 2024-01-26 00:40:22 +00:00
Sasha Koshka
8e458111b5 Change the location at which defined IR types are wrapped
Defined IR types are wrapped in a TypeDefined by generateTypeNamed.
This causes them to be sent through GEP, which is necessary for
testing.
2024-01-25 22:57:52 +00:00
Sasha Koshka
f6604dcecd Wrote test for getelementptr'ing into chained typedefs 2024-01-25 18:19:34 +00:00
Sasha Koshka
67a0157cbd Use TypeDefined in generator 2024-01-25 18:19:22 +00:00
Sasha Koshka
2a927b209f Added a way to wrap a defined type via TypeDefined
This allows "copies" of a type that refer to a source to be created
and have their names changed/redefined without modifying the source
type.
2024-01-25 18:08:26 +00:00
Sasha Koshka
f1d48d74a2 Add test for chained typedefs with different names 2024-01-25 17:56:20 +00:00
Sasha Koshka
5b5c66d409 I forgot comments existed haha 2024-01-25 08:27:18 +00:00
Sasha Koshka
699cd88000 Nicer testing framework for lexer 2024-01-25 08:27:17 +00:00
Sasha Koshka
54ac39ee01 Lexer now accepts files with no blank line at the end 2024-01-25 08:27:17 +00:00
a0d31fad38 Update README.md 2024-01-25 07:43:21 +00:00
Sasha Koshka
b20dbcebbb Add logo to readme 2024-01-25 07:42:32 +00:00
Sasha Koshka
bb59f8de4a Fix duplicated pointer types 2024-01-25 07:36:51 +00:00
Sasha Koshka
4b28d40b89 AbstractType's TypeName member is now private 2024-01-25 07:05:07 +00:00
Sasha Koshka
9390eb6b2e Added test to debug absurd behavior relating to type defs 2023-12-24 22:49:10 -05:00
70c45f6fe1 Interface method calls no longer cause a segfault 2023-12-24 22:18:47 -05:00
7757133d43 Something was off with TestCompare 2023-12-24 21:45:47 -05:00
7d926be83a Fix code I probably wrote while high off my ass 2023-12-24 21:39:56 -05:00
Sasha Koshka
d4f81b0667 Empty struct literal values are initialized to zero 2023-12-23 17:25:27 -05:00
Sasha Koshka
3cca2dd130 Added nil (zero initializer) literals 2023-12-21 23:33:38 -05:00
Sasha Koshka
eeae7ac1ed Generator can produce link names 2023-12-20 03:05:27 -05:00
Sasha Koshka
af73d8e251 Added module referencing to parser 2023-12-19 15:21:10 -05:00
Sasha Koshka
308efbbd5e Add access specifiers and link names to parser 2023-12-17 11:23:42 -05:00
Sasha Koshka
ae60aa173e Made the type checker a tad more robust 2023-12-15 13:23:37 -05:00
Sasha Koshka
6bc59ca0d1 I forgor 2023-12-15 12:46:33 -05:00
Sasha Koshka
7572e8bf08 Fix comparison predicates 2023-12-15 12:40:43 -05:00
da7807d653 Attempt to further fix interface assignment 2023-12-14 21:21:07 -05:00
b7faa727af Method calling now properly passes pointer instead of value 2023-12-14 01:23:34 -05:00
4a28ee61c0 generateAssignmentSource assigns interface methods to iface dest 2023-12-14 00:47:14 -05:00
62a83f5544 Add some extra notes to readme 2023-12-13 03:44:57 -05:00
c9eccdd86f Oops pt 2 2023-12-13 03:40:40 -05:00
e796f055ad Oops 2023-12-13 03:38:44 -05:00
895e874e2f Compiler can fall back to clang when llc is not present 2023-12-13 03:28:24 -05:00
5cd1be88ce Add logo 2023-12-13 03:20:15 -05:00
Sasha Koshka
20db37b704 Changed my mind about brackets on break and return statements 2023-12-12 19:51:17 -05:00
5dc9331668 Updated language spec 2023-12-08 17:31:16 -05:00
35ecdd7a8b Add README.md 2023-12-08 00:28:58 -05:00
Sasha Koshka
ea934445c6 Add test for aforementioned issue 2023-12-07 17:14:37 -05:00
Sasha Koshka
139a66f239 Fix IsUnsigned 2023-12-07 17:05:26 -05:00
Sasha Koshka
8c64c07fff If statements get a type 2023-12-07 04:16:58 -05:00
Sasha Koshka
019a8732cb Augh 2023-12-07 04:03:28 -05:00
Sasha Koshka
8d1d87dbb8 If/else branching is no longer... like how it was 2023-12-07 03:58:57 -05:00
Sasha Koshka
1176da7cb9 If/else generation will not attempt to overwrite branches 2023-12-07 03:54:01 -05:00
988649098c Operands to IR binary instructions now have identifiers instead of names 2023-12-07 03:04:29 -05:00
e470fb1f5c Generator alloca's variables when they are defined 2023-12-07 02:48:27 -05:00
Sasha Koshka
2353ecd0e1 Fix case where generator would assign ID to void function calls 2023-12-05 22:36:41 -05:00
Sasha Koshka
e32d349e2e Add some more test cases to the generator 2023-12-05 22:29:29 -05:00
Sasha Koshka
8bc00720ac Fix bug with popping block managers off of the stack 2023-12-05 22:27:55 -05:00
Sasha Koshka
058a985d92 Add "internal error" prefix for generator errors 2023-12-05 22:08:06 -05:00
Sasha Koshka
f7a6e905f6 Fix comments 2023-12-05 22:04:12 -05:00
Sasha Koshka
6074b414b5 Add comments 2023-12-05 16:52:33 -05:00
588800e02c Slice operations now load the data pointer 2023-12-05 15:35:17 -05:00
5205f01877 Revert slices back to having just two fields 2023-12-05 03:07:54 -05:00
b0c3839ed9 Fixed several cases where the generator would output invalid IR 2023-12-03 22:23:04 -05:00
a7fe9a592b Generator passes method owner as pointer 2023-12-03 15:38:07 -05:00
ab8d616e2b Fix stale code 2023-12-02 23:42:54 -05:00
b1cd82d4ed Generator generates methods properly 2023-12-02 23:41:35 -05:00
c0997b3e47 Oops 2023-12-02 23:36:12 -05:00
fa69bd2294 Generator now pierces pointers when accessing members as well 2023-12-02 23:35:22 -05:00
5f30623e8f Member access can now pierce through pointers in the analyzer 2023-12-02 23:23:44 -05:00
65ec3c4ad0 Analyzer adds a "this" pointer to methods 2023-12-02 23:06:58 -05:00
3b6aa7fffb String literals can be assigned to strings now 2023-12-02 22:45:22 -05:00
55a86ad64c That should be literally every feature 2023-12-02 21:45:15 -05:00
5539f8722f Created function for making slices 2023-12-02 04:21:10 -05:00
67eb74c66e Ditch brackets around break and return statements 2023-12-01 01:53:33 -05:00
Sasha Koshka
9ccb1490bf Completed operations 2023-12-01 01:18:10 -05:00
Sasha Koshka
ccd3ddd82a Made native target actually work 2023-11-30 17:16:55 -05:00
af4827590e Operation stub part II 2023-11-30 15:44:30 -05:00
1c5a58aa23 Add operation stub 2023-11-30 02:13:47 -05:00
f87a4a4b78 Added casting 2023-11-30 02:06:12 -05:00
c24113ba51 Add length to analyzer and parser 2023-11-30 02:05:32 -05:00
78d4276a57 Added bit casts 2023-11-29 20:37:56 -05:00
a58b058025 Generator properly uses subscript offset 2023-11-29 20:31:40 -05:00
593683156a Generator grabs slice type from proper place 2023-11-29 20:31:07 -05:00
b96d9c6c4c Multi-layer location expression type inference 2023-11-29 20:07:16 -05:00
0b4aef1530 Analyzer does light upward type inference for location expressions 2023-11-29 18:52:27 -05:00
c5a61e15f6 Generator now adds null terminator to c-strings 2023-11-29 00:45:38 -05:00
37819645cd Reduce element type when generating string literal data 2023-11-29 00:21:58 -05:00
0afccbe6b1 Facehoof 2023-11-29 00:13:54 -05:00
Sasha Koshka
ced43a161d Added string literals to generator 2023-11-29 00:01:35 -05:00
Sasha Koshka
c08f5d7706 Add string literals to generator WIP 2023-11-28 01:15:12 -05:00
Sasha Koshka
9808fc0e7c Added string literal to analyzer 2023-11-26 17:27:31 -05:00
905522af56 Added string literal to parser 2023-11-26 05:16:40 -05:00
fddccf2967 Add escape sequences to strings in lexer 2023-11-26 04:56:14 -05:00
aa107072d8 This should have been way more commits 2023-11-26 04:02:22 -05:00
3a751666ba Fixed scope OverVariables stopping immediately 2023-11-26 04:01:55 -05:00
f08a09cee2 fsplc command now infers output type from output file name ext 2023-11-26 04:01:03 -05:00
ae9bace68a Analyzer no longer deletes dereferences 2023-11-26 04:00:44 -05:00
36e70c0c97 LLVM improvements 2023-11-26 04:00:20 -05:00
0a54cbdd63 Typedefs that are never referenced are never generated 2023-11-23 01:44:48 -05:00
8258c4f400 Basic compiler command 2023-11-23 01:26:28 -05:00
94bf21536d Generator returns an LLVM module 2023-11-23 01:26:14 -05:00
15fece8154 Various fixes 2023-11-23 00:02:00 -05:00
a2d4252428 Migrated generator to use new llvm code generation package 2023-11-22 20:37:37 -05:00
0efc4d209e Add custom LLVM code generation package 2023-11-22 20:37:16 -05:00
0331b486bf Generator WIP 2023-11-21 15:04:22 -05:00
ff9fdfeab0 Slight modifications to analyzer 2023-11-21 15:04:01 -05:00
Sasha Koshka
05e298583e Functions/behaviors stub 2023-11-16 22:41:20 -05:00
Sasha Koshka
652a6c313b Add CLI stub 2023-11-16 22:40:57 -05:00
Sasha Koshka
729af04963 Add type generator 2023-11-16 22:04:56 -05:00
13b18c0ce0 Generator stub II 2023-11-16 15:52:28 -05:00
3f96704723 Generator stub 2023-11-14 02:49:55 -05:00
5e4d2a32e4 Pass all analyzer tests 2023-11-04 17:59:04 -04:00
9706e844d6 Pass all but one test 2023-11-04 16:34:40 -04:00
162487490e Fix goofy bugs 2023-10-31 21:52:47 -04:00
b6a7b237ba uhhhh 2023-10-31 15:43:19 -04:00
58513e7d15 Can now assign array directly to slice 2023-10-31 01:46:18 -04:00
1a09e9ba2a Pass all literal assignment tests 2023-10-29 15:18:44 -04:00
b839517e9a Array literal can be used in array and slice 2023-10-29 15:13:25 -04:00
45574d3cd5 Pass a bunch of tests 2023-10-29 15:09:20 -04:00
8ce12b8a71 Removed Void as a concept 2023-10-29 14:47:28 -04:00
7b0d2d50bd Expression analysis actually runs now 2023-10-29 14:40:29 -04:00
65a32c3cdb Fix entity string conversion 2023-10-29 14:34:21 -04:00
e47096c219 Analyze return statement 2023-10-29 14:28:51 -04:00
b884978b87 Analyze break statements 2023-10-29 02:59:45 -04:00
9e85f869d5 Analyze more expressions 2023-10-29 02:18:41 -04:00
7df9517788 Add loop stack management to scopeManager and scopeContextManager 2023-10-29 02:18:03 -04:00
8cb7e2d8b0 Analyze all the literals 2023-10-28 03:24:17 -04:00
8a5d08d7fc Revise spec a bit 2023-10-28 03:24:08 -04:00
24ae32c95a Start analyzing literals 2023-10-27 16:10:31 -04:00
7d8a1cd714 Add package for determining integer sizes 2023-10-27 16:10:05 -04:00
61a04d51a4 More expressions (wip) 2023-10-26 10:43:50 -04:00
fb5d17742e Analysis of value/bit casts 2023-10-25 01:57:02 -04:00
2a5ffb12a1 Location expressions 2023-10-24 21:54:59 -04:00
bec91323b9 Added analysis for numerous types of expressions 2023-10-24 18:29:33 -04:00
5a48415bd5 I forgor 2023-10-24 01:34:58 -04:00
4448d3ccb4 Function call analysis 2023-10-20 13:48:05 -04:00
5d4977828e Added basic equality checks to types 2023-10-19 21:53:19 -04:00
84f76f8ba4 WIP expression analysis type checking 2023-10-19 19:13:55 -04:00
13d281388a New syntax for method calls
This will free up the '::' token for namespace/module access. Exciting!
2023-10-19 17:19:23 -04:00
bed87812d5 Expression analysis stub 2023-10-18 02:29:24 -04:00
7c0e96777b That, but for operation arg count testing 2023-10-18 01:39:43 -04:00
87dcc18a8d Updated analyzer tests to account for lexer changes 2023-10-18 01:33:22 -04:00
c375c18922 Star is now a separate token 2023-10-18 01:14:17 -04:00
f65f9e042c Implement custom lexer FINALLY 2023-10-18 00:48:35 -04:00
6ee91bee08 Finished analyzing method signatures 2023-10-17 03:21:25 -04:00
416c6b1d59 hngnggg i forgor to commit
- implemented scope management
- finished function signature analyzing
- added method analyzing
  - had to restructure type analysis slightly to do this
2023-10-17 03:11:11 -04:00
90796775d3 Booleans are now literals 2023-10-09 00:24:48 -04:00
8cc9b88126 Function analysis stub 2023-10-09 00:13:13 -04:00
4b2158b1f0 Added recursive type definitions 2023-10-08 23:54:45 -04:00
fcf4eba79e All the builtin/primitive types are in their own place 2023-10-07 17:32:47 -04:00
feb0da1172 Testing ALL the types 2023-10-07 02:27:49 -04:00
47fb051caa Add readme 2023-10-07 01:55:33 -04:00
0113536b0d the ansalyzer 2023-10-07 01:18:05 -04:00
Sasha Koshka
160cbd16ad Reorganized tests 2023-10-06 18:58:17 -04:00