From c98640ca0d39ed2934dbf6d2bb2d5b9987441395 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 3 Jul 2018 22:59:30 -0400 Subject: - Improved syntax for numeric literals by allowing arbitrary zeroes (0) at the front of numbers. --- luxc/src/lux/lexer.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'luxc') diff --git a/luxc/src/lux/lexer.clj b/luxc/src/lux/lexer.clj index 7bd329766..84c925cbc 100644 --- a/luxc/src/lux/lexer.clj +++ b/luxc/src/lux/lexer.clj @@ -138,10 +138,10 @@ (|do [[meta _ token] (&reader/read-regex )] (return (&/T [meta ( (string/replace token #"_" ""))])))) - lex-nat $Nat #"^\+(0|[1-9][0-9_]*)" - lex-int $Int #"^-?(0|[1-9][0-9_]*)" - lex-deg $Deg #"^(\.[0-9_]+)" - lex-frac $Frac #"^-?(0\.[0-9_]+|[1-9][0-9_]*\.[0-9_]+)(e-?[1-9][0-9_]*)?" + lex-nat $Nat #"^\+[0-9][0-9_]*" + lex-int $Int #"^-?[0-9][0-9_]*" + lex-deg $Deg #"^\.[0-9][0-9_]+" + lex-frac $Frac #"^-?[0-9][0-9_]*\.[0-9_]+((e|E)(-|\+)?[0-9][0-9_]*)?" ) (def +same-module-mark+ (str &/+name-separator+ &/+name-separator+)) -- cgit v1.2.3