-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement plan for testability #53
Conversation
…in class Prog8Parser to interface with it
…r) to parser; .linkParents for child nodes of Module
… to replace ParsingFailedError), start testing proper error location info
… directory) - *failing*
… non-existent path)
…; Prog8Parser now only accepts this
…port isn't found, return SourceCode? from both, tryGetModuleFromResource and tryGetModuleFromFile
…ule, to make the current all-too-simple import resolution work
Since this was rebased on v7.1 (again), the change re
The next BOC "Bunch'O'Commits" (TM) - to this PR draft will address the last point s.t. it's using the same |
…(via temp. subclass ParsedModule) The temporary subclass ParsedModule : Module is introduced to concentrate all the workaround stuff in one place *while still not changing any public signature* such as of the Module ctor. The convention used to indicate stuff from resources is still "<res:...>" not "@Embedded@"- *note that this is caught by 3 tests in compiler*
…eCode.isFromResources, *change Module.source from type Path to type SourceCode*
RemarkI am trying hard to leave out opinion. And I'll stick with it - unless you ask :) |
Addendum: problems present in this PR up to this point
Please note that there is more in the pipeline already. Even more than one variation in cases. It really depends on your feedback now. |
Nice first overview: https://github.com/irmen/prog8/network |
…-import the gradle project into IDEA* Note: these resources are NOT going into the production .jar
…riz and textelite (the largest ones, 20KB / 36KB)
These five commits are adding and improving tests. Worth mentioning are:
So, my "Addendum re current problems" above is now outdated for the most part.In fact, it was rather misleading to begin with (because I was misled):
I would really like to move on to step 4 now.As said, I've got almost all of the plan already. Plus variations. |
…g "@" for strings with altEncoding
…ill in compilerAst)
…o easy fix for this atm
… test re %import with string arg
So now we've reached step 7, move In doing so I found yet another bug: the -libdirs option didn't work. While looking into this I decided that access to a
The question came up as I realized that in case of parse errors, both the
One thing that really puzzled me (and still does) is this: how to correctly "linkParents" when adding a module to a program?
To wrap up:
|
First, here's something we should definitely do - whether or not we'll switch to kotest:
There are a few restrictions re the characters that can be used (with kotest: none), but still absolutely worth it. |
@meisl I may be able to start spending some time again on prog8 in the coming weeks. Any quick hint on where to start reviewing the things again concerning this topic? |
this caused an error in determining the main module and correct compilation options
@meisl I tried to rebase this on the current 7.1 but that is a bit of work. Merging the branches however is a lot simpler - so if you don't particularly care about having all your commits in this branch on top, I'd say forget rebasing Also merging this branch back into 7.1 is rather uneventful, the few commits mentioned above can be resolved easily. That said I still haven't properly reviewed all of this PR, so that's still a task for me before we can hit the merge button. |
@@ -1308,18 +1308,30 @@ $repeatLabel lda $counterVar | |||
} | |||
} | |||
|
|||
/** | |||
* TODO: %asminclude and %asmbinary should be done earlier than code gen (-> put content into AST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you want this?
For included assembly code I could think of only one reason which is that prog8 itself is going to analyze the included assembly. But for binary blobs? What's wrong with just letting the assembler take care of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to go ahead with the proposed changes.
# Conflicts: # compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt # compilerAst/src/prog8/parser/ModuleParsing.kt # compilerAst/test/TestAntlrParser.kt # parser/antlr/Prog8ANTLR.g4
@meisl for posterity, I've created a branch Yay! Thanks again for your work on this so far. Haven't heard from you for a while I hope you haven't lost interest in the project |
This is my take on implementing the plan laid out in #50 ("CompilerDevelopment.md").
As discussed, commits will be added to this draft in bunches, allowing for comments and/or review in between.
The first bunch covers steps 1, 2 and 3 of the plan, in a total of 14 commits (not counting merges from v7.1 and what's already in #50), and about triples the nr of tests in
compilerAst
.These first 3 steps were inseparable from each other, and only after the 14 commits is a state established where everything that was working before is working again, and all tests pass - plus of course improvements wrt. testability, readability and actual functionality such as resolving #46.