Closed am-cid closed 4 months ago
closes #243
for both pow() takes in int/float. always returns self sqrt() rounds down. always returns self. eg b-chan = 10~ pwint(b.sqrt())~ >.< prints 3 isNegative() isPositive() for float ceil() returns float floor() returns float int() returns Int for int float() returns float
pow()
sqrt()
b-chan = 10~ pwint(b.sqrt())~ >.< prints 3
isNegative()
isPositive()
ceil()
floor()
int()
float()
TokenType.NUMBER
chan
kun
sama
sample text file ---------------------------------- 1 | 2 | fwunc mainuwu-san() [[ 3 | str-senpai = ""~ 4 | a-chan = 1~ 5 | b-kun = 1.1~ 6 | 7 | str = a.pow("")~ 8 | str = a.pow(2)~ 9 | str = a.pow(fax)~ 10 | str = a.pow(2.2)~ 11 | str = a.sqrt()~ 12 | str = a.abs()~ 13 | str = a.isNegative()~ 14 | str = a.isPositive()~ 15 | str = a.float()~ 16 | 17 | str = b.pow("")~ 18 | str = b.pow(2)~ 19 | str = b.pow(fax)~ 20 | str = b.pow(2.2)~ 21 | str = b.sqrt()~ 22 | str = b.abs()~ 23 | str = b.isNegative()~ 24 | str = b.isPositive()~ 25 | str = b.int()~ 26 | ]] 27 | ---------------------------------- end of file Call arg type mismatch: _____________________________ | | 'chan.pow()' called here 7 | str = a.pow("")~ | ^^^ | | 'chan.pow()' class method expects 1 argument | EXPECTED ACTUAL ARG | ✗ chan, kun, or sama senpai "" _____________________________ Assignment Type Mismatch: expected 'senpai' but got 'chan' _____________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'chan' 7..n | | str = a.pow("") | | ^^^^^^^^^ | |__________| _____________________________ Assignment Type Mismatch: expected 'senpai' but got 'chan' _____________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'chan' 8..n | | str = a.pow(2) | | ^^^^^^^^ | |__________| _____________________________ Assignment Type Mismatch: expected 'senpai' but got 'chan' _____________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'chan' 9..n | | str = a.pow(fax) | | ^^^^^^^^^^ | |__________| _____________________________ Assignment Type Mismatch: expected 'senpai' but got 'chan' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'chan' 10..n | | str = a.pow(2.2) | | ^^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'chan' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'chan' 11..n | | str = a.sqrt() | | ^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'chan' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'chan' 12..n | | str = a.abs() | | ^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'sama' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'sama' 13..n | | str = a.isNegative() | | ^^^^^^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'sama' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'sama' 14..n | | str = a.isPositive() | | ^^^^^^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'kun' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'kun' 15..n | | str = a.float() | | ^^^^^^^^^ | |__________| ______________________________ Call arg type mismatch: ______________________________ | | 'kun.pow()' called here 17 | str = b.pow("")~ | ^^^ | | 'kun.pow()' class method expects 1 argument | EXPECTED ACTUAL ARG | ✗ chan, kun, or sama senpai "" ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'kun' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'kun' 17..n | | str = b.pow("") | | ^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'kun' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'kun' 18..n | | str = b.pow(2) | | ^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'kun' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'kun' 19..n | | str = b.pow(fax) | | ^^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'kun' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'kun' 20..n | | str = b.pow(2.2) | | ^^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'kun' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'kun' 21..n | | str = b.sqrt() | | ^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'kun' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'kun' 22..n | | str = b.abs() | | ^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'sama' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'sama' 23..n | | str = b.isNegative() | | ^^^^^^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'sama' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'sama' 24..n | | str = b.isPositive() | | ^^^^^^^^^^^^^^ | |__________| ______________________________ Assignment Type Mismatch: expected 'senpai' but got 'chan' ______________________________ | Expected type defined here 3 | str-senpai = ""~ | ^^^^^^ | ____________| | | Tried to assign a value that evaluates to type: 'chan' 25..n | | str = b.int() | | ^^^^^^^ | |__________| ______________________________
closes #243
new
TokenType.NUMBER
for fns that accept any number type (chan
,kun
,sama
)etc
now convert Int's value to int and Float's value to float when capping value
test log to show return types and expected arg types