daeisbae / AParser

Yet another programming language for educational purpose and simplicity
https://daeisbae.github.io/AParser/
MIT License
1 stars 0 forks source link

Read multiple punct converting to one op tok implementation #18

Closed daeisbae closed 6 months ago

daeisbae commented 6 months ago

Read 1~2 punctuation converting to one operator token. if one punctuation is read and it is overloadable, but the next punct is not a compatible punctuation with the previous punctuation , then remove the punctuation and reallocate to another operator token.

Example

>>> !3 !=2 !!=2
Token( TokenType: Operator Value: '!' )
Token( TokenType: Integer Value: '3' )
Token( TokenType: Whitespace Value: ' ' )
Token( TokenType: Operator Value: '!=' )
Token( TokenType: Integer Value: '2' )
Token( TokenType: Whitespace Value: ' ' )
Token( TokenType: Operator Value: '!' )
Token( TokenType: Operator Value: '!=' )
Token( TokenType: Integer Value: '2' )
Token( TokenType: End of line Value: '' )