Добавлен , опубликован

Что это?

cJass - это еще одно расширение языка JASS, которое полностью совместимо с популярным vJass. Цель его создания - дать программистам еще больше возможностей по созданию простого и качественного кода. Основными направлениями являются:
  1. Макросредства и стандартная библиотека - избавляют от рутины, позволяя сконцентрироваться на основном коде.
  2. Упрощение синтаксиса - мы не хотим снова начинать спор, какой синтаксис лучше (блоки через begin & end или {}), и более того, мы не навязываем свою точку зрения - все конструкции cJass имеют JASS-style аналоги, тем не менее мы предоставляем выбор.
  3. Оптимизация карты - основная концепция cJass - это то, что все языковые конструкции не должны сказываться на качестве генерируемого кода. Также мы работаем над встроенным оптимизатором.

Как это использовать?

Просто скачайте дистрибутив (пароль для архива: cjass), распакуйте и запустите инсталлятор. У вас уже должен быть установлен Jass New Gen Pack.
Ознакомиться с возможностями можно, прочитав руководство пользователя cJass (off-line версия этого файла также имеется в директории программы).

Что-то не работает!

В настоящий момент мы активно дополняем язык всевозможными конструкциями, поэтому полноценная проверка синтаксиса пока отсутствует. Но мы всегда внимательно изучаем
bug-репорты, которые можно оставить в этой теме.

У меня есть идея: а не плохо бы...

Мы всегда рады выслушать Ваши идеи и предложения по внесению каких либо новых возможностей в язык, расширению стандартной библиотеки и т.д. Иногда мы даже действительно делаем то, что Вы нам предлагаете ;) Наша секция обратной связи ждет Вас!
И напоследок немного истории.
А история программы начинается на ресурсе wc3c.net, когда Vexorian, выслушав предложение от ADOLF'a сделать инструкции инкремента и декремента создает ветку с обсуждением синтаксиса... и благополучно забывает об этом. Тогда ADOLF подумал: "А неплохо было бы сделать свой парсер и включить в него всяких вкусностей". Изначально программа весила меньше заветных 9000 байт, распространялась по сети ICQ/Jabber и ее использовали несколько человек.
Однажды один из ее пользователей - Van Damm (впоследствии стал соавтором) сказал "это очень удобно!" (это было сказано про то, что можно вызывать функции без ключевого слова call) - и тогда мы решили, что если это удобно, почему бы не выложить программу на публичное обозрение. Благодаря zibade у нас появился сайт, где сразу стал отписываться Dark Dragon, который помог выявить львиную долю багов и внес множество интересных предложений.
С тех пор прошло много времени, мы сделали много новых версий, вес программы вырос в 3 раза (сейчас 26 Кбайт). На данный момент у нас есть планы, касающиеся многих конструкций, оптимизатора, и всего прочего.
`
ОЖИДАНИЕ РЕКЛАМЫ...

Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
0
6
13 лет назад
0
cJass display syntax error because it process textmacros like #define instruction - you cannot use in textmacros or defines unclossed library or scope (and also closed, but unopened, in cJass you may use private define, so it must process scope and library before define and textmacro).
Try it:
//! textmacro itemstacking takes itemA, itemB, type
scope stack$type$ initializer I
// ...
Or it:
scope stacka initializer I
//! runtextmacro itemstacking("'desc'","'I007'")
endscope // remove endscope instruction in textmacro
How it look in cJass style:
#define itemstacking (itemA, itemB, id) = {
    scope stack##id initializer Init {
        private boolean f () {
            unit mu = GetManipulatingUnit()
            integer inve = 0 // GetInventoryHero(mu, itemB)
            item itm = null
            if inve != 6 {
                itm = null //GetItemHero(mu, itemB)
                SetItemCharges(itm, GetItemCharges(itm)+1)
            } else {
                UnitAddItemById(mu, itemB)
            }
            mu = null
            return false
        }
        
        private nothing Init () {
            // GT_AddItemAcquiredAction(function f, itemA)
        }
    }
}

itemstacking ('desc', 'I007', a)
itemstacking ('desc', 'I007', b)
It compiled as
function stacka___f takes nothing returns boolean
local unit mu=GetManipulatingUnit()
local integer inve=0
local item itm=null
if inve!=6 then
set itm=null
call SetItemCharges(itm,GetItemCharges(itm)+1)
else
call UnitAddItemById(mu,0x49303037)
endif
set mu=null
return false
endfunction
function stacka___Init takes nothing returns nothing
endfunction
function stackb___f takes nothing returns boolean
local unit mu=GetManipulatingUnit()
local integer inve=0
local item itm=null
if inve!=6 then
set itm=null
call SetItemCharges(itm,GetItemCharges(itm)+1)
else
call UnitAddItemById(mu,0x49303037)
endif
set mu=null
return false
endfunction
function stackb___Init takes nothing returns nothing
endfunction
0
3
13 лет назад
0
DotaMaster666:
cJass display syntax error because it process textmacros like #define instruction - you cannot use in textmacros or defines unclossed library or scope (and also closed, but unopened, in cJass you may use private define, so it must process scope and library before define and textmacro).
Try it:
//! textmacro itemstacking takes itemA, itemB, type
scope stack$type$ initializer I
// ...
Or it:
scope stacka initializer I
//! runtextmacro itemstacking("'desc'","'I007'")
endscope // remove endscope instruction in textmacro
How it look in cJass style:
#define itemstacking (itemA, itemB, id) = {
    scope stack##id initializer Init {
        private boolean f () {
            unit mu = GetManipulatingUnit()
            integer inve = 0 // GetInventoryHero(mu, itemB)
            item itm = null
            if inve != 6 {
                itm = null //GetItemHero(mu, itemB)
                SetItemCharges(itm, GetItemCharges(itm)+1)
            } else {
                UnitAddItemById(mu, itemB)
            }
            mu = null
            return false
        }
        
        private nothing Init () {
            // GT_AddItemAcquiredAction(function f, itemA)
        }
    }
}

itemstacking ('desc', 'I007', a)
itemstacking ('desc', 'I007', b)
It compiled as
function stacka___f takes nothing returns boolean
local unit mu=GetManipulatingUnit()
local integer inve=0
local item itm=null
if inve!=6 then
set itm=null
call SetItemCharges(itm,GetItemCharges(itm)+1)
else
call UnitAddItemById(mu,0x49303037)
endif
set mu=null
return false
endfunction
function stacka___Init takes nothing returns nothing
endfunction
function stackb___f takes nothing returns boolean
local unit mu=GetManipulatingUnit()
local integer inve=0
local item itm=null
if inve!=6 then
set itm=null
call SetItemCharges(itm,GetItemCharges(itm)+1)
else
call UnitAddItemById(mu,0x49303037)
endif
set mu=null
return false
endfunction
function stackb___Init takes nothing returns nothing
endfunction
i tried the second thing already. i didn't think to try the first thing. the third thing looks interesting...but why did you comment out the important function calls?
EDIT: ok see now i seem to have fixed the problem by doing as your first suggestion...
but i'm still having problems with cjass.
i enabled adicparser and jasshelper, and i go all the way through cjass without errors, but get into vjass compiling and get an error about unexpected elseif where there is no elseif. it's just else.
then when i disable jasshelper and try to run the file after successful compilation, the map will not be tested. so i'm not sure what the problem is.
ok, i checked the error again and the if isn't there either. and there never was elseif. it's just else. what is there is a static if when i checked the code in the trigger editor.
the line with the static if is gone in the error message.
i don't mind taking out static if should it be necessary, but is there a way to still use them? cjass seems to delete a line that has static if at the beginning, so now vjass cannot use that line.
edit: static if is so stupid anyway. i replaced static if where i can find them with a simple comment like this
if not what we're using then do commands that use something else
it actually takes less space and no need to get spelling of library or whatever correct.
0
29
13 лет назад
0

Development version: 1.4.2.14 (19.05.2011) !

  • Fixed bugs with "flush locals" instruction.
  • Fixed removing unused globals.
  • Исправлены баги с инструкцией "flush locals".
  • Исправлено удаление неиспользуемых переменных.
0
18
13 лет назад
0
O_O
0
29
13 лет назад
0
Теперь можно спокойно юзать чистку локалок, ня.
0
18
13 лет назад
0
Неиспользуемые функции остаются :(
0
12
13 лет назад
0
а лог пишет, что удаляет?
0
29
13 лет назад
0
Nekit1234007, если функция ничего не берет, она остается, т.к. теореически может вызываться через экзекут, нужно приписывать optional (только для takes void).
Elf_Stratigo, нет не пишет.
0
18
13 лет назад
0
Это очень печально, т.к. не импонирует лицезреть мусор, в виде стандартных аллокаторов вжасса.
0
3
13 лет назад
0
Подскажите как будет выглядить триггер на сJass

Событие: юнит исп заклинание.
Условие: Заклинание == "AHtb".
Действие: Сделать ничего.

Действительно нужен пример
Заранее спасибо!
0
18
13 лет назад
0
А джасс ты знаешь?
Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
Чтобы оставить комментарий, пожалуйста, войдите на сайт.