Skip to content

Commit

Permalink
Updated : Vad to VaD - issues/3 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
PtPrashantTripathi authored Oct 6, 2022
1 parent 39bc3b6 commit 493f394
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tests/
tmp/
release/
build/
vedic/

# Packages #
############
Expand Down
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ release/
tests/
coverage/
build/
sample/
sample/
vedic/
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ zip -r -Z bzip2 ./release/${NAME}_windows.zip . -i ./vedic/vedic.exe
# build macos binary
echo "Building macos binary"
pkg -t node14-mac ./main.js --compress GZip --output ./vedic/vedic
zip -r -Z bzip2 ./release/${NAME}-macos.zip . -i ./vedic/vedic
zip -r -Z bzip2 ./release/${NAME}-macos.zip . -i ./vedic/vedic

# clear old temp
rm -rf vedic
4 changes: 2 additions & 2 deletions dist/vedic.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vedic-lang",
"version": "1.2.1",
"version": "1.2.2",
"description": "Vedic is World first Programming launguage in Sanskrit",
"license": "MIT",
"repository": "https://github.com/vedic-lang/vedic",
Expand Down
2 changes: 1 addition & 1 deletion sample/avahan.ved
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
मान दर = ८;
मान समय = ५;

वद् "मिश्रधन = \n"+मिश्रधन(मूलधन,दर,समय);
वद "मिश्रधन = \n"+मिश्रधन(मूलधन,दर,समय);
2 changes: 1 addition & 1 deletion sample/chakram.ved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
चक्रम्(मान अ = ०; अ < १०; मान अ = अ+ १)
{
# चक्रम् takes in 3 parameters initial value, and condition, and a step size
वद् "अ = " + अ;
वद "अ = " + अ;
}
# This will print ० to ९
8 changes: 4 additions & 4 deletions sample/nirdesa.ved
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

निर्देश (अ) {
यद १:
वद् 'निर्देश १ अनुष्ठित'; # case 1 executed
वद 'निर्देश १ अनुष्ठित'; # case 1 executed
यद २:
वद् 'निर्देश २ अनुष्ठित';
वद 'निर्देश २ अनुष्ठित';
यद ३:
वद् 'निर्देश ३ अनुष्ठित';
वद 'निर्देश ३ अनुष्ठित';
यदभावे:
वद् 'यदभावे औत्सर्गिक निर्देश अनुष्ठित'; # In the absence of incident default case executed
वद 'यदभावे औत्सर्गिक निर्देश अनुष्ठित'; # In the absence of incident default case executed
}
28 changes: 14 additions & 14 deletions sample/operators.ved
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
वद् २+१; # ३
वद् २-१; # १
वद् २*१; # २
वद् २/१; # २
वद् २%१; # ०
वद् २>१; # सत्य
वद् २<१; # असत्य
वद् २==१; # असत्य
वद् २!=१; # सत्य
वद् २>=१; # सत्य
वद् २>=१; # सत्य
वद् २<=१; # असत्य
वद् २&&१; # सत्य
वद् २||१; # सत्य
वद २+१; # ३
वद २-१; # १
वद २*१; # २
वद २/१; # २
वद २%१; # ०
वद २>१; # सत्य
वद २<१; # असत्य
वद २==१; # असत्य
वद २!=१; # सत्य
वद २>=१; # सत्य
वद २>=१; # सत्य
वद २<=१; # असत्य
वद २&&१; # सत्य
वद २||१; # सत्य
2 changes: 1 addition & 1 deletion sample/paryantam.ved
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
मान अ = ०;
पर्यन्तम्( अ <= ५)
{
वद् अ;
वद अ;
मान अ = अ+ १;
}
6 changes: 3 additions & 3 deletions sample/suchi.ved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Creating an सूचि
मान क = [["आम",१ ],["संतरा",२],["सेब",३]];
वद् क;
वद क;

# Adding elements to a सूचि
मान सप्तर्षि = []; # रिक्त सूचि - Empty list
Expand All @@ -13,5 +13,5 @@
मान सप्तर्षि[]= "Gautama";
मान सप्तर्षि[]= "Jamadagni";

वद् सप्तर्षि;
वद् कुल(सप्तर्षि);
वद सप्तर्षि;
वद कुल(सप्तर्षि);
2 changes: 1 addition & 1 deletion sample/sutra.ved
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
फल अ+ब;
}

वद् योग(११,२२); # it will print ३३
वद योग(११,२२); # it will print ३३
2 changes: 1 addition & 1 deletion sample/viram.ved
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
यदि (अ > ५){
विराम्;
}
वद् "अ = " + अ;
वद "अ = " + अ;
}
6 changes: 3 additions & 3 deletions sample/yadiath.ved
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
मान आयु = ३२;
यदि (आयु == २५) {
वद् "वयं सम वयस्काः एव"; # We're the same age
वद "वयं सम वयस्काः एव"; # We're the same age
}
अथ यदि (आयु > २५) {
वद् "वयं सम वयस्काः न एव"; # We're not the same age
वद "वयं सम वयस्काः न एव"; # We're not the same age
}
अथ {
वद् "मम अपेक्षया कनिष्ठः वा"; # Younger to me
वद "मम अपेक्षया कनिष्ठः वा"; # Younger to me
}
3 changes: 2 additions & 1 deletion src/symboltable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

const KEYWORDS = {
maan: 'मान', // var
vad: 'वद्', // print
vad: 'वद', // print
padh: 'पठ', // read
yadi: 'यदि', // if
atha: 'अथ', // else
satya: 'सत्य', // true
Expand Down

0 comments on commit 493f394

Please sign in to comment.