Skip to content

Commit d8e4240

Browse files
authored
Create a script to simplify the language specification (#4340)
This PR adds the script 'specification/scripts/simplify_specification.dart' which will read 'dartLangSpec.tex', remove LaTeX comments, remove commentary and rationale, and join the lines of paragraphs to a single line. The result is saved as 'dartLangSpec-terse.tex' which is more convenient for searching (grepping) and for reading normative text. Moreover, whitespace in 'dartLangSpec.tex' is modified for improved consistency. In particular, commentary and rationale is indented consistently and a number of line breaks have been moved a bit in order to avoid lines longer than 80 characters.
1 parent a59dbef commit d8e4240

File tree

6 files changed

+5417
-4787
lines changed

6 files changed

+5417
-4787
lines changed

specification/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dartLangSpec*.log
66
dartLangSpec*.out
77
dartLangSpec*.pdf
88
dartLangSpec*.toc
9+
dartLangSpec-terse.tex
910
*-hash.tex
1011
*-list.txt
1112
.dart_tool/

specification/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ NAME=dartLangSpec
22
SPEC=$(NAME).tex
33
HASH=$(NAME)-hash.tex
44
LIST=$(NAME)-list.txt
5+
TERSE_SPEC=$(NAME)-terse.tex
6+
TERSE_IDX=$(NAME)-terse.idx
57
HASHER=scripts/addlatexhash.dart
68

79
pdf:
@@ -39,6 +41,17 @@ dvihash: hash_and_list
3941
hash_and_list:
4042
dart $(HASHER) $(SPEC) $(HASH) $(LIST)
4143

44+
terse:
45+
dart scripts/simplify_specification.dart
46+
47+
tersepdf:
48+
pdflatex $(TERSE_SPEC)
49+
makeindex $(TERSE_IDX)
50+
pdflatex $(TERSE_SPEC)
51+
makeindex $(TERSE_IDX)
52+
pdflatex $(TERSE_SPEC)
53+
pdflatex $(TERSE_SPEC)
54+
4255
help:
4356
@echo "Goals:"
4457
@echo " pdf, dvi: generate the pdf/dvi file containing the spec"

0 commit comments

Comments
 (0)