[squeak-dev] The Inbox: Compiler-mt.454.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Wed Jan 27 09:32:59 UTC 2021


Hi Eliot,

please review. :-) It connects to this discussion: http://forum.world.st/Transcript-error-when-forceUpdate-false-tp5126397p5126559.html

Best,
Marcel
Am 27.01.2021 10:31:57 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Compiler was added to project The Inbox:
http://source.squeak.org/inbox/Compiler-mt.454.mcz

==================== Summary ====================

Name: Compiler-mt.454
Author: mt
Time: 27 January 2021, 10:31:47.057422 am
UUID: 6e01e1e3-e3b2-41a4-9749-37f1dab71fba
Ancestors: Compiler-eem.453

Adds pragma, which maps to . For this, allow parser extensions to be non-keyword (i.e. unary) pragmas. Might have a tiny performance impact when parsing methods with lots of non-keyword pragmas.

=============== Diff against Compiler-eem.453 ===============

Item was added:
+ ----- Method: Parser>>noContextSwitch (in category 'pragmas - code evaluation') -----
+ noContextSwitch
+ "By adding this pragma to a method, it will not be preempt the current process on method activation if a higher-priority process is runnable. Any numbered primitive without side effects will do here."
+
+
+ "Note that primitive 123 once was primitiveValueUninteruptibly but is no longer in use."
+ self addPragma: (Pragma keyword: #primitive: arguments: #(123)).
+
+ self advance.
+ ^ true!

Item was changed:
----- Method: Parser>>pragmaStatement (in category 'pragmas') -----
pragmaStatement
"Parse a pragma statement. The leading '

Note that custom pragma parsers need to fulfill two requirements:
- method selector must match the current token as simple getter,
e.g., matches #apicall or matches #primitive
- method must have pragma to be called."

"0) Early exit"
(hereType = #keyword or: [ hereType = #word or: [ hereType = #binary ] ])
ifFalse: [ ^ self expected: 'pragma declaration' ].

+ "1) Avoid interning new symbols for made-up pragmas such as #my for ."
+ (Symbol lookup: (here last == $: ifTrue: [here allButLast] ifFalse: [here])) ifNotNil: [:parserSelector |
+ Parser methodDict at: parserSelector ifPresent: [:parserMethod |
+ "2) Only call methods that claim to be a custom pragma parser via ."
+ (parserMethod hasPragma: #pragmaParser)
+ ifTrue: [^ self executeMethod: parserMethod]]].
- "1) Do not consider one-word pragmas such as and . Only keyword pragmas."
- here last == $: ifTrue: [
- "2) Avoid interning new symbols for made-up pragmas such as #my for ."
- (Symbol lookup: here allButLast) ifNotNil: [:parserSelector |
- Parser methodDict at: parserSelector ifPresent: [:parserMethod |
- "3) Only call methods that claim to be a custom pragma parser via ."
- (parserMethod hasPragma: #pragmaParser)
- ifTrue: [^ self executeMethod: parserMethod]]]].

"X) No custom pragma parser found. Use the default one."
^ self pragmaStatementKeywords!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210127/7785cba5/attachment.html>


More information about the Squeak-dev mailing list