Fixed CerberusX reporting incorrectly number of line.

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
@MikeHart : Have you seen the other updates in the conversions yet?

Edit: I may have another look at how the code is keeping tract of the nesting to detect an open nesting when EOF. is encountered. It may be using a bit more memory than it should with using a string stack.
 
Last edited:

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Nope, I just tested if the sample build and the initial error is gone.
That should have been `conversation` I started a new one. There's updates to the rebuildall.ps1 with on or two issues that need to be addressed for the in the develop branch for it to build out of the box.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,812
Ah that. Yes I saw this. Thank you. The icon problem.... well when you build a GLFW app with MSVC out of TED, it works fine. So I am not sure if that can be easily fixed, unless that file you have mentioned is only being used when building.

Btw. why in a conversation and not in a post here?
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Ah that. Yes I saw this. Thank you. The icon problem.... well when you build a GLFW app with MSVC out of TED, it works fine. So I am not sure if that can be easily fixed, unless that file you have mentioned is only being used when building.
I was seeing this in Ted and building via the ps1 script. If I remember the MSVC templates were self contained, so you could load them up into Visual Studio, plus anyone working within VS should know how to fix any issues when working outside the CX tool chain.
The CerberusGame.rc is looking in one directory higher.

I'll double check to see what's going on.
 
Last edited:

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,812
Ok, I tested your script and I see whta you mean. The github version of the msvc project is old.
But there is still a problem with your changes to toker or preprocessor.
It can't work with character literals.
Please try to build makedocs. There is complains not being able to do a cast from a string literal to integer.

Line 1148
Code:
            For Local i:Int = `a` To `z`
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Need to take a brake I guess.
You are not the only one. Not sure how I missed this mistake by not changing the token type to TOKE_INTLIT.
To save me uploading a whole file. Open the toker.cxs file and look for the Else If str="`" and change it to look like this.
code_language.cerberus:
        ' If the next character is the grave accent character, then set the token type to TOKE_INTLIT and loop through until the closing grave accent or newline character is encountered.
        ' If the remarks flag is set, then the token type should be set to LINECOMMENT
        Else If str="`"
            
            _tokeType=TOKE_INTLIT
            
            ' Loop through until either a closing grave accent is encountered. Or if the comments flag is set in the token flags,
            ' then look for a newline escape sequence and the set token type to TOKE_LINECOMMENT.
            While _tokePos<_length

                If Remarks()
                    _tokeType=TOKE_LINECOMMENT
                    If TSTR="~n"
                        _line+=1
                        Exit
                    Endif
                Else
                    If TSTR="`" Exit
                Endif
                _tokePos+=1
            Wend
            
            If _tokePos<_length
                _tokePos+=1
            Else
                If Not Remarks() _tokeType=TOKE_INTLITEX
            Endif

It should compile after transcc is rebuilt.
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
I think I better update the BUILDING.txt file and the rebuildall.sh script.
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
@MikeHart : I'm going to have a look to see what's needed to fix this and others like it. I can see what most of them are.
code_language.cerberus:
Function Main()
    Quirky()
End

Function Quirky()
  
    Select Rnd(2)
        Case 1
            Print "1"
        Case 2
            Print "2"
        Default
            Print "Default"
    End If                                ' This Should throw an error, but it doesn't until it hits another command and an error that has no relation to this error.
  
    Print "OK"
  
End Function
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,812
Are you telling me that this is still faulty?

Ah ok. I see. Back to the old version.
 
Last edited:

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Are you telling me that this is still faulty?
Ah ok. I see. Back to the old version.
The code that handles this is not in toker.cxs or or preparser.cxs. Those two files are working. These little gems are in the parser.cxs. So there is no need to revert any of the current code. These will be additional fixes.
 
Last edited:

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
535
Seems we are getting a big spring cleaning of Cerberus X. This is great! Thanks to you both! :D
 

SLotman

Active member
3rd Party Module Dev
Joined
Jul 3, 2017
Messages
149
Err... you guys know you CAN already use 'End Rem', 'End Function', 'End If" and it works, right?
I hate using just "End", so I always use it like that in my code.
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
535
The discussion was about making #EndRem mandatory because, there are situations where the linecounting was off because of content inside rem blocks. ;)
Making it mandatory would make the logic of the preprocessor easier.
 

Jimmy

New member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
569
Nice work! This is so inspiring to see all the work you do I hope you know that right!
 

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
Well I can not win.
Got the parse to work with mojo and mojo2, but my changes to ParseClassDelc break the reflection module.
Semanting
$SOURCE<5448> : Error : Syntax error - Class must terminate with 'End' or 'End Class'.

That's going to be a bloody good one to figure out.

Edit:
Ha. A looks like a simple fix. The emitted reflection output needs to be terminated with a new line character.
Just changing the Emit method at line 201-203 to:
Code:
    Method Emit( t$ )
        output.Push t+"~n"
    End
appears to fix it.
 
Last edited:

dawlane

Well-known member
CX Code Contributor
Joined
Jun 21, 2017
Messages
795
@MikeHart : OK. First go at the parser.cxs file for testing, minor update to preprocessor.cxs to fix a possible error line display issue, and to use a little less memory. And a fix to the file reflection module's reflector.cxs file for it to work with the changes in parser.cxs.
Update
Note: I've not go to town and put lots of comments in the parser yet. As I'm still getting my head round it.
 
Top Bottom