mewmew / uc

A compiler for the µC language.
57 stars 5 forks source link

parser: Add dedicated support for character literals #45

Closed mewmew closed 8 years ago

mewmew commented 8 years ago

Figure out how to handle character literals. Should they be considered a subset of integer literals of as a dedicated literal?

Related TODOs.

hand/scanner/scanner.go

// TODO: Change back to "char_lit" once dedicated support for character literals has been added.

gocc/scanner/scanner_test.go line 537, 2374, 2394, 2414, and 2434.

// TODO: Figure out if char_lit and int_lit should be separate tokens.

ast/astx/astx.go:

// TODO: Add char_lit production rule to NewBasicLit doc comment once handled
// explicitly in uc.bnf.

gocc/uc.bnf:

// TODO: Handle char_lit explicitly?
mewmew commented 8 years ago

This may be handled at some later point in the future. For now, consider character literals a subset of integer literals. Closing for now. We may revisit this in the future.