Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pcnt

This is my attempt at code golf. It's not going to be a winner, but instead follows a minimal concept to make it small but still relatively (not really) understandable.

token Syntax

Outlined here is the token syntax, or what each of the keywords means and where.

important information

pcnt works a little differently than other languages when it comes to processing different keywords (I call them tokens here). One aspect is the nature of code blocks, or things that are encased. Because pcnt delimits one character at a time, There is generally only a token to represent the end of a block, and not to open it. The one-character idea allows for a lot of implied beginnings. The exceptions are string literals (only them and numbers can be longer than a character, so they need a start and end), arithmetic priority (example: (1+3)*4), arrays (i%x[7]), and sequential lists for arrays ({1,2,3}). Similarly, there are a lot of tokens that have multiple meanings, depending on the context. This is because pcnt uses "states", or modes, to determine what each keyword means. As an example, < means 'less than' in the conditional state, and is the ending token in the parameter state. Moreover, because tokens are all one character, identifiers can be any character. For example, i%$ creates an integer variable called $. In this case $ is an identifier token and not a keyword token because it is preceded by %, which marks a variable. i%% would also work. The identifier can be any unicode character.

general tokens

`Comment`
% - variable (language namesake)
$ - function
& - class
; - end of block 
. - reference
r - return
< - end parameters
> - return type 
? - conditional 
: - then 
# - macro
k - constant

primitive data types

i - 32-bit integer 
d - 64-bit float (double)
c - 8 bit char 
l - 64 bit integer
b - boolean
u - unsigned

[] - arrays 
{} - sequence 

strings

s - string 
"" - string body
R - raw string 

loops

w - start while conditional 
@ - for 
S - switch
C - case 
B - break

oop

! - Private
~ - Protected
| - extends
t - static (dynamic implied)

operators

+ - add
- - subtract
* - multiply
/ - divide
o - modulo
e - exponent
p - increment
m - decrement
() - priority 

O - or 
A - and 
N - not 
X - xor
= - equals

About

An attempt to make a trash programming language

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages