X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=blobdiff_plain;f=parser.coffee;h=cdc3d1ff365dc6d2c2658d130746411fcbc29151;hp=7992244053dcc16edfdee5e4b5d247e5b0abf58c;hb=1d14b271fa3419e81ab843ba78eafc8d32119faf;hpb=63ce3e05b1e43795223331ee68d6b8257e3b134e diff --git a/parser.coffee b/parser.coffee index 7992244..cdc3d1f 100644 --- a/parser.coffee +++ b/parser.coffee @@ -93,10 +93,10 @@ from_code_point = (x) -> return String.fromCharCode((x >> 10) + 0xd800, (x % 0x400) + 0xdc00) # Each node is an obect of the Node class. Here are the Node types: -TYPE_TAG = 0 # name, {attributes}, [children] -TYPE_TEXT = 1 # "text" -TYPE_COMMENT = 2 -TYPE_DOCTYPE = 3 +TYPE_TAG = 'tag' # name, {attributes}, [children] +TYPE_TEXT = 'text' # "text" +TYPE_COMMENT = 'comment' +TYPE_DOCTYPE = 'doctype' # the following types are emited by the tokenizer, but shouldn't end up in the tree: TYPE_START_TAG = 4 # name, [attributes ([key,value]...) in reverse order], [children] TYPE_END_TAG = 5 # name @@ -105,14 +105,14 @@ TYPE_AFE_MARKER = 7 # http://www.w3.org/TR/html5/syntax.html#reconstruct-the-act TYPE_AAA_BOOKMARK = 8 # http://www.w3.org/TR/html5/syntax.html#adoption-agency-algorithm # namespace constants -NS_HTML = 1 -NS_MATHML = 2 -NS_SVG = 3 +NS_HTML = 'html' +NS_MATHML = 'mathml' +NS_SVG = 'svg' # quirks mode constants -QUIRKS_NO = 1 -QUIRKS_LIMITED = 2 -QUIRKS_YES = 3 +QUIRKS_NO = 'no' +QUIRKS_LIMITED = 'limited' +QUIRKS_YES = 'yes' # queue up debug logs, so eg they can be shown only for tests that fail g_debug_log = []