),
)
+DesugaredSymbolLiteralExpression = collections.namedtuple(
+ 'DesugaredSymbolLiteralExpression',
+ (
+ 'metadata',
+ 'symbol',
+ ),
+)
+
DesugaredAssignmentStatement = collections.namedtuple(
'DesugaredAssignmentStatement',
(
),
argument_list=(
desugar_expression(expression.left),
- DesugaredStringLiteralExpression(string=expression.right.symbol),
+ desugar_symbol_literal_expression(expression.right),
),
)
symbol=expression.symbol,
)
+def desugar_symbol_literal_expression(expression):
+ return DesugaredSymbolLiteralExpression(
+ metadata=expression.metadata,
+ symbol=expression.symbol,
+ )
+
def desugar_expression(expression):
return {
parsing.FurFunctionCallExpression: desugar_function_call_expression,
NormalSymbolExpression(symbol=expression.symbol),
)
+def normalize_symbol_literal_expression(counter, expression):
+ return (
+ counter,
+ (),
+ NormalSymbolLiteralExpression(symbol=expression.symbol),
+ )
+
def normalize_function_call_expression(counter, expression):
prestatements = []
desugaring.DesugaredStringLiteralExpression: normalize_string_literal_expression,
desugaring.DesugaredStructureLiteralExpression: normalize_structure_literal_expression,
desugaring.DesugaredSymbolExpression: normalize_symbol_expression,
+ desugaring.DesugaredSymbolLiteralExpression: normalize_symbol_literal_expression,
}[type(expression)](counter, expression)
def normalize_expression_statement(counter, statement):
assert(!Stack_isEmpty(&(thread->stack)));
Object key = Stack_pop(&(thread->stack));
- assert(key.type == STRING); // TODO Make this a symbol
+ assert(key.type == SYMBOL);
assert(!Stack_isEmpty(&(thread->stack)));
Object structure = Stack_pop(&(thread->stack));