チケット #45028

Document counters ruleset format

登録: 2022-07-06 08:48 最終更新: 2022-10-07 21:27

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
14

詳細

Split from #44345.

Add the ruleset comments about counters sections. Remember also data/ruledit/comments-3.2.txt, and code changes to tools/ruleutil/comments.ch + call it from tools/ruleutil/rulesave.c

チケットの履歴 (51 件中 3 件表示)

2022-07-06 08:48 更新者: cazfi
  • 新しいチケット "Document counters ruleset format" が作成されました
2022-07-13 22:29 更新者: lachu
コメント

Reply To cazfi

Split from #44345. Add the ruleset comments about counters sections. Remember also data/ruledit/comments-3.2.txt, and code changes to tools/ruleutil/comments.ch + call it from tools/ruleutil/rulesave.c

Include this two:

2022-07-13 22:28 Updated by: lachu

File 0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 9785) is attached

2022-07-13 22:29 Updated by: lachu

File 0002-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 9786) is attached
2022-07-20 18:13 更新者: cazfi
コメント

The code part seems fine after manual review (haven't compiled or tested it yet).

I'll try to make a proposal of my own for the actual documentation text.

2022-07-28 08:23 更新者: cazfi
コメント

Reply To cazfi

I'll try to make a proposal of my own for the actual documentation text.

Attached (just for classic ruleset, as an example). If it looks like ok to you, make a full patch.

I documented default as '.def' as it's loaded (not as '.default' that rulesave currently saves). Assuming that #45253 gets fixed that way.

2022-07-28 22:16 更新者: lachu
コメント

Reply To cazfi

Reply To cazfi

I'll try to make a proposal of my own for the actual documentation text.

Attached (just for classic ruleset, as an example). If it looks like ok to you, make a full patch. I documented default as '.def' as it's loaded (not as '.default' that rulesave currently saves). Assuming that #45253 gets fixed that way.

2022-07-28 22:14 Updated by: lachu

File 0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 9959) is attached

2022-07-28 22:14 Updated by: lachu

File 0002-Clarify-about-counters-in-classic-ruleset.patch (File ID: 9960) is attached

I see we need to join comment about counters data with code to generate ruleset. Also, clarification about counters inside classic ruleset are delivered in separate patch. Typo is also repaired (spaces in blank line).

2022-07-29 08:37 更新者: cazfi
コメント

scripts/spec_propagate.sh might be useful when you set up the documentation comment to all rulesets (but it's quite likely that the lack of common context causes that script to fail with some rulesets)

2022-08-06 14:18 更新者: cazfi
コメント

Reply To cazfi

when you set up the documentation comment to all rulesets

Ping. Can you make such an final patch with all the contents needed for this ticket?

2022-08-07 00:26 更新者: None
コメント

Reply To cazfi

Reply To cazfi

when you set up the documentation comment to all rulesets

Ping. Can you make such an final patch with all the contents needed for this ticket?

I will try in nearest day.

2022-08-09 04:08 更新者: lachu
  • 添付ファイル 0001-OSDN-41122-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 10044) が付加されました
2022-08-09 04:08 更新者: lachu
  • 添付ファイル 0001-OSDN-41122-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 10044) が削除されました
2022-08-09 04:10 更新者: lachu
コメント

Reply To (Anonymous)

Reply To cazfi

Reply To cazfi

when you set up the documentation comment to all rulesets

Ping. Can you make such an final patch with all the contents needed for this ticket?

I will try in nearest day.

That was my comment. I thought I have had more free time on my holidays. I will try to repair this issue in nearest time.

2022-08-11 00:29 更新者: lachu
コメント

Reply To cazfi

Reply To cazfi

when you set up the documentation comment to all rulesets

Ping. Can you make such an final patch with all the contents needed for this ticket?

I try to prepare final patch by copy civ2civ3 ruleset, copy some added content to comments-3.2.txt into result of previous operation and call this script with path to newly created ruleset. It complains that I should manually repair comments-3.2.txt

2022-08-17 00:47 更新者: lachu
コメント

I fall in providing way to apply counters-related-comments to each rulesets automatically, sorry. Apply:

0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch(12KB)
Hand-made changes in game.ruleset
2022-08-17 00:48 更新者: lachu
コメント

Reply To cazfi

Reply To cazfi

when you set up the documentation comment to all rulesets

Ping. Can you make such an final patch with all the contents needed for this ticket?

I fall. Apply last patch, which do this for each game.ruleset files, not providing way to automatically upadate these files.

2022-08-21 14:17 更新者: cazfi
コメント

Reply To lachu

Reply To cazfi

Reply To cazfi

when you set up the documentation comment to all rulesets

Ping. Can you make such an final patch with all the contents needed for this ticket?

I fall. Apply last patch, which do this for each game.ruleset files, not providing way to automatically upadate these files.

Can you provide a single patch with all the content of this ticket? This last patch lacks the code changes to rulesave part, and the comments-3.2.txt update.

2022-08-24 22:47 更新者: lachu
コメント

Reply To cazfi

Reply To lachu

Reply To cazfi

Reply To cazfi

when you set up the documentation comment to all rulesets

Ping. Can you make such an final patch with all the contents needed for this ticket?

I fall. Apply last patch, which do this for each game.ruleset files, not providing way to automatically upadate these files.

Can you provide a single patch with all the content of this ticket? This last patch lacks the code changes to rulesave part, and the comments-3.2.txt update.

0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch(15KB)
Assembly prebiously created patches

It should be previously ;-). but you can apply it now, I think.

2022-08-25 11:42 更新者: cazfi
コメント

Encountered a couple of problems:

- The patch does not apply, for the civ2civ3 part. Apparently you've created this in a tree where you have a (test) counter that does not exist in master
- xgettext gives "warning: unterminated character constant" about the changed game.rulesets, because of the ' in ";checkpoint = Trigger value of the counter. When counter's". Our usual solution to these has been to use ` instead -> "counter`s". Sorry for not realizing that before
- There's no need for adding [counters] -section. There's no entries in it (every counter is a section of its own). Even if we did, the documentation would go above it.
- ruledit gives: "3: Can't parse the comments file" - you would need at least to escape every " in it as \"

(編集済, 2022-08-25 11:43 更新者: cazfi)
2022-08-27 02:11 更新者: lachu
コメント

Reply To cazfi

Encountered a couple of problems: - The patch does not apply, for the civ2civ3 part. Apparently you've created this in a tree where you have a (test) counter that does not exist in master
- xgettext gives "warning: unterminated character constant" about the changed game.rulesets, because of the ' in ";checkpoint = Trigger value of the counter. When counter's". Our usual solution to these has been to use ` instead -> "counter`s". Sorry for not realizing that before
- There's no need for adding [counters] -section. There's no entries in it (every counter is a section of its own). Even if we did, the documentation would go above it.
- ruledit gives: "3: Can't parse the comments file" - you would need at least to escape every " in it as \"

0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch(16KB)
I still get *** fix up ruledit manually: data/ruledit/comments-3.2.txt

I repair some problems, but I still got: *** fix up ruledit manually: data/ruledit/comments-3.2.txt

2022-08-27 03:28 更新者: cazfi
コメント

Reply To lachu

I repair some problems, but I still got: *** fix up ruledit manually: data/ruledit/comments-3.2.txt

Apparently one can't get more detailed logs out from ruledit -> #45467

I'll try to make that patch tonight. Maybe you can apply it locally to help you debug the problem with your patch.

2022-09-02 02:48 更新者: cazfi
コメント

Reply To cazfi

Apparently one can't get more detailed logs out from ruledit -> #45467 I'll try to make that patch tonight. Maybe you can apply it locally to help you debug the problem with your patch.

That is now even in the repository.

2022-09-03 22:35 更新者: None
コメント

I've got:.

/scripts/spec_propagate.sh ./data/special-to-apply/ *** don't know how to propagate ./data/special-to-apply/ *** usage: ./scripts/spec_propagate.sh data/changed-ruleset-dir

2022-09-03 22:36 更新者: lachu
コメント

I've got:

./scripts/spec_propagate.sh ./data/special-to-apply/
*** don't know how to propagate ./data/special-to-apply/
*** usage: ./scripts/spec_propagate.sh data/changed-ruleset-dir
2022-09-03 22:37 更新者: lachu
コメント

Reply To lachu

I've got: ./scripts/spec_propagate.sh ./data/special-to-apply/ *** don't know how to propagate ./data/special-to-apply/ *** usage: ./scripts/spec_propagate.sh data/changed-ruleset-dir

If I place changes into data/civ2civ3/game.ruleset and type ./scripts/spec_propagate.sh ./data/civ2civ3 I've got the same.

2022-09-06 01:04 更新者: cazfi
コメント

Reply To lachu

Reply To lachu

I've got: ./scripts/spec_propagate.sh ./data/special-to-apply/ *** don't know how to propagate ./data/special-to-apply/

If I place changes into data/civ2civ3/game.ruleset and type ./scripts/spec_propagate.sh ./data/civ2civ3 I've got the same.

Like I said, that's not unexpected: "(but it's quite likely that the lack of common context causes that script to fail with some rulesets)"

Means the script can't help you, but you have to copy those comments to each ruleset manually.

2022-09-08 02:04 更新者: cazfi
コメント

Reply To cazfi

Encountered a couple of problems: - The patch does not apply, for the civ2civ3 part. Apparently you've created this in a tree where you have a (test) counter that does not exist in master

For some reason this still does not apply. It also seems that you've moved these to the very end of game.ruleset (after settings) from the location after clauses agreed earlier, and where the ruledit/ruleup saves them.

- xgettext gives "warning: unterminated character constant" about the changed game.rulesets, because of the ' in ";checkpoint = Trigger value of the counter. When counter's". Our usual solution to these has been to use ` instead -> "counter`s". Sorry for not realizing that before

That's still an issue.

- There's no need for adding [counters] -section. There's no entries in it (every counter is a section of its own). Even if we did, the documentation would go above it.

Rulesave still adds that. You should not be writing an entry comment but a section one, about a ruleset object type:
- Most importantly: use comment_write() instead of comment_entry_write() in comment_counters()
- Move comment_counters() among the other section comment writing functions (e.g. after the comment_clauses() )
- In comments-3.2.txt move entrydoc.counters to typedoc.counters (again: likely after typedoc.clauses)
- Likewise read the comment from typedoc.counters instead of entrydoc.counters
- Move "counters" in comments_storage among the section ones (again: after "clauses" is a good spot)

- ruledit gives: "3: Can't parse the comments file" - you would need at least to escape every " in it as \"

This escaping seems to work ok now.

2022-09-11 21:48 更新者: lachu
コメント

Reply To cazfi

Reply To cazfi

Encountered a couple of problems: - The patch does not apply, for the civ2civ3 part. Apparently you've created this in a tree where you have a (test) counter that does not exist in master

For some reason this still does not apply. It also seems that you've moved these to the very end of game.ruleset (after settings) from the location after clauses agreed earlier, and where the ruledit/ruleup saves them.

- xgettext gives "warning: unterminated character constant" about the changed game.rulesets, because of the ' in ";checkpoint = Trigger value of the counter. When counter's". Our usual solution to these has been to use ` instead -> "counter`s". Sorry for not realizing that before

That's still an issue.

- There's no need for adding [counters] -section. There's no entries in it (every counter is a section of its own). Even if we did, the documentation would go above it.

Rulesave still adds that. You should not be writing an entry comment but a section one, about a ruleset object type:
- Most importantly: use comment_write() instead of comment_entry_write() in comment_counters()
- Move comment_counters() among the other section comment writing functions (e.g. after the comment_clauses() )
- In comments-3.2.txt move entrydoc.counters to typedoc.counters (again: likely after typedoc.clauses)
- Likewise read the comment from typedoc.counters instead of entrydoc.counters
- Move "counters" in comments_storage among the section ones (again: after "clauses" is a good spot)

- ruledit gives: "3: Can't parse the comments file" - you would need at least to escape every " in it as \"

This escaping seems to work ok now.

0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch(11KB)
Still do not apply automatically

Still do not apply automatically. Maybe case is that I apply data manually. I will try to restore files and try ran script. You wrote there is no need to ensure script will apply changes, so I send patch.

2022-09-13 23:09 更新者: lachu
コメント

Reply To cazfi

Reply To cazfi

Encountered a couple of problems: - The patch does not apply, for the civ2civ3 part. Apparently you've created this in a tree where you have a (test) counter that does not exist in master

For some reason this still does not apply. It also seems that you've moved these to the very end of game.ruleset (after settings) from the location after clauses agreed earlier, and where the ruledit/ruleup saves them.

- xgettext gives "warning: unterminated character constant" about the changed game.rulesets, because of the ' in ";checkpoint = Trigger value of the counter. When counter's". Our usual solution to these has been to use ` instead -> "counter`s". Sorry for not realizing that before

That's still an issue.

- There's no need for adding [counters] -section. There's no entries in it (every counter is a section of its own). Even if we did, the documentation would go above it.

Rulesave still adds that. You should not be writing an entry comment but a section one, about a ruleset object type:
- Most importantly: use comment_write() instead of comment_entry_write() in comment_counters()
- Move comment_counters() among the other section comment writing functions (e.g. after the comment_clauses() )
- In comments-3.2.txt move entrydoc.counters to typedoc.counters (again: likely after typedoc.clauses)
- Likewise read the comment from typedoc.counters instead of entrydoc.counters
- Move "counters" in comments_storage among the section ones (again: after "clauses" is a good spot)

- ruledit gives: "3: Can't parse the comments file" - you would need at least to escape every " in it as \"

This escaping seems to work ok now.

Sorry for quality of my previous patches. I figure out it even contains some junk data - fix code styling, probably I use --amend while rebasing on to of other person patch.

Apply:

0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch(4KB)
Split patch, remove junks

0001-Add-clarify-what-counter-does-into-each-ruleset.patch(14KB)

Data patch, if it not apply automatically
(編集済, 2022-09-13 23:10 更新者: lachu)
2022-09-28 22:34 更新者: lachu
コメント

Reply To cazfi

Reply To cazfi

Encountered a couple of problems: - The patch does not apply, for the civ2civ3 part. Apparently you've created this in a tree where you have a (test) counter that does not exist in master

For some reason this still does not apply. It also seems that you've moved these to the very end of game.ruleset (after settings) from the location after clauses agreed earlier, and where the ruledit/ruleup saves them.

- xgettext gives "warning: unterminated character constant" about the changed game.rulesets, because of the ' in ";checkpoint = Trigger value of the counter. When counter's". Our usual solution to these has been to use ` instead -> "counter`s". Sorry for not realizing that before

That's still an issue.

- There's no need for adding [counters] -section. There's no entries in it (every counter is a section of its own). Even if we did, the documentation would go above it.

Rulesave still adds that. You should not be writing an entry comment but a section one, about a ruleset object type:
- Most importantly: use comment_write() instead of comment_entry_write() in comment_counters()
- Move comment_counters() among the other section comment writing functions (e.g. after the comment_clauses() )
- In comments-3.2.txt move entrydoc.counters to typedoc.counters (again: likely after typedoc.clauses)
- Likewise read the comment from typedoc.counters instead of entrydoc.counters
- Move "counters" in comments_storage among the section ones (again: after "clauses" is a good spot)

- ruledit gives: "3: Can't parse the comments file" - you would need at least to escape every " in it as \"

This escaping seems to work ok now.

Hi.Have you still any remarks to my works?

2022-09-30 10:00 更新者: cazfi
コメント

One patch, please.

sandbox ruleset part does not apply. It tries to move some counter definitions that do not exist.

2022-10-02 19:47 更新者: lachu
コメント

Problem was I introduce counters (inside sandbox) by:

Author: Sławomir Lach <slawek@lach.art.pl> Date: Mon Aug 1 12:19:19 2022 +0200

!OSDN 45072: Sławomir Lach <slawek@lach.art.pl> Ruleset author can look inside sandbox to figure out how to use counters.

I thought you merge it. I will prepare proper patch.

2022-10-02 20:08 更新者: lachu
  • 添付ファイル 0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 10446) が付加されました
2022-10-02 20:08 更新者: lachu
  • 添付ファイル 0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 10446) が削除されました
2022-10-02 20:10 更新者: lachu
コメント

Reply To cazfi

One patch, please. sandbox ruleset part does not apply. It tries to move some counter definitions that do not exist.

Done.

2022-10-05 13:31 更新者: cazfi
コメント

I'm yet to test the patch, but the rulesave.c change seems like you are now writing the counters documentation between clauses documentation and actual clauses, and not just before actual counters:

/* Clauses */
comment_clauses(sfile);

+ /* Counters */
+ comment_counters(sfile);
+
sect_idx = 0;
for (i = 0; i < CLAUSE_COUNT; i++) {

2022-10-06 01:05 更新者: lachu
コメント

Reply To cazfi

I'm yet to test the patch, but the rulesave.c change seems like you are now writing the counters documentation between clauses documentation and actual clauses, and not just before actual counters: /* Clauses */
comment_clauses(sfile);

+ /* Counters */
+ comment_counters(sfile);
+
sect_idx = 0;
for (i = 0; i < CLAUSE_COUNT; i++) {

0001-OSDN-45028-S-awomir-Lach-slawek-lach.art.pl.patch(16KB)
Move invocation of routine adding counters' comment

Still need to apply changes to each ruleset without using special script for this purpose.

2022-10-06 08:05 更新者: cazfi
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法なし から 受領 に更新されました
コメント
2022-10-07 21:27 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

添付ファイルリスト

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする