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

Что это?

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
3
13 лет назад
0
XimikS:
you do not understand. i have checked every entry there. they are all my changed values. none of them look anything like it. see my pictures.
nothing is bold, italic, or underlined. and the /* */ comments are not an option in there.
i think they might be called delimeted comments.
i tried making an entry for them in the .ini file, but it doesn't do anything.
0
6
13 лет назад
0
As I know u can't change style of cJass syntax highlighting. Project HORUS (highlight cJass syntax in TESH) is unofficial addon to it (TESH autors miss their sources -_-), VanDamm (HORUS autor) can't find, where this style is changed.
0
3
13 лет назад
0
Я бегу в какой-то вопросы ... cjass компилятор дает мне ошибку на vjass код, который компилируется нормально с vjass компилятора. Я был очень взволнован, чтобы видеть некоторые изменения в cjass но vjass просто не работает на всех теперь. Мне пришлось удалить все мои cjass и снимите cjass компиляции опцию.
Вот пример. textmacro не работает один бит.
Мне сказали, что где-то textmacro являются архаичными и модуль превосходят ... Может быть, я должна использовать модуль? являются модули, используемые в cjass? все ... Вот некоторые примеры кода.
i'm running into some sort of issues...the cjass compiler is giving me errors on vjass code that compiles just fine with the vjass compiler. i was pretty excited to see some of the changes in cjass but vjass just isn't working at all now. i had to remove all my cjass and unclick cjass compiling option.
here's an example. textmacro doesn't work one bit.
i've been told somewhere that textmacro are archaic and that module are superior...maybe i should be using module? are modules used in cjass? whatever...here's some sample code.
in a library:
//! textmacro itemstacking takes itemA, itemB
private function f takes nothing returns boolean
  local unit mu = GetManipulatingUnit()
  local integer invi = GetInventoryHero(mu, $itemB$)
  local item itm = null
  if invi !=6 then
    set itm=GetItemHero(mu,$itemB$)
    call SetItemCharges(itm,GetItemCharges(itm)+1)
    set mu=null
    return false 
  else
    call UnitAddItemById(mu,$itemB$)
    set mu=null
    return false
  endif
endfunction

private function I takes nothing returns nothing
  call GT_AddItemAcquiredAction(function f, $itemA$)
endfunction

endscope
//! endtextmacro
in a trigger with various scopes:
scope stacka initializer I
//! runtextmacro itemstacking("'desc'","'I007'")
scope stackb initializer I
//! runtextmacro itemstacking("'fgsk'","'I008'")
scope stackc initializer I
//! runtextmacro itemstacking("'fgfh'","'I009'")
scope stackd initializer I
//! runtextmacro itemstacking("'pclr'","'I005'")
scope stacke initializer I
//! runtextmacro itemstacking("'pman'","'I006'")
scope stackf initializer I
//! runtextmacro itemstacking("'tgxp'","'I002'")
он скажет мне без конца сфера / library...if я передача от textmacro она будет сказать "нет" инициализатор, и т.д. .. он просто не работает ...
it will tell me no end of scope/library...if i transfer from the textmacro it'll say no initializer, etc...it just doesn't work...
если кто-нибудь может дать мне хороший пример использования определить макрос в cjass, может быть, я мог бы переделать все textmacro мой cjass для составления ... или не быть лучший способ решить эту проблему? есть ли способ я могу сделать cjass только компиляции определенные триггеры, которые cjass триггеров? Таким образом это не мешает смотреть на vjass код и дал мне ошибки так что я могу практики кодирования cjass?
if anyone could give me a good example of using define macro in cjass, maybe i could remake all my textmacro for cjass compiling...or shouldn't there be a better way around this? is there a way i can make cjass only compile certain triggers which are cjass triggers? that way it doesn't keep looking at vjass code and giving me errors so that i can practice coding cjass?
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, нет не пишет.
Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
Чтобы оставить комментарий, пожалуйста, войдите на сайт.