Gidsss / UwUIDE

A compiler made to be cute uwu >~<
6 stars 0 forks source link

Feat/more int float builtin methods #244

Closed am-cid closed 4 months ago

am-cid commented 4 months ago

closes #243

for both

  1. pow() takes in int/float. always returns self
  2. sqrt() rounds down. always returns self. eg b-chan = 10~ pwint(b.sqrt())~ >.< prints 3
  3. isNegative()
  4. isPositive()

for float

  1. ceil() returns float
  2. floor() returns float
  3. int() returns Int

for int

  1. float() returns float

new

etc

test log to show return types and expected arg types

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()
              | |          ^^^^^^^
              | |__________|
        ______________________________