Skip to content
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

indexing local string vars is impossible #265

Closed
Tracked by #266
x87 opened this issue Sep 16, 2023 · 1 comment
Closed
Tracked by #266

indexing local string vars is impossible #265

x87 opened this issue Sep 16, 2023 · 1 comment
Labels
priority:p2 Medium priority scope:compiler type:bug Something isn't working
Milestone

Comments

@x87
Copy link
Collaborator

x87 commented Sep 16, 2023

this works:

s$var[0] = '0'    
s$var[1] = '1' 

this doesn't:

0@s[0] = '0'  // error Invalid local variable name 0@s.

As an implication custom string variables also get wrong indexes:

string x[3]

x[0] = '0' // 0@ - ok
x[1] = '1' // 1@ - wrong
x[2] = '0' // 2@ - wrong
@x87 x87 added type:bug Something isn't working priority:p2 Medium priority scope:compiler labels Sep 16, 2023
@x87 x87 added this to the v3.9.1 milestone Sep 16, 2023
@x87 x87 mentioned this issue Sep 17, 2023
7 tasks
@x87
Copy link
Collaborator Author

x87 commented Sep 17, 2023

Test case:

{$CLEO .cs}

string s[3]
longstring v[3]
int y = 18 // 3*2 + 3*4
                      
0@s[0] = '0'
0@s[1] = '2'
0@s[2] = '4'

s[0] = '0'   
s[1] = '2'   
s[2] = '4'   


v[0] = "6"   
v[1] = "10"   
v[2] = "14" 

s$var[0] = '4'    
s$var[1] = '6'
s$var[2] = '8'                      

v$var[0] = "4"    
v$var[1] = "8"
v$var[2] = "12"

@x87 x87 closed this as completed Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p2 Medium priority scope:compiler type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant