summaryrefslogtreecommitdiff
path: root/giscanner/docwriter.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/docwriter.py')
-rw-r--r--giscanner/docwriter.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index 35ba6f1c..a0052d87 100644
--- a/giscanner/docwriter.py
+++ b/giscanner/docwriter.py
@@ -418,6 +418,9 @@ class DocFormatter(object):
def format_type(self, type_, link=False):
raise NotImplementedError
+ def format_value(self, node):
+ raise NotImplementedError
+
def format_page_name(self, node):
if isinstance(node, ast.Namespace):
return node.name
@@ -1091,6 +1094,14 @@ class DevDocsFormatterGjs(DocFormatterGjs):
return "GLib.Variant"
return name
+ def format_value(self, node):
+ # Constants only have fundamental types?
+ type_ = node.value_type.target_fundamental
+ if type_ in ["utf8", "gunichar", "filename"]:
+ return repr(node.value)
+ # escapes quotes in the string; ought to be the same in Javascript
+ return node.value
+
def format(self, node, doc):
if doc is None:
return ''