enhanced the compiler logic to handle the class-level variales
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-20 17:37:51 +09:00
parent 9b3b2d1e5b
commit d2b3cc9f71
3 changed files with 131 additions and 112 deletions

View File

@ -281,3 +281,20 @@ class(#byte #limited #final #limited) Kuduro { ##ERROR: syntax error - conflicti
---
class(#byte #bytes) Kuduro { ##ERROR: syntax error - unrecognized class attribute name '#bytes'
}
---
class Kuduro [a b c] {
var d e
var a ##ERROR: syntax error - duplicate instance variable name 'a'
}
---
class Kuduru [a [b] c] {
var d e
var b ##TODO: should this be prohibited?
}
class Kuduro [a [b] c] {
var d e
var(#class) b ##ERROR: syntax error - duplicate class variable name 'b'
}

View File

@ -31,7 +31,7 @@ fun String length() { ##ERROR: syntax error - 'String' not followed by ( but fol
---
class A [ 10 ] { ##ERROR: syntax error - not variable name - 10
class A [ 10 ] { ##ERROR: syntax error - not variable name '10'
}
---
@ -44,11 +44,11 @@ class A [ [ [a] ] ] { ##ERROR: syntax error - not variable name
}
---
class A [ a + ] { ##ERROR: syntax error - not variable name - +
class A [ a + ] { ##ERROR: syntax error - not variable name '+'
}
---
class A [ + ] { ##ERROR: syntax error - not variable name - +
class A [ + ] { ##ERROR: syntax error - not variable name '+'
}
---