Skip to content

Commit

Permalink
[refactor] Move files out of lazylex/
Browse files Browse the repository at this point in the history
Preparing for data_lang/htm8.py.

Add htm8.asdl.  Not used yet.
  • Loading branch information
Andy C committed Jan 14, 2025
1 parent 108f1a3 commit 69df0b2
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions build/py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ py-codegen() {
# depends on syntax.asdl
gen-asdl-py 'core/runtime.asdl'
gen-asdl-py 'core/value.asdl'
gen-asdl-py 'data_lang/htm8.asdl'
gen-asdl-py 'data_lang/nil8.asdl'
gen-asdl-py 'display/pretty.asdl'
gen-asdl-py 'mycpp/mycpp.asdl'
Expand Down
24 changes: 24 additions & 0 deletions data_lang/htm8.asdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

module htm8
{

h8_id =
Decl

# CommentBegin, ProcessingBegin, CDataBegin are "pseudo-tokens", not visible
| Comment | CommentBegin
| Processing | ProcessingBegin
| CData | CDataBegin

| StartTag | StartEndTag | EndTag

| DecChar | HexChar | CharEntity

| RawData | HtmlCData

| BadAmpersand | BadGreaterThan | BadLessThan

| Invalid
| EndOfStream
generate [no_namespace_suffix] # cosmetic: call it h8_id, not h8_id_e
}
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions doctools/oils_doc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from lazylex import html
from doctools import oils_doc # module under test

with open('lazylex/testdata.html') as f:
with open('data_lang/testdata/hello.htm8') as f:
TEST_HTML = f.read()


Expand Down Expand Up @@ -58,7 +58,7 @@ def testShPrompt(self):

def testHighlightCode(self):
# type: () -> None
# lazylex/testdata.html has the language-sh-prompt
# data_lang/testdata/hello.htm8 has the language-sh-prompt

h = oils_doc.HighlightCode(TEST_HTML, None)
self.assert_('<span class="sh-prompt">' in h, h)
Expand Down
2 changes: 1 addition & 1 deletion lazylex/html_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

log = html.log

with open('lazylex/testdata.html') as f:
with open('data_lang/testdata/hello.htm8') as f:
TEST_HTML = f.read()


Expand Down

0 comments on commit 69df0b2

Please sign in to comment.